From 68e3af4cc043a460e814215be2a7953d52b048ba Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 3 May 2018 12:15:52 -0400 Subject: use awk to get a specific line from the output instead of cut cut -d$'\n' is not separating the xattrs shown as part of getfattr output. Hence use awk to get the nth line of getfattr output for nth iteration in the for loop. Change-Id: I1a96cd3f72f4f407f9a783375f78d9a69d5d3885 fixes: bz#1580519 Signed-off-by: Raghavendra Bhat (cherry picked from commit bef654f48c14bfd7ce20702edff41052f6f54bdc) --- tests/bugs/posix/bug-990028.t | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/bugs/posix/bug-990028.t b/tests/bugs/posix/bug-990028.t index 5006a611630..bef36a8897d 100755 --- a/tests/bugs/posix/bug-990028.t +++ b/tests/bugs/posix/bug-990028.t @@ -78,7 +78,7 @@ function links_across_directories() TEST [ $LINES = 2 ] for i in $(seq 1 2); do - HL=`getfattr -m "trusted.pgfid.*" -de hex $B0/brick/dir$i/file$i 2>&1 | grep "trusted.pgfid" | cut -d$'\n' -f$i | cut -d'=' -f2` + HL=`getfattr -m "trusted.pgfid.*" -de hex $B0/brick/dir$i/file$i 2>&1 | grep "trusted.pgfid" | awk -v n=$i 'NR==n' | cut -d'=' -f2` TEST_IN_LOOP [ $HL = "0x00000001" ] done @@ -155,9 +155,3 @@ links_across_directories; TEST $CLI volume stop $V0 cleanup - -# Mainly marking it as known-issue as it is consistently failing. -# Revert back once fixing this. - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=1517961 -#G_TESTDEF_TEST_STATUS_CENTOS6=KNOWN_ISSUE,BUG=1517961 -- cgit