summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
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 15:55:45 -0400
commiteb66359572b003e3babf58fca317363cd06a16c0 (patch)
tree4bb8715863542711b13f2db94a6f9d4a4cad8652 /meta-openstack/recipes-devtools/python
parent89e623cce5a8810197602ae4ab0993e33b7a3bf6 (diff)
downloadmeta-cloud-services-eb66359572b003e3babf58fca317363cd06a16c0.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')
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance/glance-change-builtin-tests-config-location.patch88
-rw-r--r--meta-openstack/recipes-devtools/python/python-glance_git.bb8
2 files changed, 96 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
diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb
index e9e8353..57ad34c 100644
--- a/meta-openstack/recipes-devtools/python/python-glance_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb
@@ -9,6 +9,7 @@ SRCNAME = "glance"
9 9
10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ 10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \
11 file://glance.init \ 11 file://glance.init \
12 file://glance-change-builtin-tests-config-location.patch \
12 " 13 "
13 14
14SRCREV="396ca82f7e359b430a6cb0a6162d7bc937367705" 15SRCREV="396ca82f7e359b430a6cb0a6162d7bc937367705"
@@ -20,6 +21,12 @@ inherit setuptools update-rc.d identity default_configs
20 21
21GLANCE_DEFAULT_STORE ?= "file" 22GLANCE_DEFAULT_STORE ?= "file"
22 23
24do_install_prepend() {
25 sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/functional/__init__.py
26 sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/unit/base.py
27 sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/utils.py
28}
29
23do_install_append() { 30do_install_append() {
24 TEMPLATE_CONF_DIR=${S}${sysconfdir} 31 TEMPLATE_CONF_DIR=${S}${sysconfdir}
25 GLANCE_CONF_DIR=${D}${sysconfdir}/glance 32 GLANCE_CONF_DIR=${D}${sysconfdir}/glance
@@ -142,6 +149,7 @@ RDEPENDS_${SRCNAME} = "${PN} \
142RDEPENDS_${SRCNAME}-api = "${SRCNAME}" 149RDEPENDS_${SRCNAME}-api = "${SRCNAME}"
143RDEPENDS_${SRCNAME}-registry = "${SRCNAME}" 150RDEPENDS_${SRCNAME}-registry = "${SRCNAME}"
144RDEPENDS_${SRCNAME}-setup = "postgresql sudo ${SRCNAME}" 151RDEPENDS_${SRCNAME}-setup = "postgresql sudo ${SRCNAME}"
152RDEPENDS_${SRCNAME}-tests = "python-psutil qpid-python"
145 153
146INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-registry" 154INITSCRIPT_PACKAGES = "${SRCNAME}-api ${SRCNAME}-registry"
147INITSCRIPT_NAME_${SRCNAME}-api = "glance-api" 155INITSCRIPT_NAME_${SRCNAME}-api = "glance-api"