From 20dd735694f1f913fec83f2ae679aedc57379716 Mon Sep 17 00:00:00 2001 From: Tong Li Date: Thu, 26 Sep 2013 16:51:07 -0400 Subject: [PATCH] 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 --- tests/api/v1/test_app.py | 6 ++++-- tests/api/v2/test_app.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/api/v1/test_app.py b/tests/api/v1/test_app.py index 69c908a76..89368bc83 100644 --- a/tests/api/v1/test_app.py +++ b/tests/api/v1/test_app.py @@ -37,8 +37,10 @@ class TestApp(base.TestCase): cfg.CONF.set_override("auth_protocol", "foottp", 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) - 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): tmpfile = self.temp_config_file_path() @@ -48,5 +50,5 @@ class TestApp(base.TestCase): service.prepare_service(['ceilometer-api', '--config-file=%s' % tmpfile]) 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) diff --git a/tests/api/v2/test_app.py b/tests/api/v2/test_app.py index 8033891e2..ece2b3853 100644 --- a/tests/api/v2/test_app.py +++ b/tests/api/v2/test_app.py @@ -45,8 +45,10 @@ class TestApp(base.TestCase): cfg.CONF.set_override("pipeline_cfg_file", self.path_get("etc/ceilometer/pipeline.yaml")) 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() - self.assertEqual(api_app.auth_protocol, 'foottp') + self.assertTrue(api_app.auth_uri.startswith('foottp')) def test_keystone_middleware_parse_conffile(self): tmpfile = self.temp_config_file_path() @@ -61,7 +63,7 @@ class TestApp(base.TestCase): '--config-file=%s' % tmpfile]) cfg.CONF.set_override('connection', "log://", group="database") api_app = app.setup_app() - self.assertEqual(api_app.auth_protocol, 'barttp') + self.assertTrue(api_app.auth_uri.startswith('barttp')) os.unlink(tmpfile)