summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-01-23 11:24:07 +0100
committerRaghavendra Bhat <raghavendra@redhat.com>2015-02-18 22:57:39 -0800
commit58b71c64308e7680b5fc5326ed1aed294f848ecb (patch)
tree8a6c757ae94fb89864668135cc05502932968bcc
parente312b0807b51120942d95d482ddce7a51ebbacc8 (diff)
tests/features/ssl-authz.t: Fix spurious failures
Fix two spurious failures in tests/features/ssl-authz.t 1) Wait for bricks to come online after starting a volume, so that the mount is usable without "socket not connected" error 2) For a mount that must fail, we may get the situation where there is no mount at all, which means creating a file will write to the mount point instead of failing. To cover that case, write the file and check it is absent from the brick. BUG: 1193970 Change-Id: If95e1d65ab23d11123f778c20f8110a3177b0e7f Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9483 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/9686 Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rwxr-xr-xtests/features/ssl-authz.t11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/features/ssl-authz.t b/tests/features/ssl-authz.t
index 37cbbd789c0..f5cd1122332 100755
--- a/tests/features/ssl-authz.t
+++ b/tests/features/ssl-authz.t
@@ -52,6 +52,7 @@ TEST $CLI volume set $V0 client.ssl on
#EST $CLI volume set $V0 ssl.cipher-list $(valid_ciphers)
TEST $CLI volume set $V0 auth.ssl-allow Anyone
TEST $CLI volume start $V0
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count
# This mount should WORK.
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0
@@ -63,6 +64,7 @@ EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
TEST $CLI volume stop $V0
TEST $CLI volume set $V0 auth.ssl-allow NotYou
TEST $CLI volume start $V0
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" online_brick_count
# This mount should FAIL because the identity given by our certificate does not
# match the allowed user. In other words, authentication works (they know who
@@ -70,7 +72,12 @@ TEST $CLI volume start $V0
TEST glusterfs --volfile-server=$H0 --volfile-id=$V0 $M0
# Looks like /*/bin/glusterfs isn't returning error status correctly (again).
-# Actually try doing something to get a real error.
-TEST ! ping_file $M0/after
+# We may get an unusable mount where ping will fail, or no mount at all,
+# where ping will write to the mount point instead of the mounted filesystem.
+# In order to avoid spurious failures, create a file by ping and check it
+# is absent from the brick.
+ping_file $M0/after
+TEST test -f $B0/1/before
+TEST ! test -f $B0/1/after
cleanup;