2015-07-13 15:04:45 -04:00
|
|
|
#!/bin/bash -ex
|
2015-08-07 09:25:02 -04:00
|
|
|
# Copyright 2015 Red Hat, Inc.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2017-03-27 12:49:52 -04:00
|
|
|
export SCRIPT_DIR=$(cd `dirname $0` && pwd -P)
|
|
|
|
source ${SCRIPT_DIR}/functions
|
|
|
|
|
2017-01-12 07:46:35 -05:00
|
|
|
export WORKSPACE=${WORKSPACE:-/tmp}
|
2023-09-13 16:24:21 +02:00
|
|
|
export CEPH_VERSION=${CEPH_VERSION:-reef}
|
2022-09-06 10:50:24 +09:00
|
|
|
export PUPPET_MAJ_VERSION=${PUPPET_MAJ_VERSION:-6}
|
2015-10-01 12:46:02 -04:00
|
|
|
export SCENARIO=${SCENARIO:-scenario001}
|
2016-02-16 14:32:33 -08:00
|
|
|
export MANAGE_PUPPET_MODULES=${MANAGE_PUPPET_MODULES:-true}
|
2015-12-15 15:27:32 -05:00
|
|
|
export MANAGE_REPOS=${MANAGE_REPOS:-true}
|
2023-11-09 22:47:10 +09:00
|
|
|
export USE_PUPPETLABS=${USE_PUPPETLABS:-true}
|
2016-09-08 13:43:30 -04:00
|
|
|
export ADD_SWAP=${ADD_SWAP:-true}
|
2022-03-30 22:49:08 +09:00
|
|
|
export SWAP_SIZE_GB=${SWAP_SIZE_GB:-8}
|
2019-01-15 14:49:57 +01:00
|
|
|
export HIERA_CONFIG=${HIERA_CONFIG:-${SCRIPT_DIR}/hiera.yaml}
|
2016-07-13 13:50:17 -06:00
|
|
|
export MANAGE_HIERA=${MANAGE_HIERA:-true}
|
2023-11-09 22:47:10 +09:00
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${USE_PUPPETLABS,,}" = true ];then
|
2023-11-09 22:47:10 +09:00
|
|
|
export PATH=${PATH}:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin
|
|
|
|
export PUPPET_BASE_PATH=/etc/puppetlabs/code
|
|
|
|
export PUPPET_PKG=${PUPPET_PKG:-puppet-agent}
|
|
|
|
else
|
|
|
|
if is_fedora; then
|
|
|
|
export PUPPET_BASE_PATH=/etc/puppet
|
|
|
|
else
|
|
|
|
export PUPPET_BASE_PATH=/etc/puppet/code
|
|
|
|
fi
|
|
|
|
export PUPPET_PKG=${PUPPET_PKG:-puppet}
|
|
|
|
fi
|
|
|
|
export PUPPETFILE_DIR=${PUPPETFILE_DIR:-${PUPPET_BASE_PATH}/modules}
|
2017-09-20 20:09:29 -04:00
|
|
|
export PUPPET_ARGS="${PUPPET_ARGS} --detailed-exitcodes --color=false --test --summarize --trace --hiera_config ${HIERA_CONFIG} --logdest ${WORKSPACE}/puppet.log"
|
2023-11-09 22:47:10 +09:00
|
|
|
|
2016-12-20 11:16:58 -05:00
|
|
|
# If openstack/tempest is broken on master, we can pin the repository to a specific commit
|
|
|
|
# by using the following line:
|
2019-03-11 23:03:59 +00:00
|
|
|
export TEMPEST_VERSION=${TEMPEST_VERSION:-'master'}
|
2023-11-17 00:42:01 +09:00
|
|
|
# For installing Tempest from RPM keep TEMPEST_FROM_SOURCE to false
|
|
|
|
# In Ubuntu, Tempest packages are not maintained so installing from source
|
|
|
|
if is_fedora; then
|
|
|
|
export TEMPEST_FROM_SOURCE=${TEMPEST_FROM_SOURCE:-false}
|
|
|
|
else
|
|
|
|
if [ $(lsb_release --id -s) = "Ubuntu" ]; then
|
|
|
|
export TEMPEST_FROM_SOURCE=${TEMPEST_FROM_SOURCE:-true}
|
|
|
|
else
|
|
|
|
export TEMPEST_FROM_SOURCE=${TEMPEST_FROM_SOURCE:-false}
|
|
|
|
fi
|
|
|
|
fi
|
2017-02-07 18:07:57 +00:00
|
|
|
# Cirros Image directory
|
2023-10-15 12:29:27 +09:00
|
|
|
export IMG_DIR=${IMG_DIR:-/tmp/openstack/image}
|
|
|
|
export CIRROS_VERSION=${CIRROS_VERSION:-0.6.2}
|
2017-03-30 12:11:41 -04:00
|
|
|
|
2017-08-24 15:49:16 -06:00
|
|
|
# if we're running the tests we don't need to write out the facts to facter
|
|
|
|
# so we can disable it.
|
|
|
|
export WRITE_FACTS=false
|
|
|
|
source ${SCRIPT_DIR}/configure_facts.sh
|
|
|
|
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Start (run_tests.sh)'
|
2015-10-01 12:46:02 -04:00
|
|
|
|
|
|
|
if [ ! -f fixtures/${SCENARIO}.pp ]; then
|
|
|
|
echo "fixtures/${SCENARIO}.pp file does not exist. Please define a valid scenario."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-08-07 09:25:02 -04:00
|
|
|
if [ $(id -u) != 0 ]; then
|
|
|
|
# preserve environment so we can have ZUUL_* params
|
2016-06-08 11:31:00 -04:00
|
|
|
export SUDO='sudo -E'
|
2015-08-07 09:25:02 -04:00
|
|
|
fi
|
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${ADD_SWAP,,}" = true ]; then
|
2016-09-08 13:43:30 -04:00
|
|
|
print_header "Create $SWAP_SIZE_GB GB swapfile"
|
2017-04-12 19:22:02 +08:00
|
|
|
set +e
|
|
|
|
$SUDO swapon -s |grep -q '/swapfile'
|
|
|
|
RESULT=$?
|
|
|
|
set -e
|
|
|
|
if [ $RESULT -eq 0 ]; then
|
2017-10-18 08:24:10 -06:00
|
|
|
$SUDO swapoff /swapfile && $SUDO rm -f /swapfile
|
2017-04-12 19:22:02 +08:00
|
|
|
fi
|
2016-09-08 13:43:30 -04:00
|
|
|
$SUDO dd if=/dev/zero of=/swapfile count=${SWAP_SIZE_GB}k bs=1M
|
|
|
|
$SUDO chmod 0600 /swapfile
|
|
|
|
$SUDO mkswap /swapfile
|
|
|
|
$SUDO swapon /swapfile
|
|
|
|
fi
|
|
|
|
|
2017-08-18 11:02:19 -07:00
|
|
|
# We install some gems as root so to take benefit of
|
|
|
|
# OpenStack Infra mirrors.
|
|
|
|
if [ -f ~/.gemrc ]; then
|
|
|
|
cat ~/.gemrc | $SUDO tee /root/.gemrc
|
|
|
|
fi
|
|
|
|
|
2018-12-17 20:06:39 +05:30
|
|
|
# handle umask issue after "pam" new release, this is needed when run_tests.sh
|
|
|
|
# is run remotely via ansible using a user which doesn't have .bashrc file
|
|
|
|
if [ -f /etc/fedora-release -a -f /etc/bashrc ]; then
|
|
|
|
source /etc/bashrc
|
|
|
|
fi
|
|
|
|
|
2016-09-23 09:20:44 -04:00
|
|
|
print_header 'Clone Tempest, plugins & pre-cache CirrOS'
|
2015-08-26 10:35:35 -04:00
|
|
|
# TODO(pabelanger): Move this into tools/install_tempest.sh and add logic so we
|
|
|
|
# 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.
|
2017-02-07 18:07:57 +00:00
|
|
|
|
2019-06-26 12:52:35 +02:00
|
|
|
if [ -d /home/zuul/src/opendev.org ]; then
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${TEMPEST_FROM_SOURCE,,}" = true ]; then
|
2019-06-26 12:52:35 +02:00
|
|
|
if [ -d /home/zuul/src/opendev.org/openstack/tempest ]; then
|
|
|
|
[ ! -d /tmp/openstack ] && mkdir -p /tmp/openstack
|
|
|
|
cp -R /home/zuul/src/opendev.org/openstack/tempest /tmp/openstack/tempest
|
|
|
|
else
|
|
|
|
git clone https://opendev.org/openstack/tempest /tmp/openstack/tempest
|
2021-07-08 14:48:22 +09:00
|
|
|
pushd /tmp/openstack/tempest
|
|
|
|
git reset --hard $TEMPEST_VERSION
|
|
|
|
popd
|
2017-10-10 19:05:08 +02:00
|
|
|
fi
|
2016-12-20 08:48:23 -05:00
|
|
|
fi
|
2017-10-10 19:05:08 +02:00
|
|
|
else
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${TEMPEST_FROM_SOURCE,,}" = true ]; then
|
2017-10-10 19:05:08 +02:00
|
|
|
$SUDO rm -rf /tmp/openstack/tempest
|
2019-04-21 14:44:50 +08:00
|
|
|
git clone https://opendev.org/openstack/tempest /tmp/openstack/tempest
|
2017-10-10 19:05:08 +02:00
|
|
|
pushd /tmp/openstack/tempest
|
2021-02-24 00:32:27 +09:00
|
|
|
git reset --hard $TEMPEST_VERSION
|
2017-10-10 19:05:08 +02:00
|
|
|
popd
|
|
|
|
fi
|
2016-12-19 15:11:34 -05:00
|
|
|
fi
|
2016-11-12 16:07:55 +01:00
|
|
|
|
2016-09-23 09:20:44 -04:00
|
|
|
# NOTE(pabelanger): We cache cirros images on our jenkins slaves, check if it
|
|
|
|
# exists.
|
2017-02-07 18:07:57 +00:00
|
|
|
|
|
|
|
if [[ ! -e $IMG_DIR ]]; then
|
|
|
|
mkdir -p $IMG_DIR
|
|
|
|
fi
|
|
|
|
|
2023-10-15 12:29:27 +09:00
|
|
|
if [ -f ~/cache/files/cirros-${CIRROS_VERSION}-x86_64-disk.img ]; then
|
2016-09-23 09:20:44 -04:00
|
|
|
# Create a symlink for tempest.
|
2023-10-15 12:29:27 +09:00
|
|
|
if ! [ -h /tmp/openstack/image/cirros-${CIRROS_VERSION}-x86_64-disk.img ] ; then
|
|
|
|
ln -s ~/cache/files/cirros-${CIRROS_VERSION}-x86_64-disk.img $IMG_DIR
|
2018-05-15 22:51:04 +02:00
|
|
|
fi
|
2016-09-23 09:20:44 -04:00
|
|
|
else
|
2023-10-15 12:29:27 +09:00
|
|
|
wget http://download.cirros-cloud.net/${CIRROS_VERSION}/cirros-${CIRROS_VERSION}-x86_64-disk.img -P $IMG_DIR
|
2016-09-23 09:20:44 -04:00
|
|
|
fi
|
2023-10-15 12:29:27 +09:00
|
|
|
ln -s $IMG_DIR/cirros-${CIRROS_VERSION}-x86_64-disk.img $IMG_DIR/cirros-${CIRROS_VERSION}-x86_64-disk-qcow2.img
|
2022-06-06 16:00:39 +09:00
|
|
|
# NOTE(tkajinam): Prepare raw format image
|
2023-10-15 12:29:27 +09:00
|
|
|
qemu-img convert -f qcow2 -O raw $IMG_DIR/cirros-${CIRROS_VERSION}-x86_64-disk.img $IMG_DIR/cirros-${CIRROS_VERSION}-x86_64-disk-raw.img
|
2016-09-23 09:20:44 -04:00
|
|
|
|
2023-11-09 22:47:10 +09:00
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${MANAGE_REPOS,,}" = true ] && [ "${USE_PUPPETLABS,,}" = true ]; then
|
2023-11-09 22:47:10 +09:00
|
|
|
install_puppetlabs_repo
|
|
|
|
fi
|
2016-06-08 11:31:00 -04:00
|
|
|
install_puppet
|
2016-06-08 11:44:10 -04:00
|
|
|
PUPPET_FULL_PATH=$(which puppet)
|
2023-11-09 22:47:10 +09:00
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${MANAGE_HIERA,,}" = true ]; then
|
2016-07-13 13:50:17 -06:00
|
|
|
configure_hiera
|
|
|
|
fi
|
2016-06-08 11:44:10 -04:00
|
|
|
|
2015-08-29 12:22:57 -04:00
|
|
|
if uses_debs; then
|
2017-03-07 14:49:01 +01:00
|
|
|
$SUDO apt-get install -y dstat ebtables iotop sysstat
|
2015-08-29 12:22:57 -04:00
|
|
|
elif is_fedora; then
|
2018-06-13 19:07:02 +05:30
|
|
|
$SUDO $YUM install -y dstat setools setroubleshoot audit iotop sysstat
|
2021-05-27 17:34:06 +02:00
|
|
|
$SUDO systemctl start auditd
|
2016-04-11 20:16:20 -04:00
|
|
|
# SElinux in permissive mode so later we can catch alerts
|
2016-06-09 16:18:03 +02:00
|
|
|
$SUDO selinuxenabled && $SUDO setenforce 0
|
2015-08-29 12:22:57 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# use dstat to monitor system activity during integration testing
|
|
|
|
if type "dstat" 2>/dev/null; then
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Start dstat'
|
2021-07-21 14:56:42 -06:00
|
|
|
DSTAT_OPTS=""
|
|
|
|
set -e
|
|
|
|
if dstat --help 2>&1 | grep -q "top-io-adv"; then
|
|
|
|
DSTAT_OPTS="${DSTAT_OPTS} --top-io-adv"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if dstat --help 2>&1 | grep -q "top-cpu-adv"; then
|
|
|
|
DSTAT_OPTS="${DSTAT_OPTS} --top-cpu-adv"
|
|
|
|
fi
|
|
|
|
set +e
|
|
|
|
$SUDO dstat -tcmndrylpg $DSTAT_OPTS --nocolor | $SUDO tee --append /var/log/dstat.log > /dev/null &
|
2015-08-29 12:22:57 -04:00
|
|
|
fi
|
|
|
|
|
2017-03-07 14:49:01 +01:00
|
|
|
if type "iostat" 2>/dev/null; then
|
|
|
|
print_header 'Start iostat'
|
|
|
|
$SUDO iostat -x -k -d -t 4 | $SUDO tee --append /var/log/iostat.log > /dev/null &
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "/usr/sbin/iotop" ]; then
|
|
|
|
print_header 'Start iotop'
|
|
|
|
$SUDO /usr/sbin/iotop --kilobytes --only --batch --time --delay=2 --processes --quiet | $SUDO tee --append /var/log/iotop.log > /dev/null &
|
|
|
|
fi
|
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${MANAGE_PUPPET_MODULES,,}" = true ]; then
|
2016-02-23 23:08:08 -05:00
|
|
|
$SUDO ./install_modules.sh
|
|
|
|
fi
|
|
|
|
|
2017-02-07 18:07:57 +00:00
|
|
|
# Added tempest specific values to common.yaml
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${TEMPEST_FROM_SOURCE,,}" = false ]; then
|
2017-02-07 18:07:57 +00:00
|
|
|
echo "tempest::install_from_source: false" >> ${SCRIPT_DIR}/hiera/common.yaml
|
|
|
|
fi
|
|
|
|
|
2015-07-13 15:04:45 -04:00
|
|
|
# Run puppet and assert something changes.
|
|
|
|
set +e
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${MANAGE_REPOS,,}" = true ]; then
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Install repos'
|
2020-07-21 08:36:06 +09:00
|
|
|
$SUDO $PUPPET_FULL_PATH apply $PUPPET_ARGS -e "include openstack_integration::repos"
|
|
|
|
RESULT=$?
|
2016-07-13 10:22:40 -06:00
|
|
|
if [ $RESULT -ne 0 ] && [ $RESULT -ne 2 ]; then
|
2016-06-09 21:28:16 -04:00
|
|
|
print_header 'Puppet failed to install repositories.'
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-09-08 22:10:53 +02:00
|
|
|
print_header 'Updating packages'
|
|
|
|
if is_fedora; then
|
|
|
|
$SUDO $YUM update -y
|
|
|
|
update_ret=$?
|
|
|
|
elif uses_debs; then
|
2019-02-04 15:39:46 +01:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
$SUDO apt-get -y -o Dpkg::Options::="--force-confnew" upgrade
|
2018-09-08 22:10:53 +02:00
|
|
|
update_ret=$?
|
|
|
|
fi
|
|
|
|
if [ $update_ret -ne 0 ]; then
|
|
|
|
print_header 'Error updating packages'
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-11-10 01:12:59 +09:00
|
|
|
timestamp_puppet_log
|
2015-12-15 15:27:32 -05:00
|
|
|
fi
|
2016-06-09 21:28:16 -04:00
|
|
|
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header "Running Puppet Scenario: ${SCENARIO} (1st time)"
|
2015-10-01 12:46:02 -04:00
|
|
|
run_puppet $SCENARIO
|
2015-07-13 15:04:45 -04:00
|
|
|
RESULT=$?
|
|
|
|
set -e
|
2016-07-13 10:22:40 -06:00
|
|
|
if [ $RESULT -ne 0 ] && [ $RESULT -ne 2 ]; then
|
2016-04-21 09:52:23 -04:00
|
|
|
print_header 'First Puppet run contains errors in catalog.'
|
2016-10-31 15:15:34 -06:00
|
|
|
catch_puppet_failures
|
2022-02-22 15:56:21 +09:00
|
|
|
#print_header 'SELinux Alerts (1st time)'
|
|
|
|
#catch_selinux_alerts
|
2015-07-13 15:04:45 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
2016-10-31 15:15:34 -06:00
|
|
|
timestamp_puppet_log
|
2015-07-13 15:04:45 -04:00
|
|
|
|
2018-01-05 07:17:24 -08:00
|
|
|
# Run puppet a second time and assert nothing changes.
|
|
|
|
set +e
|
|
|
|
print_header "Running Puppet Scenario: ${SCENARIO} (2nd time)"
|
|
|
|
run_puppet $SCENARIO
|
|
|
|
RESULT=$?
|
|
|
|
set -e
|
|
|
|
if [ $RESULT -ne 0 ]; then
|
|
|
|
print_header 'Second Puppet run is not idempotent.'
|
|
|
|
catch_puppet_failures
|
2022-02-22 15:56:21 +09:00
|
|
|
#print_header 'SELinux Alerts (2nd time)'
|
|
|
|
#catch_selinux_alerts
|
2018-01-05 07:17:24 -08:00
|
|
|
exit 1
|
2015-07-13 15:04:45 -04:00
|
|
|
fi
|
2018-01-05 07:17:24 -08:00
|
|
|
timestamp_puppet_log
|
2015-07-29 10:57:52 -04:00
|
|
|
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Prepare Tempest'
|
2017-07-20 12:58:14 +05:30
|
|
|
|
|
|
|
# FIXME: Since tempest create tempest workspace which is owned by root user.
|
|
|
|
# We need to fix it in puppet-tempest, as a workaround we are changing the mode
|
|
|
|
# of tempest workspace and run tempest command using root.
|
2022-02-04 01:00:08 +09:00
|
|
|
$SUDO touch /tmp/openstack/tempest/test-include-list.txt /tmp/openstack/tempest/test-exclude-list.txt
|
2017-10-10 19:05:08 +02:00
|
|
|
$SUDO chown -R "$(id -u):$(id -g)" /tmp/openstack/tempest/
|
2017-07-20 12:58:14 +05:30
|
|
|
|
2016-08-09 10:18:04 -04:00
|
|
|
if uses_debs; then
|
2019-04-24 14:20:46 -06:00
|
|
|
pkglist="tempest python3-stestr python3-os-testr python3-tempest"
|
|
|
|
$SUDO apt-get install -y $pkglist
|
2016-08-09 10:18:04 -04:00
|
|
|
fi
|
2016-07-12 09:52:59 -04:00
|
|
|
|
2016-02-23 23:23:04 -05:00
|
|
|
set +e
|
2015-10-26 07:30:29 +09:00
|
|
|
# Select what to test:
|
2016-03-01 18:50:40 -05:00
|
|
|
# Smoke suite
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "smoke" > /tmp/openstack/tempest/test-include-list.txt
|
2016-03-01 18:50:40 -05:00
|
|
|
|
|
|
|
# Horizon
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "dashboard" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-03-01 18:50:40 -05:00
|
|
|
|
|
|
|
# Aodh
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "TelemetryAlarming" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-03-01 18:50:40 -05:00
|
|
|
|
2016-05-19 22:24:22 +02:00
|
|
|
# Gnocchi
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "telemetry_tempest_plugin.gnocchi" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-05-19 22:24:22 +02:00
|
|
|
|
2016-11-01 13:39:47 +02:00
|
|
|
# Vitrage
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "TestEvents" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-11-01 13:39:47 +02:00
|
|
|
|
2016-12-14 12:05:34 -05:00
|
|
|
# Test Autoscaling with Telemetry (need panko, ubuntu doesn't ship it)
|
2022-02-04 01:00:08 +09:00
|
|
|
uses_debs || echo "test_telemetry_integration" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-12-14 12:05:34 -05:00
|
|
|
|
2016-03-01 18:50:40 -05:00
|
|
|
# Ironic
|
|
|
|
# Note: running all Ironic tests under SSL is not working
|
|
|
|
# https://bugs.launchpad.net/ironic/+bug/1554237
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "ironic_tempest_plugin.tests.api.admin.test_drivers" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-03-01 18:50:40 -05:00
|
|
|
|
2020-09-21 20:14:07 +02:00
|
|
|
# NOTE(tobias-urdin): Disabled because magnum network access from inside instance to
|
2016-09-07 18:12:13 -04:00
|
|
|
# deploy docker for example.
|
|
|
|
# Magnum
|
2022-02-04 01:00:08 +09:00
|
|
|
#echo "test_create_list_sign_delete_clusters" >> /tmp/openstack/tempest/test-include-list.txt
|
2023-02-24 03:37:54 +09:00
|
|
|
echo "magnum_tempest_plugin.tests.api.v1.test_magnum_service.MagnumServiceTest" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-09-07 18:12:13 -04:00
|
|
|
|
2016-02-17 15:30:37 -05:00
|
|
|
# Zaqar
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "v2.test_queues.TestManageQueue" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-04-09 11:50:00 -04:00
|
|
|
|
2016-08-17 14:40:32 +02:00
|
|
|
# ec2api
|
2016-11-25 11:52:47 -05:00
|
|
|
# VPN tests require VPNaaS, which doesn't work yet in puppet-tempest.
|
|
|
|
# As soon as enabling neutron_vpnaas_available works there, the VPN tests can
|
|
|
|
# be included.
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "ec2api_tempest_plugin.api.*test_create_delete(?!.*_vpn_connection)" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-08-17 14:40:32 +02:00
|
|
|
|
2016-10-02 23:34:09 -04:00
|
|
|
# Cinder Backup
|
2022-09-04 20:39:16 +09:00
|
|
|
echo "VolumesBackupsAdminTest" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-10-02 23:34:09 -04:00
|
|
|
|
2016-07-08 15:59:50 -04:00
|
|
|
# Cinder encrypted volumes
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "TestEncryptedCinderVolumes" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-07-08 15:59:50 -04:00
|
|
|
|
2016-07-08 16:39:31 -04:00
|
|
|
# Mistral
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "test_create_and_delete_workflow" >> /tmp/openstack/tempest/test-include-list.txt
|
2016-07-08 16:39:31 -04:00
|
|
|
|
2017-04-11 16:33:48 +02:00
|
|
|
# BGPVPN
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "test_create_bgpvpn" >> /tmp/openstack/tempest/test-include-list.txt
|
2017-04-11 16:33:48 +02:00
|
|
|
|
2017-04-26 14:05:33 +02:00
|
|
|
# L2GW
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "test_create_show_list_update_delete_l2gateway" >> /tmp/openstack/tempest/test-include-list.txt
|
2017-04-26 14:05:33 +02:00
|
|
|
|
2022-06-16 15:10:44 +09:00
|
|
|
# Heat
|
|
|
|
echo "heat_tempest_plugin.tests.scenario.test_base_resources" >> /tmp/openstack/tempest/test-include-list.txt
|
|
|
|
|
2022-02-06 23:18:57 +09:00
|
|
|
# Octavia
|
|
|
|
# We have to enable additional tests because no smoke tests will be run with
|
|
|
|
# noop drivers.
|
|
|
|
echo "octavia_tempest_plugin.tests.scenario.*standalone_CRUD" >> /tmp/openstack/tempest/test-include-list.txt
|
|
|
|
|
2022-08-21 03:40:07 +09:00
|
|
|
# Barbican
|
|
|
|
echo 'barbican_tempest_plugin.tests.scenario.test_volume_encryption.VolumeEncryptionTest' >> /tmp/openstack/tempest/test-include-list.txt
|
|
|
|
echo 'barbican_tempest_plugin.tests.scenario.test_image_signing.ImageSigningTest.test_signed_image_upload_and_boot' >> /tmp/openstack/tempest/test-include-list.txt
|
|
|
|
|
2022-09-02 01:40:44 +09:00
|
|
|
# Manila
|
2023-05-25 15:38:50 +09:00
|
|
|
echo 'manila_tempest_tests.tests.api.test_shares.SharesCephFSTest.test_create_get_delete_share' >> /tmp/openstack/tempest/test-include-list.txt
|
2022-09-02 01:40:44 +09:00
|
|
|
echo 'manila_tempest_tests.tests.api.test_shares.SharesNFSTest.test_create_get_delete_share' >> /tmp/openstack/tempest/test-include-list.txt
|
|
|
|
|
2016-12-01 10:26:05 -07:00
|
|
|
if uses_debs; then
|
2022-02-04 01:00:08 +09:00
|
|
|
echo "telemetry_tempest_plugin.scenario.test_telemetry_integration.TestTelemetryIntegration" >> /tmp/openstack/tempest/test-exclude-list.txt
|
|
|
|
EXCLUDES="--exclude-list=/tmp/openstack/tempest/test-exclude-list.txt"
|
2018-07-17 14:21:01 +02:00
|
|
|
|
2016-12-01 10:26:05 -07:00
|
|
|
else
|
2022-02-04 01:00:08 +09:00
|
|
|
# https://review.opendev.org/#/c/504345/ has changed the behavior of tempest when running with --regex and --include-list-file
|
2018-02-23 09:56:18 +01:00
|
|
|
# and now operator between them is OR when filtering tests (which is how it was documented, btw). In order to promote
|
2019-04-24 14:54:02 +08:00
|
|
|
# we need to remove this regex option and implement https://review.opendev.org/#/c/547278 when ready.
|
|
|
|
# Note these tests were disabled in https://review.opendev.org/#/c/461969/ and hopefully it's more stable now and allows
|
2022-02-04 01:00:08 +09:00
|
|
|
# us to run it until we can implement --exclude-list-file in a stable way.
|
2022-07-11 13:55:45 +09:00
|
|
|
EXCLUDES="--exclude-regex=^telemetry_tempest_plugin.scenario.test_telemetry_integration.TestTelemetryIntegration"
|
2016-12-01 10:26:05 -07:00
|
|
|
fi
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Running Tempest'
|
2016-02-23 15:39:35 -05:00
|
|
|
cd /tmp/openstack/tempest
|
2016-06-03 23:54:29 -04:00
|
|
|
|
2023-11-17 03:00:34 +09:00
|
|
|
if [ "${TEMPEST_FROM_SOURCE,,}" = true ]; then
|
2023-04-03 17:01:58 +09:00
|
|
|
python3 -m virtualenv run_tempest
|
|
|
|
/tmp/openstack/tempest/run_tempest/bin/pip3 install -c https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt -U -r requirements.txt
|
|
|
|
/tmp/openstack/tempest/run_tempest/bin/python3 setup.py install
|
|
|
|
|
|
|
|
# TODO(tobias-urdin): We must have the neutron-tempest-plugin to even test Neutron, is also required by
|
|
|
|
# vpnaas and dynamic routing projects.
|
|
|
|
if [ -d /home/zuul/src/opendev.org/openstack/neutron-tempest-plugin ]; then
|
|
|
|
cp -R /home/zuul/src/opendev.org/openstack/neutron-tempest-plugin /tmp/openstack/neutron-tempest-plugin
|
|
|
|
else
|
|
|
|
git clone https://opendev.org/openstack/neutron-tempest-plugin /tmp/openstack/neutron-tempest-plugin
|
|
|
|
fi
|
|
|
|
pushd /tmp/openstack/neutron-tempest-plugin
|
|
|
|
/tmp/openstack/tempest/run_tempest/bin/pip3 install -c https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt -U -r requirements.txt
|
|
|
|
/tmp/openstack/tempest/run_tempest/bin/pip3 setup.py install
|
|
|
|
popd
|
|
|
|
|
2018-11-05 14:53:18 +05:30
|
|
|
run_tempest/bin/stestr init
|
2017-07-20 12:58:14 +05:30
|
|
|
export tempest_binary="run_tempest/bin/tempest"
|
2017-02-07 18:07:57 +00:00
|
|
|
else
|
2017-07-20 12:58:14 +05:30
|
|
|
export tempest_binary="/usr/bin/tempest"
|
|
|
|
fi
|
|
|
|
|
2018-11-05 14:53:18 +05:30
|
|
|
# List tempest version
|
|
|
|
$tempest_binary --version
|
|
|
|
|
2018-04-26 11:32:58 +05:30
|
|
|
# List tempest plugins
|
|
|
|
$tempest_binary list-plugins
|
|
|
|
|
|
|
|
# list tempest workspace
|
|
|
|
$tempest_binary workspace list
|
|
|
|
|
|
|
|
# list tempest tests before running tempest
|
2022-02-04 01:00:08 +09:00
|
|
|
$tempest_binary run -l --include-list=/tmp/openstack/tempest/test-include-list.txt
|
2018-04-26 11:32:58 +05:30
|
|
|
|
2018-11-05 14:53:18 +05:30
|
|
|
# Run tempest tests
|
2022-02-04 01:00:08 +09:00
|
|
|
$tempest_binary run --include-list=/tmp/openstack/tempest/test-include-list.txt --concurrency=2 $EXCLUDES
|
2018-11-05 14:53:18 +05:30
|
|
|
|
2017-07-20 12:58:14 +05:30
|
|
|
RESULT=$?
|
|
|
|
set -e
|
2017-12-12 13:36:08 +05:30
|
|
|
if [ -d .testrepository ]; then
|
|
|
|
testr last --subunit > /tmp/openstack/tempest/testrepository.subunit
|
|
|
|
elif [ -d .stestr ]; then
|
2018-06-25 14:28:15 +05:30
|
|
|
if type "stestr-3" 2>/dev/null; then
|
|
|
|
stestr-3 last --subunit > /tmp/openstack/tempest/testrepository.subunit
|
|
|
|
else
|
|
|
|
stestr last --subunit > /tmp/openstack/tempest/testrepository.subunit
|
|
|
|
fi
|
2017-12-12 13:36:08 +05:30
|
|
|
fi
|
2017-07-19 08:44:50 -07:00
|
|
|
subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'SELinux Alerts (Tempest)'
|
2022-02-22 15:56:21 +09:00
|
|
|
#catch_selinux_alerts
|
2016-04-11 20:16:20 -04:00
|
|
|
|
2016-04-14 14:04:57 -06:00
|
|
|
print_header 'Done (run_tests.sh)'
|
2016-02-23 23:23:04 -05:00
|
|
|
exit $RESULT
|