Skip to content

Commit

Permalink
extract the integration tests writen in the ci file as a script file.
Browse files Browse the repository at this point in the history
  • Loading branch information
utam0k committed May 26, 2021
1 parent e264d20 commit a12092e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
19 changes: 1 addition & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,5 @@ jobs:
- uses: actions/setup-go@v2
with:
go-version: "1.11.0"
- name: Build runtime-tools
run: |
mkdir -p $(go env GOPATH)/src/github.com/opencontainers
cd $(go env GOPATH)/src/github.com/opencontainers
git clone https://github.com/opencontainers/runtime-tools
cd runtime-tools
make runtimetest validation-executables
- name: Run intetgration tests
run: |
expect_err_num=8
act_err_num=0
cd $(go env GOPATH)/src/github.com/opencontainers/runtime-tools
test_cases=("default/default.t" "linux_cgroups_devices/linux_cgroups_devices.t" "linux_cgroups_hugetlb/linux_cgroups_hugetlb.t" "linux_cgroups_pids/linux_cgroups_pids.t", "linux_cgroups_memory/linux_cgroups_memory.t", "linux_cgroups_network/linux_cgroups_network.t")
for case in "${test_cases[@]}"; do
title="Running $case"
if [ 0 -ne $(sudo RUST_BACKTRACE=1 RUNTIME=$GITHUB_WORKSPACE/target/x86_64-unknown-linux-gnu/debug/youki ./validation/$case | grep "not ok" | wc -l) ]; then
exit 1
fi
done
run: ./integration_test.sh
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "integration_test/src/github.com/opencontainers/runtime-tools"]
path = integration_test/src/github.com/opencontainers/runtime-tools
url = https://github.com/opencontainers/runtime-tools.git
12 changes: 12 additions & 0 deletions integration_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

root=$(pwd)
cd integration_test/src/github.com/opencontainers/runtime-tools
GOPATH=$root/integration_test make runtimetest validation-executables
test_cases=("default/default.t" "linux_cgroups_devices/linux_cgroups_devices.t" "linux_cgroups_hugetlb/linux_cgroups_hugetlb.t" "linux_cgroups_pids/linux_cgroups_pids.t" "linux_cgroups_memory/linux_cgroups_memory.t" "linux_cgroups_network/linux_cgroups_network.t")
for case in "${test_cases[@]}"; do
echo "Running $case"
if [ 0 -ne $(sudo RUST_BACKTRACE=1 RUNTIME=$root/target/x86_64-unknown-linux-gnu/debug/youki $root/integration_test/src/github.com/opencontainers/runtime-tools/validation/$case | grep "not ok" | wc -l) ]; then
exit 1
fi
done
Submodule runtime-tools added at 59cdde

0 comments on commit a12092e

Please sign in to comment.