def setUp(self):
     super(TenantTestCase, self).setUp()
     self.useFixture(database.Database())
     self.load_backends()
     self.load_fixtures(default_fixtures)
     self.tenant_controller = controllers.Tenant()
     self.role_controller = controllers.Role()
    def setUp(self):
        super(CompatTestCase, self).setUp()

        # FIXME(morganfainberg): Since we are running tests through the
        # controllers and some internal api drivers are SQL-only, the correct
        # approach is to ensure we have the correct backing store. The
        # credential api makes some very SQL specific assumptions that should
        # be addressed allowing for non-SQL based testing to occur.
        self.useFixture(database.Database())
        self.load_backends()

        self.load_fixtures(default_fixtures)

        # TODO(termie): add an admin user to the fixtures and use that user
        # override the fixtures, for now
        self.assignment_api.add_role_to_user_and_project(
            self.user_foo['id'], self.tenant_bar['id'], self.role_admin['id'])

        conf = self._paste_config('keystone')
        fixture = self.useFixture(appserver.AppServer(conf, appserver.MAIN))
        self.public_server = fixture.server
        fixture = self.useFixture(appserver.AppServer(conf, appserver.ADMIN))
        self.admin_server = fixture.server

        self.addCleanup(self.cleanup_instance('public_server', 'admin_server'))

        if isinstance(self.checkout_info, str):
            revdir = self.checkout_info
        else:
            revdir = tests.checkout_vendor(*self.checkout_info)
        self.add_path(revdir)
        self.clear_module('keystoneclient')
Exemple #3
0
    def setUp(self):
        # NOTE(dstanek): setup the database for subsystems that only have a
        # SQL backend (like credentials)
        self.useFixture(database.Database())

        super(KvsInheritanceTests, self).setUp()
        self.load_backends()
        self.load_fixtures(default_fixtures)
    def setUp(self):
        # NOTE(dstanek): setup the database for subsystems that do not have a
        # KVS backend (like credentials)
        self.useFixture(database.Database())

        super(KvsIdentity, self).setUp()
        self.load_backends()
        self.load_fixtures(default_fixtures)
    def setUp(self):
        super(SqlTests, self).setUp()
        self.useFixture(database.Database())
        self.load_backends()

        # populate the engine with tables & fixtures
        self.load_fixtures(default_fixtures)
        # defaulted by the data load
        self.user_foo['enabled'] = True
Exemple #6
0
    def setUp(self):
        super(TestCatalogAPISQL, self).setUp()
        self.useFixture(database.Database())
        self.catalog_api = catalog.Manager()

        self.service_id = uuid.uuid4().hex
        service = {'id': self.service_id, 'name': uuid.uuid4().hex}
        self.catalog_api.create_service(self.service_id, service)

        endpoint = self.new_endpoint_ref(service_id=self.service_id)
        self.catalog_api.create_endpoint(endpoint['id'], endpoint)
Exemple #7
0
    def setUp(self, app_conf='keystone'):
        super(RestfulTestCase, self).setUp()

        # Will need to reset the plug-ins
        self.addCleanup(setattr, auth_controllers, 'AUTH_METHODS', {})

        self.useFixture(database.Database(extensions=self.get_extensions()))
        self.load_backends()
        self.load_fixtures(default_fixtures)

        self.public_app = webtest.TestApp(
            self.loadapp(app_conf, name='main'))
        self.addCleanup(delattr, self, 'public_app')
        self.admin_app = webtest.TestApp(
            self.loadapp(app_conf, name='admin'))
        self.addCleanup(delattr, self, 'admin_app')
Exemple #8
0
    def setUp(self, app_conf='keystone'):
        """Setup for v3 Restful Test Cases.

        """
        new_paste_file = self.generate_paste_config()
        self.addCleanup(self.remove_generated_paste_config)
        if new_paste_file:
            app_conf = 'config:%s' % (new_paste_file)

        self.useFixture(database.Database(self.get_extensions()))

        super(RestfulTestCase, self).setUp(app_conf=app_conf)

        self.empty_context = {'environment': {}}

        # drop the policy rules
        self.addCleanup(rules.reset)
Exemple #9
0
    def setUp(self):
        self.useFixture(database.Database())
        super(AuthTest, self).setUp()

        self.load_backends()
        self.load_fixtures(default_fixtures)

        self.context_with_remote_user = {
            'environment': {
                'REMOTE_USER': '******',
                'AUTH_TYPE': 'Negotiate'
            }
        }
        self.empty_context = {'environment': {}}

        self.controller = token.controllers.Auth()
        # This call sets up, among other things, the call to popen
        # that will be used to run the CMS command.  These tests were
        # passing only due to the global nature of the call.  If the
        # tests in this file are run alone, API calls return unauthorized.
        environment.use_eventlet(monkeypatch_thread=False)
Exemple #10
0
 def setUp(self):
     super(KvsTrust, self).setUp()
     # Need to load the SQL database support for the fixtures
     self.useFixture(database.Database())
     self.load_backends()
     self.load_fixtures(default_fixtures)
 def setUp(self):
     super(TestTokenProviderOAuth1, self).setUp()
     self.useFixture(database.Database())
     self.load_backends()
Exemple #12
0
 def setUp(self):
     super(TestCatalogAPISQLRegions, self).setUp()
     self.useFixture(database.Database())
     self.catalog_api = catalog.Manager()
Exemple #13
0
 def setUp(self):
     super(TestTemplatedCatalog, self).setUp()
     self.useFixture(database.Database())
     self.load_backends()
     self.load_fixtures(default_fixtures)
 def test_token_flush(self):
     self.useFixture(database.Database())
     self.load_backends()
     cli.TokenFlush.main()