diff --git a/.zuul.yaml b/.zuul.yaml index eb2e9f25..a2a2d50b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -16,10 +16,13 @@ - job: name: muranoclient-functional-test-mysql-backend - parent: legacy-dsvm-base - run: playbooks/legacy/muranoclient-functional-test-mysql-backend/run.yaml - post-run: playbooks/legacy/muranoclient-functional-test-mysql-backend/post.yaml + parent: devstack-tox-functional timeout: 4200 + vars: + openrc_enable_export: true + devstack_plugins: + heat: https://opendev.org/openstack/heat + murano: https://opendev.org/openstack/murano irrelevant-files: - ^(test-|)requirements.txt$ - ^setup.cfg$ @@ -28,7 +31,6 @@ - ^releasenotes/.*$ - ^muranoclient/tests/.*$ required-projects: - - openstack/devstack-gate - openstack/heat - openstack/murano - openstack/murano-dashboard diff --git a/muranoclient/tests/functional/hooks/post_test_hook.sh b/muranoclient/tests/functional/hooks/post_test_hook.sh deleted file mode 100755 index 7a7f365b..00000000 --- a/muranoclient/tests/functional/hooks/post_test_hook.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -xe - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This script is executed inside post_test_hook function in devstack gate. - -function generate_testr_results { - if [ -f .testrepository/0 ]; then - sudo .tox/functional/bin/testr last --subunit > $WORKSPACE/testrepository.subunit - sudo mv $WORKSPACE/testrepository.subunit $BASE/logs/testrepository.subunit - sudo /usr/os-testr-env/bin/subunit2html $BASE/logs/testrepository.subunit $BASE/logs/testr_results.html - sudo gzip -9 $BASE/logs/testrepository.subunit - sudo gzip -9 $BASE/logs/testr_results.html - sudo chown $USER:$USER $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz - sudo chmod a+r $BASE/logs/testrepository.subunit.gz $BASE/logs/testr_results.html.gz - fi -} - -export MURANOCLIENT_DIR="$BASE/new/python-muranoclient" - -sudo chown -R $USER:stack $MURANOCLIENT_DIR - -# Get admin credentials -cd $BASE/new/devstack -source openrc admin admin - -# Pass the appropriate variables via a config file -CREDS_FILE=$MURANOCLIENT_DIR/functional_creds.conf -cat < $CREDS_FILE -# Credentials for functional testing -[auth] -uri = $OS_AUTH_URL - -[admin] -user = $OS_USERNAME -tenant = $OS_TENANT_NAME -pass = $OS_PASSWORD - -EOF - -# Go to the muranoclient dir -cd $MURANOCLIENT_DIR - -sudo chown -R $USER:stack $MURANOCLIENT_DIR - -# Run tests -echo "Running muranoclient functional test suite" -set +e -# Preserve env for OS_ credentials -sudo -E -H -u $USER tox -efunctional -EXIT_CODE=$? -set -e - -# Collect and parse result -generate_testr_results -exit $EXIT_CODE diff --git a/muranoclient/tests/functional/muranoclient.py b/muranoclient/tests/functional/muranoclient.py index d34bf5ff..e617cc98 100644 --- a/muranoclient/tests/functional/muranoclient.py +++ b/muranoclient/tests/functional/muranoclient.py @@ -33,7 +33,8 @@ class ClientTestBase(base.ClientTestBase): self.username = os.environ.get('OS_USERNAME') self.password = os.environ.get('OS_PASSWORD') - self.tenant_name = os.environ.get('OS_TENANT_NAME') + self.tenant_name = os.environ.get('OS_PROJECT_NAME', + os.environ.get('OS_TENANT_NAME')) self.uri = os.environ.get('OS_AUTH_URL') config = configparser.RawConfigParser() if config.read('functional_creds.conf'): diff --git a/playbooks/legacy/muranoclient-functional-test-mysql-backend/post.yaml b/playbooks/legacy/muranoclient-functional-test-mysql-backend/post.yaml deleted file mode 100644 index dac87534..00000000 --- a/playbooks/legacy/muranoclient-functional-test-mysql-backend/post.yaml +++ /dev/null @@ -1,80 +0,0 @@ -- hosts: primary - tasks: - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=**/*nose_results.html - - --include=*/ - - --exclude=* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=**/*testr_results.html.gz - - --include=*/ - - --exclude=* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/.testrepository/tmp* - - --include=*/ - - --exclude=* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=**/*testrepository.subunit.gz - - --include=*/ - - --exclude=* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}/tox' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/.tox/*/log/* - - --include=*/ - - --exclude=* - - --prune-empty-dirs - - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node - synchronize: - src: '{{ ansible_user_dir }}/workspace/' - dest: '{{ zuul.executor.log_root }}' - mode: pull - copy_links: true - verify_host: true - rsync_opts: - - --include=/logs/** - - --include=*/ - - --exclude=* - - --prune-empty-dirs diff --git a/playbooks/legacy/muranoclient-functional-test-mysql-backend/run.yaml b/playbooks/legacy/muranoclient-functional-test-mysql-backend/run.yaml deleted file mode 100644 index 7e203f6f..00000000 --- a/playbooks/legacy/muranoclient-functional-test-mysql-backend/run.yaml +++ /dev/null @@ -1,67 +0,0 @@ -- hosts: all - name: Autoconverted job legacy-muranoclient-dsvm-functional-mysql-backend from old - job gate-muranoclient-dsvm-functional-mysql-backend-ubuntu-xenial - tasks: - - - name: Ensure legacy workspace directory - file: - path: '{{ ansible_user_dir }}/workspace' - state: directory - - - shell: - cmd: | - set -e - set -x - cat > clonemap.yaml << EOF - clonemap: - - name: openstack/devstack-gate - dest: devstack-gate - EOF - /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ - https://opendev.org \ - openstack/devstack-gate - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - export PYTHONUNBUFFERED=true - export DEVSTACK_GATE_NEUTRON=1 - export DEVSTACK_PROJECT_FROM_GIT=python-muranoclient - export BRANCH_OVERRIDE=default - - export ENABLED_SERVICES=tempest - export PROJECTS="openstack/heat $PROJECTS" - export PROJECTS="openstack/python-heatclient $PROJECTS" - export PROJECTS="openstack/murano $PROJECTS" - export PROJECTS="openstack/murano-dashboard $PROJECTS" - export KEEP_LOCALRC=1 - - # Enable murano devstack plugin. Provided repo should be cloned by zuul before devstack run - # and below provided link should not be used. - export DEVSTACK_LOCAL_CONFIG="enable_plugin heat https://opendev.org/openstack/heat" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin murano https://opendev.org/openstack/murano" - - if [ "mysql-backend" = "glare-backend" ]; then - export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_service g-glare" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"MURANO_USE_GLARE=True" - fi - - if [ "$BRANCH_OVERRIDE" != "default" ] ; then - export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE - fi - - function post_test_hook { - # Configure and run functional tests - /opt/stack/new/python-muranoclient/muranoclient/tests/functional/hooks/post_test_hook.sh - } - export -f post_test_hook - - cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh - ./safe-devstack-vm-gate-wrap.sh - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}'