From 0e5297c9a87c43fe6011c240fbbe754b053da138 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Wed, 11 Dec 2013 02:24:24 -0500 Subject: tempest: create per-component test packages and flakes8 To add more complete tempest support, we require flakes8, so it is added to the dependency list. To get the individual component test scripts onto the target, create a $PACKAGE-tests package and add the script. When the tests are required on target, these packages should be added to the install list. Signed-off-by: Bruce Ashfield --- meta-openstack/recipes-devtools/python/python-cinder_git.bb | 6 +++++- meta-openstack/recipes-devtools/python/python-glance_git.bb | 6 +++++- meta-openstack/recipes-devtools/python/python-heat_git.bb | 6 +++++- meta-openstack/recipes-devtools/python/python-horizon_git.bb | 10 +++++++++- .../recipes-devtools/python/python-keystone_git.bb | 12 ++++++++++-- meta-openstack/recipes-devtools/python/python-neutron_git.bb | 5 +++++ 6 files changed, 39 insertions(+), 6 deletions(-) (limited to 'meta-openstack/recipes-devtools') diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index 28ae314..50eacaa 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb @@ -47,6 +47,8 @@ do_install_append() { install -m 0755 ${WORKDIR}/cinder-scheduler.init.sh ${D}${sysconfdir}/init.d/cinder-scheduler install -m 0755 ${WORKDIR}/cinder-volume ${D}${sysconfdir}/init.d/cinder-volume fi + + cp run_tests.sh ${CINDER_CONF_DIR} } pkg_postinst_${SRCNAME}-setup () { @@ -68,11 +70,13 @@ pkg_postinst_${SRCNAME}-setup () { echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf } -PACKAGES += "${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" +PACKAGES += "${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-volume ${SRCNAME}-scheduler" ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME}-api = "${bindir}/cinder-api \ ${sysconfdir}/init.d/cinder-api" diff --git a/meta-openstack/recipes-devtools/python/python-glance_git.bb b/meta-openstack/recipes-devtools/python/python-glance_git.bb index 935fdc9..f59af90 100644 --- a/meta-openstack/recipes-devtools/python/python-glance_git.bb +++ b/meta-openstack/recipes-devtools/python/python-glance_git.bb @@ -56,6 +56,8 @@ do_install_append() { sed 's:@suffix@:registry:' < ${WORKDIR}/glance.init >${WORKDIR}/glance-registry.init.sh install -m 0755 ${WORKDIR}/glance-registry.init.sh ${D}${sysconfdir}/init.d/glance-registry fi + + cp run_tests.sh ${GLANCE_CONF_DIR} } pkg_postinst_${SRCNAME}-setup () { @@ -75,11 +77,13 @@ pkg_postinst_${SRCNAME}-setup () { glance-manage db_sync } -PACKAGES += " ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-registry" +PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup ${SRCNAME}-api ${SRCNAME}-registry" ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME} = "${bindir}/* \ ${sysconfdir}/${SRCNAME}/* \ ${localstatedir}/* \ diff --git a/meta-openstack/recipes-devtools/python/python-heat_git.bb b/meta-openstack/recipes-devtools/python/python-heat_git.bb index 5cfd8bd..d4314f4 100644 --- a/meta-openstack/recipes-devtools/python/python-heat_git.bb +++ b/meta-openstack/recipes-devtools/python/python-heat_git.bb @@ -59,6 +59,8 @@ do_install_append() { sed 's:@suffix@:engine:' < ${WORKDIR}/heat.init >${WORKDIR}/heat-engine.init.sh install -m 0755 ${WORKDIR}/heat-engine.init.sh ${D}${sysconfdir}/init.d/heat-engine fi + + cp run_tests.sh ${HEAT_CONF_DIR} } pkg_postinst_${SRCNAME}-setup () { @@ -80,13 +82,15 @@ pkg_postinst_${SRCNAME}-setup () { inherit setuptools identity hosts update-rc.d -PACKAGES += "${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" +PACKAGES += "${SRCNAME}-tests ${SRCNAME}-common ${SRCNAME}-api ${SRCNAME}-api-cfn ${SRCNAME}-engine" PACKAGES += "${SRCNAME}-setup" ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME}-common = "${sysconfdir}/${SRCNAME}/* \ " diff --git a/meta-openstack/recipes-devtools/python/python-horizon_git.bb b/meta-openstack/recipes-devtools/python/python-horizon_git.bb index 789192c..281264c 100644 --- a/meta-openstack/recipes-devtools/python/python-horizon_git.bb +++ b/meta-openstack/recipes-devtools/python/python-horizon_git.bb @@ -39,6 +39,10 @@ inherit setuptools update-rc.d python-dir # do_install[dirs] += "${D}/usr/share/bin" do_install_append() { + HORIZON_CONF_DIR=${D}${sysconfdir}/horizon + + install -d ${HORIZON_CONF_DIR} + DASHBOARD_DIR=${D}${PYTHON_SITEPACKAGES_DIR}/openstack_dashboard sed -e "s:^LANGUAGE_CODE =.*:LANGUAGE_CODE = 'en-us':g" \ -i ${DASHBOARD_DIR}/settings.py @@ -56,12 +60,16 @@ do_install_append() { # no longer required. kept as reference. # mv ${D}${datadir}/bin ${DASHBOARD_DIR}/bin + + cp run_tests.sh ${HORIZON_CONF_DIR} } -PACKAGES += "${SRCNAME}" +PACKAGES += "${SRCNAME}-tests ${SRCNAME}" FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME} = "${bindir}/* \ ${sysconfdir}/init.d/* \ ${datadir}/* \ diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb index dbc76d8..c2a9b04 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_git.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb @@ -48,6 +48,8 @@ do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/keystone ${D}${sysconfdir}/init.d/keystone fi + + cp run_tests.sh ${KEYSTONE_CONF_DIR} } pkg_postinst_${SRCNAME}-setup () { @@ -79,19 +81,22 @@ pkg_postinst_${SRCNAME}-setup () { # end python-keystone postinst } -PACKAGES += " ${SRCNAME} ${SRCNAME}-setup" +PACKAGES += " ${SRCNAME}-tests ${SRCNAME} ${SRCNAME}-setup" ALLOW_EMPTY_${SRCNAME}-setup = "1" FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME} = "${bindir}/* \ ${sysconfdir}/${SRCNAME}/* \ ${sysconfdir}/init.d/* \ ${localstatedir}/* \ " -RDEPENDS_${PN} += "python-pam \ +RDEPENDS_${PN} += " \ + python-pam \ python-webob \ python-eventlet \ python-greenlet \ @@ -109,6 +114,9 @@ RDEPENDS_${PN} += "python-pam \ python-dogpile.cache \ " +# TODO: +# if DISTRO_FEATURE contains "tempest" then add *-tests to the main RDEPENDS + RDEPENDS_${SRCNAME} = "${PN} postgresql postgresql-client python-psycopg2" INITSCRIPT_PACKAGES = "${SRCNAME}" diff --git a/meta-openstack/recipes-devtools/python/python-neutron_git.bb b/meta-openstack/recipes-devtools/python/python-neutron_git.bb index f33db97..18655b0 100644 --- a/meta-openstack/recipes-devtools/python/python-neutron_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutron_git.bb @@ -63,6 +63,8 @@ do_install_append() { sed "s:@suffix@:$PLUGIN:" < ${WORKDIR}/neutron-agent.init >${WORKDIR}/neutron-$PLUGIN.init.sh install -m 0755 ${WORKDIR}/neutron-$PLUGIN.init.sh ${D}${sysconfdir}/init.d/neutron-$PLUGIN-agent fi + + cp run_tests.sh ${NEUTRON_CONF_DIR} } pkg_postinst_${SRCNAME}-setup () { @@ -93,6 +95,7 @@ ALLOW_EMPTY_${SRCNAME}-setup = "1" ALLOW_EMPTY_${SRCNAME}-plugin-openvswitch-setup = "1" PACKAGES += " \ + ${SRCNAME}-tests \ ${SRCNAME} \ ${SRCNAME}-doc \ ${SRCNAME}-server \ @@ -108,6 +111,8 @@ PACKAGES += " \ FILES_${PN} = "${libdir}/*" +FILES_${SRCNAME}-tests = "${sysconfdir}/${SRCNAME}/run_tests.sh" + FILES_${SRCNAME} = " \ ${bindir}/neutron-db-manage \ ${bindir}/neutron-rootwrap \ -- cgit v1.2.3-54-g00ecf