mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +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:
@@ -0,0 +1,48 @@
|
||||
---
|
||||
- debug: msg="START cli/invalid_subset.yaml"
|
||||
|
||||
|
||||
- name: test invalid subset (foobar)
|
||||
ios_facts:
|
||||
provider: "{{ cli }}"
|
||||
gather_subset:
|
||||
- "foobar"
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
|
||||
- assert:
|
||||
that:
|
||||
# Failures shouldn't return changes
|
||||
- "result.changed == false"
|
||||
# It's a failure
|
||||
- "result.failed == true"
|
||||
# Sensible Failure message
|
||||
- "result.msg == 'Bad subset'"
|
||||
|
||||
###############
|
||||
# FIXME Future
|
||||
# We may in the future want to add a test for
|
||||
|
||||
- name: test subset specified multiple times
|
||||
ios_facts:
|
||||
provider: "{{ cli }}"
|
||||
gather_subset:
|
||||
- "!hardware"
|
||||
- "hardware"
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
# Failures shouldn't return changes
|
||||
- "result.changed == false"
|
||||
# It's a failure
|
||||
- "result.failed == true"
|
||||
# Sensible Failure message
|
||||
- "result.msg == 'Bad subset'"
|
||||
ignore_errors: true
|
||||
|
||||
|
||||
|
||||
- debug: msg="END cli/invalid_subset.yaml"
|
||||
Reference in New Issue
Block a user