Skip to content

Commit

Permalink
Add parameter to support juju 2.9 to test bionic-based code
Browse files Browse the repository at this point in the history
Closes: #290
  • Loading branch information
rodrigogansobarbieri committed Dec 16, 2024
1 parent 9821150 commit 2a68d61
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions openstack/tools/charmed_openstack_functest_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ MODIFY_BUNDLE_CONSTRAINTS=true
REMOTE_BUILD=
SKIP_BUILD=false
SLEEP=
USE_JUJU29=false
WAIT_ON_DESTROY=true

. $(dirname $0)/func_test_tools/common.sh
Expand Down Expand Up @@ -58,6 +59,9 @@ OPTIONS:
enough capacity to boot the vms required by the tests.
--sleep TIME_SECS
Specify amount of seconds to sleep between functest steps.
--use-juju29
Configure the framework to use juju 2.9 instead of 3.x (usually
to be able to test bionic-based code)
--help
This help message.
EOF
Expand Down Expand Up @@ -97,6 +101,9 @@ while (($# > 0)); do
SLEEP=$2
shift
;;
--use-juju29)
USE_JUJU29=true
;;
--help|-h)
usage
exit 0
Expand Down Expand Up @@ -154,8 +161,12 @@ export TEST_JUJU3=1
# NOTE: this should not be necessary for > juju 2.x but since we still have a need for it we add it in
export TEST_ZAZA_BUG_LP1987332=1

# Some charms point to an upstream constraints file that installs python-libjuju 2.x so we need to do this to ensure we get 3.x
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju34.txt
if $USE_JUJU29; then
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju29.txt
else
# Some charms point to an upstream constraints file that installs python-libjuju 2.x so we need to do this to ensure we get 3.x
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju34.txt
fi

LOGFILE=$(mktemp --suffix=-charm-func-test-results)
(
Expand Down
15 changes: 13 additions & 2 deletions openstack/tools/openstack_regression_tests_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FUNC_TEST_PR=
FUNC_TEST_TARGET=
IMAGES_PATH=$HOME/tmp
MODIFY_BUNDLE_CONSTRAINTS=true
USE_JUJU29=false

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

Expand All @@ -25,6 +26,9 @@ OPTIONS:
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.
--use-juju29
Configure the framework to use juju 2.9 instead of 3.x (usually
to be able to test bionic-based code)
--help
This help message.
EOF
Expand All @@ -46,6 +50,9 @@ while (($# > 0)); do
--skip-modify-bundle-constraints)
MODIFY_BUNDLE_CONSTRAINTS=false
;;
--use-juju29)
USE_JUJU29=true
;;
--help|-h)
usage
exit 0
Expand Down Expand Up @@ -113,8 +120,12 @@ export TEST_JUJU3=1
# NOTE: this should not be necessary for > juju 2.x but since we still have a need for it we add it in
export TEST_ZAZA_BUG_LP1987332=1

# Some charms point to an upstream constraints file that installs python-libjuju 2.x so we need to do this to ensure we get 3.x
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju34.txt
if $USE_JUJU29; then
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju29.txt
else
# Some charms point to an upstream constraints file that installs python-libjuju 2.x so we need to do this to ensure we get 3.x
export TEST_CONSTRAINTS_FILE=https://raw.githubusercontent.com/openstack-charmers/zaza/master/constraints-juju34.txt
fi

# NOTE: this is the default applied in zaza-openstack-tests code but setting
# explicitly so we can use locally.
Expand Down

0 comments on commit 2a68d61

Please sign in to comment.