xfstests: move _filter_ln to common.filter
authorEric Sandeen <sandeen@sandeen.net>
Wed, 9 Jan 2013 16:13:26 +0000 (10:13 -0600)
committerBen Myers <bpm@sgi.com>
Fri, 18 Jan 2013 22:44:37 +0000 (16:44 -0600)
Move test 103's _filter_ln to common.filter and make
it more generic (not depending on 103's pathnames).

TBH I've lost my children's treasury of ln failure
messages, so I'm not sure this catches all variants;
it's hard to work backwards from the existing sed script
to what the various outputs were.  This works for me
but might need more tweaking on other systems.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
103
103.out
common.filter

diff --git a/103 b/103
index e383991b6bde01495747888ffc0aa97070b21646..a3907392a19c53a60fe9e890589ff825a291a41f 100755 (executable)
--- a/103
+++ b/103
@@ -54,13 +54,6 @@ _create_scratch()
        fi
 }
 
-_filter_ln()
-{
-    sed -e "s,SCRATCH_MNT/nosymlink/target - Operation not permitted,ln: creating symbolic link \`SCRATCH_MNT/nosymlink/target\' to \`SCRATCH_MNT/nosymlink/source\': Operation not permitted,g" \
-        -e "/SCRATCH_MNT.*to.*SCRATCH_MNT/! s,: Operation not permitted, to \`SCRATCH_MNT/nosymlink/source\': Operation not permitted,g" \
-       -e "s,failed to create,creating,"
-}
-
 _filter_noymlinks_flag()
 {
        _test_inode_flag nosymlinks $SCRATCH_MNT/nosymlink
diff --git a/103.out b/103.out
index 45c0aa892905e512a8201ad9710909df144c077b..f939bcd6f9d07a0a29b2be1f751ebd167ee111cf 100644 (file)
--- a/103.out
+++ b/103.out
@@ -4,7 +4,7 @@ QA output created by 103
 *** testing nosymlinks directories
 *** setting nosymlinks bit
 --n-- SCRATCH_MNT/nosymlink
-ln: creating symbolic link `SCRATCH_MNT/nosymlink/target' to `SCRATCH_MNT/nosymlink/source': Operation not permitted
+ln: creating symbolic link `SCRATCH_MNT/nosymlink/target': Operation not permitted
 *** 1st listing...
 SCRATCH_MNT
 SCRATCH_MNT/nosymlink
index f0f60763070ecc0e979d1eff616bc3c064b07b2b..9e4c90c56cb7e30a540a1ceb829c0f109791b704 100644 (file)
@@ -229,5 +229,12 @@ _filter_spaces()
        sed -e 's/ [ ]*/ /g'
 }
 
+# Account for different "ln" failure messages
+_filter_ln()
+{
+       sed -e "s,\(creating symbolic link .*\) to .*: ,\1," \
+           -e "s,failed to create,creating,"
+}
+
 # make sure this script returns success
 /bin/true