Add integration tests for multi-node-bridge role
Change-Id: I1cf7d5de19b3426a9577b4ecbc3538813a16dfc7
This commit is contained in:
parent
beb0737569
commit
79e2859162
54
tests/multi-node-bridge.yaml
Normal file
54
tests/multi-node-bridge.yaml
Normal file
@ -0,0 +1,54 @@
|
||||
- name: Test the multi-node-bridge role
|
||||
hosts:
|
||||
- switch
|
||||
- peers
|
||||
roles:
|
||||
- multi-node-bridge
|
||||
post_tasks:
|
||||
- become: yes
|
||||
block:
|
||||
- name: openvswitch should be installed
|
||||
package:
|
||||
name: "{{ ovs_package }}"
|
||||
state: installed
|
||||
register: ovs_installed
|
||||
|
||||
- name: openvswitch should be running
|
||||
service:
|
||||
name: "{{ ovs_service }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
register: ovs_running
|
||||
|
||||
- name: bridge should exist
|
||||
openvswitch_bridge:
|
||||
bridge: "{{ bridge_name }}"
|
||||
register: ovs_bridge
|
||||
|
||||
- name: port should exist
|
||||
command: ovs-vsctl show
|
||||
changed_when: false
|
||||
register: ovs_port
|
||||
|
||||
- name: switch should be reachable
|
||||
command: ping -c 4 {{ bridge_address_prefix }}.{{ bridge_address_offset }}
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: ovs_ping_switch
|
||||
|
||||
- name: peer should be reachable
|
||||
command: ping -c 4 {{ bridge_address_prefix }}.{{ bridge_address_offset + 1 }}
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
register: ovs_ping_peer
|
||||
|
||||
- name: assert test results
|
||||
assert:
|
||||
that:
|
||||
- not ovs_installed | changed
|
||||
- not ovs_running | changed
|
||||
- not ovs_bridge | changed
|
||||
- ovs_port.rc == 0
|
||||
- "'Port \"br-infra_' in ovs_port.stdout"
|
||||
- ovs_ping_switch.rc == 0
|
||||
- ovs_ping_peer.rc == 0
|
@ -9,3 +9,4 @@
|
||||
- include: multi-node-known-hosts.yaml
|
||||
- include: multi-node-hosts-file.yaml
|
||||
- include: multi-node-firewall.yaml
|
||||
- include: multi-node-bridge.yaml
|
||||
|
@ -63,6 +63,7 @@
|
||||
- ^roles/configure-unbound/.*
|
||||
- ^roles/fetch-zuul-cloner/.*
|
||||
- ^roles/mirror-info/.*
|
||||
- ^roles/multi-node-bridge/.*
|
||||
- ^roles/multi-node-firewall/.*
|
||||
- ^roles/multi-node-hosts-file/.*
|
||||
- ^roles/multi-node-known-hosts/.*
|
||||
|
Loading…
Reference in New Issue
Block a user