def setUp(self): super(TempestConfigfileManagerTestCase, self).setUp() env = fakes.FakeEnvironment( env_uuid="fake_env", data={ "platforms": { "openstack": { "platform_data": { "admin": CRED } } } } ) with mock.patch("%s.credential.OpenStackCredential" % PATH, return_value=fakes.FakeCredential(**CRED)): self.tempest = config.TempestConfigfileManager(env)
def existing_image_context(self): self.context.update({ "config": { "users": { "tenants": self.tenants_num, "users_per_tenant": self.users_per_tenant, }, "sahara_image": { "image_uuid": "some_id" } }, "admin": { "credential": fakes.FakeCredential() }, "users": self.users_key, "tenants": self.tenants, }) return self.context
def setUp(self): super(TempestContextTestCase, self).setUp() self.mock_isfile = mock.patch("os.path.isfile", return_value=True).start() self.cred = fakes.FakeCredential(**CRED) self.deployment = fakes.FakeDeployment(uuid="fake_deployment", admin=self.cred) cfg = { "verifier": mock.Mock(deployment=self.deployment), "verification": { "uuid": "uuid" } } cfg["verifier"].manager.home_dir = "/p/a/t/h" cfg["verifier"].manager.configfile = "/fake/path/to/config" self.context = context.TempestContext(cfg) self.context.conf.add_section("compute") self.context.conf.add_section("orchestration") self.context.conf.add_section("scenario")
def url_image_context(self): self.context.update({ "config": { "users": { "tenants": self.tenants_num, "users_per_tenant": self.users_per_tenant, }, "sahara_image": { "image_url": "http://somewhere", "plugin_name": "test_plugin", "hadoop_version": "test_version", "username": "******" } }, "admin": { "credential": fakes.FakeCredential() }, "users": self.users_key, "tenants": self.tenants }) return self.context
def setUp(self): super(TempestContextTestCase, self).setUp() self.mock_isfile = mock.patch("os.path.isfile", return_value=True).start() self.cred = fakes.FakeCredential(**CRED) p_cred = mock.patch(PATH + ".credential.OpenStackCredential", return_value=self.cred) p_cred.start() self.addCleanup(p_cred.stop) self.env = mock.Mock(data={"platforms": {"openstack": { "platform_data": {"admin": {}}}}} ) cfg = {"verifier": mock.Mock(env=self.env), "verification": {"uuid": "uuid"}} cfg["verifier"].manager.home_dir = "/p/a/t/h" cfg["verifier"].manager.configfile = "/fake/path/to/config" self.context = context.TempestContext(cfg) self.context.conf.add_section("compute") self.context.conf.add_section("orchestration") self.context.conf.add_section("scenario")
def setUp(self): super(SaharaImageTestCase, self).setUp() self.tenants_num = 2 self.users_per_tenant = 2 self.users = self.tenants_num * self.users_per_tenant self.task = mock.MagicMock() self.tenants = {} self.users_key = [] for i in range(self.tenants_num): self.tenants[str(i)] = { "id": str(i), "name": str(i), "sahara": { "image": "42" } } for j in range(self.users_per_tenant): self.users_key.append({ "id": "%s_%s" % (str(i), str(j)), "tenant_id": str(i), "credential": fakes.FakeCredential() })
def setUp(self): super(TempestConfigfileManagerTestCase, self).setUp() deployment = fakes.FakeDeployment(uuid="fake_deployment", admin=fakes.FakeCredential(**CRED)) self.tempest = config.TempestConfigfileManager(deployment)