diff --git a/tests/multi-node-known-hosts.yaml b/tests/multi-node-known-hosts.yaml new file mode 100644 index 00000000..f965329b --- /dev/null +++ b/tests/multi-node-known-hosts.yaml @@ -0,0 +1,27 @@ +- name: Test the multi-node-known-hosts role + hosts: all + roles: + - multi-node-known-hosts + post_tasks: + - name: lookup known_hosts file + command: cat ~/.ssh/known_hosts + register: known_hosts + + - name: Set up host addresses + set_fact: + host_addresses: > + {% set hosts = [] -%} + {% for host, vars in hostvars.items() -%} + {% set _ = hosts.append(vars['nodepool']['private_ipv4']) -%} + {% set _ = hosts.append(vars['nodepool']['public_ipv4']) -%} + {% if vars['nodepool']['public_ipv6'] != '' -%} + {% set _ = hosts.append(vars['nodepool']['public_ipv6']) -%} + {% endif -%} + {% endfor -%} + {{- hosts | sort | unique -}} + + - name: assert that hosts are in known_hosts + assert: + that: + - "item in known_hosts.stdout" + with_items: "{{ host_addresses }}" diff --git a/tests/multinode.yaml b/tests/multinode.yaml new file mode 100644 index 00000000..052954b9 --- /dev/null +++ b/tests/multinode.yaml @@ -0,0 +1,5 @@ +# 'base' is implicit and runs before multi-node roles +- include: base.yaml + +# Roles that are part of the 'multinode' job +- include: multi-node-known-hosts.yaml diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 5fdcd6de..e3b91aea 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -43,6 +43,119 @@ parent: base-integration nodeset: ubuntu-xenial +- job: + name: multinode-integration + description: | + Runs roles that are included by default in the 'multinode' job in order + to prevent regressions. + parent: base-minimal + roles: + - zuul: openstack-infra/zuul-jobs + run: tests/multinode + +- job: + name: multinode-integration-centos-7 + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: centos-7 + - name: secondary + label: centos-7 + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + +- job: + name: multinode-integration-debian-jessie + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: debian-jessie + - name: secondary + label: debian-jessie + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + +- job: + name: multinode-integration-fedora-26 + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: fedora-26 + - name: secondary + label: fedora-26 + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + +- job: + name: multinode-integration-opensuse423 + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: opensuse-423 + - name: secondary + label: opensuse-423 + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + +- job: + name: multinode-integration-ubuntu-trusty + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: ubuntu-trusty + - name: secondary + label: ubuntu-trusty + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + +- job: + name: multinode-integration-ubuntu-xenial + parent: multinode-integration + nodeset: + nodes: + - name: primary + label: ubuntu-xenial + - name: secondary + label: ubuntu-xenial + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary + + - job: name: build-openstack-sphinx-docs parent: tox-docs diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 1c4ba5bc..7f4ae5e2 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -10,6 +10,12 @@ - base-integration-ubuntu-trusty - base-integration-ubuntu-xenial - base-integration-opensuse423 + - multinode-integration-centos-7 + - multinode-integration-debian-jessie + - multinode-integration-fedora-26 + - multinode-integration-ubuntu-trusty + - multinode-integration-ubuntu-xenial + - multinode-integration-opensuse423 - build-openstack-sphinx-docs - tox-linters gate: @@ -19,5 +25,11 @@ - base-integration-ubuntu-trusty - base-integration-ubuntu-xenial - base-integration-opensuse423 + - multinode-integration-centos-7 + - multinode-integration-debian-jessie + - multinode-integration-fedora-26 + - multinode-integration-ubuntu-trusty + - multinode-integration-ubuntu-xenial + - multinode-integration-opensuse423 - build-openstack-sphinx-docs - tox-linters