From 8acdea4dcb00b44c5e1ca75e80149313bc72b647 Mon Sep 17 00:00:00 2001 From: kshithijiyer Date: Fri, 3 May 2019 14:05:20 +0530 Subject: Changing error messages to be checked as per new messages. Changing error message displayed when peer detach is issued with bricks are present on the node which is being detached. Adding a logic to handle both the new as well as the old error message. Old msg: peer detach: failed: Brick(s) with the peer exist in cluster New msg: peer detach: failed: Peer hosts one or more bricks. If the peer is in not recoverable state then use either replace-brick or remove-brick command with force to remove all bricks from the peer and attempt the peer detach again. Change-Id: I3d8fdac2c33638ecc2a8b5782c68caebbf17cf41 Signed-off-by: kshithijiyer --- tests/functional/glusterd/test_peer_detach.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/functional/glusterd/test_peer_detach.py b/tests/functional/glusterd/test_peer_detach.py index 633036927..d52498808 100644 --- a/tests/functional/glusterd/test_peer_detach.py +++ b/tests/functional/glusterd/test_peer_detach.py @@ -122,6 +122,15 @@ class PeerDetachVerification(GlusterBaseClass): % self.servers[1]) msg = ('peer detach: failed: Brick(s) with the peer ' + self.servers[1] + ' ' + 'exist in cluster') + if msg not in err: + msg = ('peer detach: failed: Peer ' + self.servers[1] + + ' hosts one or more bricks. ' + + 'If the peer is in not recoverable ' + + 'state then use either ' + + 'replace-brick or remove-brick command ' + + 'with force to remove ' + + 'all bricks from the peer and ' + + 'attempt the peer detach again.') self.assertIn(msg, err, "Peer detach not failed with " "proper error message") @@ -133,5 +142,12 @@ class PeerDetachVerification(GlusterBaseClass): "option : %s" % self.servers[1]) msg = ('peer detach: failed: Brick(s) with the peer ' + self.servers[1] + ' ' + 'exist in cluster') - self.assertIn(msg, err, "Peer detach not failed with proper " - "error message with force option") + if msg not in err: + msg = ('peer detach: failed: Peer ' + self.servers[1] + + ' hosts one or more bricks. ' + + 'If the peer is in not recoverable ' + + 'state then use either ' + + 'replace-brick or remove-brick command ' + + 'with force to remove ' + + 'all bricks from the peer and ' + + 'attempt the peer detach again.') -- cgit