Initial commit

This commit is contained in:
Ansible Core Team
2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
---
testcase: "*"
test_items: []

View File

@@ -0,0 +1,16 @@
---
- name: collect all common test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
delegate_to: localhost
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} ansible_connection=network_cli"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View File

@@ -0,0 +1,16 @@
---
- name: collect all common test cases
find:
paths: "{{ role_path }}/tests/common"
patterns: "{{ testcase }}.yaml"
register: test_cases
delegate_to: localhost
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test cases (connection=network_cli)
include: "{{ test_case_to_run }} ansible_connection=httpapi"
with_items: "{{ test_items }}"
loop_control:
loop_var: test_case_to_run

View File

@@ -0,0 +1,3 @@
---
- {include: cli.yaml, tags: ['cli']}
- {include: httpapi.yaml, tags: ['httpapi']}

View File

@@ -0,0 +1,16 @@
---
- debug: msg="START common/multiple.yaml on connection={{ ansible_connection }}"
- name: run multiple commands on remote nodes
exos_command:
commands:
- show version
- show ports no-refresh
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END common/multiple.yaml on connection={{ ansible_connection }}"

View File

@@ -0,0 +1,17 @@
---
- debug: msg="START common/prompt.yaml on connection={{ ansible_connection }}"
- name: run command that requires answering a prompt
exos_command:
commands:
- command: 'clear license-info'
prompt: 'Are you sure.*'
answer: 'Yes'
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END common/prompt.yaml on connection={{ ansible_connection }}"

View File

@@ -0,0 +1,14 @@
---
- debug: msg="START common/single.yaml on connection={{ ansible_connection }}"
- name: run show version on remote devices
exos_command:
commands: show version
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END common/single.yaml on connection={{ ansible_connection }}"

View File

@@ -0,0 +1,15 @@
---
- debug: msg="START common/waitfor.yaml on connection={{ ansible_connection }}"
- name: run show version and check to see if output contains ExtremeXOS
exos_command:
commands: show version
wait_for: result[0] contains ExtremeXOS
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END common/waitfor.yaml on connection={{ ansible_connection }}"

View File

@@ -0,0 +1,20 @@
---
- debug: msg="START common/waitfor_multiple.yaml on connection={{ ansible_connection }}"
- name: run multiple commands and evaluate the output
exos_command:
commands:
- show version
- show ports no-refresh
wait_for:
- result[0] contains ExtremeXOS
- result[1] contains 20
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END common/waitfor_multiple.yaml on connection={{ ansible_connection }}"