Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Fix vyos_command integration test (#56091) #56169

Merged
merged 1 commit into from May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 32 additions & 17 deletions test/integration/targets/vyos_command/tests/cli/cli_command.yaml
Expand Up @@ -2,25 +2,40 @@
- debug:
msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}"

- name: get output for single command
cli_command:
command: show version
register: result
- block:
- name: get output for single command
cli_command:
command: show version
register: result

- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"

- name: send invalid command
cli_command:
command: 'show foo'
register: result
ignore_errors: yes
- name: send invalid command
cli_command:
command: 'show foo'
register: result
ignore_errors: yes

- assert:
that:
- "result.failed == true"
- "result.msg is defined"
- assert:
that:
- "result.failed == true"
- "result.msg is defined"
when: "ansible_connection == 'network_cli'"

- block:
- name: test failure for local connection
cli_command:
command: show version
register: result
ignore_errors: yes

- assert:
that:
- 'result.failed == true'
- "'Connection type local is not valid for this module' in result.msg"
when: "ansible_connection == 'local'"

- debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}"