summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorricolin <rico.lin.guanyu@gmail.com>2020-02-14 12:11:30 +0800
committerricolin <rico.lin.guanyu@gmail.com>2020-02-27 13:39:25 +0800
commit5352760deb3da75c59615e4850d391bdb51167ee (patch)
tree7b2d8903dde41c7f6a2b0ff57f31c57f86549a60
parente4db219a2a2ff4192c3acd668b1c73da0c420f8c (diff)
downloadheat-5352760deb3da75c59615e4850d391bdb51167ee.tar.gz
Use stable constraint and update fedora mirror
Stable branches till stable/rocky is using python version <py3.6. Tempest test those branch in venv but Tempest tox use the master upper-constraint[1] which block installation due to dependencies require >=py3.6. For exmaple, oslo.concurrency 4.0.0 is not compatible for <py3.6. As we pin Tempest for EM stable brach, we should be able to use stable constraint for Tempest installation as well as while running during run-tempest playbook. tox.ini is hard coded to use master constraint[1] which force run-tempest to recreate the tox env and use the master constraint. Fix for that- https://review.opendev.org/#/c/705870/ [1] https://opendev.org/openstack/tempest/src/commit/bc9fe8eca801f54915ff3eafa418e6e18ac2df63/tox.ini#L14 Update pre-upgrade tests set to alias with ocata grenade tests Also update Fedora image ref for test jobs. Fedora-Cloud-Base-29-1.2.x86_64 is removed from openstack local mirro. Update to use Fedora-Cloud-Base-30-1.2.x86_64 for test jobs. Change-Id: I12e52dcbe306fda7d3b8f28d3b3a25c4c741884f
-rwxr-xr-xdevstack/upgrade/resources.sh59
-rwxr-xr-xheat_integrationtests/cleanup_test_env.sh2
-rwxr-xr-xheat_integrationtests/post_test_hook.sh4
-rwxr-xr-xheat_integrationtests/pre_test_hook.sh4
-rwxr-xr-xheat_integrationtests/prepare_test_env.sh2
5 files changed, 56 insertions, 15 deletions
diff --git a/devstack/upgrade/resources.sh b/devstack/upgrade/resources.sh
index ff864d1f1..59109d341 100755
--- a/devstack/upgrade/resources.sh
+++ b/devstack/upgrade/resources.sh
@@ -36,11 +36,7 @@ function _heat_set_user {
OS_PROJECT_DOMAIN_ID=$DEFAULT_DOMAIN
}
-function _run_heat_api_tests {
- local devstack_dir=$1
-
- pushd $devstack_dir/../tempest
- sed -i -e '/group_regex/c\group_regex=heat_tempest_plugin\\.tests\\.api\\.test_heat_api(?:\\.|_)([^_]+)' .stestr.conf
+function _config_tempest {
conf_file=etc/tempest.conf
iniset_multiline $conf_file service_available heat_plugin True
iniset $conf_file heat_plugin username $OS_USERNAME
@@ -53,14 +49,57 @@ function _run_heat_api_tests {
iniset $conf_file heat_plugin project_domain_name $OS_PROJECT_DOMAIN_NAME
iniset $conf_file heat_plugin region $OS_REGION_NAME
iniset $conf_file heat_plugin auth_version $OS_IDENTITY_API_VERSION
- tox -evenv-tempest -- tempest run --regex heat_tempest_plugin.tests.api
+}
+
+function _write_heat_integrationtests {
+ local upgrade_tests=$1
+ cat > $upgrade_tests <<EOF
+heat_tempest_plugin.tests.api
+EOF
+}
+
+function _run_heat_api_tests {
+ pushd $TARGET_RELEASE_DIR/tempest
+ sed -i -e '/group_regex/c\group_regex=heat_tempest_plugin\\.tests\\.api\\.test_heat_api(?:\\.|_)([^_]+)' .stestr.conf
+
+ # Run set of specified functional tests
+ UPGRADE_TESTS=upgrade_tests.list
+ _write_heat_integrationtests $UPGRADE_TESTS
+
+ _config_tempest
+
+ sudo UPPER_CONSTRAINTS_FILE=$TARGET_RELEASE_DIR/requirements/upper-constraints.txt \
+ tox -evenv-tempest -- stestr --test-path=$TARGET_RELEASE_DIR/heat/heat_integrationtests \
+ --top-dir=$TARGET_RELEASE_DIR/heat \
+ --group_regex='heat_tempest_plugin\.tests\.api\.test_heat_api[._]([^_]+)' run \
+ --whitelist-file $UPGRADE_TESTS
popd
}
-function create {
- # run heat api tests instead of tempest smoke before create
- _run_heat_api_tests $BASE_DEVSTACK_DIR
+function _run_heat_create_tests {
+ pushd $BASE_RELEASE_DIR/tempest
+ _config_tempest
+ # Old version of tempest is installed in grenade environment, so use
+ # .testr.conf instead of .stestr.conf
+ cat <<'EOF' >.testr.conf
+[DEFAULT]
+test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
+ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
+ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \
+ OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \
+ ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} \
+ ${OS_TEST_PATH:-./tempest/test_discover} $LISTOPT $IDOPTION
+test_id_option=--load-list $IDFILE
+test_list_option=--list
+group_regex=([^\.]*\.)*
+EOF
+
+ UPPER_CONSTRAINTS_FILE=$BASE_RELEASE_DIR/requirements/upper-constraints.txt tempest run --regex '(test_create_update.CreateStackTest|test_create_update.UpdateStackTest)'
+ popd
+}
+function create {
+ _run_heat_create_tests
# creates a tenant for the server
eval $(openstack project create -f shell -c id $HEAT_PROJECT)
if [[ -z "$id" ]]; then
@@ -94,7 +133,7 @@ function verify {
_heat_set_user
local side="$1"
if [[ "$side" = "post-upgrade" ]]; then
- _run_heat_api_tests $TARGET_DEVSTACK_DIR
+ _run_heat_api_tests
fi
stack_name=$(resource_get heat stack_name)
heat stack-show $stack_name
diff --git a/heat_integrationtests/cleanup_test_env.sh b/heat_integrationtests/cleanup_test_env.sh
index f30189e62..26d49c1db 100755
--- a/heat_integrationtests/cleanup_test_env.sh
+++ b/heat_integrationtests/cleanup_test_env.sh
@@ -30,4 +30,4 @@ openstack flavor delete m1.heat_int
openstack flavor delete m1.heat_micro
# delete the image created
-openstack image delete Fedora-Cloud-Base-29-1.2.x86_64
+openstack image delete Fedora-Cloud-Base-30-1.2.x86_64
diff --git a/heat_integrationtests/post_test_hook.sh b/heat_integrationtests/post_test_hook.sh
index 80e017937..f59e6376d 100755
--- a/heat_integrationtests/post_test_hook.sh
+++ b/heat_integrationtests/post_test_hook.sh
@@ -21,6 +21,8 @@ sudo -E $DEST/heat/heat_integrationtests/prepare_test_env.sh
sudo -E $DEST/heat/heat_integrationtests/prepare_test_network.sh
cd $DEST/tempest
-sudo tox -evenv-tempest -- stestr --test-path=$DEST/heat/heat_integrationtests --top-dir=$DEST/heat --group_regex='heat_tempest_plugin\.tests\.api\.test_heat_api[._]([^_]+)' run
+sudo UPPER_CONSTRAINTS_FILE=${UPPER_CONSTRAINTS_FILE:-$DEST/requirements/upper-constraints.txt} \
+tox -evenv-tempest -- stestr --test-path=$DEST/heat/heat_integrationtests --top-dir=$DEST/heat \
+--group_regex='heat_tempest_plugin\.tests\.api\.test_heat_api[._]([^_]+)' run
sudo -E $DEST/heat/heat_integrationtests/cleanup_test_env.sh
diff --git a/heat_integrationtests/pre_test_hook.sh b/heat_integrationtests/pre_test_hook.sh
index 9b1df3c26..e2d81e96b 100755
--- a/heat_integrationtests/pre_test_hook.sh
+++ b/heat_integrationtests/pre_test_hook.sh
@@ -44,9 +44,9 @@ echo "[[local|localrc]]" >> $localconf
# to network
if [[ -e /etc/ci/mirror_info.sh ]]; then
source /etc/ci/mirror_info.sh
- echo "IMAGE_URLS+=${NODEPOOL_FEDORA_MIRROR}/releases/29/Cloud/x86_64/images/Fedora-Cloud-Base-29-1.2.x86_64.qcow2" >> $localconf
+ echo "IMAGE_URLS+=${NODEPOOL_FEDORA_MIRROR}/releases/30/Cloud/x86_64/images/Fedora-Cloud-Base-30-1.2.x86_64.qcow2" >> $localconf
else
- echo "IMAGE_URLS+=https://download.fedoraproject.org/pub/fedora/linux/releases/29/Cloud/x86_64/images/Fedora-Cloud-Base-29-1.2.x86_64.qcow2" >> $localconf
+ echo "IMAGE_URLS+=https://download.fedoraproject.org/pub/fedora/linux/releases/30/Cloud/x86_64/images/Fedora-Cloud-Base-30-1.2.x86_64.qcow2" >> $localconf
fi
echo "CEILOMETER_PIPELINE_INTERVAL=60" >> $localconf
diff --git a/heat_integrationtests/prepare_test_env.sh b/heat_integrationtests/prepare_test_env.sh
index be502b546..605af83ce 100755
--- a/heat_integrationtests/prepare_test_env.sh
+++ b/heat_integrationtests/prepare_test_env.sh
@@ -48,7 +48,7 @@ function _config_iniset {
iniset $conf_file heat_plugin instance_type m1.heat_int
iniset $conf_file heat_plugin minimal_instance_type m1.heat_micro
- iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-29-1.2.x86_64
+ iniset $conf_file heat_plugin image_ref Fedora-Cloud-Base-30-1.2.x86_64
iniset $conf_file heat_plugin minimal_image_ref cirros-0.3.5-x86_64-disk
if [ "$DISABLE_CONVERGENCE" == "true" ]; then