ansible/test/integration/targets/eos_smoke/tests/cli/misc_tests.yaml
Nathaniel Case f654d47c01
Remove provider (and transport, where applicable) from consideration when not using connection=local (#39555) (#39861)
* Remove provider (and transport, where applicable) from consideration

* Add tests that misplaced transport does not fail task

(cherry picked from commit c6270e15a6)
2018-05-08 12:54:03 -04:00

37 lines
956 B
YAML

---
- debug: msg="START cli/misc_tests.yaml on connection={{ ansible_connection }}"
# test become and unbecome
- block:
- name: command that does require become (should fail)
eos_command:
commands: show running-config
provider: "{{ cli }}"
become: no
ignore_errors: yes
register: result
- assert:
that:
- 'result.failed == true'
- '"privileged mode required" in result.module_stderr'
- name: command that doesn't require become
eos_command:
commands: show uptime
provider: "{{ cli }}"
become: no
# Test that transport values are properly ignored
- name: wrong transport specified
eos_command:
commands: show version
transport: eapi
- name: wrong transport specified in provider
eos_command:
commands: show version
provider: "{{ eapi }}"
when: "ansible_connection != 'local'"