From b4beaa0505e8b23ac027fb6c995aa259c3f7550a Mon Sep 17 00:00:00 2001 From: Samikshan Bairagya Date: Wed, 5 Apr 2017 18:03:10 +0530 Subject: glusterd: Add client details to get-state output This commit optionally adds client details corresponding to the locally running bricks to the get-state output. Since getting the client details involves sending RPC requests to the respective local bricks, this is a relatively more costly operation. These client details would be added to the get-state output only if the get-state command is invoked with the 'detail' option. This commit therefore also changes the get-state CLI usage. The modified usage is as follows: # gluster get-state [] [[odir ] \ [file ]] [detail] Change-Id: I42cd4ef160f9e96d55a08a10d32c8ba44e4cd3d8 BUG: 1431183 Signed-off-by: Samikshan Bairagya Reviewed-on: https://review.gluster.org/17003 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- .../cli/bug-1353156-get-state-cli-validations.t | 33 +++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'tests/bugs/cli') diff --git a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t index 6ab7a084da0..f6e72a591ce 100644 --- a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t +++ b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t @@ -77,7 +77,15 @@ TEST positive_test $CLI get-state odir $ODIR file gdstate TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate -TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate +TEST positive_test $CLI get-state detail + +TEST positive_test $CLI get-state glusterd detail + +TEST positive_test $CLI get-state odir $ODIR detail + +TEST positive_test $CLI get-state glusterd odir $ODIR detail + +TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate detail TEST ! $CLI get-state glusterfsd odir $ODIR; ERRSTR=$($CLI get-state glusterfsd odir $ODIR 2>&1 >/dev/null); @@ -111,19 +119,12 @@ TEST ! $CLI get-state glusterd foo bar; ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; -cleanup; +TEST ! $CLI get-state glusterd detail file gdstate; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; + +TEST ! $CLI get-state glusterd foo bar detail; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; -# I've cleaned this up as much as I can - making sure the gdstates directory -# gets cleaned up, checking whether the CLI command actually succeeded before -# parsing its output, etc. - but it still fails in Jenkins. Specifically, the -# first get-state request that hits the server (i.e. doesn't bail out with a -# parse error first) succeeds, but any others time out. They don't even get as -# far as the glusterd log message that says we received a get-state request. -# There doesn't seem to be a core file, so glusterd doesn't seem to have -# crashed, but it's not responding either. Even worse, the problem seems to be -# environment-dependent; Jenkins is the only place I've seen it, and that's -# just about the worst environment ever for debugging anything. -# -# I'm marking this test bad so progress can be made elsewhere. If anybody else -# thinks this functionality is important, and wants to make it debuggable, good -# luck to you. +cleanup; -- cgit