Add multinode integration jobs and integration tests for known_hosts

This adds the required framework to test the 'multinode' job and adds
a first integration tested role: multi-node-known-hosts.
The groups 'switch' and 'peers' are bound to be used when integration
testing the 'multi-node-bridge' role.

Change-Id: Ia84189ce3e1b273ca8509d2a9796970750191977
Depends-On: Ia7480dab0f357b5710d1962a40499381837942b3
This commit is contained in:
David Moreau-Simard 2017-09-17 11:06:35 -04:00
parent b1912315cb
commit c588aebca3
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
4 changed files with 157 additions and 0 deletions

View File

@ -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 }}"

5
tests/multinode.yaml Normal file
View File

@ -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

View File

@ -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

View File

@ -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