summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_static_routes
diff options
context:
space:
mode:
authorNilashish Chakraborty <nilashishchakraborty8@gmail.com>2024-06-25 14:54:01 +0530
committerGitHub <noreply@github.com>2024-06-25 14:54:01 +0530
commitb872b6f21d14ff10c221d84217eb568318e9ad8b (patch)
tree0aacdea877a7e2b209735cd0f7c0b9d62a9446f7 /tests/integration/targets/vyos_static_routes
parent37baff3d4d547911bec1387218edfd477ca79062 (diff)
downloadvyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.tar.gz
vyos.vyos-b872b6f21d14ff10c221d84217eb568318e9ad8b.zip
`vyos.vyos` is no longer deprecated! 🎉 (#348)
* Remove deprecation notice for vyos.vyos Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * Add changelog Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * fix review comments Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> * chore: auto fixes from pre-commit.com hooks --------- Signed-off-by: NilashishC <nilashishchakraborty8@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'tests/integration/targets/vyos_static_routes')
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/_populate.yaml16
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/deleted_afi.yaml13
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/deleted_all.yaml13
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/empty_config.yaml7
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/gathered.yaml7
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/merged.yaml21
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/overridden.yaml12
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/parsed.yaml8
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/rendered.yaml7
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/replaced.yaml19
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/cli/rtt.yaml11
-rw-r--r--tests/integration/targets/vyos_static_routes/tests/redirection/cli/shortname.yaml21
12 files changed, 50 insertions, 105 deletions
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/_populate.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/_populate.yaml
index 12e43921..fdd6b1ac 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/_populate.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/_populate.yaml
@@ -3,12 +3,14 @@
- name: Setup
vars:
- lines: "set protocols static route 192.0.2.32/28 next-hop '192.0.2.10'\nset\
- \ protocols static route 192.0.2.32/28 next-hop '192.0.2.9'\nset protocols\
- \ static route 192.0.2.32/28 blackhole\nset protocols static route 192.0.2.32/28\n\
- set protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::1'\n\
- set protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::2'\n\
- set protocols static route6 2001:db8:1000::/36 blackhole distance '2'\nset\
- \ protocols static route6 2001:db8:1000::/36\n"
+ lines: >-
+ "set protocols static route 192.0.2.32/28 next-hop '192.0.2.10'\n
+ set protocols static route 192.0.2.32/28 next-hop '192.0.2.9'\n
+ set protocols static route 192.0.2.32/28 blackhole\n
+ set protocols static route 192.0.2.32/28\n
+ set protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::1'\n
+ set protocols static route6 2001:db8:1000::/36 next-hop '2001:db8:2000:2::2'\n
+ set protocols static route6 2001:db8:1000::/36 blackhole distance '2'\n
+ set protocols static route6 2001:db8:1000::/36"
ansible.netcommon.cli_config:
config: "{{ lines }}"
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/deleted_afi.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/deleted_afi.yaml
index 491f9c3b..bcfa0499 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/deleted_afi.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/deleted_afi.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- Start vyos_static_routes deleted integration tests ansible_connection={{
- ansible_connection }}
+ msg: Start vyos_static_routes deleted integration tests ansible_connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -25,14 +23,12 @@
- name: Assert that the correct set of commands were generated
assert:
that:
- - "{{ deleted_afi_all['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that the after dicts were correctly generated
assert:
that:
- - "{{ deleted_afi_all['after'] | symmetric_difference(result['after'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['after'] | symmetric_difference(result['after']) |length == 0 }}"
- name: Delete attributes of given interfaces (IDEMPOTENT)
register: result
@@ -47,7 +43,6 @@
- name: Assert that the before dicts were correctly generated
assert:
that:
- - "{{ deleted_afi_all['after'] | symmetric_difference(result['before'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['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_all.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/deleted_all.yaml
index bddb528c..ebc9192e 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/deleted_all.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/deleted_all.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- Start vyos_static_routes deleted integration tests ansible_connection={{
- ansible_connection }}
+ msg: Start vyos_static_routes deleted integration tests ansible_connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -21,14 +19,12 @@
- name: Assert that the correct set of commands were generated
assert:
that:
- - "{{ deleted_afi_all['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that the after dicts were correctly generated
assert:
that:
- - "{{ deleted_afi_all['after'] | symmetric_difference(result['after'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['after'] | symmetric_difference(result['after']) |length == 0 }}"
- name: Delete attributes of given interfaces (IDEMPOTENT)
register: result
@@ -43,7 +39,6 @@
- name: Assert that the before dicts were correctly generated
assert:
that:
- - "{{ deleted_afi_all['after'] | symmetric_difference(result['before'])\
- \ |length == 0 }}"
+ - "{{ deleted_afi_all['after'] | symmetric_difference(result['before']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/empty_config.yaml
index 6fded87a..31ca9e66 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/empty_config.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/empty_config.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START vyos_static_routes empty_config integration tests on connection={{
- ansible_connection }}
+ msg: START vyos_static_routes empty_config integration tests on connection={{ ansible_connection }}
- name: Merged with empty config should give appropriate error message
register: result
@@ -46,8 +44,7 @@
- assert:
that:
- - result.msg == 'value of running_config parameter must not be empty for state
- parsed'
+ - result.msg == 'value of running_config parameter must not be empty for state parsed'
- name: Rendered with empty config should give appropriate error message
register: result
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/gathered.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/gathered.yaml
index 6b34912b..0af88be3 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/gathered.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/gathered.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START vyos_static_routes gathered integration tests on connection={{ ansible_connection
- }}
+ msg: START vyos_static_routes gathered integration tests on connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -16,8 +14,7 @@
- name: Assert that gathered dicts was correctly generated
assert:
that:
- - "{{ populate | symmetric_difference(result['gathered']) |length == 0\
- \ }}"
+ - "{{ populate | symmetric_difference(result['gathered']) |length == 0 }}"
- name: Gather the existing running configuration (IDEMPOTENT)
register: result
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/merged.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/merged.yaml
index 19e71fae..273f4608 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/merged.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/merged.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START vyos_static_routes merged integration tests on connection={{ ansible_connection
- }}
+ msg: START vyos_static_routes merged integration tests on connection={{ ansible_connection }}
- include_tasks: _remove_config.yaml
@@ -36,25 +34,19 @@
- name: Assert that before dicts were correctly generated
assert:
- that:
- "{{ merged['before'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}"
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ merged['commands'] | symmetric_difference(result['commands']) |length\
- \ == 0 }}"
+ - "{{ merged['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that after dicts was correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}"
- - name:
- Merge the provided configuration with the existing running configuration
- (IDEMPOTENT)
+ - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
register: result
vyos.vyos.vyos_static_routes: *id001
@@ -66,7 +58,6 @@
- name: Assert that before dicts were correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/overridden.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/overridden.yaml
index 9281306f..da5aff47 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/overridden.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/overridden.yaml
@@ -1,7 +1,6 @@
---
- debug:
- msg: START vyos_static_routes overridden integration tests on connection={{
- ansible_connection }}
+ msg: START vyos_static_routes overridden integration tests on connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -26,14 +25,12 @@
- name: Assert that correct commands were generated
assert:
that:
- - "{{ overridden['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
+ - "{{ overridden['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that after dicts were correctly generated
assert:
that:
- - "{{ overridden['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
+ - "{{ overridden['after'] | symmetric_difference(result['after']) |length == 0 }}"
- name: Overrides all device configuration with provided configurations (IDEMPOTENT)
register: result
@@ -47,7 +44,6 @@
- name: Assert that before dicts were correctly generated
assert:
that:
- - "{{ overridden['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ - "{{ overridden['after'] | symmetric_difference(result['before']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/parsed.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/parsed.yaml
index 5776f7f0..9881bd0a 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/parsed.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/parsed.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START vyos_static_routes parsed integration tests on connection={{ ansible_connection
- }}
+ msg: START vyos_static_routes parsed integration tests on connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -23,9 +21,7 @@
- name: Assert that correct parsing done
assert:
- that:
- "{{ ansible_facts['network_resources']['static_routes'] | symmetric_difference(result['parsed'])\
- \ |length == 0 }}"
+ that: "{{ ansible_facts['network_resources']['static_routes'] | symmetric_difference(result['parsed']) |length == 0 }}"
- name: Gather the existing running configuration (IDEMPOTENT)
register: result
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/rendered.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/rendered.yaml
index 4362d1fd..761cff7a 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/rendered.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/rendered.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START vyos_static_routes rendered integration tests on connection={{ ansible_connection
- }}
+ msg: START vyos_static_routes rendered integration tests on connection={{ ansible_connection }}
- include_tasks: _populate.yaml
@@ -37,8 +35,7 @@
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ rendered['commands'] | symmetric_difference(result['rendered'])\
- \ |length == 0 }}"
+ - "{{ rendered['commands'] | symmetric_difference(result['rendered']) |length == 0 }}"
- name: Structure provided configuration into device specific commands (IDEMPOTENT)
register: result
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/replaced.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/replaced.yaml
index 28f80fb1..26150e57 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/replaced.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/replaced.yaml
@@ -1,14 +1,11 @@
---
- debug:
- msg:
- START vyos_static_routes replaced integration tests on connection={{ ansible_connection
- }}
+ msg: START vyos_static_routes replaced integration tests on connection={{ ansible_connection }}
- include_tasks: _populate.yaml
- block:
- - name: Replace device configurations of listed static routes with provided
- configurations
+ - name: Replace device configurations of listed static routes with provided configurations
register: result
vyos.vyos.vyos_static_routes: &id001
config:
@@ -29,8 +26,7 @@
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ replaced['commands'] | symmetric_difference(result['commands'])\
- \ |length == 0 }}"
+ - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that before dicts are correctly generated
assert:
@@ -40,11 +36,9 @@
- name: Assert that after dict is correctly generated
assert:
that:
- - "{{ replaced['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
+ - "{{ replaced['after'] | symmetric_difference(result['after']) |length == 0 }}"
- - name: Replace device configurations of listed static routes with provided
- configurarions (IDEMPOTENT)
+ - name: Replace device configurations of listed static routes with provided configurarions (IDEMPOTENT)
register: result
vyos.vyos.vyos_static_routes: *id001
@@ -56,7 +50,6 @@
- name: Assert that before dict is correctly generated
assert:
that:
- - "{{ replaced['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/cli/rtt.yaml b/tests/integration/targets/vyos_static_routes/tests/cli/rtt.yaml
index 64e8044f..2f8d475b 100644
--- a/tests/integration/targets/vyos_static_routes/tests/cli/rtt.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/cli/rtt.yaml
@@ -1,7 +1,6 @@
---
- debug:
- msg: START vyos_static_routes round trip integration tests on connection={{
- ansible_connection }}
+ msg: START vyos_static_routes round trip integration tests on connection={{ ansible_connection }}
- include_tasks: _remove_config.yaml
@@ -60,9 +59,7 @@
- name: Assert that changes were applied
assert:
- that:
- "{{ round_trip['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
+ that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}"
- name: Revert back to base config using facts round trip
register: revert
@@ -72,8 +69,6 @@
- name: Assert that config was reverted
assert:
- that:
- "{{ base_config['after'] | symmetric_difference(revert['after']) |length\
- \ == 0 }}"
+ that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_static_routes/tests/redirection/cli/shortname.yaml b/tests/integration/targets/vyos_static_routes/tests/redirection/cli/shortname.yaml
index 364866e1..9bf6cbb6 100644
--- a/tests/integration/targets/vyos_static_routes/tests/redirection/cli/shortname.yaml
+++ b/tests/integration/targets/vyos_static_routes/tests/redirection/cli/shortname.yaml
@@ -1,8 +1,6 @@
---
- debug:
- msg:
- START shortname merged integration tests on connection={{ ansible_connection
- }}
+ msg: START shortname merged integration tests on connection={{ ansible_connection }}
- include_tasks: _remove_config.yaml
@@ -36,25 +34,19 @@
- name: Assert that before dicts were correctly generated
assert:
- that:
- "{{ merged['before'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}"
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ merged['commands'] | symmetric_difference(result['commands']) |length\
- \ == 0 }}"
+ - "{{ merged['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
- name: Assert that after dicts was correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['after']) |length\
- \ == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}"
- - name:
- Merge the provided configuration with the existing running configuration
- (IDEMPOTENT)
+ - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
register: result
vyos.vyos.static_routes: *id001
@@ -66,7 +58,6 @@
- name: Assert that before dicts were correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['before']) |length\
- \ == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}"
always:
- include_tasks: _remove_config.yaml