예제 #1
0
    def test_keystone_manage_calls(self):
        """
        Test that we can call keystone-manage and all sampledata calls work
        """
        cmd = [
            os.path.join(possible_topdir, 'bin', 'keystone-manage'), '-c',
            client_tests.TEST_CONFIG_FILE_NAME, '--log-file',
            os.path.join(possible_topdir, 'bin',
                         'keystone.log'), 'service', 'list'
        ]
        # This will init backends
        manage.parse_args(cmd[1:])

        # Loop through and try sampledata calls
        sampledata_calls = sampledata.DEFAULT_FIXTURE
        for call in sampledata_calls:
            manage.process(*call)
    def test_keystone_manage_calls(self):
        """
        Test that we can call keystone-manage and all sampledata calls work
        """
        cmd = [
            os.path.join(possible_topdir, 'bin', 'keystone-manage'),
            '-c', client_tests.TEST_CONFIG_FILE_NAME,
            '--log-file', os.path.join(possible_topdir, 'bin', 'keystone.log'),
            'service', 'list'
        ]
        # This will init backends
        manage.parse_args(cmd[1:])

        # Loop through and try sampledata calls
        sampledata_calls = sampledata.DEFAULT_FIXTURE
        for call in sampledata_calls:
            manage.process(*call)
예제 #3
0
    def test_keystone_manage_calls(self):
        """
        Test that we can call keystone-manage and all sampledata calls work
        """
        cmd = [
            os.path.join(possible_topdir, 'bin', 'keystone-manage'),
            '-c', client_tests.TEST_CONFIG_FILE_NAME,
            '--log-file', os.path.join(possible_topdir, 'bin', 'keystone.log'),
            'service', 'list'
        ]
        # This will init backends
        manage.parse_args(cmd[1:])

        # Loop through and try sampledata calls
        sampledata_calls = sampledata.DEFAULT_FIXTURE
        for call in sampledata_calls:
            try:
                manage.process(*call)
            except Exception as exc:
                self.assertFalse(True, "Call to '%s' failed: %s %s" %
                                 (' '.join(call), sys.stderr, exc))
예제 #4
0
    def test_keystone_manage_calls(self):
        """
        Test that we can call keystone-manage and all sampledata calls work
        """
        cmd = [
            os.path.join(possible_topdir, 'bin', 'keystone-manage'), '-c',
            client_tests.TEST_CONFIG_FILE_NAME, '--log-file',
            os.path.join(possible_topdir, 'bin',
                         'keystone.log'), 'service', 'list'
        ]
        # This will init backends
        manage.parse_args(cmd[1:])

        # Loop through and try sampledata calls
        sampledata_calls = sampledata.DEFAULT_FIXTURE
        for call in sampledata_calls:
            try:
                manage.process(*call)
            except Exception as exc:
                self.assertFalse(
                    True, "Call to '%s' failed: %s %s" %
                    (' '.join(call), sys.stderr, exc))
예제 #5
0
            # the server is
            client_tests.TEST_TARGET_SERVER_ADMIN_PROTOCOL = admin.protocol
            client_tests.TEST_TARGET_SERVER_ADMIN_ADDRESS = admin.host
            client_tests.TEST_TARGET_SERVER_ADMIN_PORT = admin.port

        except RuntimeError, e:
            logger.exception(e)
            raise e

        self.server = service
        self.admin_server = admin

        # Load bootstrap data
        from keystone import manage
        manage_args = ['--config-file', self.conf_fp.name]
        manage.parse_args(args=manage_args)

        #TODO(zns): this should end up being run by a 'bootstrap' script
        fixtures = [
            ('role', 'add', CONF.keystone_admin_role),
            ('user', 'add', 'admin', 'secrete'),
            ('role', 'grant', CONF.keystone_admin_role, 'admin'),
            ('role', 'add', CONF.keystone_service_admin_role),
            ('role', 'add', 'Member'),
        ]
        for cmd in fixtures:
            manage.process(*cmd)

    def tearDown(self):
        try:
            if self.server is not None:
예제 #6
0
            # the server is
            client_tests.TEST_TARGET_SERVER_ADMIN_PROTOCOL = admin.protocol
            client_tests.TEST_TARGET_SERVER_ADMIN_ADDRESS = admin.host
            client_tests.TEST_TARGET_SERVER_ADMIN_PORT = admin.port

        except RuntimeError, e:
            logger.exception(e)
            raise e

        self.server = service
        self.admin_server = admin

        # Load bootstrap data
        from keystone import manage
        manage_args = ['--config-file', self.conf_fp.name]
        manage.parse_args(args=manage_args)

        #TODO(zns): this should end up being run by a 'bootstrap' script
        fixtures = [
            ('role', 'add', CONF.keystone_admin_role),
            ('user', 'add', 'admin', 'secrete'),
            ('role', 'grant', CONF.keystone_admin_role, 'admin'),
            ('role', 'add', CONF.keystone_service_admin_role),
            ('role', 'add', 'Member'),
            ]
        for cmd in fixtures:
            manage.process(*cmd)

    def tearDown(self):
        try:
            if self.server is not None: