summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder-builtin-tests-config-location.patch36
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder_git.bb6
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder-builtin-tests-config-location.patch b/meta-openstack/recipes-devtools/python/python-cinder/cinder-builtin-tests-config-location.patch
new file mode 100644
index 0000000..c6bdfa7
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder-builtin-tests-config-location.patch
@@ -0,0 +1,36 @@
1cinder builtin tests config location
2
3Many cinder built-in testcases failed because they
4can not find cinder configuration file, as these
5testcases assume that they are run at python
6site-packages dir. So forcing these failure
7testcases to look for these confiugration file
8using absolute path.
9
10Signed-off-by: Vu Tran <vu.tran@windriver.com>
11
12diff --git a/cinder/tests/conf_fixture.py b/cinder/tests/conf_fixture.py
13index dbf8d08..ac925eb 100644
14--- a/cinder/tests/conf_fixture.py
15+++ b/cinder/tests/conf_fixture.py
16@@ -43,7 +43,7 @@ def set_defaults(conf):
17 conf.set_default('verbose', True)
18 conf.set_default('connection', 'sqlite://', group='database')
19 conf.set_default('sqlite_synchronous', False)
20- conf.set_default('policy_file', 'cinder/tests/policy.json')
21+ conf.set_default('policy_file', '%PYTHON_SITEPACKAGES_DIR%/cinder/tests/policy.json')
22 conf.set_default(
23 'xiv_ds8k_proxy',
24 'cinder.tests.test_xiv_ds8k.XIVDS8KFakeProxyDriver')
25diff --git a/cinder/tests/fake_flags.py b/cinder/tests/fake_flags.py
26index 3bf94ae..998524c 100644
27--- a/cinder/tests/fake_flags.py
28+++ b/cinder/tests/fake_flags.py
29@@ -43,6 +43,6 @@ def set_defaults(conf):
30 conf.set_default('verbose', True)
31 conf.set_default('connection', 'sqlite://', group='database')
32 conf.set_default('sqlite_synchronous', False)
33- conf.set_default('policy_file', 'cinder/tests/policy.json')
34+ conf.set_default('policy_file', '%PYTHON_SITEPACKAGES_DIR%/cinder/tests/policy.json')
35 conf.set_default('xiv_proxy', 'cinder.tests.test_xiv.XIVFakeProxyDriver')
36 conf.set_default('backup_driver', 'cinder.tests.backup.fake_service')
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
index b723257..7b3bb28 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb
+++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb
@@ -17,6 +17,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \
17 file://lvm_iscsi_setup.sh \ 17 file://lvm_iscsi_setup.sh \
18 file://add-cinder-volume-types.sh \ 18 file://add-cinder-volume-types.sh \
19 file://fix_cinder_memory_leak.patch \ 19 file://fix_cinder_memory_leak.patch \
20 file://cinder-builtin-tests-config-location.patch \
20 " 21 "
21 22
22SRCREV="81259f36f57e91b31009fbd209ea2a07a2ceb213" 23SRCREV="81259f36f57e91b31009fbd209ea2a07a2ceb213"
@@ -27,6 +28,11 @@ inherit setuptools update-rc.d identity default_configs
27 28
28CINDER_BACKUP_BACKEND_DRIVER ?= "cinder.backup.drivers.swift" 29CINDER_BACKUP_BACKEND_DRIVER ?= "cinder.backup.drivers.swift"
29 30
31do_install_prepend() {
32 sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/conf_fixture.py
33 sed 's:%PYTHON_SITEPACKAGES_DIR%:${PYTHON_SITEPACKAGES_DIR}:g' -i ${S}/${SRCNAME}/tests/fake_flags.py
34}
35
30do_install_append() { 36do_install_append() {
31 TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME} 37 TEMPLATE_CONF_DIR=${S}${sysconfdir}/${SRCNAME}
32 CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME} 38 CINDER_CONF_DIR=${D}${sysconfdir}/${SRCNAME}