Files
5210671dbb6379ef996e35f18dd0de136bdd2b86
puppet-openstack-integration /run_tests.sh

176 lines
5.3 KiB
Bash
Raw Normal View History

#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
export PUPPET_ARGS="${PUPPET_ARGS} --detailed-exitcodes --color=false --test --trace"
export PUPPET_RELEASE_FILE=puppetlabs-release-pc1
export PUPPET_BASE_PATH=/etc/puppetlabs/code
export PUPPET_PKG=puppet-agent
else
export PUPPET_RELEASE_FILE=puppetlabs-release
export PUPPET_BASE_PATH=/etc/puppet
export PUPPET_PKG=puppet
fi
source ${SCRIPT_DIR}/functions
if [ ! -f fixtures/${SCENARIO}.pp ]; then
echo "fixtures/${SCENARIO}.pp file does not exist. Please define a valid scenario."
exit 1
fi
# preserve environment so we can have ZUUL_* params
# can clone tempest outside of the gate. Also, tempest should be sandboxed into
# the local directory but works needs to be added into puppet to properly find
# the path.
if [ -e /usr/zuul-env/bin/zuul-cloner ] ; then
/usr/zuul-env/bin/zuul-cloner --workspace /tmp --cache-dir /opt/git \
git://git.openstack.org openstack/tempest
$SUDO rm -rf /tmp/openstack/tempest
git clone git://git.openstack.org/openstack/tempest /tmp/openstack/tempest
$SUDO apt-get install -y dstat
$SUDO yum install -y dstat setools setroubleshoot audit
# use dstat to monitor system activity during integration testing
if type "dstat" 2>/dev/null; then
$SUDO dstat -tcmndrylpg --top-cpu-adv --top-io-adv --nocolor | $SUDO tee --append /var/log/dstat.log > /dev/null &
$SUDO ./install_modules.sh
fi
set +e
$SUDO $PUPPET_FULL_PATH apply $PUPPET_ARGS -e "include ::openstack_integration::repos"
set -e
if [ $RESULT -ne 2 ]; then
fi
# Run puppet a second time and assert nothing changes.
set +e
set -e
if [ $RESULT -ne 0 ]; then
fi
$SUDO rm -f /tmp/openstack/tempest/cirros-0.3.4-x86_64-disk.img
# exists.
if [ -f ~/cache/files/cirros-0.3.4-x86_64-disk.img ]; then
# Create a symlink for tempest.
ln -s ~/cache/files/cirros-0.3.4-x86_64-disk.img /tmp/openstack/tempest
else
wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img -P /tmp/openstack/tempest
fi
$SUDO pip install tempest-lib
# https://bugzilla.redhat.com/show_bug.cgi?id=1252812
$SUDO pip install gabbi
TESTS="smoke"
# Horizon
# Aodh
TESTS="${TESTS} TelemetryAlarming"
# Ironic
# Note: running all Ironic tests under SSL is not working
# https://bugs.launchpad.net/ironic/+bug/1554237
TESTS="${TESTS} api.baremetal.admin.test_drivers"
TESTS="${TESTS} TestManageQueue"
# TODO: we need to find why tempest tests fail when running
# latest Ubuntu Mitaka on Xenial and recent Tempest.
git checkout c9e37ae50f8f87bb39d64295bfd40c515b4edeba
fi
set -e