Add a cloud provider and a set of smoketests for the NIOS modules (#40573)

* Add a cloud provider and a set of smoketests for the NIOS modules
This commit is contained in:
jctanner
2018-05-25 08:50:45 -04:00
committed by John R Barker
parent 362e622a4b
commit 1d5fe326e8
34 changed files with 562 additions and 37 deletions

View File

@@ -1 +1,3 @@
unsupported
posix/ci/cloud/group4/nios
cloud/nios
destructive

View File

@@ -1,2 +0,0 @@
---
- { include: cli.yaml, tags: ['cli'] }

View File

@@ -0,0 +1 @@
- include: nios_dns_view_idempotence.yml

View File

@@ -0,0 +1,58 @@
- name: delete dns view instance
nios_dns_view:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
- name: configure a new dns view instance
nios_dns_view:
name: ansible-dns
state: present
provider: "{{ nios_provider }}"
register: nios_dns_create1
- name: configure a new dns view instance
nios_dns_view:
name: ansible-dns
state: present
provider: "{{ nios_provider }}"
register: nios_dns_create2
- name: update the comment for dns view
nios_dns_view:
name: ansible-dns
comment: this is an example comment
state: present
provider: "{{ nios_provider }}"
register: nios_dns_update1
- name: update the comment for dns view
nios_dns_view:
name: ansible-dns
comment: this is an example comment
state: present
provider: "{{ nios_provider }}"
register: nios_dns_update2
- name: delete dns view instance
nios_dns_view:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
register: nios_dns_delete1
- name: delete dns view instance
nios_dns_view:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
register: nios_dns_delete2
- assert:
that:
- "nios_dns_create1.changed"
- "not nios_dns_create2.changed"
- "nios_dns_update1.changed"
- "not nios_dns_update2.changed"
- "nios_dns_delete1.changed"
- "not nios_dns_delete2.changed"

View File

@@ -1 +1,3 @@
unsupported
posix/ci/cloud/group4/nios
cloud/nios
destructive

View File

@@ -1,22 +0,0 @@
---
- name: collect all cli test cases
find:
paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml"
register: test_cases
delegate_to: localhost
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} "
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run
- name: run test case (connection=local)
include: "{{ test_case_to_run }} ansible_connection=local"
with_first_found: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View File

@@ -1,2 +0,0 @@
---
- { include: cli.yaml, tags: ['cli'] }

View File

@@ -0,0 +1 @@
- include: nios_host_record_idempotence.yml

View File

@@ -0,0 +1,85 @@
- name: cleanup the parent object
nios_zone:
name: ansible.com
state: absent
provider: "{{ nios_provider }}"
- name: create the parent object
nios_zone:
name: ansible.com
state: present
provider: "{{ nios_provider }}"
- name: cleanup ipv4 host record
nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
state: absent
provider: "{{ nios_provider }}"
- name: create an ipv4 host record
nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
state: present
provider: "{{ nios_provider }}"
register: ipv4_create1
- name: recreate an ipv4 host record
nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
state: present
provider: "{{ nios_provider }}"
register: ipv4_create2
- assert:
that:
- "ipv4_create1.changed"
- "not ipv4_create2.changed"
- name: add a comment to an existing host record
nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
comment: this is a test comment
state: present
provider: "{{ nios_provider }}"
register: ipv4_update1
- name: add a comment to an existing host record
nios_host_record:
name: host.ansible.com
ipv4:
- address: 192.168.10.1
comment: this is a test comment
state: present
provider: "{{ nios_provider }}"
register: ipv4_update2
- name: remove a host record from the system
nios_host_record:
name: host.ansible.com
state: absent
provider: "{{ nios_provider }}"
register: ipv4_delete1
- name: remove a host record from the system
nios_host_record:
name: host.ansible.com
state: absent
provider: "{{ nios_provider }}"
register: ipv4_delete2
- assert:
that:
- "ipv4_create1.changed"
- "not ipv4_create2.changed"
- "ipv4_update1.changed"
- "not ipv4_update2.changed"
- "ipv4_delete1.changed"
- "not ipv4_delete2.changed"

View File

@@ -1 +1,3 @@
unsupported
posix/ci/cloud/group4/nios
cloud/nios
destructive

View File

@@ -1,2 +0,0 @@
---
- { include: cli.yaml, tags: ['cli'] }

View File

@@ -0,0 +1 @@
- include: nios_network_idempotence.yml

View File

@@ -0,0 +1,80 @@
- name: cleanup a network ipv4
nios_network:
network: 192.168.10.0/24
comment: this is a test comment
state: absent
provider: "{{ nios_provider }}"
- name: configure a network ipv4
nios_network:
network: 192.168.10.0/24
comment: this is a test comment
state: present
provider: "{{ nios_provider }}"
register: nios_ipv4_create1
- name: configure a network ipv4
nios_network:
network: 192.168.10.0/24
comment: this is a test comment
state: present
provider: "{{ nios_provider }}"
register: nios_ipv4_create2
#- assert:
# that:
# - "nios_ipv4_create1.changed"
# - "not nios_ipv4_create2.changed"
- name: set dhcp options for a network ipv4
nios_network:
network: 192.168.10.0/24
comment: this is a test comment
options:
- name: domain-name
value: ansible.com
state: present
provider: "{{ nios_provider }}"
register: nios_ipv4_update1
- name: set dhcp options for a network ipv4
nios_network:
network: 192.168.10.0/24
comment: this is a test comment
options:
- name: domain-name
value: ansible.com
state: present
provider: "{{ nios_provider }}"
register: nios_ipv4_update2
- name: remove a network ipv4
nios_network:
network: 192.168.10.0/24
state: absent
provider: "{{ nios_provider }}"
register: nios_ipv4_remove1
- name: remove a network ipv4
nios_network:
network: 192.168.10.0/24
state: absent
provider: "{{ nios_provider }}"
register: nios_ipv4_remove2
- name: configure a network ipv6
nios_network:
network: fe80::/64
comment: this is a test comment
state: present
provider: "{{ nios_provider }}"
register: nios_ipv6_create1
- assert:
that:
- "nios_ipv4_create1.changed"
- "not nios_ipv4_create2.changed"
- "nios_ipv4_update1.changed"
- "not nios_ipv4_update2.changed"
- "nios_ipv4_remove1.changed"
- "not nios_ipv4_remove2.changed"

View File

@@ -1 +1,3 @@
unsupported
posix/ci/cloud/group4/nios
cloud/nios
destructive

View File

@@ -1,2 +0,0 @@
---
- { include: cli.yaml, tags: ['cli'] }

View File

@@ -0,0 +1 @@
- include: nios_network_view_idempotence.yml

View File

@@ -0,0 +1,58 @@
- name: cleanup a new network view
nios_network_view:
name: ansible
state: absent
provider: "{{ nios_provider }}"
- name: configure a new network view
nios_network_view:
name: ansible
state: present
provider: "{{ nios_provider }}"
register: nios_network_view_create1
- name: configure a new network view
nios_network_view:
name: ansible
state: present
provider: "{{ nios_provider }}"
register: nios_network_view_create2
- name: update the comment for network view
nios_network_view:
name: ansible
comment: this is an example comment
state: present
provider: "{{ nios_provider }}"
register: nios_network_view_update1
- name: update the comment for network view
nios_network_view:
name: ansible
comment: this is an example comment
state: present
provider: "{{ nios_provider }}"
register: nios_network_view_update2
- name: remove the network view
nios_network_view:
name: ansible
state: absent
provider: "{{ nios_provider }}"
register: nios_network_view_delete1
- name: remove the network view
nios_network_view:
name: ansible
state: absent
provider: "{{ nios_provider }}"
register: nios_network_view_delete2
- assert:
that:
- "nios_network_view_create1.changed"
- "not nios_network_view_create2.changed"
- "nios_network_view_update1.changed"
- "not nios_network_view_update2.changed"
- "nios_network_view_delete1.changed"
- "not nios_network_view_delete2.changed"

View File

@@ -1 +1,3 @@
unsupported
posix/ci/cloud/group4/nios
cloud/nios
destructive

View File

@@ -1,2 +0,0 @@
---
- { include: cli.yaml, tags: ['cli'] }

View File

@@ -0,0 +1 @@
- include: nios_zone_idempotence.yml

View File

@@ -0,0 +1,68 @@
- name: cleanup dns view instance
nios_dns_view:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
- name: cleanup test zone
nios_zone:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
- name: configure a zone on the system
nios_zone:
name: ansible-dns
state: present
provider: "{{ nios_provider }}"
register: zone_create1
- name: configure a zone on the system
nios_zone:
name: ansible-dns
state: present
provider: "{{ nios_provider }}"
register: zone_create2
- name: update the comment and ext attributes for an existing zone
nios_zone:
name: ansible-dns
comment: this is an example comment
extattrs:
Site: west-dc
state: present
provider: "{{ nios_provider }}"
register: zone_update1
- name: update the comment and ext attributes for an existing zone
nios_zone:
name: ansible-dns
comment: this is an example comment
extattrs:
Site: west-dc
state: present
provider: "{{ nios_provider }}"
register: zone_update2
- name: remove the dns zone
nios_zone:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
register: zone_delete1
- name: remove the dns zone
nios_zone:
name: ansible-dns
state: absent
provider: "{{ nios_provider }}"
register: zone_delete2
- assert:
that:
- "zone_create1.changed"
- "not zone_create2.changed"
- "zone_update1.changed"
- "not zone_update2.changed"
- "zone_delete1.changed"
- "not zone_delete2.changed"

View File

@@ -0,0 +1,7 @@
- name: create the provider credentials from the cloud script
set_fact:
nios_provider:
host: "{{ lookup('env', 'NIOS_HOST') }}"
username: admin
password: infoblox
- debug: var=nios_provider