Fix some issues with tempest test when not running with devstack

Change-Id: Ia4d6aa8bd783b706a247a1920018a7d72fbc0e13
This commit is contained in:
Saad Zaher 2017-05-23 14:43:35 +00:00
parent e1b0a57a27
commit 94a5e51bce
3 changed files with 17 additions and 6 deletions

View File

@ -136,7 +136,9 @@ class BaseFreezerTest(tempest.test.BaseTestCase):
@classmethod
def get_auth_url(cls):
return cls.os_primary.auth_provider.auth_client.auth_url[:-len('/tokens')]
return cls.os_primary.auth_provider.auth_client.auth_url[:-len(
'/auth/tokens'
)]
@classmethod
def setup_clients(cls):
@ -160,7 +162,6 @@ class BaseFreezerTest(tempest.test.BaseTestCase):
return os.environ
def run_subprocess(self, sub_process_args, fail_message):
proc = subprocess.Popen(sub_process_args,

View File

@ -41,7 +41,7 @@ class TestFreezerSwiftBackup(base.BaseFreezerTest):
"/tmp/freezer-test-backup-restore/"
+ test_id)
self.freezer_container_name = 'freezer-test-container-0'
self.freezer_container_name = 'container_{}'.format(test_id)
self.freezer_backup_name = 'freezer-test-backup-swift-0'
shutil.rmtree(self.backup_source_dir, True)

View File

@ -74,7 +74,7 @@ class BaseFreezerCliTest(base.BaseFreezerTest):
if row[0].strip() == job_id.strip():
return row
self.fail('Could not find job: {}'.format(job_id))
self.fail('Could not find job: {}'.format(job_id))
def wait_for_job_status(self, job_id, status, timeout=720):
start = time.time()
@ -116,9 +116,13 @@ class CLIClientWithFreezer(cli_base.CLIClient):
"""
flags += ' --os-endpoint-type %s' % endpoint_type
flags += ' --os-cacert /etc/ssl/certs/ca-certificates.crt'
flags += ' --os-project-domain-name Default'
flags += ' --os-user-domain-name Default'
return self.cmd_with_auth(
'freezer-scheduler', action, flags, params, fail_ok, merge_stderr)
# This class is just copied from the freezer repo. Depending on where the
# scenario tests end up we may need to refactore this.
class Temp_Tree(object):
@ -229,14 +233,20 @@ class TestFreezerScenario(BaseFreezerCliTest):
self.source_tree.add_random_data()
self.dest_tree = Temp_Tree()
self.cli.freezer_scheduler(action='start', flags='-c test_node')
self.cli.freezer_scheduler(
action='start',
flags='-c test_node -f /tmp/freezer_tempest_job_dir/'
)
def tearDown(self):
super(TestFreezerScenario, self).tearDown()
self.source_tree.cleanup()
self.dest_tree.cleanup()
self.cli.freezer_scheduler(action='stop', flags='-c test_node')
self.cli.freezer_scheduler(
action='stop',
flags='-c test_node -f /tmp/freezer_tempest_job_dir/'
)
def test_simple_backup(self):
backup_job = {