diff options
| author | Vu Tran <vu.tran@windriver.com> | 2014-04-09 16:45:51 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-04-11 14:15:28 -0400 |
| commit | c173214e9c25409944144c9b4bd9892949a834ba (patch) | |
| tree | 96067b1f4364eaf1dc4a374f706d2b2f34cb919d /meta-openstack/recipes-devtools/python/python-swift_git.bb | |
| parent | 8178afe2b2b27459c36e9c08c22117f1b6a39650 (diff) | |
| download | meta-cloud-services-c173214e9c25409944144c9b4bd9892949a834ba.tar.gz | |
swift: add tests
Introduce swift test package which contains
all Swift unit tests. Swift unit tests can
be run as:
$ cd /usr/lib64/python2.7/site-packages/swift
$ nosetests -v test
Signed-off-by: Vu Tran <vu.tran@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-swift_git.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-swift_git.bb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-swift_git.bb b/meta-openstack/recipes-devtools/python/python-swift_git.bb index d3419c5..6ab147d 100644 --- a/meta-openstack/recipes-devtools/python/python-swift_git.bb +++ b/meta-openstack/recipes-devtools/python/python-swift_git.bb | |||
| @@ -10,13 +10,14 @@ SRCNAME = "swift" | |||
| 10 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | 10 | SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ |
| 11 | file://proxy-server.conf \ | 11 | file://proxy-server.conf \ |
| 12 | file://dispersion.conf \ | 12 | file://dispersion.conf \ |
| 13 | file://test.conf \ | ||
| 13 | " | 14 | " |
| 14 | 15 | ||
| 15 | SRCREV="2f3526c559fe53ce904b735a81dee6de46127176" | 16 | SRCREV="2f3526c559fe53ce904b735a81dee6de46127176" |
| 16 | PV="2013.2.2+git${SRCPV}" | 17 | PV="2013.2.2+git${SRCPV}" |
| 17 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
| 18 | 19 | ||
| 19 | inherit setuptools hosts identity | 20 | inherit setuptools python-dir hosts identity |
| 20 | 21 | ||
| 21 | do_install_append() { | 22 | do_install_append() { |
| 22 | SWIFT_CONF_DIR=${D}${sysconfdir}/swift | 23 | SWIFT_CONF_DIR=${D}${sysconfdir}/swift |
| @@ -29,6 +30,7 @@ do_install_append() { | |||
| 29 | install -m 600 ${S}/etc/container-server.conf-sample ${SWIFT_CONF_DIR}/container-server.conf | 30 | install -m 600 ${S}/etc/container-server.conf-sample ${SWIFT_CONF_DIR}/container-server.conf |
| 30 | install -m 600 ${S}/etc/object-server.conf-sample ${SWIFT_CONF_DIR}/object-server.conf | 31 | install -m 600 ${S}/etc/object-server.conf-sample ${SWIFT_CONF_DIR}/object-server.conf |
| 31 | install -m 600 ${WORKDIR}/dispersion.conf ${SWIFT_CONF_DIR}/dispersion.conf | 32 | install -m 600 ${WORKDIR}/dispersion.conf ${SWIFT_CONF_DIR}/dispersion.conf |
| 33 | install -m 600 ${WORKDIR}/test.conf ${SWIFT_CONF_DIR}/test.conf | ||
| 32 | 34 | ||
| 33 | sed 's/^# bind_port =.*/bind_port = 6002/' -i ${SWIFT_CONF_DIR}/account-server.conf | 35 | sed 's/^# bind_port =.*/bind_port = 6002/' -i ${SWIFT_CONF_DIR}/account-server.conf |
| 34 | sed 's/^# user =.*/user = root/' -i ${SWIFT_CONF_DIR}/account-server.conf | 36 | sed 's/^# user =.*/user = root/' -i ${SWIFT_CONF_DIR}/account-server.conf |
| @@ -55,13 +57,28 @@ do_install_append() { | |||
| 55 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 57 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 56 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 58 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 57 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf | 59 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/dispersion.conf |
| 60 | |||
| 61 | sed "s/%ADMIN_TENANT_NAME%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 62 | sed "s/%ADMIN_USER%/admin/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 63 | sed "s/%ADMIN_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 64 | sed "s/%SERVICE_TENANT_NAME%/${SERVICE_TENANT_NAME}/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 65 | sed "s/%SERVICE_USER%/${SRCNAME}/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 66 | sed "s/%SERVICE_PASSWORD%/${SERVICE_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 67 | sed "s/%DEMO_USER%/demo/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 68 | sed "s/%DEMO_PASSWORD%/${ADMIN_PASSWORD}/g" -i ${SWIFT_CONF_DIR}/test.conf | ||
| 69 | |||
| 70 | cp -r test ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/ | ||
| 71 | grep -rl '^from test' ${D}/${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/test | xargs sed 's/^from test/from swift\.test/g' -i | ||
| 58 | } | 72 | } |
| 59 | 73 | ||
| 60 | PACKAGES += "${SRCNAME}" | 74 | PACKAGES += "${SRCNAME}-tests ${SRCNAME}" |
| 61 | 75 | ||
| 62 | FILES_${PN} = "${libdir}/*\ | 76 | FILES_${PN} = "${libdir}/*\ |
| 63 | " | 77 | " |
| 64 | 78 | ||
| 79 | FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/test.conf \ | ||
| 80 | " | ||
| 81 | |||
| 65 | FILES_${SRCNAME} = "${bindir}/* \ | 82 | FILES_${SRCNAME} = "${bindir}/* \ |
| 66 | ${sysconfdir}/${SRCNAME}/* \ | 83 | ${sysconfdir}/${SRCNAME}/* \ |
| 67 | " | 84 | " |
