Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Oct 28, 2020
1 parent 6e9732b commit c267b94
Showing 1 changed file with 1 addition and 87 deletions.
88 changes: 1 addition & 87 deletions tests/integration/targets/docker_network/tasks/tests/ipam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,94 +11,8 @@
dnetworks: "{{ dnetworks + [nname_ipam_0, nname_ipam_1, nname_ipam_2, nname_ipam_3] }}"


#################### Deprecated ipam_config ####################

- name: Create network with ipam_config and deprecated ipam_options (conflicting)
docker_network:
name: "{{ nname_ipam_0 }}"
ipam_options:
subnet: 172.3.29.0/24
ipam_config:
- subnet: 172.3.29.0/24
register: network
ignore_errors: yes

- assert:
that:
- network is failed
- "network.msg == 'parameters are mutually exclusive: ipam_config|ipam_options'"

- name: Create network with deprecated custom IPAM options
docker_network:
name: "{{ nname_ipam_0 }}"
ipam_options:
subnet: 172.3.29.0/24
gateway: 172.3.29.2
iprange: 172.3.29.0/26
aux_addresses:
host1: 172.3.29.3
host2: 172.3.29.4
register: network

- assert:
that:
- network is changed

- name: Create network with deprecated custom IPAM options (idempotence)
docker_network:
name: "{{ nname_ipam_0 }}"
ipam_options:
subnet: 172.3.29.0/24
gateway: 172.3.29.2
iprange: 172.3.29.0/26
aux_addresses:
host1: 172.3.29.3
host2: 172.3.29.4
register: network

- assert:
that:
- network is not changed

- name: Change of network created with deprecated custom IPAM options
docker_network:
name: "{{ nname_ipam_0 }}"
ipam_options:
subnet: 172.3.28.0/24
gateway: 172.3.28.2
iprange: 172.3.28.0/26
aux_addresses:
host1: 172.3.28.3
register: network
diff: yes

- assert:
that:
- network is changed
- network.diff.differences | length == 4
- '"ipam_config[0].subnet" in network.diff.differences'
- '"ipam_config[0].gateway" in network.diff.differences'
- '"ipam_config[0].iprange" in network.diff.differences'
- '"ipam_config[0].aux_addresses" in network.diff.differences'

- name: Remove gateway and iprange of network with deprecated custom IPAM options
docker_network:
name: "{{ nname_ipam_0 }}"
ipam_options:
subnet: 172.3.28.0/24
register: network

- assert:
that:
- network is not changed

- name: Cleanup network with deprecated custom IPAM options
docker_network:
name: "{{ nname_ipam_0 }}"
state: absent


#################### IPv4 IPAM config ####################

- name: Create network with custom IPAM config
docker_network:
name: "{{ nname_ipam_1 }}"
Expand Down

0 comments on commit c267b94

Please sign in to comment.