diff mbox series

[v3,1/2] xfs/270: Fix syntax error

Message ID 1658219473-2310-1-git-send-email-xuyang2018.jy@fujitsu.com (mailing list archive)
State New, archived
Headers show
Series [v3,1/2] xfs/270: Fix syntax error | expand

Commit Message

Yang Xu (Fujitsu) July 19, 2022, 8:31 a.m. UTC
Without xfsprogs commit
f4afdcb0a ("xfs_db: clean up the salvage read callsites in set_cur()"),
this case will fail as below:

+/var/lib/xfstests/tests/xfs/270: line 51: [: !=: unary operator expected

With this xfsprogs bug, xfs_db can't get new_ro_compat value, so report
this bash syntax error.

Fix this and add a helper output for xfsprogs bug.

Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 tests/xfs/270 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/xfs/270 b/tests/xfs/270
index b740c379..4954e943 100755
--- a/tests/xfs/270
+++ b/tests/xfs/270
@@ -47,9 +47,12 @@  _scratch_xfs_set_metadata_field "features_ro_compat" "$ro_compat" "sb 0" \
 new_ro_compat=$(_scratch_xfs_get_metadata_field "features_ro_compat" "sb 0" \
 						2>/dev/null)
 
-# verify the new ro_compat field is correct.
-if [ $new_ro_compat != $ro_compat ]; then
+# verify the new ro_compat field is correct. Without xfsprogs commit
+# f4afdcb0ad ("xfs_db: clean up the salvage read callsites in set_cur()"),
+# we can't get new_ro_compat value.
+if [ "$new_ro_compat" != "$ro_compat" ]; then
 	echo "Unable to set new features_ro_compat. Wanted $ro_compat, got $new_ro_compat"
+	echo "May hit a known xfsprog bug"
 fi
 
 # rw mount with unknown ro-compat feature should fail