Skip to content

Commit

Permalink
ansible-test: ios_command cli test should only be network_cli (ansibl…
Browse files Browse the repository at this point in the history
…e#56955)

We do not support testing under ansible_connection=local

Signed-off-by: Paul Belanger <[email protected]>
  • Loading branch information
pabelanger authored and NilashishC committed May 27, 2019
1 parent d5ab712 commit d7f4f88
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions test/integration/targets/ios_command/tests/cli/cli_command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@
- 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'"

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

0 comments on commit d7f4f88

Please sign in to comment.