summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-02-18 15:39:59 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-02-18 15:39:59 +0000
commit52cb0f3bb90b1dadb53b2702be6c3bd43f115f11 (patch)
treefa892b70c19fa07db78dcecea491366f5af05d34
parent1427608f00045f7627d5b24306c6ae53b4f36f56 (diff)
downloadsystem-tests-52cb0f3bb90b1dadb53b2702be6c3bd43f115f11.tar.gz
Use morph deploy's AUTOSTART flag instead of rebooting manually
-rw-r--r--test_trove_upgrades.py29
1 files changed, 12 insertions, 17 deletions
diff --git a/test_trove_upgrades.py b/test_trove_upgrades.py
index ea95b91..f90cbb9 100644
--- a/test_trove_upgrades.py
+++ b/test_trove_upgrades.py
@@ -169,10 +169,11 @@ class Deployment(object):
run_morph(
['build', self.system_morph_name], cwd=self.branch.branch_dir)
- def run_deploy(self):
+ def run_deploy(self, autostart=False):
+ autostart_param = \
+ '%s.AUTOSTART=%s' % (self.vm_name, 'yes' if autostart else 'no')
run_morph(
- ['deploy', self.deploy_morph_name,
- '%s.AUTOSTART=yes' % self.vm_name],
+ ['deploy', self.deploy_morph_name, autostart_param],
cwd=self.branch.branch_dir)
def create_ssh_key(self, key_name):
@@ -291,11 +292,12 @@ class TroveUpgrade(Deployment):
'trove-system-x86_64', 'trove-test-upgrade', systembranch,
vm_name)
- def run_deploy(self):
+ def run_deploy(self, autostart=False):
+ autostart_param = \
+ '%s.AUTOSTART=%s' % (self.vm_name, 'yes' if autostart else 'no')
run_morph(
['deploy', self.deploy_morph_name,
- '--upgrade',
- '%s.AUTOSTART=yes' % self.vm_name],
+ '--upgrade', autostart_param],
cwd=self.branch.branch_dir)
def create_config(self, initial_deployment, upgrade_method='ssh-rsync',
@@ -506,7 +508,7 @@ class TestUpgrades(BaseTestSuite):
instance = TroveInitialDeployment(branch, vm_name)
instance.create_config()
instance.run_build()
- instance.run_deploy()
+ instance.run_deploy(autostart=True)
cliapp.runcmd(['ssh-add', instance.admin_id])
@@ -561,15 +563,7 @@ class TestUpgrades(BaseTestSuite):
upgrade.create_config(instance, upgrade_method='ssh-rsync',
version_label='trove-current')
upgrade.run_build()
- upgrade.run_deploy()
-
- # FIXME: AUTOSTART=yes should do this
- try:
- remote_runcmd(test_url, ['reboot'])
- except cliapp.AppException:
- # Bit of a hack because we get disconnect before the command
- # exits so SSH returns failure.
- pass
+ upgrade.run_deploy(autostart=True)
self.wait_for_machine_to_boot(instance)
@@ -580,7 +574,8 @@ class TestUpgrades(BaseTestSuite):
['snapshot-mgr', 'set-default', 'factory'])
remote_runcmd(test_url, ['reboot'])
except cliapp.AppException:
- # Same hack as above.
+ # Bit of a hack because we get disconnect before the command
+ # exits so SSH returns failure.
pass
self.wait_for_machine_to_boot(instance)