summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarel Zak2016-07-11 11:01:14 +0200
committerKarel Zak2016-07-11 11:01:14 +0200
commit94fa9b4637b3555fac8646c93602d2c29d80b074 (patch)
tree965162ea32861932627636447bb890edce3271e4 /tests
parenttests: add chrt test (diff)
downloadkernel-qcow2-util-linux-94fa9b4637b3555fac8646c93602d2c29d80b074.tar.gz
kernel-qcow2-util-linux-94fa9b4637b3555fac8646c93602d2c29d80b074.tar.xz
kernel-qcow2-util-linux-94fa9b4637b3555fac8646c93602d2c29d80b074.zip
tests: implement ts_skip_subtest
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/functions.sh17
-rwxr-xr-xtests/ts/schedutils/chrt12
2 files changed, 18 insertions, 11 deletions
diff --git a/tests/functions.sh b/tests/functions.sh
index db5f536c6..b9a852365 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -91,12 +91,12 @@ function ts_check_losetup {
ts_skip "no loop-device support"
}
-function ts_skip_subtest {
+function ts_report_skip {
ts_report " SKIPPED ($1)"
}
function ts_skip {
- ts_skip_subtest "$1"
+ ts_report_skip "$1"
ts_cleanup_on_exit
exit 0
@@ -130,7 +130,7 @@ function ts_failed {
exit $?
}
-function ts_ok_subtest {
+function ts_report_ok {
if [ x"$1" == x"" ]; then
ts_report " OK"
else
@@ -139,7 +139,7 @@ function ts_ok_subtest {
}
function ts_ok {
- ts_ok_subtest "$1"
+ ts_report_ok "$1"
exit 0
}
@@ -413,7 +413,7 @@ function ts_finalize_subtest {
ts_failed_subtest "$1"
res=1
else
- ts_ok_subtest "$(tt_gen_mem_report "$1")"
+ ts_report_ok "$(tt_gen_mem_report "$1")"
fi
[ $res -ne 0 ] && TS_NSUBFAILED=$(( $TS_NSUBFAILED + 1 ))
@@ -424,6 +424,13 @@ function ts_finalize_subtest {
return $res
}
+function ts_skip_subtest {
+ ts_report_skip "$1"
+ # reset environment back to parental test
+ ts_init_core_env
+
+}
+
function ts_finalize {
ts_cleanup_on_exit
diff --git a/tests/ts/schedutils/chrt b/tests/ts/schedutils/chrt
index 31bc7fdaa..38c87f9f0 100755
--- a/tests/ts/schedutils/chrt
+++ b/tests/ts/schedutils/chrt
@@ -45,8 +45,8 @@ if [ $? == 0 ]; then
do_chrt --fifo 1
do_chrt --fifo 99
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_init_subtest "batch"
@@ -54,8 +54,8 @@ skip_policy SCHED_BATCH
if [ $? == 0 ]; then
do_chrt --batch 0
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_init_subtest "other"
@@ -63,8 +63,8 @@ skip_policy SCHED_OTHER
if [ $? == 0 ]; then
do_chrt --other 0
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_init_subtest "rr"
@@ -73,8 +73,8 @@ if [ $? == 0 ]; then
do_chrt --rr 1
do_chrt --rr 99
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_init_subtest "idle"
@@ -82,8 +82,8 @@ skip_policy SCHED_IDLE
if [ $? == 0 ]; then
do_chrt --idle 0
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_init_subtest "deadline"
@@ -93,7 +93,7 @@ if [ $? == 0 ]; then
do_chrt --deadline --sched-period 13000 --sched-deadline 12000 0
do_chrt --deadline --sched-period 13000 --sched-deadline 12000 --sched-runtime 10000 0
cleanup_output
+ ts_finalize_subtest
fi
-ts_finalize_subtest
ts_finalize