From 9ea09886b02756ec6449837040921f9207b8d4ac Mon Sep 17 00:00:00 2001 From: Keith Holman Date: Fri, 13 Jun 2014 15:09:46 -0400 Subject: barbican: add full path to test configuration files Barbican expects configuration files for its tests to be in the same location as they appear in the source tree. However, during deployment configuration files are put into the /etc/barbican directory. This fix patches the tests to find the configuration files in the directory they are placed by the barbican recipe. Signed-off-by: Keith Holman Signed-off-by: Bruce Ashfield --- ...ican-fix-path-to-find-configuration-files.patch | 33 ++++++++++++++++++++++ .../recipes-devtools/python/python-barbican_git.bb | 4 +++ 2 files changed, 37 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-barbican/barbican-fix-path-to-find-configuration-files.patch (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-barbican/barbican-fix-path-to-find-configuration-files.patch b/meta-openstack/recipes-devtools/python/python-barbican/barbican-fix-path-to-find-configuration-files.patch new file mode 100644 index 0000000..8fd1010 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-barbican/barbican-fix-path-to-find-configuration-files.patch @@ -0,0 +1,33 @@ +From 30a57a0b4f2dcaff76821f21f4a545ecb9ddf194 Mon Sep 17 00:00:00 2001 +From: Keith Holman +Date: Fri, 13 Jun 2014 13:46:04 -0400 +Subject: [PATCH] barbican: fix path to find configuration files + +Barbican attempts to find configuration files for tests based on where +the files are located within the source tree. On deployment, +configuration files are installed to a directory specified by a build +recipe. This fix updates the location for the configuration files +with an identifier that is replaced during deployment. + +Signed-off-by: Keith Holman +--- + barbican/tests/api/test_resources_policy.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/barbican/tests/api/test_resources_policy.py b/barbican/tests/api/test_resources_policy.py +index 7d995c6..28b7599 100644 +--- a/barbican/tests/api/test_resources_policy.py ++++ b/barbican/tests/api/test_resources_policy.py +@@ -35,8 +35,7 @@ from barbican.openstack.common import policy + CONF = cfg.CONF + + # Point to the policy.json file located in source control. +-TEST_VAR_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), +- '../../../etc', 'barbican')) ++TEST_VAR_DIR = "%BARBICAN_CONF_DIR%" + + ENFORCER = policy.Enforcer() + +-- +1.9.3 + diff --git a/meta-openstack/recipes-devtools/python/python-barbican_git.bb b/meta-openstack/recipes-devtools/python/python-barbican_git.bb index 0b6a6a7..8e53efd 100644 --- a/meta-openstack/recipes-devtools/python/python-barbican_git.bb +++ b/meta-openstack/recipes-devtools/python/python-barbican_git.bb @@ -11,6 +11,7 @@ BARBICAN_MAX_PACKET_SIZE ?= "65535" SRC_URI = "git://github.com/openstack/barbican.git;branch=master \ file://barbican.init \ file://barbican-increase-buffer-size-to-support-PKI-tokens.patch \ + file://barbican-fix-path-to-find-configuration-files.patch \ " SRCREV="177d4499af6b261f48814503e3565f433e86cc66" @@ -42,6 +43,9 @@ do_install_append() { rm -f ${D}/usr/bin/barbican.sh rm -f ${D}/usr/bin/barbican-worker.py fi + + sed -e "s:%BARBICAN_CONF_DIR%:${sysconfdir}/${SRCNAME}:g" \ + -i ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/tests/api/test_resources_policy.py } USERADD_PACKAGES = "${PN}" -- cgit v1.2.3-54-g00ecf