summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2019-05-03 14:05:20 +0530
committerAkarsha Rai <akrai@redhat.com>2019-05-08 10:19:21 +0000
commit8acdea4dcb00b44c5e1ca75e80149313bc72b647 (patch)
tree7af4d094e7b08205c759f36c40f01e4be2e77a55
parentb8311dc6d0b8e063f7757aec88417393f8c8f02d (diff)
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 <my_server> exist in cluster New msg: peer detach: failed: Peer <my_server> 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 <kshithij.ki@gmail.com>
-rw-r--r--tests/functional/glusterd/test_peer_detach.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/functional/glusterd/test_peer_detach.py b/tests/functional/glusterd/test_peer_detach.py
index 6330369..d524988 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.')