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_lldp_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_lldp_interfaces')
12 files changed, 51 insertions, 100 deletions
diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml index 2c6782bd..5ed9e981 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate.yaml @@ -3,13 +3,14 @@ - name: Setup vars: - lines: - "set service lldp interface eth1\nset service lldp interface eth1 location\ - \ civic-based country-code US\nset service lldp interface eth1 location civic-based\ - \ ca-type 0 ca-value ENGLISH\nset service lldp interface eth2\nset service\ - \ lldp interface eth2 location coordinate-based latitude 33.524449N\nset service\ - \ lldp interface eth2 location coordinate-based altitude 2200\nset service\ - \ lldp interface eth2 location coordinate-based datum WGS84\nset service lldp\ - \ interface eth2 location coordinate-based longitude 222.267255W\n" + lines: >- + "set service lldp interface eth1\nset service lldp interface eth1 location + civic-based country-code US\nset service lldp interface eth1 location + civic-based ca-type 0 ca-value ENGLISH\nset service lldp interface + eth2\nset service lldp interface eth2 location coordinate-based latitude + 33.524449N\nset service lldp interface eth2 location coordinate-based + altitude 2200\nset service lldp interface eth2 location coordinate-based + datum WGS84\nset service lldp interface eth2 location coordinate-based + longitude 222.267255W\n" ansible.netcommon.cli_config: config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml index 208f21ea..c1e3a8c5 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_populate_intf.yaml @@ -1,9 +1,10 @@ --- - name: Setup vars: - lines: - "set service lldp interface eth2\nset service lldp interface eth2 location\ - \ civic-based country-code US\nset service lldp interface eth2 location civic-based\ - \ ca-type 0 ca-value ENGLISH\nset service lldp interface eth2 disable\n" + lines: >- + "set service lldp interface eth2 + \nset service lldp interface eth2 location civic-based country-code US + \nset service lldp interface eth2 location civic-based ca-type 0 ca-value ENGLISH + \nset service lldp interface eth2 disable" ansible.netcommon.cli_config: config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml index 776fa22d..c5227047 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces deleted integration tests ansible_connection={{ - ansible_connection }} + msg: START vyos_lldp_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 @@ -46,7 +42,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_lldp_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml index 6c097e31..209f8282 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces empty_config integration tests on connection={{ - ansible_connection }} + msg: START vyos_lldp_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_lldp_interfaces/tests/cli/gathered.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml index 216f2d12..7b8e778d 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/gathered.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces gathered integration tests on connection={{ ansible_connection - }} + msg: START vyos_lldp_interfaces gathered integration tests on connection={{ ansible_connection }} - include_tasks: _populate.yaml @@ -16,7 +14,6 @@ - name: Assert that gathered dicts was correctly generated assert: that: - - "{{ populate | symmetric_difference(result['gathered']) |length == 0\ - \ }}" + - "{{ populate | symmetric_difference(result['gathered']) |length == 0 }}" always: - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml index 30c46ec2..ecf75974 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces merged integration tests on connection={{ ansible_connection - }} + msg: START vyos_lldp_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_lldp_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_lldp_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml index e077e010..70504817 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces overridden integration tests on connection={{ - ansible_connection }} + msg: START vyos_lldp_interfaces overridden integration tests on connection={{ ansible_connection }} - include_tasks: _remove_config.yaml @@ -21,20 +19,17 @@ - name: Assert that before dicts were correctly generated assert: that: - - "{{ populate_intf | symmetric_difference(result['before']) |length ==\ - \ 0 }}" + - "{{ populate_intf | symmetric_difference(result['before']) |length == 0 }}" - 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 @@ -48,7 +43,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_lldp_interfaces/tests/cli/parsed.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml index a32e9d54..c3129340 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/parsed.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_nterfaces parsed integration tests on connection={{ ansible_connection - }} + msg: START vyos_lldp_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_lldp_interfaces/tests/cli/rendered.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml index 87bed904..3eb25386 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rendered.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces rendered integration tests on connection={{ ansible_connection - }} + msg: START vyos_lldp_interfaces rendered integration tests on connection={{ ansible_connection }} - include_tasks: _remove_config.yaml @@ -30,7 +28,6 @@ - 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 }}" always: - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml index 46c91cf3..e914c990 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml @@ -1,14 +1,11 @@ --- - debug: - msg: START vyos_lldp_interfaces replaced integration tests on connection={{ - ansible_connection }} + msg: START vyos_lldp_interfaces replaced integration tests on connection={{ ansible_connection }} - include_tasks: _populate.yaml - block: - - name: - Replace device configurations of listed LLDP interfaces with provided - configurations + - name: Replace device configurations of listed LLDP interfaces with provided configurations register: result vyos.vyos.vyos_lldp_interfaces: &id001 config: @@ -34,8 +31,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: @@ -45,12 +41,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 LLDP interfaces with provided - configurarions (IDEMPOTENT) + - name: Replace device configurations of listed LLDP interfaces with provided configurarions (IDEMPOTENT) register: result vyos.vyos.vyos_lldp_interfaces: *id001 @@ -62,7 +55,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_lldp_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml index e23253bb..6cf5d699 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml @@ -1,8 +1,6 @@ --- - debug: - msg: - START vyos_lldp_interfaces round trip integration tests on connection={{ - ansible_connection }} + msg: START vyos_lldp_interfaces round trip integration tests on connection={{ ansible_connection }} - include_tasks: _remove_config.yaml @@ -42,9 +40,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 @@ -54,8 +50,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_lldp_interfaces/tests/redirection/cli/shortname.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml index 0b06a742..c21192a4 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/redirection/cli/shortname.yaml @@ -1,7 +1,6 @@ --- - debug: - msg: START shortaname integration tests on connection={{ - ansible_connection }} + msg: START shortaname integration tests on connection={{ ansible_connection }} - include_tasks: _remove_config.yaml @@ -20,20 +19,17 @@ - name: Assert that before dicts were correctly generated assert: that: - - "{{ populate_intf | symmetric_difference(result['before']) |length ==\ - \ 0 }}" + - "{{ populate_intf | symmetric_difference(result['before']) |length == 0 }}" - 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 +43,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 |