diff options
| author | CaptTrews <capttrews@gmail.com> | 2019-12-04 00:26:13 +0000 |
|---|---|---|
| committer | CaptTrews <capttrews@gmail.com> | 2019-12-04 00:26:13 +0000 |
| commit | f4fff0b4a4ecd2e634f4dcb515bf92c20d3771ba (patch) | |
| tree | 133958d96ff13a3df7bae53742d138ac9bfd2884 /tests/integration/targets/vyos_lldp_global | |
| parent | df640eaacf60e82e6cf6f8b10236894eef1cc8ce (diff) | |
| download | vyos-ansible-collection-f4fff0b4a4ecd2e634f4dcb515bf92c20d3771ba.tar.gz vyos-ansible-collection-f4fff0b4a4ecd2e634f4dcb515bf92c20d3771ba.zip | |
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
Diffstat (limited to 'tests/integration/targets/vyos_lldp_global')
7 files changed, 136 insertions, 136 deletions
diff --git a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml index 79660af..8017e93 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml @@ -5,40 +5,40 @@ - include_tasks: _populate.yaml - block: - - name: Delete attributes of LLDP service. - vyos.vyos.vyos_lldp_global: &deleted - config: - state: deleted - register: result - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ populate == result['before']}}" - - - name: Assert that the correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}" - - - name: Assert that the after dicts were correctly generated - assert: - that: - - "{{ deleted['after'] == result['after']}}" - - - name: Delete attributes of given interfaces (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ deleted['after'] == result['before'] }}" + - name: Delete attributes of LLDP service. + vyos.vyos.vyos_lldp_global: &deleted + config: + state: deleted + register: result + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ populate == result['before']}}" + + - name: Assert that the correct set of commands were generated + assert: + that: + - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}" + + - name: Assert that the after dicts were correctly generated + assert: + that: + - "{{ deleted['after'] == result['after']}}" + + - name: Delete attributes of given interfaces (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *deleted + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result.changed == false" + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ deleted['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml index 5bac638..05609b6 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - debug: - msg: "START vyos_lldp_global empty_config integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global empty_config integration tests on connection={{ ansible_connection }}" - name: Merged with empty config should give appropriate error message vyos.vyos.vyos_lldp_global: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml index b1687da..a17bd61 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml @@ -1,49 +1,49 @@ --- - debug: - msg: "START vyos_lldp_global merged integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global merged integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Merge the provided configuration with the exisiting running configuration - vyos.vyos.vyos_lldp_global: &merged + - name: Merge the provided configuration with the exisiting running configuration + vyos.vyos.vyos_lldp_global: &merged config: - legacy_protocols: - - 'fdp' - - 'cdp' - address: 192.0.2.11 + legacy_protocols: + - 'fdp' + - 'cdp' + address: 192.0.2.11 state: merged - register: result + register: result - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: "{{ merged['before'] == result['before'] }}" - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that after dicts was correctly generated + assert: that: - - "{{ merged['after'] == result['after'] }}" + - "{{ merged['after'] == result['after'] }}" - - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *merged - register: result + - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *merged + register: result - - name: Assert that the previous task was idempotent - assert: + - name: Assert that the previous task was idempotent + assert: that: - - "result['changed'] == false" + - "result['changed'] == false" - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: - - "{{ merged['after'] == result['before'] }}" + - "{{ merged['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml index 22bd8e5..371e7f3 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml @@ -1,51 +1,51 @@ --- - debug: - msg: "START vyos_lldp_global replaced integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global replaced integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Replace device configurations of LLDP service with provided configurations - vyos.vyos.vyos_lldp_global: &replaced + - name: Replace device configurations of LLDP service with provided configurations + vyos.vyos.vyos_lldp_global: &replaced config: - legacy_protocols: - - 'edp' - - 'sonmp' - - 'cdp' - address: 192.0.2.14 + legacy_protocols: + - 'edp' + - 'sonmp' + - 'cdp' + address: 192.0.2.14 state: replaced - register: result + register: result - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that before dicts are correctly generated + assert: that: - - "{{ populate == result['before'] }}" + - "{{ populate == result['before'] }}" - - name: Assert that after dict is correctly generated - assert: + - name: Assert that after dict is correctly generated + assert: that: - - "{{ replaced['after'] == result['after'] }}" + - "{{ replaced['after'] == result['after'] }}" - - name: Replace device configurations of LLDP service with provided configurarions (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *replaced - register: result + - name: Replace device configurations of LLDP service with provided configurarions (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *replaced + register: result - - name: Assert that task was idempotent - assert: + - name: Assert that task was idempotent + assert: that: - - "result['changed'] == false" + - "result['changed'] == false" - - name: Assert that before dict is correctly generated - assert: + - name: Assert that before dict is correctly generated + assert: that: - - "{{ replaced['after'] == result['before'] }}" + - "{{ replaced['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml index 4f8ca9c..02902bc 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml @@ -5,47 +5,47 @@ - include_tasks: _remove_config.yaml - block: - - name: Apply the provided configuration (base config) - vyos.vyos.vyos_lldp_global: - config: - legacy_protocols: - - 'fdp' - - 'cdp' - address: 192.0.2.11 - state: merged - register: base_config - - - name: Gather vyos_lldp_global facts - vyos.vyos.vyos_facts: - gather_subset: - - default - gather_network_resources: - - lldp_global - - - name: Apply the provided configuration (config to be reverted) - vyos.vyos.vyos_lldp_global: - config: - legacy_protocols: - - 'edp' - - 'sonmp' - - 'cdp' - address: 192.0.2.14 - state: merged - register: result - - - name: Assert that changes were applied - assert: - that: "{{ round_trip['after'] == result['after'] }}" - - - name: Revert back to base config using facts round trip - vyos.vyos.vyos_lldp_global: - config: "{{ ansible_facts['network_resources']['lldp_global'] }}" - state: replaced - register: revert - - - name: Assert that config was reverted - assert: - that: "{{ base_config['after'] == revert['after'] }}" + - name: Apply the provided configuration (base config) + vyos.vyos.vyos_lldp_global: + config: + legacy_protocols: + - 'fdp' + - 'cdp' + address: 192.0.2.11 + state: merged + register: base_config + + - name: Gather vyos_lldp_global facts + vyos.vyos.vyos_facts: + gather_subset: + - default + gather_network_resources: + - lldp_global + + - name: Apply the provided configuration (config to be reverted) + vyos.vyos.vyos_lldp_global: + config: + legacy_protocols: + - 'edp' + - 'sonmp' + - 'cdp' + address: 192.0.2.14 + state: merged + register: result + + - name: Assert that changes were applied + assert: + that: "{{ round_trip['after'] == result['after'] }}" + + - name: Revert back to base config using facts round trip + vyos.vyos.vyos_lldp_global: + config: "{{ ansible_facts['network_resources']['lldp_global'] }}" + state: replaced + register: revert + + - name: Assert that config was reverted + assert: + that: "{{ base_config['after'] == revert['after'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/vars/main.yaml b/tests/integration/targets/vyos_lldp_global/vars/main.yaml index f091f2c..420b2b4 100644 --- a/tests/integration/targets/vyos_lldp_global/vars/main.yaml +++ b/tests/integration/targets/vyos_lldp_global/vars/main.yaml @@ -4,7 +4,7 @@ merged: address: '192.0.2.17' enable: true legacy_protocols: - - 'cdp' + - 'cdp' commands: - "set service lldp management-address '192.0.2.11'" |
