Skip to content

Commit

Permalink
Merge pull request #265 from chenyukang/fix-test-script
Browse files Browse the repository at this point in the history
Print logfile when test case crash
  • Loading branch information
utam0k authored Sep 5, 2021
2 parents 7f6bc2c + 8c86ef8 commit 3fac283
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test_cases=(
# This case includes checking for features that are excluded from linux kernel 5.0, so even runc doesn't pass it.
# ref. https://github.com/docker/cli/pull/2908
# "linux_cgroups_relative_blkio/linux_cgroups_relative_blkio.t"
"linux_cgroups_relative_cpus/linux_cgroups_relative_cpus.t"
"linux_cgroups_relative_cpus/linux_cgroups_relative_cpus.t"
"linux_cgroups_relative_devices/linux_cgroups_relative_devices.t"
"linux_cgroups_relative_hugetlb/linux_cgroups_relative_hugetlb.t"
"linux_cgroups_relative_memory/linux_cgroups_relative_memory.t"
Expand Down Expand Up @@ -78,7 +78,7 @@ check_enviroment() {
if [[ $test_case =~ .*(memory|hugetlb).t ]]; then
if [[ ! -e "/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes" ]]; then
return 1
fi
fi
fi
}

Expand All @@ -97,13 +97,13 @@ for case in "${test_cases[@]}"; do
fi

if [ $PATTERN != "." ] && [[ ! $case =~ $PATTERN ]]; then
continue
fi
continue
fi

echo "Running $case"
logfile="./log/$case.log"
mkdir -p "$(dirname $logfile)"
sudo RUST_BACKTRACE=1 RUNTIME=${RUNTIME} ${ROOT}/integration_test/src/github.com/opencontainers/runtime-tools/validation/$case >$logfile 2>&1
sudo RUST_BACKTRACE=1 RUNTIME=${RUNTIME} ${ROOT}/integration_test/src/github.com/opencontainers/runtime-tools/validation/$case >$logfile 2>&1 || (cat $logfile && exit 1)
if [ 0 -ne $(grep "not ok" $logfile | wc -l ) ]; then
cat $logfile
exit 1
Expand Down

0 comments on commit 3fac283

Please sign in to comment.