diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 00000000..c30b3da8 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,44 @@ +- project: + name: openstack/mogan + check: + jobs: + - mogan-tox-functional + - mogan-dsvm-tempest-plugin + gate: + jobs: + - mogan-tox-functional + - mogan-dsvm-tempest-plugin + +- job: + name: mogan-dsvm-tempest-plugin + parent: legacy-dsvm-base + run: playbooks/legacy/mogan-dsvm-tempest-plugin/run + post-run: playbooks/legacy/mogan-dsvm-tempest-plugin/post + timeout: 3600 + required-projects: + - openstack-infra/devstack-gate + - openstack/ironic + - openstack/ironic-lib + - openstack/ironic-python-agent + - openstack/mogan + - openstack/python-ironicclient + - openstack/python-moganclient + - openstack/tempest + irrelevant-files: + - ^.*\.rst$ + - ^api-ref/.*$ + - ^doc/.*$ + - ^mogan/tests/functional.*$ + - ^mogan/tests/unit.*$ + - ^releasenotes/.*$ + - ^tools/.*$ + - ^tox.ini$ + +- job: + name: mogan-tox-functional + parent: legacy-base + run: playbooks/legacy/mogan-tox-functional/run + post-run: playbooks/legacy/mogan-tox-functional/post + timeout: 2400 + required-projects: + - openstack/requirements diff --git a/playbooks/legacy/mogan-dsvm-tempest-plugin/post.yaml b/playbooks/legacy/mogan-dsvm-tempest-plugin/post.yaml new file mode 100644 index 00000000..dac87534 --- /dev/null +++ b/playbooks/legacy/mogan-dsvm-tempest-plugin/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 diff --git a/playbooks/legacy/mogan-dsvm-tempest-plugin/run.yaml b/playbooks/legacy/mogan-dsvm-tempest-plugin/run.yaml new file mode 100644 index 00000000..0895cf65 --- /dev/null +++ b/playbooks/legacy/mogan-dsvm-tempest-plugin/run.yaml @@ -0,0 +1,69 @@ +- hosts: all + name: Autoconverted job legacy-mogan-dsvm-tempest-plugin from old job gate-mogan-dsvm-tempest-plugin + 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_plugin ironic git://git.openstack.org/openstack/ironic + enable_plugin mogan git://git.openstack.org/openstack/mogan + IRONIC_TEMPEST_WHOLE_DISK_IMAGE=True + IRONIC_USE_RESOURCE_CLASSES=True + + EOF + 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_TEMPEST=1 + export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1 + # Run only mogan tests + export DEVSTACK_GATE_TEMPEST_REGEX="^mogan\." + export DEVSTACK_GATE_IRONIC=1 + export DEVSTACK_GATE_NEUTRON=1 + export DEVSTACK_GATE_VIRT_DRIVER=ironic + export DEVSTACK_GATE_CONFIGDRIVE=1 + export DEVSTACK_GATE_IRONIC_BUILD_RAMDISK=0 + export DEVSTACK_GATE_IRONIC_DRIVER=agent_ipmitool + export PROJECTS="openstack/mogan $PROJECTS" + export PROJECTS="openstack/python-moganclient $PROJECTS" + export PROJECTS="openstack/ironic $PROJECTS" + export PROJECTS="openstack/ironic-lib $PROJECTS" + export PROJECTS="openstack/ironic-python-agent $PROJECTS" + export PROJECTS="openstack/python-ironicclient $PROJECTS" + export OVERRIDE_ENABLED_SERVICES="g-api,g-reg,q-agt,q-dhcp,q-l3,q-svc,key,mysql,rabbit,ir-api,ir-cond,s-account,s-container,s-object,s-proxy,tempest" + + 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/mogan-tox-functional/post.yaml b/playbooks/legacy/mogan-tox-functional/post.yaml new file mode 100644 index 00000000..68fbdf81 --- /dev/null +++ b/playbooks/legacy/mogan-tox-functional/post.yaml @@ -0,0 +1,67 @@ +- 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 diff --git a/playbooks/legacy/mogan-tox-functional/run.yaml b/playbooks/legacy/mogan-tox-functional/run.yaml new file mode 100644 index 00000000..99b013c6 --- /dev/null +++ b/playbooks/legacy/mogan-tox-functional/run.yaml @@ -0,0 +1,86 @@ +- hosts: all + name: Autoconverted job legacy-mogan-tox-functional from old job gate-mogan-tox-functional-ubuntu-xenial + tasks: + + - name: Ensure legacy workspace directory + file: + path: '{{ ansible_user_dir }}/workspace' + state: directory + + - shell: + cmd: | + set -e + set -x + CLONEMAP=`mktemp` + REQS_DIR=`mktemp -d` + function cleanup { + mkdir -p $WORKSPACE + rm -rf $CLONEMAP $REQS_DIR + } + trap cleanup EXIT + cat > $CLONEMAP << EOF + clonemap: + - name: $ZUUL_PROJECT + dest: . + EOF + # zuul cloner works poorly if there are 2 names that are the + # same in here. + if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then + cat >> $CLONEMAP << EOF + - name: openstack/requirements + dest: $REQS_DIR + EOF + fi + /usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \ + git://git.openstack.org $ZUUL_PROJECT openstack/requirements + # REQS_DIR is not set for openstack/requirements and there is also + # no need to copy in this case. + if [[ "$ZUUL_PROJECT" != "openstack/requirements" ]]; then + cp $REQS_DIR/upper-constraints.txt ./ + fi + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + if [ -x tools/test-setup.sh ] ; then + tools/test-setup.sh + fi + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -x + sudo rm -f /etc/sudoers.d/zuul + # Prove that general sudo access is actually revoked + ! sudo -n true + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: /usr/local/jenkins/slave_scripts/run-tox.sh functional + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + OUT=`git ls-files --other --exclude-standard --directory` + if [ -z "$OUT" ]; then + echo "No extra files created during test." + exit 0 + else + echo "The following un-ignored files were created during the test:" + echo "$OUT" + exit 0 # TODO: change to 1 to fail tests. + fi + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}'