cleanup shell test only if TST_NO_CLEANUP is not defined
PATCH 1/1 cleanup shell test only if TST_NO_CLEANUP is not defined
Could be useful to debug a single test so it leaves the setup on the machine intact.
Signed-off-by Alexey Kodanev <[email protected]>
--- testcases/lib/test.sh | 2 +- testcases/lib/tst_test.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
testcases/lib/test.sh +1 -1
@@ -96,7 +96,7 @@ tst_require_root() tst_exit() { - if [ -n "$TST_CLEANUP" ]; then + if [ -n "$TST_CLEANUP" -a -z "$TST_NO_CLEANUP" ]; then $TST_CLEANUP fi
testcases/lib/tst_test.sh +2 -1
@@ -33,7 +33,8 @@ tst_do_exit() { local ret=0 - if [ -n "$TST_SETUP_STARTED" -a -n "$TST_CLEANUP" ]; then + if [ -n "$TST_SETUP_STARTED" -a -n "$TST_CLEANUP" -a \ + -z "$TST_NO_CLEANUP" ]; then $TST_CLEANUP fi
Signature · 1 line
1.7.1
PATCH 1/1 cleanup shell test only if TST_NO_CLEANUP is not defined
Hi!
Quoted 2 lines
Could be useful to debug a single test so it leaves the setup on the machine intact.
I do not think that this is useful enough to be included in the shell library, but on the other hand it's just oneliner. Feel free to push it if you find it useful.
Signature · 2 lines
Cyril Hrubis [email protected]