From b0d8afa2d2861f1191c4139e9aa9d4ba67e83135 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 7 Jul 2017 02:46:26 +0530 Subject: tests: fix stats-dump.t failure Since https://review.gluster.org/#/c/17452, the statistics are appended to the same file instead of overwritten over the previous stats. This was causing the .t to fail since it checks for only the presence of a non zero aggr.fop.write.count assuming the latest statistics will overwrite the previous ones. Fix it by checking for that the latest value of aggr.fop.write.count is non zero. Change-Id: I858011f343966a5d1c19d66dcc64b8cd26315df7 BUG: 1468432 Signed-off-by: Ravishankar N Reviewed-on: https://review.gluster.org/17721 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Raghavendra Talur --- tests/basic/stats-dump.t | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'tests/basic') diff --git a/tests/basic/stats-dump.t b/tests/basic/stats-dump.t index 1752922b7df..5f35db4e0bd 100644 --- a/tests/basic/stats-dump.t +++ b/tests/basic/stats-dump.t @@ -28,18 +28,11 @@ done sleep 2 # Verify we have non-zero write counts from the bricks, gNFSd -# and the FUSE mount -BRICK_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfsd__d_backends_patchy?.dump)" -BRICK_RET="$?" -NFSD_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfs_nfsd.dump)" -NFSD_RET="$?" -FUSE_OUTPUT="$(grep 'aggr.fop.write.count": "0"' ${GLUSTERD_WORKDIR}/stats/glusterfs_patchy.dump)" -FUSE_RET="$?" - -TEST [ 0 -ne "$BRICK_RET" ] -TEST [ 0 -ne "$NFSD_RET" ] -TEST [ 0 -ne "$FUSE_RET" ] +# and the FUSE mount. +TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfs_nfsd.dump|tail -1|cut -d: -f2) != "0," ] +TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfs_patchy.dump|tail -1|cut -d: -f2) != "0," ] +TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfsd__d_backends_patchy0.dump|tail -1|cut -d: -f2) != "0," ] +TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfsd__d_backends_patchy1.dump|tail -1|cut -d: -f2) != "0," ] +TEST [ $(grep 'aggr.fop.write.count' ${GLUSTERD_WORKDIR}/stats/glusterfsd__d_backends_patchy2.dump|tail -1|cut -d: -f2) != "0," ] cleanup; -#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=1468432 -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=1468432 -- cgit