From 6847948b8fe689af980c92469588c6dc7727d26e Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Wed, 18 Jun 2014 15:49:10 -0400 Subject: ceilometer builtin tests Use known protocol scheme Commit e5b7606eaa94033256eb1aca5f6a6eed4f9e54a0 from https://github.com/openstack/ceilometer.git master With the recent introduction of the identity_uri in keystoneclient, there is a small backward incompatible change which means that weird protocols like the ones we use during tests aren't support properly anymore. The patch replaces "foottp" and "barttp" by "file" hopefully keeping testing coverage the same. Signed-off-by: Vu Tran --- ...e-known-protocol-scheme-in-keystone-tests.patch | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-ceilometer/Use-known-protocol-scheme-in-keystone-tests.patch (limited to 'meta-openstack/recipes-devtools/python/python-ceilometer') diff --git a/meta-openstack/recipes-devtools/python/python-ceilometer/Use-known-protocol-scheme-in-keystone-tests.patch b/meta-openstack/recipes-devtools/python/python-ceilometer/Use-known-protocol-scheme-in-keystone-tests.patch new file mode 100644 index 0000000..7756dca --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-ceilometer/Use-known-protocol-scheme-in-keystone-tests.patch @@ -0,0 +1,85 @@ +Use known protocol scheme in keystone tests + +Commit e5b7606eaa94033256eb1aca5f6a6eed4f9e54a0 from +https://github.com/openstack/ceilometer.git master + +With the recent introduction of the identity_uri in keystoneclient, +there is a small backward incompatible change which means that weird +protocols like the ones we use during tests aren't support properly +anymore. The patch replaces "foottp" and "barttp" by "file" hopefully +keeping testing coverage the same. + +Change-Id: Idb30ff3ee0ca50911e453899ad32e630f9b18724 +Closes-Bug: #1309092 + +diff --git a/ceilometer/tests/api/v1/test_app.py b/ceilometer/tests/api/v1/test_app.py +index fed5b8b..b25b7ef 100644 +--- a/ceilometer/tests/api/v1/test_app.py ++++ b/ceilometer/tests/api/v1/test_app.py +@@ -34,17 +34,17 @@ class TestApp(test.BaseTestCase): + self.CONF = self.useFixture(config.Config()).conf + + def test_keystone_middleware_conf(self): +- self.CONF.set_override("auth_protocol", "foottp", ++ self.CONF.set_override("auth_protocol", "file", + group=acl.OPT_GROUP_NAME) + self.CONF.set_override("auth_version", "v2.0", + group=acl.OPT_GROUP_NAME) + self.CONF.set_override("auth_uri", None, + group=acl.OPT_GROUP_NAME) + api_app = app.make_app(self.CONF, attach_storage=False) +- self.assertTrue(api_app.wsgi_app.auth_uri.startswith('foottp')) ++ self.assertTrue(api_app.wsgi_app.auth_uri.startswith('file')) + + def test_keystone_middleware_parse_conffile(self): +- content = "[{0}]\nauth_protocol = barttp"\ ++ content = "[{0}]\nauth_protocol = file"\ + "\nauth_version = v2.0".format(acl.OPT_GROUP_NAME) + tmpfile = fileutils.write_to_tempfile(content=content, + prefix='ceilometer', +@@ -52,5 +52,5 @@ class TestApp(test.BaseTestCase): + service.prepare_service(['ceilometer-api', + '--config-file=%s' % tmpfile]) + api_app = app.make_app(self.CONF, attach_storage=False) +- self.assertTrue(api_app.wsgi_app.auth_uri.startswith('barttp')) ++ self.assertTrue(api_app.wsgi_app.auth_uri.startswith('file')) + os.unlink(tmpfile) +diff --git a/ceilometer/tests/api/v2/test_app.py b/ceilometer/tests/api/v2/test_app.py +index 0b3ebcf..4e624bd 100644 +--- a/ceilometer/tests/api/v2/test_app.py ++++ b/ceilometer/tests/api/v2/test_app.py +@@ -42,7 +42,7 @@ class TestApp(base.BaseTestCase): + self.CONF = self.useFixture(config.Config()).conf + + def test_keystone_middleware_conf(self): +- self.CONF.set_override("auth_protocol", "foottp", ++ self.CONF.set_override("auth_protocol", "file", + group=acl.OPT_GROUP_NAME) + self.CONF.set_override("auth_version", "v2.0", + group=acl.OPT_GROUP_NAME) +@@ -52,14 +52,14 @@ class TestApp(base.BaseTestCase): + self.CONF.set_override("auth_uri", None, group=acl.OPT_GROUP_NAME) + + api_app = app.setup_app() +- self.assertTrue(api_app.auth_uri.startswith('foottp')) ++ self.assertTrue(api_app.auth_uri.startswith('file')) + + def test_keystone_middleware_parse_conffile(self): + pipeline_conf = self.path_get("/etc/ceilometer/pipeline.yaml") + content = "[DEFAULT]\n"\ + "pipeline_cfg_file = {0}\n"\ + "[{1}]\n"\ +- "auth_protocol = barttp\n"\ ++ "auth_protocol = file\n"\ + "auth_version = v2.0\n".format(pipeline_conf, + acl.OPT_GROUP_NAME) + +@@ -70,7 +70,7 @@ class TestApp(base.BaseTestCase): + '--config-file=%s' % tmpfile]) + self.CONF.set_override('connection', "log://", group="database") + api_app = app.setup_app() +- self.assertTrue(api_app.auth_uri.startswith('barttp')) ++ self.assertTrue(api_app.auth_uri.startswith('file')) + os.unlink(tmpfile) + + -- cgit v1.2.3-54-g00ecf