summaryrefslogtreecommitdiff
path: root/tests/integration/targets
diff options
context:
space:
mode:
authoransible-zuul[bot] <48994755+ansible-zuul[bot]@users.noreply.github.com>2020-05-07 09:47:35 +0000
committerGitHub <noreply@github.com>2020-05-07 09:47:35 +0000
commit62d621f64c082d889950d48ccf4d1177aa24000a (patch)
treeee5a9a1886d259e892be851cbcf766be7c00ba87 /tests/integration/targets
parent439fcb4bb32f97a4d8f35bb30bc8c888b256476d (diff)
parent3ab82e0e018bf0ca02f14391d03e15b3c259da0a (diff)
downloadvyos-ansible-old-62d621f64c082d889950d48ccf4d1177aa24000a.tar.gz
vyos-ansible-old-62d621f64c082d889950d48ccf4d1177aa24000a.zip
Merge pull request #30 from rohitthakur2590/static_routes_delete_changes
[VyOS]: Static routes Deleted state operation updated Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'tests/integration/targets')
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/deleted.yaml62
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/deleted_nh.yaml68
-rw-r--r--tests/integration/targets/vyos_static_routes/vars/main.yaml26
3 files changed, 1 insertions, 155 deletions
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/deleted.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/deleted.yaml
deleted file mode 100644
index 7f098f5..0000000
--- a/tests/integration/targets/vyos_static_routes/tests/cli/deleted.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
----
-- debug:
- msg: Start vyos_static_routes deleted integration tests ansible_connection={{
- ansible_connection }}
-
-- include_tasks: _populate.yaml
-
-- block:
-
- - name: Delete static route based on destiation.
- register: result
- vyos.vyos.vyos_static_routes: &id001
- config:
-
- - address_families:
-
- - afi: ipv4
- routes:
-
- - dest: 192.0.2.32/28
-
- - afi: ipv6
- routes:
-
- - dest: 2001:db8:1000::/36
- state: deleted
-
- - name: Assert that the before dicts were correctly generated
- assert:
- that:
- - "{{ populate | symmetric_difference(result['before']) |length == 0 }}"
-
- - name: Assert that the correct set of commands were generated
- assert:
- that:
- - "{{ deleted_dest['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
-
- - name: Assert that the after dicts were correctly generated
- assert:
- that:
- - "{{ deleted_dest['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
-
- - name: Delete attributes of given interfaces (IDEMPOTENT)
- register: result
- vyos.vyos.vyos_static_routes: *id001
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - result.changed == false
- - result.commands|length == 0
-
- - name: Assert that the before dicts were correctly generated
- assert:
- that:
- - "{{ deleted_dest['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
- always:
-
- - include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/deleted_nh.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/deleted_nh.yaml
deleted file mode 100644
index f6075d2..0000000
--- a/tests/integration/targets/vyos_static_routes/tests/cli/deleted_nh.yaml
+++ /dev/null
@@ -1,68 +0,0 @@
----
-- debug:
- msg: Start vyos_static_routes deleted integration tests ansible_connection={{
- ansible_connection }}
-
-- include_tasks: _populate.yaml
-
-- block:
-
- - name: Delete static route based on next_hop.
- register: result
- vyos.vyos.vyos_static_routes: &id001
- config:
-
- - address_families:
-
- - afi: ipv4
- routes:
-
- - dest: 192.0.2.32/28
- next_hops:
-
- - forward_router_address: 192.0.2.9
-
- - afi: ipv6
- routes:
-
- - dest: 2001:db8:1000::/36
- next_hops:
-
- - forward_router_address: 2001:db8:2000:2::1
- state: deleted
-
- - name: Assert that the before dicts were correctly generated
- assert:
- that:
- - "{{ populate | symmetric_difference(result['before']) |length == 0 }}"
-
- - name: Assert that the correct set of commands were generated
- assert:
- that:
- - "{{ deleted_nh['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
-
- - name: Assert that the after dicts were correctly generated
- assert:
- that:
- - "{{ deleted_nh['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
-
- - name: Delete attributes of given interfaces (IDEMPOTENT)
- register: result
- vyos.vyos.vyos_static_routes: *id001
-
- - name: Assert that the previous task was idempotent
- assert:
- that:
- - result.changed == false
- - result.commands|length == 0
-
- - name: Assert that the before dicts were correctly generated
- assert:
- that:
- - "{{ deleted_nh['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
- always:
-
- - include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/vars/main.yaml b/tests/integration/targets/vyos_static_routes/vars/main.yaml
index 93b875f..6ce4cea 100644
--- a/tests/integration/targets/vyos_static_routes/vars/main.yaml
+++ b/tests/integration/targets/vyos_static_routes/vars/main.yaml
@@ -94,31 +94,7 @@ rendered:
- set protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::2'
- set protocols static route6 2001:db8:1000::/36 blackhole distance '2'
- set protocols static route6 2001:db8:1000::/36
-deleted_dest:
- commands:
- - delete protocols static route 192.0.2.32/28
- - delete protocols static route6 2001:db8:1000::/36
- after: []
-deleted_nh:
- commands:
- - delete protocols static route 192.0.2.32/28 next-hop '192.0.2.9'
- - delete protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::1'
- after:
- - address_families:
- - afi: ipv4
- routes:
- - dest: 192.0.2.32/28
- blackhole_config:
- type: blackhole
- next_hops:
- - forward_router_address: 192.0.2.10
- - afi: ipv6
- routes:
- - dest: 2001:db8:1000::/36
- blackhole_config:
- distance: 2
- next_hops:
- - forward_router_address: 2001:db8:2000:2::2
+
deleted_afi_all:
commands:
- delete protocols static route