Permalink
Browse files

CBQE-2326: add hostname mgmt negative tests

Change-Id: I0542d96aebb9745bd8ddd1c48bad9ceb4ddf3aaa
Reviewed-on: http://review.couchbase.org/39353
Reviewed-by: Meenakshi Goel <meenakshi.goel@globallogic.com>
Tested-by: buildbot <build@couchbase.com>
  • Loading branch information...
1 parent 0e00028 commit 42c3b0c2ec3c18dcce0f036414675a43388763b8 @IrynaMironava IrynaMironava committed Jul 15, 2014
Showing with 25 additions and 0 deletions.
  1. +2 −0 conf/py-hostnameTests.conf
  2. +23 −0 pytests/hostname/hostnamemgmt_tests.py
@@ -6,6 +6,8 @@ hostname.hostnamemgmt_tests.HostnameMgmtTests:
test_rename_rebalance,error=Renaming is disallowed for nodes that are already part of a cluster
test_rename_with_index
test_rename_with_warm_up
+ test_rename_negative,error=eaddrnotavail
+ test_rename_negative_name_with_space,error=Requested name hostname is not allowed
hostname.hostnamemgmt_multirenames_tests.HostnameMgmtMultiTests:
test_add_cluster_twice
test_add_same_node_to_cluster,use_names=2
@@ -102,3 +102,26 @@ def test_rename_with_warm_up(self):
shell.start_couchbase()
shell.disconnect()
self.verify_referenced_by_names(self.servers[:self.nodes_in + self.nodes_init], hostnames)
+
+ def test_rename_negative(self):
+ if len(self.servers) < 2:
+ self.fail("test require more than 1 node")
+ hostnames = self.rename_nodes(self.servers[:2])
+ self._set_hostames_to_servers_objs(hostnames)
+ self.verify_referenced_by_names(self.servers[:2], hostnames)
+ try:
+ self.rename_nodes(self.servers[:1], names={self.servers[0]: hostnames[self.servers[1]]})
+ except Exception, ex:
+ if self.error:
+ self.assertTrue(str(ex).find(self.error) != -1, "Unexpected error msg")
+ else:
+ raise ex
+
+ def test_rename_negative_name_with_space(self):
+ try:
+ self.rename_nodes(self.servers[:1], names={self.servers[0]: ' '})
+ except Exception, ex:
+ if self.error:
+ self.assertTrue(str(ex).find(self.error) != -1, "Unexpected error msg")
+ else:
+ raise ex

0 comments on commit 42c3b0c

Please sign in to comment.