Skip to content

Commit

Permalink
Add support for release test bump constraints
Browse files Browse the repository at this point in the history
nova-compute needs enough resources to be able to create
whatever vms the tests need so needs a flavor big enough
to support that.
  • Loading branch information
dosaboy committed Oct 2, 2024
1 parent 22d5c75 commit 6632de5
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions openstack/tools/openstack_regression_tests_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
FUNC_TEST_PR=
FUNC_TEST_TARGET=
IMAGES_PATH=$HOME/tmp
MODIFY_BUNDLE_CONSTRAINTS=true

. $(dirname $0)/func_test_tools/common.sh

Expand All @@ -20,6 +21,10 @@ OPTIONS:
--func-test-pr PR_ID
Provides similar functionality to Func-Test-Pr in commit message. Set
to zaza-openstack-tests Pull Request ID.
--skip-modify-bundle-constraints
By default we modify test bundle constraints to ensure that applications
have the resources they need. For example nova-compute needs to have
enough capacity to boot the vms required by the tests.
--help
This help message.
EOF
Expand All @@ -38,6 +43,9 @@ while (($# > 0)); do
FUNC_TEST_PR=$2
shift
;;
--skip-modify-bundle-constraints)
MODIFY_BUNDLE_CONSTRAINTS=false
;;
--help|-h)
usage
exit 0
Expand Down Expand Up @@ -125,6 +133,20 @@ LOGFILE=$(mktemp --suffix=-openstack-release-test-results)
# Ensure charmed-openstack-tester checked out and up-to-date
get_and_update_repo https://github.com/openstack-charmers/charmed-openstack-tester

# Ensure nova-compute has enough resources to create vms in tests.
if $MODIFY_BUNDLE_CONSTRAINTS; then
for f in tests/distro-regression/tests/bundles/*.yaml; do
# Dont do this if the test does not have nova-compute
if $(grep -q "nova-compute:" $f); then
if [[ $(yq '.applications' $f) = null ]]; then
yq -i '.services.nova-compute.constraints="root-disk=40G mem=4G"' $f
else
yq -i '.applications.nova-compute.constraints="root-disk=40G mem=4G"' $f
fi
fi
done
fi

# If a func test pr is provided switch to that pr.
if [[ -n $FUNC_TEST_PR ]]; then
# We use the zosci-config tools to do this.
Expand Down

0 comments on commit 6632de5

Please sign in to comment.