diff options
author | René Moser <mail@renemoser.net> | 2018-02-04 19:23:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-04 19:23:57 +0100 |
commit | 588cd749ac460d559dad4e83c435af0b286e0216 (patch) | |
tree | 16c94457f6840a0ee8eee3aaf49719581d362149 /test/integration/targets | |
parent | VMware: Refactor vmware_vmkernel module (#35531) (diff) | |
download | ansible-588cd749ac460d559dad4e83c435af0b286e0216.tar.xz ansible-588cd749ac460d559dad4e83c435af0b286e0216.zip |
cs_network: implement support acl (#35706)
Diffstat (limited to 'test/integration/targets')
4 files changed, 306 insertions, 0 deletions
diff --git a/test/integration/targets/cs_network/aliases b/test/integration/targets/cs_network/aliases new file mode 100644 index 0000000000..ee8454c6d1 --- /dev/null +++ b/test/integration/targets/cs_network/aliases @@ -0,0 +1,2 @@ +cloud/cs +posix/ci/cloud/group1/cs diff --git a/test/integration/targets/cs_network/meta/main.yml b/test/integration/targets/cs_network/meta/main.yml new file mode 100644 index 0000000000..e9a5b9eeae --- /dev/null +++ b/test/integration/targets/cs_network/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - cs_common diff --git a/test/integration/targets/cs_network/tasks/main.yml b/test/integration/targets/cs_network/tasks/main.yml new file mode 100644 index 0000000000..cfe24c41fb --- /dev/null +++ b/test/integration/targets/cs_network/tasks/main.yml @@ -0,0 +1,3 @@ +--- + +- include_tasks: vpc_network_tier.yml diff --git a/test/integration/targets/cs_network/tasks/vpc_network_tier.yml b/test/integration/targets/cs_network/tasks/vpc_network_tier.yml new file mode 100644 index 0000000000..c53faf1a87 --- /dev/null +++ b/test/integration/targets/cs_network/tasks/vpc_network_tier.yml @@ -0,0 +1,298 @@ +--- +- name: setup cleanup vpc network tier + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + vpc: vpc_network_test + state: absent + ignore_errors: yes + +- name: setup cleanup existing vpc + cs_vpc: + name: vpc_network_test + zone: "{{ cs_common_zone_adv }}" + state: absent + register: vpc +- name: verify cleanup existing vpc + assert: + that: + - vpc is successful + +- name: setup vpc + cs_vpc: + name: vpc_network_test + cidr: 10.43.0.0/16 + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + register: vpc +- name: verify setup vpc + assert: + that: + - vpc is successful + +- name: setup network acl + cs_network_acl: + name: my_network_acl1 + vpc: vpc_network_test + zone: "{{ cs_common_zone_adv }}" + register: acl +- name: verify setup network acl + assert: + that: + - acl is successful + +- name: setup network acl rule + cs_network_acl_rule: + network_acl: my_network_acl1 + rule_position: 1 + vpc: vpc_network_test + traffic_type: ingress + action_policy: allow + port: 80 + cidr: 0.0.0.0/0 + zone: "{{ cs_common_zone_adv }}" + register: acl_rule +- name: verify setup network acl rule + assert: + that: + - acl_rule is successful + +- name: setup vpc network tier + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + vpc: vpc_network_test + state: absent + register: network +- name: verify setup vpc network tier + assert: + that: + - network is successful + +- name: test fail vpc network tier if vpc not given + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + acl: my_network_acl1 + check_mode: yes + register: network + ignore_errors: yes +- name: verify test fail vpc network tier if vpc not given + assert: + that: + - network is failed + - "network.msg == 'Missing required params: vpc'" + +- name: test create a vpc network tier in check mode + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + check_mode: yes + register: network +- name: verify test create a vpc network tier in check mode + assert: + that: + - network is changed + +- name: test create a vpc network tier + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + register: network +- name: verify test create a vpc network tier + assert: + that: + - network is changed + - network.acl_type == 'Account' + - not network.acl + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test create a vpc network tier idempotence + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + register: network +- name: verify test create a vpc network tier idempotence + assert: + that: + - network is not changed + - network.acl_type == 'Account' + - not network.acl + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test update a vpc network tier in check mode + cs_network: + name: vpc tier 1 + display_text: vpc tier 1 description + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + acl: my_network_acl1 + check_mode: yes + register: network +- name: verify test update a vpc network tier in check mode + assert: + that: + - network is changed + - network.acl_type == 'Account' + - network.acl == 'my_network_acl1' + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test update a vpc network tier + cs_network: + name: vpc tier 1 + display_text: vpc tier 1 description + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + acl: my_network_acl1 + register: network +- name: verify test update a vpc network tier + assert: + that: + - network is changed + - network.acl_type == 'Account' + - network.acl == 'my_network_acl1' + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1 description' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test update a vpc network tier idempotence + cs_network: + name: vpc tier 1 + display_text: vpc tier 1 description + zone: "{{ cs_common_zone_adv }}" + network_domain: cs2sandbox.simulator.example.com + vpc: vpc_network_test + network_offering: DefaultIsolatedNetworkOfferingForVpcNetworks + gateway: 10.43.0.1 + netmask: 255.255.255.0 + acl: my_network_acl1 + register: network +- name: verify test update a vpc network tier idempotence + assert: + that: + - network is not changed + - network.acl_type == 'Account' + - network.acl == 'my_network_acl1' + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1 description' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test absent a vpc network tier in check mode + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + vpc: vpc_network_test + state: absent + register: network + check_mode: yes +- name: verify test absent a vpc network tier in check mode + assert: + that: + - network is changed + - network.acl_type == 'Account' + - network.acl == 'my_network_acl1' + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1 description' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test absent a vpc network tier + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + vpc: vpc_network_test + state: absent + register: network +- name: verify test absent a vpc network tier + assert: + that: + - network is changed + - network.acl_type == 'Account' + - network.acl == 'my_network_acl1' + - network.broadcast_domain_type == 'Vlan' + - network.cidr == '10.43.0.0/24' + - network.gateway == '10.43.0.1' + - network.display_text == 'vpc tier 1 description' + - network.network_offering == 'DefaultIsolatedNetworkOfferingForVpcNetworks' + - network.vpc == 'vpc_network_test' + - network.network_domain == 'cs2sandbox.simulator.example.com' + +- name: test absent a vpc network tier idempotence + cs_network: + name: vpc tier 1 + zone: "{{ cs_common_zone_adv }}" + vpc: vpc_network_test + state: absent + register: network +- name: verify test absent a vpc network tier idempotence + assert: + that: + - network is not changed + +- name: cleanup vpc + cs_vpc: + name: vpc_network_test + cidr: 10.43.0.0/16 + zone: "{{ cs_common_zone_adv }}" + state: absent + register: vpc +- name: verify cleanup vpc + assert: + that: + - vpc is successful |