mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
WIP: net_command: Initial tests for VyOS (#20147)
* Conditional include on ansible_network_os * copy & paste error * More tests * More tests * junos tests (based on vyos) * remove excessive whitespace * Pass in ansible_network_os * net_command for ios * consistent debug * wrapp line * ansible-test changes made in another PR * ansible-test changes made in another PR
This commit is contained in:
@@ -20,16 +20,27 @@
|
||||
|
||||
# This is a placeholder test, will be fleshed out by gundalow at a later point
|
||||
|
||||
- name: Check we can communicate using net_command
|
||||
net_command: show version
|
||||
connection: network_cli
|
||||
register: result
|
||||
|
||||
- debug:
|
||||
msg: "{{ result.stdout }}"
|
||||
# Check if ansible_network_os being undef or incorrect
|
||||
# Without this we wouldn't run any tests, and not actually test Ansible
|
||||
|
||||
- name: Ensure output is valid
|
||||
assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- "'VyOS' in result.stdout"
|
||||
# FIXME One we can get ansible_network_os from env remove it from
|
||||
# test/runner/johnb@x260:~/git/ansible-inc/ansible/test/runner/lib/executor.py
|
||||
#
|
||||
|
||||
- name: Check for acceptable ansible_network_os
|
||||
fail:
|
||||
msg: "ansible_network_os is undefined or not an acceptable platform: '{{ ansible_network_os }}'"
|
||||
when: ansible_network_os not in [ 'vyos', 'junos', 'ios' ]
|
||||
|
||||
- name: vyos Specific includes
|
||||
include: vyos.yml
|
||||
when: ansible_network_os == 'vyos'
|
||||
|
||||
- name: junos Specific includes
|
||||
include: junos.yml
|
||||
when: ansible_network_os == 'junos'
|
||||
|
||||
- name: ios Specific includes
|
||||
include: ios.yml
|
||||
when: ansible_network_os == 'ios'
|
||||
|
||||
Reference in New Issue
Block a user