tempest: Avoid unnecessary package installation

When tempest should be installed from source, we don't (shouldn't)
install tempest packages.

Depends-on: https://review.opendev.org/916577
Change-Id: Ic22610b897f6e3de8d9d0de11cc387314cdb0d7b
This commit is contained in:
Takashi Kajinami 2024-04-20 12:40:46 +09:00
parent 3392f8555a
commit 0ff08bc9aa
2 changed files with 13 additions and 15 deletions

View File

@ -345,7 +345,6 @@ class openstack_integration::tempest (
img_disk_format => $image_format, img_disk_format => $image_format,
compute_build_interval => 10, compute_build_interval => 10,
ca_certificates_file => $::openstack_integration::params::ca_bundle_cert_path, ca_certificates_file => $::openstack_integration::params::ca_bundle_cert_path,
manage_tests_packages => true,
attach_encrypted_volume => $attach_encrypted_volume, attach_encrypted_volume => $attach_encrypted_volume,
tempest_workspace => '/tmp/openstack/tempest', tempest_workspace => '/tmp/openstack/tempest',
run_ssh => true, run_ssh => true,

View File

@ -205,6 +205,11 @@ fi
# Added tempest specific values to common.yaml # Added tempest specific values to common.yaml
if [ "${TEMPEST_FROM_SOURCE,,}" = false ]; then if [ "${TEMPEST_FROM_SOURCE,,}" = false ]; then
echo "tempest::install_from_source: false" >> ${SCRIPT_DIR}/hiera/common.yaml echo "tempest::install_from_source: false" >> ${SCRIPT_DIR}/hiera/common.yaml
echo "tempest::manage_tests_packages: true" >> ${SCRIPT_DIR}/hiera/common.yaml
echo "tempest::magnum::manage_tests_packages: true" >> ${SCRIPT_DIR}/hiera/common.yaml
else
echo "tempest::manage_tests_packages: false" >> ${SCRIPT_DIR}/hiera/common.yaml
echo "tempest::magnum::manage_tests_packages: false" >> ${SCRIPT_DIR}/hiera/common.yaml
fi fi
# Run puppet and assert something changes. # Run puppet and assert something changes.
@ -269,11 +274,6 @@ print_header 'Prepare Tempest'
$SUDO touch /tmp/openstack/tempest/test-include-list.txt /tmp/openstack/tempest/test-exclude-list.txt $SUDO touch /tmp/openstack/tempest/test-include-list.txt /tmp/openstack/tempest/test-exclude-list.txt
$SUDO chown -R "$(id -u):$(id -g)" /tmp/openstack/tempest/ $SUDO chown -R "$(id -u):$(id -g)" /tmp/openstack/tempest/
if uses_debs; then
pkglist="tempest python3-stestr python3-os-testr python3-tempest"
$SUDO apt-get install -y $pkglist
fi
set +e set +e
# Select what to test: # Select what to test:
# Smoke suite # Smoke suite
@ -370,10 +370,15 @@ if [ "${TEMPEST_FROM_SOURCE,,}" = true ]; then
/tmp/openstack/tempest/run_tempest/bin/pip3 setup.py install /tmp/openstack/tempest/run_tempest/bin/pip3 setup.py install
popd popd
run_tempest/bin/pip3 install os-testr
run_tempest/bin/stestr init run_tempest/bin/stestr init
export tempest_binary="run_tempest/bin/tempest" export tempest_binary="run_tempest/bin/tempest"
export stestr="run_tempest/bin/stestr"
export subunit2html="run_tempest/bin/subunit2html"
else else
export tempest_binary="/usr/bin/tempest" export tempest_binary="/usr/bin/tempest"
export stestr="/usr/bin/stestr"
export subunit2html="/usr/bin/subunit2html"
fi fi
# List tempest version # List tempest version
@ -393,16 +398,10 @@ $tempest_binary run --include-list=/tmp/openstack/tempest/test-include-list.txt
RESULT=$? RESULT=$?
set -e set -e
if [ -d .testrepository ]; then if [ -d .stestr ]; then
testr last --subunit > /tmp/openstack/tempest/testrepository.subunit $stestr last --subunit > /tmp/openstack/tempest/testrepository.subunit
elif [ -d .stestr ]; then
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
fi fi
subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html $subunit2html /tmp/openstack/tempest/testrepository.subunit /tmp/openstack/tempest/testr_results.html
print_header 'SELinux Alerts (Tempest)' print_header 'SELinux Alerts (Tempest)'
#catch_selinux_alerts #catch_selinux_alerts