]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
ignore first test in run_some
authorSerge Hallyn <serge@hallyn.com>
Mon, 27 Feb 2023 21:05:47 +0000 (15:05 -0600)
committerSerge Hallyn <serge@hallyn.com>
Tue, 28 Feb 2023 03:38:45 +0000 (21:38 -0600)
bc github...

For some reason, the first test - ONLY on github - seems to not
give the '$ ' prompt expected when you spawn 'su testsuite'.
So just run the first test twice, and ignore the first failure.

tests/run_some

index c40e3b807f315052cb09ad5a2d1b3ea1b4e0ba33..0e7729df6a835776572145443de00bd535977d12 100755 (executable)
@@ -18,8 +18,15 @@ run_test()
 {
        [ -f RUN_TEST.STOP ] && exit 1
 
+       passed=0
        if $1 > $1.log 2>&1
        then
+               passed=1
+       fi
+
+       if [ -n "$2" ]; then # ignore failure
+               echo -n "."
+       elif [ $passed -eq 1 ]; then
                succeeded=$((succeeded+1))
                echo -n "+"
        else
@@ -54,6 +61,8 @@ echo "-: test failed"
 > testsuite.log
 
 find "${build_path}" -name "*.gcda" -delete
+# ignore the result of the first test.  ~magic~
+run_test ./su/01/su_user.test ignore_failure
 run_test ./su/01/su_user.test
 run_test ./su/01/su_root.test
 find "${build_path}" -name "*.gcda" -exec chmod a+rw {} \;