Skip to contentSkip to conversation

xfs/148: fix some errors for output

PATCH In review XiaoLi Feng 2 participants 3 messages Dec 4, 2019 – Dec 6, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/148: fix some errors for output

From: Xiaoli Feng <[email protected]>

When disable crc, the extended attributes display is different for "attr -l". And there is no quotes when ls no-exist file in RHEL7. eg. RHEL7:
ls: cannot access file: No such file or directory
RHEL8:
ls: cannot access 'file': No such file or directory

---
 tests/xfs/148     |  2 +-
 tests/xfs/148.out | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)
tests/xfs/148 +1 -1
index 42cfdab0..1203edd9 100755
@@ -79,7 +79,7 @@ access_stuff() {
 	$ATTR_PROG -l $testfile
 
 	for name in "${test_names[@]}"; do
-		ls "$testdir/f_$name"
+		ls "$testdir/f_$name" 2>&1 | sed -e "s/'//g"
 		$ATTR_PROG -g "a_$name" $testfile
 	done
 }
tests/xfs/148.out +9 -8
index c301ecb6..b1bea98a 100644
@@ -4,10 +4,11 @@ f_another
 f_are_bad_for_you
 f_something
 f_too_many_beans
-Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
-Attribute "a_too_many_beans" has a 3 byte value for TEST_DIR/mount-148/testfile
 Attribute "a_are_bad_for_you" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "a_too_many_beans" has a 3 byte value for TEST_DIR/mount-148/testfile
 Attribute "a_another" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "selinux" has a 37 byte value for TEST_DIR/mount-148/testfile
 TEST_DIR/mount-148/testdir/f_something
 Attribute "a_something" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
@@ -20,10 +21,10 @@ heh
 TEST_DIR/mount-148/testdir/f_another
 Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
 attr_get: No data available
 Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
 attr_get: No data available
 Could not get "a_are_bad/for_you" for TEST_DIR/mount-148/testfile
 ++ ACCESSING BAD METADATA
@@ -33,18 +34,18 @@ attr_list: Structure needs cleaning
 TEST_DIR/mount-148/testdir/f_something
 Attribute "a_something" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many_beans': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many_beans: No such file or directory
 attr_get: No data available
 Could not get "a_too_many_beans" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad_for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad_for_you: No such file or directory
 attr_get: No data available
 Could not get "a_are_bad_for_you" for TEST_DIR/mount-148/testfile
 TEST_DIR/mount-148/testdir/f_another
 Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
 attr_get: No data available
 Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
 Attribute "a_are_bad/for_you" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
Signature · 1 line
2.18.1
#1 lore raw
Quoted 33 lines · XiaoLi Feng

From: Xiaoli Feng <[email protected]>

When disable crc, the extended attributes display is different for "attr -l". And there is no quotes when ls no-exist file in RHEL7. eg. RHEL7:
ls: cannot access file: No such file or directory
RHEL8:
ls: cannot access 'file': No such file or directory

---
 tests/xfs/148     |  2 +-
 tests/xfs/148.out | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)
tests/xfs/148 +1 -1
index 42cfdab0..1203edd9 100755
@@ -79,7 +79,7 @@ access_stuff() {
 	$ATTR_PROG -l $testfile
 
 	for name in "${test_names[@]}"; do
-		ls "$testdir/f_$name"
+		ls "$testdir/f_$name" 2>&1 | sed -e "s/'//g"
 		$ATTR_PROG -g "a_$name" $testfile
 	done
 }
tests/xfs/148.out +0 -0
index c301ecb6..b1bea98a 100644

tests/xfs/148.out f_another · line 11

Quoted 10 lines
tests/xfs/148.out +3 -2
@@ -4,10 +4,11 @@ f_another
 f_are_bad_for_you
 f_something
 f_too_many_beans
-Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
-Attribute "a_too_many_beans" has a 3 byte value for TEST_DIR/mount-148/testfile
 Attribute "a_are_bad_for_you" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "a_too_many_beans" has a 3 byte value for TEST_DIR/mount-148/testfile
 Attribute "a_another" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "selinux" has a 37 byte value for TEST_DIR/mount-148/testfile

The single-quot filter part is fine, but this change in the golden output doesn't reflect that...

--D

Quoted 42 lines
tests/xfs/148.out +6 -6
 TEST_DIR/mount-148/testdir/f_something
 Attribute "a_something" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
@@ -20,10 +21,10 @@ heh
 TEST_DIR/mount-148/testdir/f_another
 Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
 attr_get: No data available
 Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
 attr_get: No data available
 Could not get "a_are_bad/for_you" for TEST_DIR/mount-148/testfile
 ++ ACCESSING BAD METADATA
@@ -33,18 +34,18 @@ attr_list: Structure needs cleaning
 TEST_DIR/mount-148/testdir/f_something
 Attribute "a_something" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many_beans': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many_beans: No such file or directory
 attr_get: No data available
 Could not get "a_too_many_beans" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad_for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad_for_you: No such file or directory
 attr_get: No data available
 Could not get "a_are_bad_for_you" for TEST_DIR/mount-148/testfile
 TEST_DIR/mount-148/testdir/f_another
 Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
 attr_get: No data available
 Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
 Attribute "a_are_bad/for_you" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
Signature · 1 line
2.18.1
#2 lore raw

Hi,

----- Original Message -----

Quoted 57 lines

From: "Darrick J. Wong" <[email protected]>
To: "XiaoLi Feng" <[email protected]>
Cc: [email protected]
Sent: Thursday, December 5, 2019 12:10:53 AM
Subject: Re: [PATCH v1] xfs/148: fix some errors for output

Quoted 44 lines · XiaoLi Feng

From: Xiaoli Feng <[email protected]>

When disable crc, the extended attributes display is different for "attr -l". And there is no quotes when ls no-exist file in RHEL7. eg. RHEL7:
ls: cannot access file: No such file or directory
RHEL8:
ls: cannot access 'file': No such file or directory

---
 tests/xfs/148     |  2 +-
 tests/xfs/148.out | 17 +++++++++--------
 2 files changed, 10 insertions(+), 9 deletions(-)
tests/xfs/148 +1 -1
index 42cfdab0..1203edd9 100755
@@ -79,7 +79,7 @@ access_stuff() {
 	$ATTR_PROG -l $testfile
 
 	for name in "${test_names[@]}"; do
-		ls "$testdir/f_$name"
+		ls "$testdir/f_$name" 2>&1 | sed -e "s/'//g"
 		$ATTR_PROG -g "a_$name" $testfile
 	done
 }
tests/xfs/148.out +0 -2
index c301ecb6..b1bea98a 100644
@@ -4,10 +4,11 @@ f_another
 f_are_bad_for_you
 f_something
 f_too_many_beans
-Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
-Attribute "a_too_many_beans" has a 3 byte value for

TEST_DIR/mount-148/testfile
Attribute "a_are_bad_for_you" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "a_too_many_beans" has a 3 byte value for TEST_DIR/mount-148/testfile
Attribute "a_another" has a 3 byte value for TEST_DIR/mount-148/testfile

tests/xfs/148.out f_another · line 11

Quoted 2 lines
tests/xfs/148.out +2 -0
+Attribute "a_something" has a 3 byte value for TEST_DIR/mount-148/testfile
+Attribute "selinux" has a 37 byte value for TEST_DIR/mount-148/testfile

The single-quot filter part is fine, but this change in the golden output doesn't reflect that...

Quoted 1 line

--D

Just found that you already sent a patch to fix "attr -l" output order. It's better. And sorry, I didn't understand well about "but this change in the golden output doesn't reflect that". I tested it on RHEL8, it's pass.

Quoted 60 lines
Quoted 58 lines

TEST_DIR/mount-148/testdir/f_something
Attribute "a_something" had a 3 byte value for
TEST_DIR/mount-148/testfile:
heh

tests/xfs/148.out +0 -1
@@ -20,10 +21,10 @@ heh
 TEST_DIR/mount-148/testdir/f_another
 Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or

directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
attr_get: No data available
Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
attr_get: No data available
Could not get "a_are_bad/for_you" for TEST_DIR/mount-148/testfile ++ ACCESSING BAD METADATA

tests/xfs/148.out +0 -1
@@ -33,18 +34,18 @@ attr_list: Structure needs cleaning
 TEST_DIR/mount-148/testdir/f_something
 Attribute "a_something" had a 3 byte value for
 TEST_DIR/mount-148/testfile:
 heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many_beans': No such

file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many_beans: No such file or directory
attr_get: No data available
Could not get "a_too_many_beans" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad_for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad_for_you: No such file or directory
attr_get: No data available
Could not get "a_are_bad_for_you" for TEST_DIR/mount-148/testfile TEST_DIR/mount-148/testdir/f_another
Attribute "a_another" had a 3 byte value for TEST_DIR/mount-148/testfile:
heh
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_too_many': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_too_many: No such file or directory
attr_get: No data available
Could not get "a_too_many" for TEST_DIR/mount-148/testfile
-ls: cannot access 'TEST_DIR/mount-148/testdir/f_are_bad/for_you': No such file or directory
+ls: cannot access TEST_DIR/mount-148/testdir/f_are_bad/for_you: No such file or directory
Attribute "a_are_bad/for_you" had a 3 byte value for TEST_DIR/mount-148/testfile:
heh
--
2.18.1