Bug 1574606 - the regression test "tests/bugs/posix/bug-990028.t" fails
Summary: the regression test "tests/bugs/posix/bug-990028.t" fails
Alias: None
Product: GlusterFS
Classification: Community
Component: tests
Version: mainline
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
Depends On:
Blocks: 1580511 1580519 1580524 1580536
TreeView+ depends on / blocked
Reported: 2018-05-03 16:09 UTC by Raghavendra Bhat
Modified: 2018-06-20 18:06 UTC (History)
1 user (show)

Fixed In Version: glusterfs-v4.1.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1580511 1580519 1580524 1580536 (view as bug list)
Last Closed: 2018-06-20 18:06:01 UTC
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:

Attachments (Terms of Use)

Description Raghavendra Bhat 2018-05-03 16:09:33 UTC
Description of problem:

The following regression test fails everytime with the the below error.

TEST: tests/bugs/posix/bug-990028.t
ok 163, LINENUM:78
tests/bugs/posix/../../include.rc: line 334: [: too many arguments
not ok 164 , LINENUM:82
FAILED COMMAND: [ 0x00000001 0x00000001 = 0x00000001 ]
not ok 165 , LINENUM:82
FAILED COMMAND: [ 0x00000001 0x00000001 = 0x00000001 ]
tests/bugs/posix/../../include.rc: line 334: [: too many arguments
ok 166, LINENUM:88
ok 167, LINENUM:91
ok 168, LINENUM:95
ok 169, LINENUM:99
ok 170, LINENUM:105
ok 171, LINENUM:108
ok 172, LINENUM:113
ok 173, LINENUM:116
ok 174, LINENUM:117
ok 175, LINENUM:123
ok 176, LINENUM:126
ok 177, LINENUM:128
ok 178, LINENUM:135
ok 179, LINENUM:135
ok 180, LINENUM:141
ok 181, LINENUM:146
ok 182, LINENUM:146
ok 183, LINENUM:149
ok 184, LINENUM:155
Failed 2/184 subtests 

Test Summary Report
tests/bugs/posix/bug-990028.t (Wstat: 0 Tests: 184 Failed: 2)
  Failed tests:  164-165

The failure happens because in the line 82 the getfattr command to get the value of the xattr trusted.pgfid.<gfid> each line fails and it still prints the output of 2 lines (i.e. both the xattrs, instead of the xattr that correspond to the file in interest)

getfattr -m "trusted.pgfid.*" -de hex /d/backends/brick/dir2/file2 2>&1 | grep "trusted.pgfid" | cut -d$'\n' -f 1 | cut -d'=' -f2
[root@hp-dl380pgen8-02-vm-10 gluster-gerrit]# getfattr -m "trusted.pgfid.*" -de hex /d/backends/brick/dir2/file2 2>&1 | grep "trusted.pgfid" | cut -d$'\n' -f 1

After some investigation found the below FIX:

The following for loop (which makes use of "awk -v n=$i 'NR==n'" will print only one line at a time (1st line for 1st iteration of the for loop and 2nd line for the 2nd iteration of the for loop)

for i in $(seq 1 2) ; do getfattr -m "trusted.pgfid.*" -de hex /d/backends/brick/dir$i/file$i 2>&1 | grep "trusted.pgfid"  | awk -v n=$i 'NR==n'; done

With the above change all the tests passed from this test case.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 Worker Ant 2018-05-03 16:21:51 UTC
REVIEW: https://review.gluster.org/19959 (use awk to get a specific line from the output instead of cut) posted (#1) for review on master by Raghavendra Bhat

Comment 2 Worker Ant 2018-05-04 04:53:00 UTC
COMMIT: https://review.gluster.org/19959 committed in master by "Amar Tumballi" <amarts@redhat.com> with a commit message- 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#1574606
Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>

Comment 3 Shyamsundar 2018-06-20 18:06:01 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-v4.1.0, please open a new bug report.

glusterfs-v4.1.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2018-June/000102.html
[2] https://www.gluster.org/pipermail/gluster-users/

Note You need to log in before you can comment on or make changes to this bug.