Permalink
Browse files

CBQE-1942: implement downgrade tests

Change-Id: Ic03060eaa164297cfa0151278b95d9c756da770e
Reviewed-on: http://review.couchbase.org/33462
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Andrei Baranouski <andrei.baranouski@gmail.com>
  • Loading branch information...
1 parent 35926b5 commit b9cdf169ae832d37d51101f1fe7894a1afc123c1 @IrynaMironava IrynaMironava committed Feb 12, 2014
Showing with 16 additions and 3 deletions.
  1. +4 −0 conf/py-newupgrade.conf
  2. +5 −1 lib/remote/remote_util.py
  3. +6 −1 pytests/newupgradebasetest.py
  4. +1 −1 pytests/newupgradetests.py
View
@@ -104,3 +104,7 @@ newupgradetests.MultiNodesUpgradeTests:
# online_upgrade_and_rebalance,initial_version=2.0.0-1976-rel,initial_build_type=community,released_upgrade_version=2.0.1-170-rel,nodes_init=2,servers=2,items=100000,GROUP=2_0;ONLINE;P0;COM_ENT;OLD_RELEASE
# online_upgrade_rebalance_in_out,initial_version=2.0.0-1976-rel,initial_build_type=community,released_upgrade_version=2.0.1-170-rel,reboot_cluster=true,GROUP=2_0;ONLINE;P0;COM_ENT;OLD_RELEASE,BUGS=MB-8371
# online_upgrade_rebalance_in_out,initial_version=1.8.1-942-rel,initial_build_type=community,released_upgrade_version=2.0.1-170-rel,reboot_cluster=true,GROUP=2_0;ONLINE;P0;COM_ENT;OLD_RELEASE,BUGS=MB-8371
+newupgradetests.MultiNodesUpgradeTests:
+ offline_cluster_upgrade,initial_version=2.0.1-170-rel,nodes_init=3,sasl_buckets=1,standard_buckets=1,downgrade=true,GROUP=DOWNGRADE
+ online_upgrade_rebalance_in_out,initial_version=2.0.1-170-rel,sasl_buckets=1,standard_buckets=1,downgrade=true,GROUP=DOWNGRADE
+
@@ -852,7 +852,7 @@ def create_multiple_dir(self, dir_paths):
except IOError:
pass
- def membase_upgrade(self, build, save_upgrade_config=False):
+ def membase_upgrade(self, build, save_upgrade_config=False, forcefully=False):
# upgrade couchbase server
if getattr(self, "info", None) is None:
self.info = self.extract_remote_info()
@@ -871,13 +871,17 @@ def membase_upgrade(self, build, save_upgrade_config=False):
command = 'INSTALL_UPGRADE_CONFIG_DIR=/opt/membase/var/lib/membase/config {0}'.format(install_command)
else:
command = 'rpm -U /tmp/{0}'.format(build.name)
+ if forcefully:
+ command = 'rpm -U --force /tmp/{0}'.format(build.name)
elif self.info.deliverable_type == 'deb':
if save_upgrade_config:
self.membase_uninstall(save_upgrade_config=save_upgrade_config)
install_command = 'dpkg -i /tmp/{0}'.format(build.name)
command = 'INSTALL_UPGRADE_CONFIG_DIR=/opt/membase/var/lib/membase/config {0}'.format(install_command)
else:
command = 'dpkg -i /tmp/{0}'.format(build.name)
+ if forcefully:
+ command = 'dpkg -i --force /tmp/{0}'.format(build.name)
output, error = self.execute_command(command, use_channel=True)
self.log_command_output(output, error)
return output, error
@@ -27,6 +27,11 @@ def setUp(self):
self.initial_vbuckets = self.input.param('initial_vbuckets', 1024)
self.upgrade_versions = self.input.param('upgrade_version', '2.0.1-170-rel')
self.upgrade_versions = self.upgrade_versions.split(";")
+
+ self.is_downgrade = self.input.param('downgrade', False)
+ if self.is_downgrade:
+ self.initial_version, self.upgrade_versions = self.upgrade_versions[0], [self.initial_version]
+
upgrade_path = self.input.param('upgrade_path', [])
if upgrade_path:
upgrade_path = upgrade_path.split(",")
@@ -180,7 +185,7 @@ def _upgrade(self, upgrade_version, server, queue=None, skip_init=False, info=No
appropriate_build = self._get_build(server, upgrade_version, remote, info=info)
self.assertTrue(appropriate_build.url, msg="unable to find build {0}".format(upgrade_version))
self.assertTrue(remote.download_build(appropriate_build), "Build wasn't downloaded!")
- o, e = remote.membase_upgrade(appropriate_build, save_upgrade_config=False)
+ o, e = remote.membase_upgrade(appropriate_build, save_upgrade_config=False, forcefully=self.is_downgrade)
self.log.info("upgrade {0} to version {1} is completed".format(server.ip, upgrade_version))
remote.disconnect()
self.sleep(10)
@@ -483,7 +483,7 @@ def online_upgrade(self):
FIND_MASTER = True
self.log.info("2.0 Node %s becomes the master" % (new_server.ip))
break
- if not FIND_MASTER:
+ if not FIND_MASTER and not self.is_downgrade:
raise Exception("After rebalance in 2.0 Nodes, 2.0 doesn't become the master")
servers_out = self.servers[:self.nodes_init]

0 comments on commit b9cdf16

Please sign in to comment.