def test_multivm_unittest(self): project = os.path.join(testenv.topdir, 'examples', 'multivm') os.chdir(project) with env.new(): status = main(['-u', testenv.username, '-p', testenv.password, '-s', testenv.service_url, 'run', 'unittest']) assert status == 0
def setup_class(cls): args = get_common_args() args += ['-m', 'platformtest.yml', 'run', 'platformtest', '--dry-run'] with env.new(): # do not pollute test-global env status = main(args) if status != 0: raise SkipTest('Could not start platformtest app.') project, defname, instance = env.application['name'].split(':') appname = '{0}:{1}'.format(defname, instance) vms = [vm['name'] for vm in env.appdef['vms']] cls.appname = appname args = get_common_args() args += ['-m', 'platformtest.yml', 'save', appname, '-y'] with env.new(): status = main(args) if status != 0: raise SkipTest('Could not create blueprint.') project, defname, instance = env.blueprint['name'].split(':') bpname = '{0}:{1}'.format(defname, instance) cls.bpname = bpname
def setup(self): unittest = getattr(self, 'unittest', False) integrationtest = getattr(self, 'integrationtest', False) systemtest = getattr(self, 'systemtest', False) if integrationtest or systemtest: if not testenv.username or not testenv.password: raise SkipTest('This test requires API credentials.') testenv._tempdirs = [] testenv.tempdir = tempdir() testenv._saved_stderr = sys.stderr sys.stderr = sys.stdout # Have nose capture stderr too testenv.context = env.new() testenv.context.__enter__() if integrationtest: args = argparse.Namespace( user = testenv.username, password = testenv.password, service_url = testenv.service_url, manifest = None, quiet = False, verbose=True, debug = True, yes = False) create_environment(args) env.api._login()
def teardown_class(cls): args = get_common_args() args += ['-m', 'platformtest.yml', '-y', 'clean', '-b'] with env.new(): main(args)