diff options
author | Paul Moore <paul@paul-moore.com> | 2018-09-22 14:28:27 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2018-09-22 14:28:27 -0400 |
commit | 9d4f7f69714d5af80309aa1b8a6d2c8300bb6730 (patch) | |
tree | 7f5e752c0765e61e7c03f4ea8ae12d803fac7f66 | |
parent | 124117e34978e3ef33d75088388de845709229d3 (diff) | |
download | libseccomp-9d4f7f69714d5af80309aa1b8a6d2c8300bb6730.tar.gz |
tests: add an API level check to the live tests
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | tests/20-live-basic_die.tests | 8 | ||||
-rw-r--r-- | tests/21-live-basic_allow.tests | 4 | ||||
-rw-r--r-- | tests/24-live-arg_allow.tests | 4 | ||||
-rw-r--r-- | tests/32-live-tsync_allow.tests | 4 | ||||
-rw-r--r-- | tests/44-live-a2_order.tests | 4 | ||||
-rw-r--r-- | tests/47-live-kill_process.tests | 4 | ||||
-rwxr-xr-x | tests/regression | 16 |
7 files changed, 28 insertions, 16 deletions
diff --git a/tests/20-live-basic_die.tests b/tests/20-live-basic_die.tests index 1f54108..cade132 100644 --- a/tests/20-live-basic_die.tests +++ b/tests/20-live-basic_die.tests @@ -7,7 +7,7 @@ test type: live -# Testname Result -20-live-basic_die KILL -20-live-basic_die TRAP -20-live-basic_die ERRNO +# Testname API Result +20-live-basic_die 1 KILL +20-live-basic_die 1 TRAP +20-live-basic_die 1 ERRNO diff --git a/tests/21-live-basic_allow.tests b/tests/21-live-basic_allow.tests index d56e916..73027dc 100644 --- a/tests/21-live-basic_allow.tests +++ b/tests/21-live-basic_allow.tests @@ -7,5 +7,5 @@ test type: live -# Testname Result -21-live-basic_allow ALLOW +# Testname API Result +21-live-basic_allow 1 ALLOW diff --git a/tests/24-live-arg_allow.tests b/tests/24-live-arg_allow.tests index daa0418..5d89be5 100644 --- a/tests/24-live-arg_allow.tests +++ b/tests/24-live-arg_allow.tests @@ -7,5 +7,5 @@ test type: live -# Testname Result -24-live-arg_allow ALLOW +# Testname API Result +24-live-arg_allow 1 ALLOW diff --git a/tests/32-live-tsync_allow.tests b/tests/32-live-tsync_allow.tests index 9938ea7..2e8a3bd 100644 --- a/tests/32-live-tsync_allow.tests +++ b/tests/32-live-tsync_allow.tests @@ -7,5 +7,5 @@ test type: live -# Testname Result -32-live-tsync_allow ALLOW +# Testname API Result +32-live-tsync_allow 2 ALLOW diff --git a/tests/44-live-a2_order.tests b/tests/44-live-a2_order.tests index 8cd1314..40b8cca 100644 --- a/tests/44-live-a2_order.tests +++ b/tests/44-live-a2_order.tests @@ -7,5 +7,5 @@ test type: live -# Testname Result -44-live-a2_order ALLOW +# Testname API Result +44-live-a2_order 1 ALLOW diff --git a/tests/47-live-kill_process.tests b/tests/47-live-kill_process.tests index 505349a..4f58ed4 100644 --- a/tests/47-live-kill_process.tests +++ b/tests/47-live-kill_process.tests @@ -7,5 +7,5 @@ test type: live -# Testname Result -47-live-kill_process KILL_PROCESS +# Testname API Result +47-live-kill_process 3 KILL_PROCESS diff --git a/tests/regression b/tests/regression index 4141399..23291d8 100755 --- a/tests/regression +++ b/tests/regression @@ -35,6 +35,7 @@ GLBL_ARCH_BE_SUPPORT=" \ GLBL_SYS_ARCH="../tools/scmp_arch_detect" GLBL_SYS_RESOLVER="../tools/scmp_sys_resolver" GLBL_SYS_SIM="../tools/scmp_bpf_sim" +GLBL_SYS_API="../tools/scmp_api_level" #### # functions @@ -709,12 +710,23 @@ function run_test_bpf_valgrind() { # function run_test_live() { local rc + local api local line=($2) # parse the test line line_cmd=${line[0]} - line_act=${line[1]} - line_test="$line_cmd $line_act" + line_api=${line[1]} + line_act=${line[2]} + line_test="$line_cmd $line_api $line_act" + + # check the api level + api=$($GLBL_SYS_API) + if [[ $api -lt $line_api ]]; then + # runtime api level is too low + print_result "$1" "SKIPPED" "(api level)" + stats_skipped=$(($stats_skipped+1)) + return + fi # print out the input test data to the log file print_data "$1" "$2" |