def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestNegativeRestClient, self).setUp() self.negative_rest_client = rest_client.NegativeRestClient( fake_auth_provider.FakeAuthProvider()) self.useFixture(mockpatch.PatchObject(self.negative_rest_client, '_log_request'))
def setUp(self): super(TestTenantIsolation, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(http.ClosingHttp, 'request', fake_identity._fake_v2_response)
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientUtils, self).setUp() self.retry_count = 0 self.retry_pass = None self.original_deleted_method = self.rest_client.is_resource_deleted self.rest_client.is_resource_deleted = self._is_resource_deleted
def setUp(self): super(BaseAuthTestsSetUp, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(http.ClosingHttp, 'request', self.fake_http.request) self.auth_provider = self._auth(self.credentials)
def setUp(self): super(TestTenantIsolation, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, "TempestConfigPrivate", fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(json_token_client.TokenClientJSON, "raw_request", fake_identity._fake_v2_response) cfg.CONF.set_default("operator_role", "FakeRole", group="object-storage")
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestNegativeRestClient, self).setUp() self.negative_rest_client = rest_client.NegativeRestClient( fake_auth_provider.FakeAuthProvider()) self.useFixture( mockpatch.PatchObject(self.negative_rest_client, '_log_request'))
def setUp(self): super(BaseAuthTestsSetUp, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(auth, 'get_credentials', fake_get_credentials) self.auth_provider = self._auth(self.credentials, fake_identity.FAKE_AUTH_URL)
def setUp(self): super(TestTenantIsolation, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(http.ClosingHttp, 'request', fake_identity._fake_v2_response) cfg.CONF.set_default('operator_role', 'FakeRole', group='object-storage')
def setUp(self): super(BaseAuthTestsSetUp, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(auth, 'get_credentials', fake_get_credentials) self.stubs.Set(auth, 'get_default_credentials', fake_get_default_credentials) self.auth_provider = self._auth(self.credentials)
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestNegativeRestClient, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.stubs.Set(httplib2.Http, 'request', self.fake_http.request) self.negative_rest_client = negative_rest_client.NegativeRestClient( fake_auth_provider.FakeAuthProvider(), None) self.useFixture( mockpatch.PatchObject(self.negative_rest_client, '_log_request'))
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestNegativeRestClient, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.stubs.Set(httplib2.Http, 'request', self.fake_http.request) self.negative_rest_client = negative_rest_client.NegativeRestClient( fake_auth_provider.FakeAuthProvider(), None) self.useFixture(mockpatch.PatchObject(self.negative_rest_client, '_log_request'))
def setUp(self): super(TestDynamicCredentialProvider, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(json_token_client.TokenClient, 'raw_request', fake_identity._fake_v2_response) cfg.CONF.set_default('operator_role', 'FakeRole', group='object-storage') self._mock_list_ec2_credentials('fake_user_id', 'fake_tenant_id')
def setUp(self): super(TestTenantIsolation, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(json_token_client.TokenClientJSON, 'raw_request', fake_identity._fake_v2_response) cfg.CONF.set_default('operator_role', 'FakeRole', group='object-storage') self._mock_list_ec2_credentials('fake_user_id', 'fake_tenant_id')
def setUp(self): super(TestDynamicCredentialProvider, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(json_token_client.TokenClient, 'raw_request', fake_identity._fake_v2_response) cfg.CONF.set_default('operator_role', 'FakeRole', group='object-storage') self._mock_list_ec2_credentials('fake_user_id', 'fake_tenant_id') self.fixed_params.update(admin_creds=self._get_fake_admin_creds())
def setUp(self): super(TestGlanceHTTPClient, self).setUp() self.fake_http = fake_http.fake_httplib2(return_type=200) # NOTE(maurosr): using http here implies that we will be using httplib # directly. With https glance_client would use an httpS version, but # the real backend would still be httplib anyway and since we mock it # that there is no reason to care. self.endpoint = 'http://fake_url.com' self.fake_auth = fake_auth_provider.FakeAuthProvider() self.fake_auth.base_url = mock.MagicMock(return_value=self.endpoint) self.useFixture(mockpatch.PatchObject(httplib.HTTPConnection, 'request', side_effect=self.fake_http.request(self.endpoint)[1])) self.client = glance_http.HTTPClient(self.fake_auth, {})
def setUp(self): super(TestAccount, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, "TempestConfigPrivate", fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(token_client.TokenClientJSON, "raw_request", fake_identity._fake_v2_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = [ {"username": "******", "tenant_name": "test_tenant1", "password": "******"}, {"username": "******", "tenant_name": "test_tenant2", "password": "******"}, {"username": "******", "tenant_name": "test_tenant3", "password": "******"}, {"username": "******", "tenant_name": "test_tenant4", "password": "******"}, {"username": "******", "tenant_name": "test_tenant5", "password": "******"}, {"username": "******", "tenant_name": "test_tenant6", "password": "******", "roles": ["role1", "role2"]}, {"username": "******", "tenant_name": "test_tenant7", "password": "******", "roles": ["role2", "role3"]}, {"username": "******", "tenant_name": "test_tenant8", "password": "******", "roles": ["role4", "role1"]}, { "username": "******", "tenant_name": "test_tenant9", "password": "******", "roles": ["role1", "role2", "role3", "role4"], }, { "username": "******", "tenant_name": "test_tenant10", "password": "******", "roles": ["role1", "role2", "role3", "role4"], }, { "username": "******", "tenant_name": "test_tenant11", "password": "******", "roles": [cfg.CONF.identity.admin_role], }, { "username": "******", "tenant_name": "test_tenant12", "password": "******", "roles": [cfg.CONF.identity.admin_role], }, ] self.accounts_mock = self.useFixture( mockpatch.Patch("tempest.common.accounts.read_accounts_yaml", return_value=self.test_accounts) ) cfg.CONF.set_default("test_accounts_file", "fake_path", group="auth") self.useFixture(mockpatch.Patch("os.path.isfile", return_value=True))
def setUp(self): super(TestGlanceHTTPClient, self).setUp() self.fake_http = fake_http.fake_httplib2(return_type=200) # NOTE(maurosr): using http here implies that we will be using httplib # directly. With https glance_client would use an httpS version, but # the real backend would still be httplib anyway and since we mock it # that there is no reason to care. self.endpoint = 'http://fake_url.com' self.fake_auth = fake_auth_provider.FakeAuthProvider() self.fake_auth.base_url = mock.MagicMock(return_value=self.endpoint) self.useFixture(mockpatch.PatchObject( httplib.HTTPConnection, 'request', side_effect=self.fake_http.request(self.endpoint)[1])) self.client = glance_http.HTTPClient(self.fake_auth, {})
def setUp(self): super(TestAccount, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(token_client.TokenClientJSON, 'raw_request', fake_identity._fake_v2_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = [ {'username': '******', 'tenant_name': 'test_tenant1', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant2', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant3', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant4', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant5', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant6', 'password': '******', 'roles': ['role1', 'role2']}, {'username': '******', 'tenant_name': 'test_tenant7', 'password': '******', 'roles': ['role2', 'role3']}, {'username': '******', 'tenant_name': 'test_tenant8', 'password': '******', 'roles': ['role4', 'role1']}, {'username': '******', 'tenant_name': 'test_tenant9', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4']}, {'username': '******', 'tenant_name': 'test_tenant10', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4']}, {'username': '******', 'tenant_name': 'test_tenant11', 'password': '******', 'roles': [cfg.CONF.identity.admin_role]}, {'username': '******', 'tenant_name': 'test_tenant12', 'password': '******', 'roles': [cfg.CONF.identity.admin_role]}, {'username': '******', 'tenant_name': 'test_tenant13', 'password': '******', 'resources': {'network': 'network-1'}}, {'username': '******', 'tenant_name': 'test_tenant14', 'password': '******', 'roles': ['role-7', 'role-11'], 'resources': {'network': 'network-2'}}, ] self.useFixture(mockpatch.Patch( 'tempest.common.accounts.read_accounts_yaml', return_value=self.test_accounts)) cfg.CONF.set_default('test_accounts_file', 'fake_path', group='auth') self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def setUp(self): super(TestPreProvisionedCredentials, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(token_client.TokenClient, 'raw_request', fake_identity._fake_v2_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = [ {'username': '******', 'tenant_name': 'test_tenant1', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant2', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant3', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant4', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant5', 'password': '******'}, {'username': '******', 'tenant_name': 'test_tenant6', 'password': '******', 'roles': ['role1', 'role2']}, {'username': '******', 'tenant_name': 'test_tenant7', 'password': '******', 'roles': ['role2', 'role3']}, {'username': '******', 'tenant_name': 'test_tenant8', 'password': '******', 'roles': ['role4', 'role1']}, {'username': '******', 'tenant_name': 'test_tenant9', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4']}, {'username': '******', 'tenant_name': 'test_tenant10', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4']}, {'username': '******', 'tenant_name': 'test_tenant11', 'password': '******', 'roles': [cfg.CONF.identity.admin_role]}, {'username': '******', 'tenant_name': 'test_tenant12', 'password': '******', 'roles': [cfg.CONF.identity.admin_role]}, ] self.accounts_mock = self.useFixture(mockpatch.Patch( 'tempest.common.preprov_creds.read_accounts_yaml', return_value=self.test_accounts)) self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestExpectedSuccess, self).setUp()
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientParseRespXML, self).setUp() self.rest_client.TYPE = self.TYPE
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientUpdateHeaders, self).setUp() self.useFixture( mockpatch.PatchObject(self.rest_client, '_error_checker')) self.headers = {'X-Configuration-Session': 'session_id'}
def setUp(self): super(CredentialsTests, self).setUp() self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(http.ClosingHttp, 'request', self.fake_http.request) self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
def setUp(self): self.fake_http = fake_http.fake_httplib2(404) super(TestRestClientNotFoundHandling, self).setUp()
def setUp(self): super(TestPreProvisionedCredentials, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(token_client.TokenClient, 'raw_request', fake_identity._fake_v2_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = [ { 'username': '******', 'tenant_name': 'test_tenant1', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant2', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant3', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant4', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant5', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant6', 'password': '******', 'roles': ['role1', 'role2'] }, { 'username': '******', 'tenant_name': 'test_tenant7', 'password': '******', 'roles': ['role2', 'role3'] }, { 'username': '******', 'tenant_name': 'test_tenant8', 'password': '******', 'roles': ['role4', 'role1'] }, { 'username': '******', 'tenant_name': 'test_tenant9', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4'] }, { 'username': '******', 'tenant_name': 'test_tenant10', 'password': '******', 'roles': ['role1', 'role2', 'role3', 'role4'] }, { 'username': '******', 'tenant_name': 'test_tenant11', 'password': '******', 'roles': [cfg.CONF.identity.admin_role] }, { 'username': '******', 'tenant_name': 'test_tenant12', 'password': '******', 'roles': [cfg.CONF.identity.admin_role] }, ] self.accounts_mock = self.useFixture( mockpatch.Patch('tempest.common.preprov_creds.read_accounts_yaml', return_value=self.test_accounts)) self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientUpdateHeaders, self).setUp() self.useFixture(mockpatch.PatchObject(self.rest_client, '_error_checker')) self.headers = {'X-Configuration-Session': 'session_id'}
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientHTTPMethods, self).setUp() self.useFixture( mockpatch.PatchObject(self.rest_client, '_error_checker'))
def setUp(self): self.fake_http = fake_http.fake_httplib2() super(TestRestClientHTTPMethods, self).setUp() self.useFixture(mockpatch.PatchObject(self.rest_client, "_error_checker"))
def setUp(self): super(BaseAuthTestsSetUp, self).setUp() self.fake_http = fake_http.fake_httplib2(return_type=200) self.stubs.Set(auth, 'get_credentials', fake_get_credentials) self.auth_provider = self._auth(self.credentials, fake_identity.FAKE_AUTH_URL)