generic/294: filter quotes from mknod
authorOmer Zilberberg <omzg@plexistor.com>
Mon, 27 Jun 2016 12:53:28 +0000 (15:53 +0300)
committerEryu Guan <eguan@redhat.com>
Tue, 28 Jun 2016 03:30:49 +0000 (11:30 +0800)
Since coreutils v8.25, mknod errors omit quotes around filenames,
and this breaks generic/294's golden image.

Checked on Ubuntu 16.04.

See coreutils: 08e8fd7 all: avoid quoting file names when possible
https://github.com/coreutils/coreutils/commit/08e8fd7e38f2dae7c69c54eb22d508b6517e66e5

Signed-off-by: Omer Zilberberg <omzg@plexistor.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/filter
tests/generic/294
tests/generic/294.out

index 244621a039610900c9fc8140a020988ce06f60c1..8d9f489bea1c6f2071cb06851033da45c5525e17 100644 (file)
@@ -385,5 +385,12 @@ _filter_od()
        '
 }
 
+# Remove quotes from failed mknod calls. Starting with Coreutils v8.25,
+# mknod errors print unquoted filenames
+_filter_mknod()
+{
+       sed -e "s/mknod: '\(.*\)': File exists/mknod: \1: File exists/"
+}
+
 # make sure this script returns success
 /bin/true
index 3fa6ba21d200e632940920056029c37b03e01930..fb5d9aa80524b1d6e74b305cc610644f77f4639d 100755 (executable)
@@ -55,7 +55,7 @@ THIS_TEST_DIR=$SCRATCH_MNT/$seq.test
 
 _create_files()
 {
-       mknod $THIS_TEST_DIR/testnode c 1 3
+       mknod $THIS_TEST_DIR/testnode c 1 3 2>&1 | _filter_mknod
        mkdir $THIS_TEST_DIR/testdir
        touch $THIS_TEST_DIR/testtarget
        ln -s $THIS_TEST_DIR/testtarget $THIS_TEST_DIR/testlink 2>&1 | _filter_ln
index 1ac1c671b84dbe3b41412ac551bf971c07f137c1..7802472868f120a5d752e4742816cd39585d77d8 100644 (file)
@@ -1,5 +1,5 @@
 QA output created by 294
-mknod: 'SCRATCH_MNT/294.test/testnode': File exists
+mknod: SCRATCH_MNT/294.test/testnode: File exists
 mkdir: cannot create directory 'SCRATCH_MNT/294.test/testdir': File exists
 touch: cannot touch 'SCRATCH_MNT/294.test/testtarget': Read-only file system
 ln: creating symbolic link 'SCRATCH_MNT/294.test/testlink': File exists