Skip to content

Commit

Permalink
tests: add an API level check to the live tests
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
pcmoore committed Sep 22, 2018
1 parent 124117e commit 9d4f7f6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 16 deletions.
8 changes: 4 additions & 4 deletions tests/20-live-basic_die.tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/21-live-basic_allow.tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

test type: live

# Testname Result
21-live-basic_allow ALLOW
# Testname API Result
21-live-basic_allow 1 ALLOW
4 changes: 2 additions & 2 deletions tests/24-live-arg_allow.tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

test type: live

# Testname Result
24-live-arg_allow ALLOW
# Testname API Result
24-live-arg_allow 1 ALLOW
4 changes: 2 additions & 2 deletions tests/32-live-tsync_allow.tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

test type: live

# Testname Result
32-live-tsync_allow ALLOW
# Testname API Result
32-live-tsync_allow 2 ALLOW
4 changes: 2 additions & 2 deletions tests/44-live-a2_order.tests
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

test type: live

# Testname Result
44-live-a2_order ALLOW
# Testname API Result
44-live-a2_order 1 ALLOW
4 changes: 2 additions & 2 deletions tests/47-live-kill_process.tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 14 additions & 2 deletions tests/regression
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 9d4f7f6

Please sign in to comment.