summaryrefslogtreecommitdiff
path: root/test_trove_upgrades.py
diff options
context:
space:
mode:
Diffstat (limited to 'test_trove_upgrades.py')
-rw-r--r--test_trove_upgrades.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/test_trove_upgrades.py b/test_trove_upgrades.py
index 8f39aec..596f000 100644
--- a/test_trove_upgrades.py
+++ b/test_trove_upgrades.py
@@ -63,7 +63,6 @@ import yaml
# functions in morphlib to do stuff. It's better than copying and pasting
# stuff though!
import morphlib
-import morphlib.plugins.branch_and_merge_plugin
import config
import util
@@ -239,11 +238,6 @@ class TroveUpgrade(Deployment):
super(TroveUpgrade, self).__init__(
'trove-system-x86_64', 'trove-test-upgrade', systembranch)
- # Temporary hack until Pedro's branch is merged.
- systembranch.set_chunk_version(
- 'trove-system-x86_64', 'foundation', 'tbdiff',
- ref='origin/baserock/pedroalvarez/system-version-manager4')
-
def run_deploy(self, autostart=False):
autostart_param = \
'%s.AUTOSTART=%s' % (self.name, 'yes' if autostart else 'no')
@@ -311,13 +305,15 @@ class TroveUpgrade(Deployment):
write_file(deploy_morph_file, yaml.dump(deploy_morph))
-class SystemTestBranch(object):
+class SystemTestBranch():
'''Morph system-branch abstraction for use in Baserock system tests.'''
def __init__(self, workspace_dir, name):
self.workspace_dir = workspace_dir
self.branch_dir = os.path.join(workspace_dir, name)
self.morphs_dir = os.path.join(
- self.branch_dir, 'baserock:baserock', 'definitions')
+ self.branch_dir, 'baserock', 'baserock', 'definitions')
+
+ self.sysbranch = morphlib.sysbranchdir.open(self.branch_dir)
def get_repo_and_ref_for_chunk(self, stratum, chunk):
stratum_morph_file = os.path.join(
@@ -354,7 +350,7 @@ class SystemTestBranch(object):
Uses `morph edit` and `git reset` to achieve this.
'''
- chunk_repo_uri, original_ref = self.get_repo_and_ref_for_chunk(
+ chunk_repo_url, original_ref = self.get_repo_and_ref_for_chunk(
stratum, chunk)
with set_directory(self.morphs_dir):
@@ -362,9 +358,7 @@ class SystemTestBranch(object):
run_git(['add', '%s.morph' % stratum])
run_git(['commit', '-m', 'Edit %s chunk' % chunk])
- plugin = morphlib.plugins.branch_and_merge_plugin.BranchAndMergePlugin
- chunk_dir = os.path.join(
- self.branch_dir, plugin.convert_uri_to_path(chunk_repo_uri))
+ chunk_dir = self.sysbranch.get_git_directory_name(chunk_repo_url)
run_git(['reset', '--hard', ref], cwd=chunk_dir)
self._copy_chunk_morph_if_missing(chunk_dir, chunk, original_ref)
@@ -721,11 +715,11 @@ class TestUpgrades(BaseTestSuite):
with self.given_out_of_date_trove_instance(
fixture_dir, reuse=reuse_fixture) as instance:
# Set up Bob's account without a password.
- #instance.runcmd(['adduser', '-D', 'bob'])
- #whoami = instance.runcmd(['su', 'bob', '-c', 'whoami'])
- #home = instance.runcmd(['su', 'bob', '-c', '\"cd && pwd\"'])
- #assert whoami == "bob\n"
- #assert home == "/home/bob\n"
+ instance.runcmd(['adduser', '-D', 'bob'])
+ whoami = instance.runcmd(['su', 'bob', '-c', 'whoami'])
+ home = instance.runcmd(['su', 'bob', '-c', '\"cd && pwd\"'])
+ assert whoami == "bob\n"
+ assert home == "/home/bob\n"
self.upgrade_to_latest_trove(workspace_dir, instance)
@@ -809,7 +803,11 @@ class SimpleTestRunner(cliapp.Application):
else:
fixture_dir = cliapp.runcmd(
['mktemp', '-d', '-p', config.BUILD_TEMPDIR]).strip()
- run_morph(['init', fixture_dir])
+ run_morph(['init', fixture_dir])
+
+ # `morph init` expects the workspace dir to be empty, but once it's
+ # created we can put the logs in there too. Why not.
+ config.log_dir = fixture_dir
try:
print "Running %s" % test