Skip to content

Commit

Permalink
Merge pull request #256 from dosaboy/openstack-release-test-constraints
Browse files Browse the repository at this point in the history
Add support for release test bump constraints
  • Loading branch information
dosaboy authored Oct 2, 2024
2 parents 22d5c75 + 6632de5 commit 7468248
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 7468248

Please sign in to comment.