]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
check: fix incorrect interrupt detection
authorDmitry Monakhov <dmonakhov@openvz.org>
Wed, 22 Feb 2017 09:48:13 +0000 (13:48 +0400)
committerEryu Guan <eguan@redhat.com>
Wed, 22 Feb 2017 10:01:52 +0000 (18:01 +0800)
Currently "Interrupted!" string always appeared in check.log because
flag cleared at very end after summary was dumped already.  It looks
very strange, but it was broken from very beginning 27fba05e
(2001-01-15)

- update interrupt flag at the end of a section loop, but before _wrapup
- dump 'Interrupted' to stdout

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
check

diff --git a/check b/check
index 5a93c94ed11cffa41e4e64f770b8aff0e3998c1c..5d7f75c48f938bc97e2c6336537bf1c969de38f8 100755 (executable)
--- a/check
+++ b/check
@@ -405,7 +405,7 @@ _wrapup()
                        echo "Ran:$try" >>$check.log
                fi
 
-               $interrupt && echo "Interrupted!" >>$check.log
+               $interrupt && echo "Interrupted!" | tee -a $check.log
 
                if [ ! -z "$notrun" ]; then
                        if [ $brief_test_summary == "false" ]; then
@@ -755,7 +755,9 @@ for section in $HOST_OPTIONS_SECTIONS; do
 
            seq="after_$seqnum"
        done
+       interrupt=false
        _wrapup
+       interrupt=true
        echo
 
        _test_unmount 2> /dev/null