def setUp(self): super(TestBaseTestCase, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.fixed_network_name = 'fixed-net' cfg.CONF.set_default('fixed_network_name', self.fixed_network_name, 'compute') cfg.CONF.set_default('neutron', True, 'service_available')
def setUp(self): super(TestRemoteClientWithServer, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) cfg.CONF.set_default('ip_version_for_ssh', 4, group='validation') cfg.CONF.set_default('network_for_ssh', 'public', group='validation') cfg.CONF.set_default('connect_timeout', 1, group='validation') cfg.CONF.set_default('console_output', True, group='compute-feature-enabled') self.conn = remote_client.RemoteClient( '127.0.0.1', 'user', 'pass', server=self.server, servers_client=FakeServersClient()) self.useFixture( fixtures.MockPatch( 'tempest.lib.common.ssh.Client._get_ssh_connection', side_effect=lib_exc.SSHTimeout(host='127.0.0.1', user='******', password='******'))) self.log = self.useFixture( fixtures.FakeLogger( name='tempest.lib.common.utils.linux.remote_client', level='DEBUG'))
def setUp(self): super(TestNotLockingAccount, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.temp_dir = tempfile.mkdtemp() cfg.CONF.set_default('lock_path', self.temp_dir) self.addCleanup(os.rmdir, self.temp_dir) self.test_accounts = [ { 'username': '******', 'tenant_name': 'test_tenant1', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant2', 'password': '******' }, { 'username': '******', 'tenant_name': 'test_tenant3', 'password': '******' }, ] self.useFixture( mockpatch.Patch('tempest.common.accounts.read_accounts_yaml', return_value=self.test_accounts)) cfg.CONF.set_default('test_accounts_file', '', group='auth') self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
def setUp(self): super(TestNotLockingAccount, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) 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': '******' }, ] self.useFixture( mockpatch.Patch('tempest.common.preprov_creds.read_accounts_yaml', return_value=self.test_accounts)) cfg.CONF.set_default('test_accounts_file', '', group='auth') self.useFixture(mockpatch.Patch('os.path.isfile', return_value=True))
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(TestNegativeRestClient, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) 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(TestDynamicCredentialProviderV3, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.useFixture(fixtures.MockPatchObject( domains_client.DomainsClient, 'list_domains', return_value=dict(domains=[dict(id='default', name='Default')]))) self.patchobject(self.roles_client.RolesClient, 'create_user_role_on_domain')
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(TestDynamicCredentialProvider, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) 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(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(TestTempestBaseTestClass, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) class ParentTest(test.BaseTestCase): def runTest(self): pass self.parent_test = ParentTest
def setUp(self): super(TestRemoteClient, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) cfg.CONF.set_default('ip_version_for_ssh', 4, group='compute') cfg.CONF.set_default('network_for_ssh', 'public', group='compute') cfg.CONF.set_default('ssh_channel_timeout', 1, group='compute') self.conn = remote_client.RemoteClient('127.0.0.1', 'user', 'pass') self.ssh_mock = self.useFixture( mockpatch.PatchObject(self.conn, 'ssh_client'))
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.stubs.Set(auth, 'get_credentials', fake_auth_provider.get_credentials) self.stubs.Set(auth, 'get_default_credentials', fake_auth_provider.get_default_credentials) self.auth_provider = self._auth(self.credentials)
def setUp(self): super(TestValidationResources, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.useFixture(registry_fixture.RegistryFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) class TestTestClass(test.BaseTestCase): pass self.test_test_class = TestTestClass
def setUp(self): super(TestPreProvisionedCredentials, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.patch(self.token_client, side_effect=self.identity_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = self._fake_accounts(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): super(BaseRestClientTestClass, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.rest_client = rest_client.RestClient( fake_auth_provider.FakeAuthProvider()) self.stubs.Set(httplib2.Http, 'request', self.fake_http.request) self.useFixture( mockpatch.PatchObject(self.rest_client, '_get_region', side_effect=self._get_region())) self.useFixture(mockpatch.PatchObject(self.rest_client, '_log_request'))
def setUp(self): super(TestDynamicCredentialProvider, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.useFixture(registry_fixture.RegistryFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.patchobject(self.token_client_class, 'raw_request', self.fake_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(BaseCmdServiceTests, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.useFixture( fixtures.MockPatch('tempest.cmd.cleanup_service._get_network_id', return_value='')) cleanup_service.init_conf() self.conf_values = { "flavors": cleanup_service.CONF_FLAVORS[0], "images": cleanup_service.CONF_IMAGES[0], "projects": cleanup_service.CONF_PROJECTS[0], "users": cleanup_service.CONF_USERS[0], }
def setUp(self): super(TestDebug, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) common_pre = 'tempest.common.commands' self.ip_addr_raw_mock = self.patch(common_pre + '.ip_addr_raw') self.ip_route_raw_mock = self.patch(common_pre + '.ip_route_raw') self.iptables_raw_mock = self.patch(common_pre + '.iptables_raw') self.ip_ns_list_mock = self.patch(common_pre + '.ip_ns_list') self.ip_ns_addr_mock = self.patch(common_pre + '.ip_ns_addr') self.ip_ns_route_mock = self.patch(common_pre + '.ip_ns_route') self.iptables_ns_mock = self.patch(common_pre + '.iptables_ns') self.ovs_db_dump_mock = self.patch(common_pre + '.ovs_db_dump') self.log_mock = self.patch('tempest.common.debug.LOG')
def setUp(self): super(TestPreProvisionedCredentials, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.patch(self.token_client, side_effect=self.identity_response) self.useFixture(lockutils_fixtures.ExternalLockFixture()) self.test_accounts = self._fake_accounts(cfg.CONF.identity.admin_role) self.accounts_mock = self.useFixture( fixtures.MockPatch( 'tempest.lib.common.preprov_creds.read_accounts_yaml', return_value=self.test_accounts)) self.useFixture(fixtures.MockPatch('os.path.isfile', return_value=True)) # NOTE(andreaf) Ensure config is loaded so service clients are # registered in the registry before tests config.service_client_config()
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(TestDiscovery, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate)
def setUp(self): super(TestRestClientErrorCheckerJSON, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.rest_client = rest_client.RestClient( fake_auth_provider.FakeAuthProvider())
def mock_config_and_opts(self, identity_version): self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.opts = FakeOpts(version=identity_version)
def setUp(self): super(ConfiguredV2CredentialsTests, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) self.stubs.Set(self.tokenclient_class, 'raw_request', self.identity_response)
def setUp(self): super(TestMicroversionsTestsClass, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)
def setUp(self): super(TestAccount, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate) 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.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): super(BaseDecoratorsTest, self).setUp() self.config_fixture = self.useFixture(fake_config.ConfigFixture()) self.patchobject(config, 'TempestConfigPrivate', fake_config.FakePrivate)
def setUp(self): super(TestTenantIsolation, self).setUp() self.useFixture(fake_config.ConfigFixture()) self.stubs.Set(config, 'TempestConfigPrivate', fake_config.FakePrivate)