summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-glance
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-06-16 21:44:13 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-06-23 12:54:26 -0400
commit1f578a07a36ec3c0bd40548873d9c7c79822ddac (patch)
tree9676b0f9e20a2495668f48df240ddc6b0a66f8ff /meta-openstack/recipes-devtools/python/python-glance
parentbd0c221f230e26adeb693eb626b08757037a8c6a (diff)
downloadmeta-cloud-services-1f578a07a36ec3c0bd40548873d9c7c79822ddac.tar.gz
glance builtin tests config location and missing packages
Many glance built-in testcases failed because they can not find glance configuration files, as these testcases assume that they are run at python site-packages dir. So forcing these failure testcases to look for these confiugration file using absolute path. Also some tests fail because of missing two packages: python-psutil and qpid-python. So add these packages into glance-tests RDEPENDS Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-glance')
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance/glance-change-builtin-tests-config-location.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-glance/glance-change-builtin-tests-config-location.patch b/meta-openstack/recipes-devtools/python/python-glance/glance-change-builtin-tests-config-location.patch
new file mode 100644
index 0000000..4f82a53
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-glance/glance-change-builtin-tests-config-location.patch
@@ -0,0 +1,88 @@
1glance change builtin tests config location
2
3Many glance built-in testcases failed because they
4can not find glance configuration files, as these
5testcases assume that they are run at python
6site-packages dir.
7
8So forcing these failure testcases to look for
9these configuration files using absolute path.
10
11Signed-off-by: Vu Tran <vu.tran@windriver.com>
12
13diff --git a/glance/tests/functional/__init__.py b/glance/tests/functional/__init__.py
14index 1256133..01adb81 100644
15--- a/glance/tests/functional/__init__.py
16+++ b/glance/tests/functional/__init__.py
17@@ -900,7 +900,7 @@ class FunctionalTest(test_utils.BaseTestCase):
18 return engine.execute(sql)
19
20 def copy_data_file(self, file_name, dst_dir):
21- src_file_name = os.path.join('glance/tests/etc', file_name)
22+ src_file_name = os.path.join('%PYTHON_SITEPACKAGES_DIR%/glance/tests/etc', file_name)
23 shutil.copy(src_file_name, dst_dir)
24 dst_file_name = os.path.join(dst_dir, file_name)
25 return dst_file_name
26diff --git a/glance/tests/unit/api/test_common.py b/glance/tests/unit/api/test_common.py
27index 8892025..2aac6b7 100644
28--- a/glance/tests/unit/api/test_common.py
29+++ b/glance/tests/unit/api/test_common.py
30@@ -137,7 +137,7 @@ class TestMalformedRequest(test_utils.BaseTestCase):
31 super(TestMalformedRequest, self).setUp()
32 self.config(flavor='',
33 group='paste_deploy',
34- config_file='etc/glance-api-paste.ini')
35+ config_file='/etc/glance/glance-api-paste.ini')
36 self.api = config.load_paste_app('glance-api')
37
38 def test_redirect_incomplete_url(self):
39diff --git a/glance/tests/unit/base.py b/glance/tests/unit/base.py
40index 4a19730..16ec103 100644
41--- a/glance/tests/unit/base.py
42+++ b/glance/tests/unit/base.py
43@@ -76,7 +76,7 @@ class IsolatedUnitTest(StoreClearingUnitTest):
44 registry=self.registry)
45
46 def _copy_data_file(self, file_name, dst_dir):
47- src_file_name = os.path.join('glance/tests/etc', file_name)
48+ src_file_name = os.path.join('%PYTHON_SITEPACKAGES_DIR%/glance/tests/etc', file_name)
49 shutil.copy(src_file_name, dst_dir)
50 dst_file_name = os.path.join(dst_dir, file_name)
51 return dst_file_name
52diff --git a/glance/tests/unit/common/test_config.py b/glance/tests/unit/common/test_config.py
53index 2dfede1..422a458 100644
54--- a/glance/tests/unit/common/test_config.py
55+++ b/glance/tests/unit/common/test_config.py
56@@ -64,8 +64,7 @@ class TestPasteApp(test_utils.BaseTestCase):
57
58 paste_to = temp_file.replace('.conf', '-paste.ini')
59 if not paste_config_file and make_paste_file:
60- paste_from = os.path.join(os.getcwd(),
61- 'etc/glance-registry-paste.ini')
62+ paste_from = '/etc/glance/glance-registry-paste.ini'
63 _appendto(paste_from, paste_to, paste_append)
64
65 app = config.load_paste_app('glance-registry')
66@@ -90,8 +89,7 @@ class TestPasteApp(test_utils.BaseTestCase):
67 paste_append=pipeline)
68
69 def test_load_paste_app_with_paste_config_file(self):
70- paste_config_file = os.path.join(os.getcwd(),
71- 'etc/glance-registry-paste.ini')
72+ paste_config_file = '/etc/glance/glance-registry-paste.ini'
73 expected_middleware = context.UnauthenticatedContextMiddleware
74 self._do_test_load_paste_app(expected_middleware,
75 paste_config_file=paste_config_file)
76diff --git a/glance/tests/utils.py b/glance/tests/utils.py
77index 760824c..db598ba 100644
78--- a/glance/tests/utils.py
79+++ b/glance/tests/utils.py
80@@ -67,7 +67,7 @@ class BaseTestCase(testtools.TestCase):
81 self.config(property_protection_file=self.property_file)
82
83 def _copy_data_file(self, file_name, dst_dir):
84- src_file_name = os.path.join('glance/tests/etc', file_name)
85+ src_file_name = os.path.join('%PYTHON_SITEPACKAGES_DIR%/glance/tests/etc', file_name)
86 shutil.copy(src_file_name, dst_dir)
87 dst_file_name = os.path.join(dst_dir, file_name)
88 return dst_file_name