generic/403: don't spew '$GETFATTR_PROG: Killed' messages
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 24 Jan 2018 23:53:35 +0000 (15:53 -0800)
committerEryu Guan <eguan@redhat.com>
Thu, 25 Jan 2018 07:56:31 +0000 (15:56 +0800)
Use a runfile presence check to control the background getfattr loop
instead of using kill -9.  This helps us to avoid the problem that
the controlling bash will print a process killed message, which
wrecks the golden output.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/generic/403

index 17897ffb03ceac58320cb7b23ec789a444d53dc3..31c481b4e23eeefcff9dd4f0c74e4678fe5bc893 100755 (executable)
@@ -61,7 +61,9 @@ touch $SCRATCH_MNT/file
 $SETFATTR_PROG -n trusted.small -v a $SCRATCH_MNT/file
 
 # start a background getxattr loop for the existing xattr
-while [ true ]; do
+runfile="$tmp.getfattr"
+touch $runfile
+while [ -e $runfile ]; do
        $GETFATTR_PROG --absolute-names -n trusted.small $SCRATCH_MNT/file \
                > /dev/null || break
 done &
@@ -75,7 +77,7 @@ for i in $(seq 0 99); do
        $SETFATTR_PROG -x trusted.big $SCRATCH_MNT/file
 done
 
-kill -9 $getfattr_pid > /dev/null 2>&1
+rm -f $runfile
 wait > /dev/null 2>&1
 
 echo Silence is golden