1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-03-28 09:50:23 +01:00

extract the integration tests writen in the ci file as a script file.

This commit is contained in:
utam0k 2021-05-26 18:50:03 +09:00
parent e264d20d8b
commit a12092eccc
4 changed files with 17 additions and 18 deletions

View File

@ -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
.gitmodules vendored Normal file
View File

@ -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
integration_test.sh Executable file
View File

@ -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

@ -0,0 +1 @@
Subproject commit 59cdde06764be8d761db120664020f0415f36045