From 5d2f83201479a3a8201eb56ae31002410e7004d1 Mon Sep 17 00:00:00 2001 From: "rafael@valletech.eu" Date: Fri, 11 Sep 2020 11:15:02 +0200 Subject: [PATCH] implementing tests for specific IP assingment to network --- .../targets/cs_ip_address/tasks/network.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/integration/targets/cs_ip_address/tasks/network.yml b/tests/integration/targets/cs_ip_address/tasks/network.yml index e87ff972..4a7499e0 100644 --- a/tests/integration/targets/cs_ip_address/tasks/network.yml +++ b/tests/integration/targets/cs_ip_address/tasks/network.yml @@ -222,12 +222,70 @@ - ip_address is successful - ip_address is not changed +- name: test associate specifc ip address + cs_ip_address: + ip_address: 192.168.2.199 + network: ipaddr_test_network + zone: "{{ cs_common_zone_adv }}" + register: specific_ip_address + +- name: verify test associate specifc ip address + assert: + that: + - specific_ip_address is successful + - specific_ip_address is changed + - specific_ip_address.ip_address == "192.168.2.199" + +- name: test associate specific ip idempotence + cs_ip_address: + ip_address: 192.168.2.199 + network: ipaddr_test_network + zone: "{{ cs_common_zone_adv }}" + register: specific_ip_address + +- name: verify test associate specifc ip address idempotence + assert: + that: + - specific_ip_address is successful + - specific_ip_address is not changed + - specific_ip_address.ip_address == "192.168.2.199" + +- name: test dissasociate specific ip + cs_ip_address: + state: absent + ip_address: 192.168.2.199 + network: ipaddr_test_network + zone: "{{ cs_common_zone_adv }}" + register: specific_ip_address + +- name: verify test dissasociate specific ip + assert: + that: + - specific_ip_address is successful + - specific_ip_address is changed + - specific_ip_address.ip_address == "192.168.2.199" + +- name: test dissasociate specific ip idempotence + cs_ip_address: + state: absent + ip_address: 192.168.2.199 + network: ipaddr_test_network + zone: "{{ cs_common_zone_adv }}" + register: specific_ip_address + +- name: verify test dissasociate specific ip idempotence + assert: + that: + - specific_ip_address is successful + - specific_ip_address is not changed + - name: cleanup instance cs_instance: name: "{{ cs_resource_prefix }}-vm-cs-ip-address" zone: "{{ cs_common_zone_adv }}" state: expunged register: instance + - name: verify instance cleanup assert: that: