overlay/017: silence test output
authorAmir Goldstein <amir73il@gmail.com>
Fri, 28 Apr 2017 08:24:43 +0000 (11:24 +0300)
committerEryu Guan <eguan@redhat.com>
Mon, 1 May 2017 06:08:03 +0000 (14:08 +0800)
Change test to output golden silence on success.

We are going to run the same check several times,
so instead of cloning the test output, cloning the
silence will be more conveniet.

Generalize cleanup of temp files for the same reason.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/overlay/017
tests/overlay/017.out

index 5ca30408cbcfcbac4f812ad3012714f9aafe4ece..7c1430dbdc4ffc7fae884a7c59304c7911f238cd 100755 (executable)
@@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _cleanup()
 {
+       cd /
        rm -f $tmp.*
 }
 
@@ -73,7 +74,7 @@ mknod $lowerdir/fifo p
 _scratch_mount
 
 
-rm -f $tmp.before $tmp.after
+rm -f $tmp.*
 
 # Test stable stat(2) st_ino
 
@@ -89,11 +90,13 @@ done
 
 # find by inode number - expect to find file by inode number
 cat $tmp.before | while read ino f; do
-       find $f -inum $ino -maxdepth 0 | _filter_scratch
+       find $SCRATCH_MNT/ -maxdepth 1 -inum $ino | grep -q $f || \
+               echo "$f not found by ino $ino"
 done
 
 # Compare before..after - expect silence
 diff $tmp.before $tmp.after
 
+echo "Silence is golden"
 status=0
 exit
index 1f277c562cabf479a1a1544a8bce2baaeaf9a359..822284487977c93df8cbfc16e9231396f20d313e 100644 (file)
@@ -1,7 +1,2 @@
 QA output created by 017
-SCRATCH_MNT/dir
-SCRATCH_MNT/file
-SCRATCH_MNT/symlink
-SCRATCH_MNT/chrdev
-SCRATCH_MNT/blkdev
-SCRATCH_MNT/fifo
+Silence is golden