From 3f9c3e3424039cbffb913e77b0f8a07465f0610e Mon Sep 17 00:00:00 2001 From: Bala Konda Reddy M Date: Fri, 18 Jan 2019 16:10:32 +0530 Subject: Fix: Volume create should fail when a node is down Earlier while volume creation randomly selected one node and stopped gluster but the volume type used in the test is pure distribute and default glusto config takes 4 bricks. With the fix now randomly selecting only first 4 nodes for volume creation and it will fail. Change-Id: I3cf2fc8281c9747b190e1fe9ef471edbb2c4d2ca Signed-off-by: Bala Konda Reddy M --- tests/functional/glusterd/test_volume_create.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/functional/glusterd/test_volume_create.py b/tests/functional/glusterd/test_volume_create.py index 3a181597b..4046b8130 100644 --- a/tests/functional/glusterd/test_volume_create.py +++ b/tests/functional/glusterd/test_volume_create.py @@ -197,7 +197,11 @@ class TestVolumeCreate(GlusterBaseClass): self.assertTrue(ret, "Peer probe is failed") g.log.info("Peer probe to all the servers is success") - random_server = self.servers[random.randint(1, len(self.servers) - 1)] + # Taking random node from the first four nodes as the + # volume getting created is using first four nodes + # Excluding servers[0] as it is mnode + first_four_servers = self.servers[:4] + random_server = random.choice(first_four_servers[1:]) ret = stop_glusterd(random_server) self.assertTrue(ret, "Glusterd is stopped successfully") @@ -205,6 +209,6 @@ class TestVolumeCreate(GlusterBaseClass): ret = setup_volume(self.mnode, self.all_servers_info, self.volume) self.assertFalse(ret, "Expected: It should fail to create a volume " "when one of the node is down. Actual: Successfully " - "created the volume with bbrick whose node is down") + "created the volume with brick whose node is down") g.log.info("Failed to create the volume with brick whose node is down") -- cgit