diff options
author | Kate Case <kcase@redhat.com> | 2023-01-25 08:37:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-25 08:37:58 -0500 |
commit | e9911888f6dcdf9031f3fdb2e32c52e45815fdbe (patch) | |
tree | dc22abb4a329ef04e98685b81d074679dc24c456 /tests/integration/targets/vyos_ospfv3 | |
parent | bcfe61a3b6ff69f08450f3dbd8f0f1827fb18ab3 (diff) | |
download | vyos.vyos-e9911888f6dcdf9031f3fdb2e32c52e45815fdbe.tar.gz vyos.vyos-e9911888f6dcdf9031f3fdb2e32c52e45815fdbe.zip |
Add prettier and isort to pre-commit. (#270)
* Add prettier and isort to pre-commit.
* Bump line-length to 100
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Diffstat (limited to 'tests/integration/targets/vyos_ospfv3')
11 files changed, 124 insertions, 130 deletions
diff --git a/tests/integration/targets/vyos_ospfv3/defaults/main.yaml b/tests/integration/targets/vyos_ospfv3/defaults/main.yaml index 852a6be..164afea 100644 --- a/tests/integration/targets/vyos_ospfv3/defaults/main.yaml +++ b/tests/integration/targets/vyos_ospfv3/defaults/main.yaml @@ -1,3 +1,3 @@ --- -testcase: '[^_].*' +testcase: "[^_].*" test_items: [] diff --git a/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml b/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml index 93eb2fe..83496e0 100644 --- a/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml +++ b/tests/integration/targets/vyos_ospfv3/tasks/cli.yaml @@ -1,8 +1,8 @@ --- - name: Collect all cli test cases find: - paths: '{{ role_path }}/tests/cli' - patterns: '{{ testcase }}.yaml' + paths: "{{ role_path }}/tests/cli" + patterns: "{{ testcase }}.yaml" use_regex: true register: test_cases delegate_to: localhost @@ -11,9 +11,9 @@ set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" - name: Run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }}' + include: "{{ test_case_to_run }}" vars: ansible_connection: ansible.netcommon.network_cli - with_items: '{{ test_items }}' + with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml b/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml index 5564a3e..48ad53a 100644 --- a/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml +++ b/tests/integration/targets/vyos_ospfv3/tasks/redirection.yaml @@ -1,8 +1,8 @@ --- - name: collect all redirection cli test cases find: - paths: '{{ role_path }}/tests/redirection/cli' - patterns: '{{ testcase }}.yaml' + paths: "{{ role_path }}/tests/redirection/cli" + patterns: "{{ testcase }}.yaml" register: shortname_test_cases delegate_to: localhost @@ -10,7 +10,7 @@ set_fact: test_items="{{ shortname_test_cases.files | map(attribute='path') | list }}" - name: run test case (connection=ansible.netcommon.network_cli) - include: '{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli' - with_items: '{{ test_items }}' + include: "{{ test_case_to_run }} ansible_connection=ansible.netcommon.network_cli" + with_items: "{{ test_items }}" loop_control: loop_var: test_case_to_run diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/_populate.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/_populate.yaml index fb66d0a..31f90ef 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/_populate.yaml @@ -2,12 +2,12 @@ - name: Setup vars: lines: "set protocols ospfv3 area 2 export-list 'export1' \n - set protocols ospfv3 area 2 import-list 'import1' \n - set protocols ospfv3 area 2 range '2001:db10::/32' \n - set protocols ospfv3 area 2 range '2001:db20::/32' \n - set protocols ospfv3 area 2 range '2001:db30::/32' \n - set protocols ospfv3 area 3 range '2001:db40::/32' \n - set protocols ospfv3 parameters router-id '192.0.2.10' \n - set protocols ospfv3 redistribute 'bgp'" + set protocols ospfv3 area 2 import-list 'import1' \n + set protocols ospfv3 area 2 range '2001:db10::/32' \n + set protocols ospfv3 area 2 range '2001:db20::/32' \n + set protocols ospfv3 area 2 range '2001:db30::/32' \n + set protocols ospfv3 area 3 range '2001:db40::/32' \n + set protocols ospfv3 parameters router-id '192.0.2.10' \n + set protocols ospfv3 redistribute 'bgp'" ansible.netcommon.cli_config: - config: '{{ lines }}' + config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/_remove_config.yaml index 2a47505..ca4537e 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/_remove_config.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/_remove_config.yaml @@ -3,4 +3,4 @@ vars: lines: "delete protocols ospfv3\n" ansible.netcommon.cli_config: - config: '{{ lines }}' + config: "{{ lines }}" diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml index 55bec18..e0be4c3 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/deleted.yaml @@ -6,7 +6,6 @@ - include_tasks: _populate.yaml - block: - - name: Delete ospfv3 routes register: result vyos.vyos.vyos_ospfv3: &id001 @@ -44,5 +43,4 @@ that: - "{{ deleted['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/parsed.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/parsed.yaml index 6287083..1bec41a 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/parsed.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/parsed.yaml @@ -1,6 +1,7 @@ --- - debug: - msg: START vyos_ospfv3 parsed integration tests on connection={{ ansible_connection + msg: + START vyos_ospfv3 parsed integration tests on connection={{ ansible_connection }} - name: Parse externally provided ospfv3 config to agnostic model diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/rendered.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/rendered.yaml index 3f714ce..b921bda 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/rendered.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/rendered.yaml @@ -6,26 +6,25 @@ - include_tasks: _remove_config.yaml - block: - - name: Structure provided configuration into device specific commands register: result vyos.vyos.vyos_ospfv3: config: redistribute: - - route_type: 'bgp' + - route_type: "bgp" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' + - address: "2001:db40::/32" state: rendered - name: Assert that correct set of commands were generated diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/replaced.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/replaced.yaml index 74d25db..08291ba 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/replaced.yaml @@ -8,27 +8,26 @@ - include_tasks: _populate.yaml - block: - - name: Replace device configurations of listed ospfv3 routes with provided configurations register: result vyos.vyos.vyos_ospfv3: &id001 config: redistribute: - - route_type: 'bgp' + - route_type: "bgp" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db30::/32' - - address: '2001:db50::/32' - - area_id: '4' + - address: "2001:db10::/32" + - address: "2001:db30::/32" + - address: "2001:db50::/32" + - area_id: "4" range: - - address: '2001:db60::/32' + - address: "2001:db60::/32" state: replaced - name: Assert that correct set of commands were generated @@ -47,7 +46,8 @@ that: - "{{ replaced['after'] == result['after'] }}" - - name: Replace device configurations of listed ospfv3 routes with provided configurarions + - name: + Replace device configurations of listed ospfv3 routes with provided configurarions (IDEMPOTENT) register: result vyos.vyos.vyos_ospfv3: *id001 @@ -62,5 +62,4 @@ that: - "{{ replaced['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_ospfv3/tests/cli/rtt.yaml b/tests/integration/targets/vyos_ospfv3/tests/cli/rtt.yaml index d817554..2142aad 100644 --- a/tests/integration/targets/vyos_ospfv3/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_ospfv3/tests/cli/rtt.yaml @@ -6,26 +6,25 @@ - include_tasks: _remove_config.yaml - block: - - name: Apply the provided configuration (base config) register: base_config vyos.vyos.vyos_ospfv3: config: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' + - address: "2001:db40::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" state: merged - name: Gather ospfv3 facts @@ -40,21 +39,21 @@ vyos.vyos.vyos_ospfv3: config: redistribute: - - route_type: 'bgp' + - route_type: "bgp" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db30::/32' - - address: '2001:db50::/32' - - area_id: '4' + - address: "2001:db10::/32" + - address: "2001:db30::/32" + - address: "2001:db50::/32" + - area_id: "4" range: - - address: '2001:db60::/32' + - address: "2001:db60::/32" state: replaced - name: Assert that changes were applied @@ -71,5 +70,4 @@ assert: that: "{{ base_config['after'] == revert['after']}}" always: - - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_ospfv3/vars/main.yaml b/tests/integration/targets/vyos_ospfv3/vars/main.yaml index 6ded89a..3793760 100644 --- a/tests/integration/targets/vyos_ospfv3/vars/main.yaml +++ b/tests/integration/targets/vyos_ospfv3/vars/main.yaml @@ -14,59 +14,58 @@ merged: - set protocols ospfv3 area 3 range 2001:db40::/32 after: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' + - address: "2001:db40::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' - + - route_type: "bgp" merged_update: commands: - set protocols ospfv3 area 3 range 2001:db70::/32 after: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' - - address: '2001:db70::/32' + - address: "2001:db40::/32" + - address: "2001:db70::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" populate: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' + - address: "2001:db40::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" replaced: commands: - delete protocols ospfv3 area 2 range 2001:db20::/32 @@ -76,20 +75,20 @@ replaced: - set protocols ospfv3 area 4 range 2001:db60::/32 after: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db30::/32' - - address: '2001:db50::/32' - - area_id: '4' + - address: "2001:db10::/32" + - address: "2001:db30::/32" + - address: "2001:db50::/32" + - area_id: "4" range: - - address: '2001:db60::/32' + - address: "2001:db60::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" rendered: commands: - set protocols ospfv3 redistribute bgp @@ -105,38 +104,38 @@ rendered: parsed: after: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db20::/32' - - address: '2001:db30::/32' - - area_id: '3' + - address: "2001:db10::/32" + - address: "2001:db20::/32" + - address: "2001:db30::/32" + - area_id: "3" range: - - address: '2001:db40::/32' + - address: "2001:db40::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" deleted: commands: - - 'delete protocols ospfv3' + - "delete protocols ospfv3" after: {} round_trip: after: areas: - - area_id: '2' - export_list: 'export1' - import_list: 'import1' + - area_id: "2" + export_list: "export1" + import_list: "import1" range: - - address: '2001:db10::/32' - - address: '2001:db30::/32' - - address: '2001:db50::/32' - - area_id: '4' + - address: "2001:db10::/32" + - address: "2001:db30::/32" + - address: "2001:db50::/32" + - area_id: "4" range: - - address: '2001:db60::/32' + - address: "2001:db60::/32" parameters: - router_id: '192.0.2.10' + router_id: "192.0.2.10" redistribute: - - route_type: 'bgp' + - route_type: "bgp" |