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: try: manage.process(*call) except Exception as exc: self.assertFalse(True, "Call to '%s' failed: %s %s" % (' '.join(call), sys.stderr, exc))
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))
# 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: print "Stopping the Service API..." self.server.stop() self.server = None if self.admin_server is not None: print "Stopping the Admin API..." self.admin_server.stop() self.admin_server = None if self.conf_fp: self.conf_fp.close() self.conf_fp = None except Exception as e: