summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2017-07-07 02:46:26 +0530
committerRaghavendra Talur <rtalur@redhat.com>2017-07-10 14:32:25 +0000
commitb0d8afa2d2861f1191c4139e9aa9d4ba67e83135 (patch)
tree74eef5e7c358ca8f8c395572f6bed46de55f7784
parentf28b5d1007644749761fd374d951b72ace2e203e (diff)
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 <ravishankar@redhat.com> Reviewed-on: https://review.gluster.org/17721 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
-rw-r--r--tests/basic/stats-dump.t19
1 files changed, 6 insertions, 13 deletions
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