diff options
Diffstat (limited to 'recipes-containers/lxc/files/run-ptest')
| -rw-r--r-- | recipes-containers/lxc/files/run-ptest | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/recipes-containers/lxc/files/run-ptest b/recipes-containers/lxc/files/run-ptest index 23a6256b..e9855449 100644 --- a/recipes-containers/lxc/files/run-ptest +++ b/recipes-containers/lxc/files/run-ptest | |||
| @@ -1,4 +1,57 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/bash |
| 2 | 2 | ||
| 3 | make -C src/tests -k check-TESTS | 3 | # Network interfaces come up and down and can be quite noisy |
| 4 | # and since we are often on the console when running ptests | ||
| 5 | # let's just quiet things some | ||
| 6 | dmesg -n 1 | ||
| 4 | 7 | ||
| 8 | # Blacklisted test will be skipped | ||
| 9 | blacklist="" | ||
| 10 | # Not applicable | ||
| 11 | blacklist="$blacklist lxc-test-apparmor" | ||
| 12 | # These currently hang so skip them until someone fixes them up | ||
| 13 | blacklist="$blacklist lxc-test-shutdowntest" | ||
| 14 | blacklist="$blacklist lxc-test-state-server" | ||
| 15 | |||
| 16 | passed=0 | ||
| 17 | failed=0 | ||
| 18 | skipped=0 | ||
| 19 | |||
| 20 | # Create logs dir and clear old logs if any | ||
| 21 | mkdir logs 2> /dev/null | ||
| 22 | rm -f logs/* | ||
| 23 | |||
| 24 | echo "### Starting LXC ptest ###" | ||
| 25 | |||
| 26 | for test in ./tests/* | ||
| 27 | do | ||
| 28 | if [[ ! $blacklist = *$(basename $test)* ]] | ||
| 29 | then | ||
| 30 | $test >logs/$(basename $test).log 2>&1 | ||
| 31 | else | ||
| 32 | echo "$test SKIPPED" | ||
| 33 | skipped=$((skipped+1)) | ||
| 34 | continue | ||
| 35 | fi | ||
| 36 | |||
| 37 | if [ $? -eq 0 ] | ||
| 38 | then | ||
| 39 | echo "$test PASS" | ||
| 40 | passed=$((passed+1)) | ||
| 41 | else | ||
| 42 | echo "$test FAIL" | ||
| 43 | failed=$((failed+1)) | ||
| 44 | fi | ||
| 45 | done | ||
| 46 | |||
| 47 | echo "" | ||
| 48 | echo "Results:" | ||
| 49 | echo " PASSED = $passed" | ||
| 50 | echo " FAILED = $failed" | ||
| 51 | echo " SKIPPED = $skipped" | ||
| 52 | echo "(for details check individual test log in ./logs directory)" | ||
| 53 | echo "" | ||
| 54 | echo "### LXC ptest complete ###" | ||
| 55 | |||
| 56 | # restore dmesg to console | ||
| 57 | dmesg -n 6 | ||
