From aa4164ab79e02de02c6d1c1fe34311515956c4b2 Mon Sep 17 00:00:00 2001 From: Saad Zaher Date: Mon, 4 Dec 2017 11:44:32 +0000 Subject: [PATCH] Move freezer-api legacy jobs to project Change-Id: Id2a81947b44748c1931c4ec1be81f994b0643ba5 --- .zuul.yaml | 51 ++++++++++++ devstack/gate_hook.sh | 4 +- freezer_api/tests/unit/test_service.py | 5 +- .../legacy/freezer-api-centos-7/post.yaml | 80 +++++++++++++++++++ .../legacy/freezer-api-centos-7/run.yaml | 69 ++++++++++++++++ .../legacy/freezer-api-opensuse-423/post.yaml | 80 +++++++++++++++++++ .../legacy/freezer-api-opensuse-423/run.yaml | 69 ++++++++++++++++ .../freezer-api-ubuntu-xenial/post.yaml | 80 +++++++++++++++++++ .../legacy/freezer-api-ubuntu-xenial/run.yaml | 69 ++++++++++++++++ 9 files changed, 503 insertions(+), 4 deletions(-) create mode 100644 .zuul.yaml create mode 100644 playbooks/legacy/freezer-api-centos-7/post.yaml create mode 100644 playbooks/legacy/freezer-api-centos-7/run.yaml create mode 100644 playbooks/legacy/freezer-api-opensuse-423/post.yaml create mode 100644 playbooks/legacy/freezer-api-opensuse-423/run.yaml create mode 100644 playbooks/legacy/freezer-api-ubuntu-xenial/post.yaml create mode 100644 playbooks/legacy/freezer-api-ubuntu-xenial/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..f82534de --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,51 @@ +- project: + name: openstack/freezer-api + check: + jobs: + - freezer-api-ubuntu-xenial: + voting: false + - freezer-api-centos-7: + voting: false + - freezer-api-opensuse-423: + voting: false + +- job: + name: freezer-api-ubuntu-xenial + parent: legacy-dsvm-base + run: playbooks/legacy/freezer-api-ubuntu-xenial/run.yaml + post-run: playbooks/legacy/freezer-api-ubuntu-xenial/post.yaml + timeout: 7800 + required-projects: + - openstack-infra/devstack-gate + - openstack/freezer + - openstack/freezer-api + - openstack/freezer-web-ui + - openstack/python-freezerclient + +- job: + name: freezer-api-centos-7 + parent: legacy-dsvm-base + run: playbooks/legacy/freezer-api-centos-7/run.yaml + post-run: playbooks/legacy/freezer-api-centos-7/post.yaml + timeout: 7800 + nodeset: legacy-centos-7 + required-projects: + - openstack-infra/devstack-gate + - openstack/freezer + - openstack/freezer-api + - openstack/freezer-web-ui + - openstack/python-freezerclient + +- job: + name: freezer-api-opensuse-423 + parent: legacy-dsvm-base + run: playbooks/legacy/freezer-api-opensuse-423/run.yaml + post-run: playbooks/legacy/freezer-api-opensuse-423/post.yaml + timeout: 7800 + nodeset: legacy-opensuse-423 + required-projects: + - openstack-infra/devstack-gate + - openstack/freezer + - openstack/freezer-api + - openstack/freezer-web-ui + - openstack/python-freezerclient diff --git a/devstack/gate_hook.sh b/devstack/gate_hook.sh index e86c8f71..6b99b400 100755 --- a/devstack/gate_hook.sh +++ b/devstack/gate_hook.sh @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -set -ex +# set -ex # Install freezer devstack integration #export DEVSTACK_LOCAL_CONFIG="enable_plugin freezer-api https://git.openstack.org/openstack/freezer-api" @@ -23,4 +23,4 @@ export DEVSTACK_GATE_TEMPEST_REGEX="freezer_api_tempest_plugin" export PROJECTS="openstack/python-freezerclient $PROJECTS" # Invoke default behavior. -$BASE/new/devstack-gate/devstack-vm-gate.sh +# $BASE/new/devstack-gate/devstack-vm-gate.sh diff --git a/freezer_api/tests/unit/test_service.py b/freezer_api/tests/unit/test_service.py index b6f09f36..6dea0f13 100644 --- a/freezer_api/tests/unit/test_service.py +++ b/freezer_api/tests/unit/test_service.py @@ -15,19 +15,20 @@ limitations under the License. """ -import unittest import falcon from mock import patch from freezer_api import service +from freezer_api.tests.unit import common -class TestService(unittest.TestCase): +class TestService(common.FreezerBaseTestCase): def setUp(self): self.falcon_versions_hooks = ['0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.1.10'] self.falcon_versions_middleware = ['0.2.0', '0.3.0', '1.0.0'] + super(TestService, self).setUp() @patch('freezer_api.cmd.api.v1') @patch('freezer_api.cmd.api.driver') diff --git a/playbooks/legacy/freezer-api-centos-7/post.yaml b/playbooks/legacy/freezer-api-centos-7/post.yaml new file mode 100644 index 00000000..9156dff2 --- /dev/null +++ b/playbooks/legacy/freezer-api-centos-7/post.yaml @@ -0,0 +1,80 @@ +- 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 \ No newline at end of file diff --git a/playbooks/legacy/freezer-api-centos-7/run.yaml b/playbooks/legacy/freezer-api-centos-7/run.yaml new file mode 100644 index 00000000..0a4af690 --- /dev/null +++ b/playbooks/legacy/freezer-api-centos-7/run.yaml @@ -0,0 +1,69 @@ +- hosts: all + name: Autoconverted job legacy-osbackup-freezer-dsvm-centos7 from old job gate-osbackup-freezer-dsvm-centos7 + 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-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + # enable freezer-agent and freezer-scheduler + enable_plugin freezer git://git.openstack.org/openstack/freezer + # enable freezer-api and python-freezerclient + enable_plugin freezer-api https://git.openstack.org/openstack/freezer-api + # enable freezer-web-ui and python-freezerclient + enable_plugin freezer-web-ui https://git.openstack.org/openstack/freezer-web-ui + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + # checkout freezer components + export PROJECTS="openstack/freezer-api $PROJECTS" + export PROJECTS="openstack/freezer-web-ui $PROJECTS" + export PROJECTS="openstack/freezer $PROJECTS" + export PROJECTS="openstack/python-freezerclient $PROJECTS" + # tempest config + export DEVSTACK_GATE_TEMPEST=1 + export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1 + TEMPEST_REGEX="freezer_api_tempest_plugin" + export DEVSTACK_GATE_TEMPEST_REGEX="freezer_api_tempest_plugin" + + # which repo is being tested + export DEVSTACK_PROJECT_FROM_GIT=freezer-api + + export "OVERRIDE_FREEZER_PROJECT_BRANCH"=$ZUUL_BRANCH + + 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 }}' diff --git a/playbooks/legacy/freezer-api-opensuse-423/post.yaml b/playbooks/legacy/freezer-api-opensuse-423/post.yaml new file mode 100644 index 00000000..9156dff2 --- /dev/null +++ b/playbooks/legacy/freezer-api-opensuse-423/post.yaml @@ -0,0 +1,80 @@ +- 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 \ No newline at end of file diff --git a/playbooks/legacy/freezer-api-opensuse-423/run.yaml b/playbooks/legacy/freezer-api-opensuse-423/run.yaml new file mode 100644 index 00000000..cb7457e0 --- /dev/null +++ b/playbooks/legacy/freezer-api-opensuse-423/run.yaml @@ -0,0 +1,69 @@ +- hosts: all + name: Autoconverted job legacy-osbackup-freezer-dsvm-opensuse-423 from old job gate-osbackup-freezer-dsvm-opensuse-423 + 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-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + # enable freezer-agent and freezer-scheduler + enable_plugin freezer git://git.openstack.org/openstack/freezer + # enable freezer-api and python-freezerclient + enable_plugin freezer-api https://git.openstack.org/openstack/freezer-api + # enable freezer-web-ui and python-freezerclient + enable_plugin freezer-web-ui https://git.openstack.org/openstack/freezer-web-ui + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + # checkout freezer components + export PROJECTS="openstack/freezer-api $PROJECTS" + export PROJECTS="openstack/freezer-web-ui $PROJECTS" + export PROJECTS="openstack/freezer $PROJECTS" + export PROJECTS="openstack/python-freezerclient $PROJECTS" + # tempest config + export DEVSTACK_GATE_TEMPEST=1 + export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1 + TEMPEST_REGEX="freezer_api_tempest_plugin" + export DEVSTACK_GATE_TEMPEST_REGEX="freezer_api_tempest_plugin" + + # which repo is being tested + export DEVSTACK_PROJECT_FROM_GIT=freezer-api + + export "OVERRIDE_FREEZER_PROJECT_BRANCH"=$ZUUL_BRANCH + + 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 }}' diff --git a/playbooks/legacy/freezer-api-ubuntu-xenial/post.yaml b/playbooks/legacy/freezer-api-ubuntu-xenial/post.yaml new file mode 100644 index 00000000..9156dff2 --- /dev/null +++ b/playbooks/legacy/freezer-api-ubuntu-xenial/post.yaml @@ -0,0 +1,80 @@ +- 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 \ No newline at end of file diff --git a/playbooks/legacy/freezer-api-ubuntu-xenial/run.yaml b/playbooks/legacy/freezer-api-ubuntu-xenial/run.yaml new file mode 100644 index 00000000..02c27b65 --- /dev/null +++ b/playbooks/legacy/freezer-api-ubuntu-xenial/run.yaml @@ -0,0 +1,69 @@ +- hosts: all + name: Autoconverted job legacy-osbackup-freezer-dsvm from old job gate-osbackup-freezer-dsvm + 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-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + # enable freezer-agent and freezer-scheduler + enable_plugin freezer git://git.openstack.org/openstack/freezer + # enable freezer-api and python-freezerclient + enable_plugin freezer-api https://git.openstack.org/openstack/freezer-api + # enable freezer-web-ui and python-freezerclient + enable_plugin freezer-web-ui https://git.openstack.org/openstack/freezer-web-ui + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + # checkout freezer components + export PROJECTS="openstack/freezer-api $PROJECTS" + export PROJECTS="openstack/freezer-web-ui $PROJECTS" + export PROJECTS="openstack/freezer $PROJECTS" + export PROJECTS="openstack/python-freezerclient $PROJECTS" + # tempest config + export DEVSTACK_GATE_TEMPEST=1 + export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1 + TEMPEST_REGEX="freezer_api_tempest_plugin" + export DEVSTACK_GATE_TEMPEST_REGEX="freezer_api_tempest_plugin" + + # which repo is being tested + export DEVSTACK_PROJECT_FROM_GIT=freezer-api + + export "OVERRIDE_FREEZER_PROJECT_BRANCH"=$ZUUL_BRANCH + + 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 }}'