From f003d0065f377cad282ddc0f1c4912f329c63b46 Mon Sep 17 00:00:00 2001 From: Crag Wolfe Date: Tue, 14 Apr 2015 00:53:58 -0400 Subject: [PATCH] Add instack-tempest-test-overcloud ...and run it optionally from instack-deploy-overcloud. Co-Authored-By: Imre Farkas Change-Id: I5975345d6aa3f3e9fc92f62cd1cc908f2d21679b --- .../basic_deployment/basic_deployment.rst | 14 +++++++++ .../puppet-stack-config.pp | 2 ++ scripts/instack-deploy-overcloud | 10 +++++- scripts/instack-tempest-test-overcloud | 31 +++++++++++++++++++ setup.cfg | 1 + 5 files changed, 57 insertions(+), 1 deletion(-) create mode 100755 scripts/instack-tempest-test-overcloud diff --git a/doc/source/basic_deployment/basic_deployment.rst b/doc/source/basic_deployment/basic_deployment.rst index 1f88f627a..248161e35 100644 --- a/doc/source/basic_deployment/basic_deployment.rst +++ b/doc/source/basic_deployment/basic_deployment.rst @@ -225,6 +225,20 @@ Deploy the overcloud (default of 1 compute and 1 control): instack-deploy-overcloud --tuskar +.. admonition:: Deployment with post-install validation + :class: tempest + + To deploy the overcloud **and** verify it by running Tempest:: + + instack-deploy-overcloud --tuskar --tempest + + .. note:: The full Tempest test suite might take hours to run on a single CPU. + + To run only a part of the Tempest test suite (eg. tests with ``gate`` tag):: + + export TEMPEST_ARGS="gate" + instack-deploy-overcloud --tuskar --tempest + Post-Deployment --------------- diff --git a/elements/puppet-stack-config/puppet-stack-config.pp b/elements/puppet-stack-config/puppet-stack-config.pp index 06b7c386f..bd6faaba9 100644 --- a/elements/puppet-stack-config/puppet-stack-config.pp +++ b/elements/puppet-stack-config/puppet-stack-config.pp @@ -360,3 +360,5 @@ class { 'tuskar::ui': # tempest # TODO: when puppet-tempest supports install by package, do that instead package{'openstack-tempest': } +# needed for /bin/subunit-2to1 (called by run_tempest.sh) +package{'subunit-filters': } diff --git a/scripts/instack-deploy-overcloud b/scripts/instack-deploy-overcloud index 1eae49b95..de1ab0ef3 100755 --- a/scripts/instack-deploy-overcloud +++ b/scripts/instack-deploy-overcloud @@ -12,6 +12,7 @@ if [ -z "$OS_AUTH_URL" ]; then fi TUSKAR= +TEMPEST= # Default stack create timeout, in minutes # Note heat defaults to 60mins, which may not be enough when @@ -27,11 +28,12 @@ function show_options () { echo "Options:" echo " --tuskar -- will use tuskar for building the heat Template" echo " --timeout -- create timeout in minutes, default $TIMEOUT" + echo " --tempest -- run tempest tests after deployment" echo exit $1 } -TEMP=$(getopt -o ,h -l,tuskar,timeout:,help -n $SCRIPT_NAME -- "$@") +TEMP=$(getopt -o ,h -l,tuskar,timeout:,tempest,help -n $SCRIPT_NAME -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi # Note the quotes around `$TEMP': they are essential! @@ -41,6 +43,7 @@ while true ; do case "$1" in --tuskar) TUSKAR="1"; shift 1;; --timeout) TIMEOUT="$2"; shift 2;; + --tempest) TEMPEST="1"; shift 1;; -h | --help) show_options 0;; --) shift ; break ;; *) echo "Error: unsupported option $1." ; exit 1 ;; @@ -517,3 +520,8 @@ rm $NETWORK_JSON nova flavor-create m1.demo auto 512 10 1 echo "Overcloud Deployed" + +if [ -n "$TEMPEST" ]; then + TEMPEST_ARGS=${TEMPEST_ARGS:-} $(dirname $0)/instack-tempest-test-overcloud + $(dirname $0)/instack-test-overcloud +fi diff --git a/scripts/instack-tempest-test-overcloud b/scripts/instack-tempest-test-overcloud new file mode 100755 index 000000000..ef35bff51 --- /dev/null +++ b/scripts/instack-tempest-test-overcloud @@ -0,0 +1,31 @@ +#!/bin/bash + +set -eux + +source ~/overcloudrc + +TEMPEST_ARGS=${TEMPEST_ARGS:-} +# e.g. TEMPEST_ARGS='tempest.api.compute.flavors tempest.api.network.admin' + +mkdir -p ~/tempest +cd ~/tempest +/usr/share/openstack-tempest-kilo/tools/configure-tempest-directory + +./tools/config_tempest.py --out etc/tempest.conf --debug --create \ +identity.uri $OS_AUTH_URL \ +compute.allow_tenant_isolation true \ +object-storage.operator_role SwiftOperator \ +identity.admin_password $OS_PASSWORD \ +compute.build_timeout 500 \ +compute.image_ssh_user cirros \ +compute.ssh_user cirros \ +network.build_timeout 500 \ +volume.build_timeout 500 \ +scenario.ssh_user cirros + +FULL_TEMPEST_ARGS="--no-virtual-env" +if [ -n "$TEMPEST_ARGS" ]; then + FULL_TEMPEST_ARGS="$FULL_TEMPEST_ARGS -- $TEMPEST_ARGS" +fi + +./run_tempest.sh $FULL_TEMPEST_ARGS 2>&1 | tee ~/tempest/tempest-run.log diff --git a/setup.cfg b/setup.cfg index c75cab38a..b4f48edee 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,6 +27,7 @@ scripts = scripts/instack-install-undercloud scripts/instack-ironic-deployment scripts/instack-prepare-for-overcloud + scripts/instack-tempest-test-overcloud scripts/instack-test-overcloud scripts/instack-virt-setup