Whamcloud - gitweb
tests: use grep -E for better portability in r_inline_xattr
authorTheodore Ts'o <tytso@mit.edu>
Mon, 23 Mar 2020 03:56:14 +0000 (23:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 Mar 2020 01:21:05 +0000 (21:21 -0400)
Since r_inline_xattr is using an extended regexp, we need grep -E on
some implementations of grep.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/r_inline_xattr/expect
tests/r_inline_xattr/script

index 885de59..773db10 100644 (file)
@@ -1,5 +1,5 @@
 resize2fs test
-debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''
+debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \(''
 Inode: 1550   Type: regular    Mode:  0644   Flags: 0x0
   user.name (11) = "propervalue"
 Exit status is 0
@@ -8,7 +8,7 @@ Resizing the filesystem on test.img to 5120 (1k) blocks.
 The filesystem on test.img is now 5120 (1k) blocks long.
 
 Exit status is 0
-debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''
+debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \(''
 Inode: 12   Type: regular    Mode:  0644   Flags: 0x0
   user.name (11) = "propervalue"
 Exit status is 0
index 4e7dd94..2f754e6 100644 (file)
@@ -13,8 +13,8 @@ gunzip < $IMAGE > $TMPFILE
 echo "resize2fs test" > $OUT.new
 
 # Look at existing inline extended attribute
-echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''" >> $OUT.new
-$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|user.name (" >> $OUT.new
+echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new
+$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new
 status=$?
 echo Exit status is $status >> $OUT.new
 
@@ -25,8 +25,8 @@ status=$?
 echo Exit status is $status >> $OUT.new
 
 # Look at inline extended attribute in resized fs
-echo "debugfs -R ''stat file'' test.img 2>&1 | grep ''^Inode\|in inode body\|user.name (''" >> $OUT.new
-$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep "^Inode\|in inode body\|user.name (" >> $OUT.new
+echo "debugfs -R ''stat file'' test.img 2>&1 | grep -E ''^Inode\|in inode body\|user.name \\(''" >> $OUT.new
+$DEBUGFS -R "stat file" $TMPFILE 2>&1 | grep -E "^Inode|in inode body|user.name \(" >> $OUT.new
 status=$?
 echo Exit status is $status >> $OUT.new