summaryrefslogtreecommitdiffstats
path: root/tests/bugs/cli/bug-1169302.t
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2017-01-06 12:58:02 +0100
committerKaleb KEITHLEY <kkeithle@redhat.com>2017-01-24 05:42:57 -0500
commite2525785e026d209845b939b9d02048d3004920d (patch)
tree4d0258945237bf58bb029d8c9db8d8984f4f508e /tests/bugs/cli/bug-1169302.t
parent7c6538f6c8f9a015663b4fc57c640a7c451c87f7 (diff)
gfapi: create statedump when glusterd requests it
When GlusterD sends the STATEDUMP procedure to the libgfapi client, the client checks if it matches the PID that should take the statedump. If so, it will do a statedump for the glfs_t that is connected to this mgmt connection. BUG: 1169302 Change-Id: I70d6a1f4f19d525377aebc8fa57f51e513b92d84 See-also: http://review.gluster.org/9228 Signed-off-by: Poornima G <pgurusid@redhat.com> [ndevos: separated patch from 9228] Reviewed-on: https://review.gluster.org/16415 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'tests/bugs/cli/bug-1169302.t')
-rwxr-xr-xtests/bugs/cli/bug-1169302.t30
1 files changed, 23 insertions, 7 deletions
diff --git a/tests/bugs/cli/bug-1169302.t b/tests/bugs/cli/bug-1169302.t
index 92252aa7887..24355e55646 100755
--- a/tests/bugs/cli/bug-1169302.t
+++ b/tests/bugs/cli/bug-1169302.t
@@ -7,7 +7,7 @@
function check_peers {
$CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l
}
-cleanup;
+cleanup
#setup cluster and test volume
TEST launch_cluster 3; # start 3-node virtual cluster
@@ -19,16 +19,32 @@ EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers;
TEST $CLI_1 volume create $V0 $H1:$B1/$V0 $H2:$B2/$V0 $H3:$B3/$V0
TEST $CLI_1 volume start $V0
-# there is no gfapi application to take statedumps yet, it will get added in
-# the next patch, this only tests the CLI for correctness
-
-cleanup_statedump
-
+# test CLI parameter acceptance
TEST ! $CLI_1 volume statedump $V0 client $H2:0
TEST ! $CLI_2 volume statedump $V0 client $H2:-1
TEST $CLI_3 volume statedump $V0 client $H2:765
TEST ! $CLI_1 volume statedump $V0 client $H2:
TEST ! $CLI_2 volume statedump $V0 client
+TEST ! $CLI_3 volume statedump $V0 client $H2 $GFAPI_PID
+
+# build and run a gfapi appliction for triggering a statedump
+logdir=`gluster --print-logdir`
+STATEDUMP_TIMEOUT=60
+
+build_tester $(dirname $0)/bug-1169302.c -lgfapi
+$(dirname $0)/bug-1169302 $V0 $H1 $logdir/bug-1169302.log testfile & GFAPI_PID=$!
+
+cleanup_statedump
+
+# Take the statedump of the process connected to $H1, it should match the
+# hostname or IP-address with the connection from the bug-1169302 executable.
+# In our CI it seems not possible to use $H0, 'localhost', $(hostname --fqdn)
+# or even "127.0.0.1"....
+TEST $CLI_3 volume statedump $V0 client $H1:$GFAPI_PID
+EXPECT_WITHIN $STATEDUMP_TIMEOUT "Y" path_exists $statedumpdir/glusterdump.$GFAPI_PID*
+
+kill $GFAPI_PID
cleanup_statedump
-cleanup;
+cleanup_tester $(dirname $0)/bug-1169302
+cleanup