mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Migrate Network Tests into ansible/ansible (#18233)
* Docs Networking tests * Copy networking tests from test-network-modules * Networking transport settings - group_vars * Network playbooks * Debug should be off by default * Update nxos.yaml * Remove items from top level * Use dependencies, not pre-tasks * Remove trailing blank lines * Remove backup files * newlines
This commit is contained in:
50
test/integration/targets/eos_template/tests/eapi/backup.yaml
Normal file
50
test/integration/targets/eos_template/tests/eapi/backup.yaml
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
- debug: msg="START eapi/backup.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet5
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- name: delete backup files
|
||||
file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{backup_files.files|default([])}}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
backup: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: collect any backup files
|
||||
find:
|
||||
paths: "{{ role_path }}/backup"
|
||||
pattern: "{{ inventory_hostname }}_config*"
|
||||
register: backup_files
|
||||
delegate_to: localhost
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "backup_files.files is defined"
|
||||
|
||||
- debug: msg="END eapi/backup.yaml"
|
||||
36
test/integration/targets/eos_template/tests/eapi/basic.yaml
Normal file
36
test/integration/targets/eos_template/tests/eapi/basic.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
---
|
||||
- debug: msg="START eapi/basic.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet5
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/basic.yaml"
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
- debug: msg="START eapi/defaults.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- shutdown
|
||||
parents:
|
||||
- interface Ethernet5
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
#- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with defaults included
|
||||
eos_template:
|
||||
src: defaults/config.j2
|
||||
include_defaults: yes
|
||||
provider: "{{ eapi }}"
|
||||
register: result
|
||||
|
||||
#- debug: var=result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == false"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/defaults.yaml"
|
||||
38
test/integration/targets/eos_template/tests/eapi/force.yaml
Normal file
38
test/integration/targets/eos_template/tests/eapi/force.yaml
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
- debug: msg="START eapi/force.yaml"
|
||||
|
||||
- name: setup
|
||||
eos_config:
|
||||
commands:
|
||||
- no description
|
||||
- no shutdown
|
||||
parents:
|
||||
- interface Ethernet5
|
||||
match: none
|
||||
provider: "{{ eapi }}"
|
||||
|
||||
- name: configure device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- name: check device with config
|
||||
eos_template:
|
||||
src: basic/config.j2
|
||||
provider: "{{ eapi }}"
|
||||
force: yes
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
- "result.updates is defined"
|
||||
|
||||
- debug: msg="END eapi/force.yaml"
|
||||
Reference in New Issue
Block a user