Skip to contentSkip to conversation

generic/486: filter out irrelevant attrs

PATCH In review Murphy Zhou 2 participants 2 messages Jun 27, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 generic/486: filter out irrelevant attrs

In some setup, there could be extra attrs printed, like selinux. They are breaking golden output and irrelevant for this test. So focus on the attr we are testing on to avoid false alarm. Print the output to .full for debug.

---
 tests/generic/486 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/generic/486 +3 -1
index ff115a07..ea571efe 100755
@@ -46,10 +46,12 @@ _scratch_mkfs >>$seqres.full 2>&1
 _scratch_mount >>$seqres.full 2>&1
 
 filter_attr_output() {
-	_filter_scratch | sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
+	_filter_scratch | grep world | \
+		sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
 }
 
 ./src/attr_replace_test $SCRATCH_MNT/hello
+$ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output
 
 status=0
Signature · 1 line
2.21.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Murphy Zhou

In some setup, there could be extra attrs printed, like selinux. They are breaking golden output and irrelevant for this test. So focus on the attr we are testing on to avoid false alarm. Print the output to .full for debug.

--D

Quoted 25 lines
---
 tests/generic/486 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/generic/486 +3 -1
index ff115a07..ea571efe 100755
@@ -46,10 +46,12 @@ _scratch_mkfs >>$seqres.full 2>&1
 _scratch_mount >>$seqres.full 2>&1
 
 filter_attr_output() {
-	_filter_scratch | sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
+	_filter_scratch | grep world | \
+		sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
 }
 
 ./src/attr_replace_test $SCRATCH_MNT/hello
+$ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output
 
 status=0
Signature · 1 line
2.21.0