keystone client changes in AuthProtocol made our test cases failing

class AuthProtocol from python-keystoneclient project has been
changed. It no longer has the member auth_protocol, auth_port and
auth_host, our test cases need to be changed to test against other
members like auth_uri.

Change-Id: I3af86bb773fef80054bb0ad3820e1b8510bf67cb
fixes: bug #1231491
This commit is contained in:
Tong Li 2013-09-26 16:51:07 -04:00
parent 9cc81d7365
commit 20dd735694
2 changed files with 8 additions and 4 deletions

View File

@ -37,8 +37,10 @@ class TestApp(base.TestCase):
cfg.CONF.set_override("auth_protocol", "foottp", cfg.CONF.set_override("auth_protocol", "foottp",
group=acl.OPT_GROUP_NAME) group=acl.OPT_GROUP_NAME)
cfg.CONF.set_override("auth_version", "v2.0", group=acl.OPT_GROUP_NAME) cfg.CONF.set_override("auth_version", "v2.0", group=acl.OPT_GROUP_NAME)
cfg.CONF.set_override("auth_uri", None,
group=acl.OPT_GROUP_NAME)
api_app = app.make_app(cfg.CONF, attach_storage=False) api_app = app.make_app(cfg.CONF, attach_storage=False)
self.assertEqual(api_app.wsgi_app.auth_protocol, 'foottp') self.assertTrue(api_app.wsgi_app.auth_uri.startswith('foottp'))
def test_keystone_middleware_parse_conffile(self): def test_keystone_middleware_parse_conffile(self):
tmpfile = self.temp_config_file_path() tmpfile = self.temp_config_file_path()
@ -48,5 +50,5 @@ class TestApp(base.TestCase):
service.prepare_service(['ceilometer-api', service.prepare_service(['ceilometer-api',
'--config-file=%s' % tmpfile]) '--config-file=%s' % tmpfile])
api_app = app.make_app(cfg.CONF, attach_storage=False) api_app = app.make_app(cfg.CONF, attach_storage=False)
self.assertEqual(api_app.wsgi_app.auth_protocol, 'barttp') self.assertTrue(api_app.wsgi_app.auth_uri.startswith('barttp'))
os.unlink(tmpfile) os.unlink(tmpfile)

View File

@ -45,8 +45,10 @@ class TestApp(base.TestCase):
cfg.CONF.set_override("pipeline_cfg_file", cfg.CONF.set_override("pipeline_cfg_file",
self.path_get("etc/ceilometer/pipeline.yaml")) self.path_get("etc/ceilometer/pipeline.yaml"))
cfg.CONF.set_override('connection', "log://", group="database") cfg.CONF.set_override('connection', "log://", group="database")
cfg.CONF.set_override("auth_uri", None, group=acl.OPT_GROUP_NAME)
api_app = app.setup_app() api_app = app.setup_app()
self.assertEqual(api_app.auth_protocol, 'foottp') self.assertTrue(api_app.auth_uri.startswith('foottp'))
def test_keystone_middleware_parse_conffile(self): def test_keystone_middleware_parse_conffile(self):
tmpfile = self.temp_config_file_path() tmpfile = self.temp_config_file_path()
@ -61,7 +63,7 @@ class TestApp(base.TestCase):
'--config-file=%s' % tmpfile]) '--config-file=%s' % tmpfile])
cfg.CONF.set_override('connection', "log://", group="database") cfg.CONF.set_override('connection', "log://", group="database")
api_app = app.setup_app() api_app = app.setup_app()
self.assertEqual(api_app.auth_protocol, 'barttp') self.assertTrue(api_app.auth_uri.startswith('barttp'))
os.unlink(tmpfile) os.unlink(tmpfile)