diff options
author | Nilashish Chakraborty <nilashishchakraborty8@gmail.com> | 2024-06-25 14:54:01 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-25 14:54:01 +0530 |
commit | b872b6f21d14ff10c221d84217eb568318e9ad8b (patch) | |
tree | 0aacdea877a7e2b209735cd0f7c0b9d62a9446f7 /tests/integration/targets/vyos_l3_interfaces | |
parent | 37baff3d4d547911bec1387218edfd477ca79062 (diff) | |
download | vyos.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_l3_interfaces')
11 files changed, 35 insertions, 75 deletions
diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml index 2a766d5d..6f6c5066 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml @@ -3,10 +3,11 @@ - name: Setup vars: - lines: - "set interfaces ethernet eth1 address '192.0.2.14/24'\nset interfaces\ - \ ethernet eth2 address '192.0.2.10/24'\nset interfaces ethernet eth2 address\ - \ '192.0.2.11/24'\nset interfaces ethernet eth2 address '2001:db8::10/32'\n\ - set interfaces ethernet eth2 address '2001:db8::12/32'\n" + lines: |- + set interfaces ethernet eth1 address '192.0.2.14/24' + set interfaces ethernet eth2 address '192.0.2.10/24' + set interfaces ethernet eth2 address '192.0.2.11/24' + set interfaces ethernet eth2 address '2001:db8::10/32' + set interfaces ethernet eth2 address '2001:db8::12/32' ansible.netcommon.cli_config: config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_remove_config.yaml index c5acac9c..aa5a628f 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_remove_config.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_remove_config.yaml @@ -1,9 +1,7 @@ --- - name: Remove Config vars: - lines: - "delete interfaces ethernet \"{{ intf }}\" address\ndelete interfaces\ - \ ethernet \"{{ intf }}\" vif\n" + lines: "delete interfaces ethernet \"{{ intf }}\" address\ndelete interfaces ethernet \"{{ intf }}\" vif\n" loop: - eth1 - eth2 diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml index 9242fb51..df21b431 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_interfaces deleted integration tests ansible_connection={{ ansible_connection - }} + msg: START vyos_interfaces deleted integration tests ansible_connection={{ ansible_connection }} - include_tasks: _populate.yaml @@ -24,14 +22,12 @@ - name: Assert that the correct set of commands were generated assert: that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length\ - \ == 0 }}" + - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}" - name: Assert that the after dicts were correctly generated assert: that: - - "{{ deleted['after'] | symmetric_difference(result['after']) |length\ - \ == 0 }}" + - "{{ deleted['after'] | symmetric_difference(result['after']) |length == 0 }}" - name: Delete attributes of given interfaces (IDEMPOTENT) register: result @@ -45,7 +41,6 @@ - name: Assert that the before dicts were correctly generated assert: that: - - "{{ deleted['after'] | symmetric_difference(result['before']) |length\ - \ == 0 }}" + - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml index 15393fb2..94b6c135 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces empty_config integration tests on connection={{ - ansible_connection }} + msg: START vyos_l3_interfaces 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_l3_interfaces/tests/cli/gathered.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/gathered.yaml index f18f7d37..41a53d87 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/gathered.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/gathered.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces gathered integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_interfaces 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_l3_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml index d1f7bf0a..4ec4d0f2 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection }} - include_tasks: _remove_config.yaml @@ -30,25 +28,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_l3_interfaces: *id001 @@ -60,7 +52,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_l3_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml index c12e2ae6..8334a610 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_interfaces merged integration tests on connection={{ ansible_connection }} - include_tasks: _populate.yaml @@ -28,14 +26,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 @@ -49,7 +45,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_l3_interfaces/tests/cli/parsed.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/parsed.yaml index 6640271b..969359ff 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/parsed.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/parsed.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_nterfaces parsed integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_nterfaces parsed integration tests on connection={{ ansible_connection }} - name: Parse externally provided interfaces config to agnostic model register: result @@ -13,5 +11,4 @@ - name: Assert that config was correctly parsed assert: that: - - "{{ parsed['after'] | symmetric_difference(result['parsed']) |length ==\ - \ 0 }}" + - "{{ parsed['after'] | symmetric_difference(result['parsed']) |length == 0 }}" diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/rendered.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/rendered.yaml index 2a606c30..199879f4 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/rendered.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/rendered.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces rendered integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_interfaces rendered integration tests on connection={{ ansible_connection }} - include_tasks: _populate.yaml @@ -26,8 +24,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_l3_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml index 26fe4f8e..502175fc 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_l3_interfaces replaced integration tests on connection={{ ansible_connection - }} + msg: START vyos_l3_interfaces replaced integration tests on connection={{ ansible_connection }} - include_tasks: _populate.yaml @@ -23,8 +21,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: @@ -34,12 +31,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 interfaces with provided configurarions - (IDEMPOTENT) + - name: Replace device configurations of listed interfaces with provided configurarions (IDEMPOTENT) register: result vyos.vyos.vyos_l3_interfaces: *id001 @@ -51,7 +45,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_l3_interfaces/tests/redirection/cli/shortname.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/redirection/cli/shortname.yaml index 963ab55a..6debbeee 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/redirection/cli/shortname.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/redirection/cli/shortname.yaml @@ -24,8 +24,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 |