mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Added support for new Ansible Infra (network_cli plugin, cliconf, module utils cleanup and test) for dellos10 Support t (#34915)
* Support for network_cli plugin and tests * Fixed ansible-test * issues * Fixed Pylint warning * Fixed the sanity test errors * Fix YAMLlinter issue - removed blank spaces * Fixed Python 3 failures * Fixed the PEP8 issue * Fix sanity --test validate-modules * Reverted the changes to the doc fragments
This commit is contained in:
committed by
John R Barker
parent
1f544ed6cc
commit
2f46f8f944
20
test/integration/roles/test_dellos10_command/tests/cli/bad_operator.yaml
Executable file
20
test/integration/roles/test_dellos10_command/tests/cli/bad_operator.yaml
Executable file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- debug: msg="START cli/bad_operator.yaml"
|
||||
|
||||
- name: test bad operator
|
||||
dellos10_command:
|
||||
commands:
|
||||
- show version
|
||||
- show interface ethernet 1/1/1
|
||||
wait_for:
|
||||
- "result[0] contains 'Description : blah'"
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "result.msg is defined"
|
||||
|
||||
- debug: msg="END cli/bad_operator.yaml"
|
||||
20
test/integration/roles/test_dellos10_command/tests/cli/contains.yaml
Executable file
20
test/integration/roles/test_dellos10_command/tests/cli/contains.yaml
Executable file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
- debug: msg="START cli/contains.yaml"
|
||||
|
||||
- name: test contains operator
|
||||
dellos10_command:
|
||||
commands:
|
||||
- show version
|
||||
- show interface ethernet 1/1/1
|
||||
wait_for:
|
||||
- "result[0] contains OS10-Premium"
|
||||
- "result[1] contains Ethernet "
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.stdout is defined"
|
||||
|
||||
- debug: msg="END cli/contains.yaml"
|
||||
28
test/integration/roles/test_dellos10_command/tests/cli/invalid.yaml
Executable file
28
test/integration/roles/test_dellos10_command/tests/cli/invalid.yaml
Executable file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- debug: msg="START cli/invalid.yaml"
|
||||
|
||||
- name: run invalid command
|
||||
dellos10_command:
|
||||
commands: ['show foo']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "'Error: Unrecognized command' in result.stdout"
|
||||
|
||||
- name: run commands that include invalid command
|
||||
dellos10_command:
|
||||
commands:
|
||||
- show version
|
||||
- show foo
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "'Error: Unrecognized command' in result.stdout"
|
||||
|
||||
- debug: msg="END cli/invalid.yaml"
|
||||
29
test/integration/roles/test_dellos10_command/tests/cli/output.yaml
Executable file
29
test/integration/roles/test_dellos10_command/tests/cli/output.yaml
Executable file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- debug: msg="START cli/output.yaml"
|
||||
|
||||
- name: get output for single command
|
||||
dellos10_command:
|
||||
commands: ['show version']
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.stdout is defined"
|
||||
|
||||
- name: get output for multiple commands
|
||||
dellos10_command:
|
||||
commands:
|
||||
- show version
|
||||
- show interface Eth 1/1/1
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.stdout is defined"
|
||||
- "result.stdout | length == 2"
|
||||
|
||||
- debug: msg="END cli/output.yaml"
|
||||
19
test/integration/roles/test_dellos10_command/tests/cli/timeout.yaml
Executable file
19
test/integration/roles/test_dellos10_command/tests/cli/timeout.yaml
Executable file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- debug: msg="START cli/timeout.yaml"
|
||||
|
||||
- name: test bad condition
|
||||
dellos10_command:
|
||||
commands:
|
||||
- show version
|
||||
wait_for:
|
||||
- "result[0] contains bad_value_string"
|
||||
provider: "{{ cli }}"
|
||||
register: result
|
||||
ignore_errors: yes
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "result.msg is defined"
|
||||
|
||||
- debug: msg="END cli/timeout.yaml"
|
||||
Reference in New Issue
Block a user