Purge legacy test modules (#37691)

pull/37992/head
Senthil Kumar Ganesan 6 years ago committed by John R Barker
parent 135d343254
commit c2226dd18b

@ -1,13 +0,0 @@
---
- hosts: dellos10
gather_facts: no
connection: local
vars:
limit_to: "*"
test_items: ""
roles:
- { role: test_dellos10_command, when: "limit_to in ['*', 'dellos10_command']" }
- { role: test_dellos10_config, when: "limit_to in ['*', 'dellos10_config']" }
- { role: test_dellos10_facts, when: "limit_to in ['*', 'dellos10_facts']" }

@ -1,13 +0,0 @@
---
- hosts: dellos6
gather_facts: no
connection: local
vars:
limit_to: "*"
debug: false
roles:
- { role: dellos6_command, when: "limit_to in ['*', 'dellos6_command']" }
- { role: dellos6_config, when: "limit_to in ['*', 'dellos6_config']" }
- { role: dellos6_facts, when: "limit_to in ['*', 'dellos6_facts']" }

@ -1,13 +0,0 @@
---
- hosts: dellos9
gather_facts: no
connection: local
vars:
limit_to: "*"
debug: false
roles:
- { role: dellos9_command, when: "limit_to in ['*', 'dellos9_command']" }
- { role: dellos9_config, when: "limit_to in ['*', 'dellos9_config']" }
- { role: dellos9_facts, when: "limit_to in ['*', 'dellos9_facts']" }

@ -1,6 +0,0 @@
---
cli:
host: "{{ ansible_host }}"
username: "{{ dellos10_cli_user | default('admin') }}"
password: "{{ dellos10_cli_pass | default('admin') }}"
transport: cli

@ -1,14 +0,0 @@
---
- name: collect all cli test cases
find:
paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: set test_items
set_fact:
test_items: "{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case
include: "{{ item }}"
with_items: "{{ test_items }}"

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

@ -1,20 +0,0 @@
---
- debug: msg="START cli/bad_operator.yaml"
- name: test bad operator
dellos10_command:
commands:
- show version
- show interface ethernet 1/1/1
wait_for:
- "result[0] contains 'Description : blah'"
provider: "{{ cli }}"
register: result
ignore_errors: yes
- assert:
that:
- "result.failed == true"
- "result.msg is defined"
- debug: msg="END cli/bad_operator.yaml"

@ -1,20 +0,0 @@
---
- debug: msg="START cli/contains.yaml"
- name: test contains operator
dellos10_command:
commands:
- show version
- show interface ethernet 1/1/1
wait_for:
- "result[0] contains OS10-Premium"
- "result[1] contains Ethernet "
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- debug: msg="END cli/contains.yaml"

@ -1,28 +0,0 @@
---
- debug: msg="START cli/invalid.yaml"
- name: run invalid command
dellos10_command:
commands: ['show foo']
provider: "{{ cli }}"
register: result
ignore_errors: yes
- assert:
that:
- "'Error: Unrecognized command' in result.stdout"
- name: run commands that include invalid command
dellos10_command:
commands:
- show version
- show foo
provider: "{{ cli }}"
register: result
ignore_errors: yes
- assert:
that:
- "'Error: Unrecognized command' in result.stdout"
- debug: msg="END cli/invalid.yaml"

@ -1,29 +0,0 @@
---
- debug: msg="START cli/output.yaml"
- name: get output for single command
dellos10_command:
commands: ['show version']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- name: get output for multiple commands
dellos10_command:
commands:
- show version
- show interface Eth 1/1/1
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.stdout is defined"
- "result.stdout | length == 2"
- debug: msg="END cli/output.yaml"

@ -1,19 +0,0 @@
---
- debug: msg="START cli/timeout.yaml"
- name: test bad condition
dellos10_command:
commands:
- show version
wait_for:
- "result[0] contains bad_value_string"
provider: "{{ cli }}"
register: result
ignore_errors: yes
- assert:
that:
- "result.failed == true"
- "result.msg is defined"
- debug: msg="END cli/timeout.yaml"

@ -1,13 +0,0 @@
---
- name: collect all cli test cases
find:
paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case
include: "{{ item }}"
with_items: "{{ test_items }}"

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

@ -1,4 +0,0 @@
interface loopback999
shutdown
description basic

@ -1,3 +0,0 @@
interface loopback999
no shutdown
description default

@ -1,58 +0,0 @@
---
- debug: msg="START cli/backup.yaml"
- name: setup
dellos10_config:
commands:
- interface loopback 999
- no interface loopback 999
match: none
provider: "{{ cli }}"
ignore_errors: yes
- 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: "{{ backupitem.path }}"
state: absent
with_items: "{{ backup_files.files }}"
loop_control:
loop_var: backupitem
- name: configure device with config
dellos10_config:
src: basic/config.j2
backup: yes
provider: "{{ cli }}"
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"
- name: teardown
dellos10_config:
commands:
- no interface loopback999
match: none
provider: "{{ cli }}"
- debug: msg="END cli/backup.yaml"

@ -1,42 +0,0 @@
---
- debug: msg="START cli/basic.yaml"
- name: setup
dellos10_config:
commands:
- interface loopback 999
- no interface loopback 999
match: none
provider: "{{ cli }}"
ignore_errors: yes
- name: configure device with config
dellos10_config:
src: basic/config.j2
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "result.updates is defined"
- name: check device with config
dellos10_config:
src: basic/config.j2
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.updates is defined"
- name: teardown
dellos10_config:
commands:
- no interface loopback999
match: none
provider: "{{ cli }}"
- debug: msg="END cli/basic.yaml"

@ -1,46 +0,0 @@
---
- debug: msg="START cli/defaults.yaml"
- name: setup
dellos10_config:
commands:
- interface loopback 999
- no interface loopback 999
match: none
provider: "{{ cli }}"
ignore_errors: yes
- name: configure device with defaults included
dellos10_config:
src: defaults/config.j2
provider: "{{ cli }}"
register: result
- debug: var=result
- assert:
that:
- "result.changed == true"
- "result.updates is defined"
- name: check device with defaults included
dellos10_config:
src: defaults/config.j2
provider: "{{ cli }}"
register: result
- debug: var=result
- assert:
that:
- "result.changed == false"
- "result.updates is defined"
- name: teardown
dellos10_config:
commands:
- no interface loopback999
match: none
provider: "{{ cli }}"
- debug: msg="END cli/defaults.yaml"

@ -1,44 +0,0 @@
---
- debug: msg="START cli/force.yaml"
- name: setup
dellos10_config:
commands:
- interface loopback 999
- no interface loopback 999
match: none
provider: "{{ cli }}"
ignore_errors: yes
- name: configure device with config
dellos10_config:
src: basic/config.j2
provider: "{{ cli }}"
match: none
register: result
- assert:
that:
- "result.changed == true"
- "result.updates is defined"
- name: check device with config
dellos10_config:
src: basic/config.j2
provider: "{{ cli }}"
match: none
register: result
- assert:
that:
- "result.changed == true"
- "result.updates is defined"
- name: teardown
dellos10_config:
commands:
- no interface loopback999
match: none
provider: "{{ cli }}"
- debug: msg="END cli/force.yaml"

@ -1,42 +0,0 @@
---
- debug: msg="START cli/sublevel.yaml"
- name: setup test
dellos10_config:
lines:
- 'no ip access-list test'
provider: "{{ cli }}"
match: none
- name: configure sub level command
dellos10_config:
lines: ['seq 5 permit ip any any count byte']
parents: ['ip access-list test']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip access-list test' in result.updates"
- "'seq 5 permit ip any any count byte' in result.updates"
- name: configure sub level command idempotent check
dellos10_config:
lines: ['seq 5 permit ip any any count byte']
parents: ['ip access-list test']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines:
- 'no ip access-list test'
provider: "{{ cli }}"
match: none
- debug: msg="END cli/sublevel.yaml"

@ -1,62 +0,0 @@
---
- debug: msg="START cli/sublevel_block.yaml"
- name: setup
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
parents: ['ip access-list test']
before: ['no ip access-list test']
after: ['exit']
provider: "{{ cli }}"
match: none
- name: configure sub level command using block resplace
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
parents: ['ip access-list test']
replace: block
after: ['exit']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip access-list test' in result.updates"
- "'seq 5 permit ip host 1.1.1.1 any count byte' in result.updates"
- "'seq 10 permit ip host 2.2.2.2 any count byte' in result.updates"
- "'seq 15 permit ip host 3.3.3.3 any count byte' in result.updates"
- "'seq 20 permit ip host 4.4.4.4 any count byte' in result.updates"
- name: check sub level command using block replace
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
parents: ['ip access-list test']
replace: block
after: ['exit']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines:
- no ip access-list test
match: none
provider: "{{ cli }}"
- debug: msg="END cli/sublevel_block.yaml"

@ -1,66 +0,0 @@
---
- debug: msg="START cli/sublevel_exact.yaml"
- name: setup
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
- seq 25 permit ip host 5.5.5.5 any count byte
parents: ['ip access-list test']
before: ['no ip access-list test']
after: ['exit']
provider: "{{ cli }}"
match: none
- name: configure sub level command using exact match
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
parents: ['ip access-list test']
after: ['exit']
match: exact
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip access-list test' in result.updates"
- "'seq 5 permit ip host 1.1.1.1 any count byte' in result.updates"
- "'seq 10 permit ip host 2.2.2.2 any count byte' in result.updates"
- "'seq 15 permit ip host 3.3.3.3 any count byte' in result.updates"
- "'seq 20 permit ip host 4.4.4.4 any count byte' in result.updates"
- "'seq 25 permit ip host 5.5.5.5 any count byte' not in result.updates"
- name: check sub level command using exact match
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
- seq 25 permit ip host 5.5.5.5 any count byte
parents: ['ip access-list test']
after: ['exit']
match: exact
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines:
- no ip access-list test
provider: "{{ cli }}"
match: none
- debug: msg="END cli/sublevel_exact.yaml"

@ -1,63 +0,0 @@
---
- debug: msg="START cli/sublevel_strict.yaml"
- name: setup
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
- seq 25 permit ip host 5.5.5.5 any count byte
parents: ['ip access-list test']
before: ['no ip access-list test']
after: ['exit']
provider: "{{ cli }}"
match: none
- name: configure sub level command using strict match
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 20 permit ip host 4.4.4.4 any count byte
parents: ['ip access-list test']
match: strict
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: check sub level command using strict match
dellos10_config:
lines:
- seq 5 permit ip host 1.1.1.1 any count byte
- seq 15 permit ip host 3.3.3.3 any count byte
- seq 10 permit ip host 2.2.2.2 any count byte
parents: ['ip access-list test']
after: ['exit']
match: strict
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'ip access-list test' in result.updates"
- "'seq 5 permit ip host 1.1.1.1 any count byte' not in result.updates"
- "'seq 10 permit ip host 2.2.2.2 any count byte' in result.updates"
- "'seq 15 permit ip host 3.3.3.3 any count byte' in result.updates"
- "'seq 20 permit ip host 4.4.4.4 any count byte' not in result.updates"
- "'seq 25 permit ip host 5.5.5.5 any count byte' not in result.updates"
- name: teardown
dellos10_config:
lines:
- no ip access-list test
provider: "{{ cli }}"
match: none
- debug: msg="END cli/sublevel_strict.yaml"

@ -1,37 +0,0 @@
---
- debug: msg="START cli/toplevel.yaml"
- name: setup
dellos10_config:
lines: ['hostname {{ inventory_hostname }}']
provider: "{{ cli }}"
match: none
- name: configure top level command
dellos10_config:
lines: ['hostname foo']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'hostname foo' in result.updates"
- name: configure top level command idempotent check
dellos10_config:
lines: ['hostname foo']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines: ['hostname {{ inventory_hostname }}']
provider: "{{ cli }}"
match: none
- debug: msg="END cli/toplevel.yaml"

@ -1,44 +0,0 @@
---
- debug: msg="START cli/toplevel_after.yaml"
- name: setup
dellos10_config:
lines:
- "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}"
provider: "{{ cli }}"
match: none
- name: configure top level command with before
dellos10_config:
lines: ['hostname foo']
after: ['snmp-server contact bar']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'hostname foo' in result.updates"
- "'snmp-server contact bar' in result.updates"
- name: configure top level command with before idempotent check
dellos10_config:
lines: ['hostname foo']
after: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines:
- "no snmp-server contact"
- "hostname {{ inventory_hostname }}"
provider: "{{ cli }}"
match: none
- debug: msg="END cli/toplevel_after.yaml"

@ -1,44 +0,0 @@
---
- debug: msg="START cli/toplevel_before.yaml"
- name: setup
dellos10_config:
lines:
- "snmp-server contact ansible"
- "hostname {{ inventory_hostname }}"
provider: "{{ cli }}"
match: none
- name: configure top level command with before
dellos10_config:
lines: ['hostname foo']
before: ['snmp-server contact bar']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == true"
- "'hostname foo' in result.updates"
- "'snmp-server contact bar' in result.updates"
- name: configure top level command with before idempotent check
dellos10_config:
lines: ['hostname foo']
before: ['snmp-server contact foo']
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines:
- "no snmp-server contact"
- "hostname {{ inventory_hostname }}"
provider: "{{ cli }}"
match: none
- debug: msg="END cli/toplevel_before.yaml"

@ -1,39 +0,0 @@
---
- debug: msg="START cli/toplevel_nonidempotent.yaml"
- name: setup
dellos10_config:
lines: ['hostname {{ inventory_hostname }}']
provider: "{{ cli }}"
match: none
- name: configure top level command
dellos10_config:
lines: ['hostname foo']
provider: "{{ cli }}"
match: strict
register: result
- assert:
that:
- "result.changed == true"
- "'hostname foo' in result.updates"
- name: configure top level command idempotent check
dellos10_config:
lines: ['hostname foo']
provider: "{{ cli }}"
match: strict
register: result
- assert:
that:
- "result.changed == false"
- name: teardown
dellos10_config:
lines: ['hostname {{ inventory_hostname }}']
provider: "{{ cli }}"
match: none
- debug: msg="END cli/toplevel_nonidempotent.yaml"

@ -1,14 +0,0 @@
---
- name: collect all cli test cases
find:
paths: "{{ role_path }}/tests/cli"
patterns: "{{ testcase }}.yaml"
register: test_cases
- name: set test_items
set_fact:
test_items: "{{ test_cases.files | map(attribute='path') | list }}"
- name: run test case
include: "{{ item }}"
with_items: "{{ test_items }}"

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

@ -1,48 +0,0 @@
---
- debug: msg="START cli/facts.yaml"
- name: test all facts
dellos10_facts:
gather_subset:
- all
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.ansible_facts is defined"
- "result.ansible_facts.ansible_net_interfaces is defined"
- "result.ansible_facts.ansible_net_memfree_mb is defined"
- "result.ansible_facts.ansible_net_model is defined"
- "result.ansible_facts.ansible_net_servicetag is defined"
- "result.ansible_facts.ansible_net_version is defined"
- name: test all facts except hardware
dellos10_facts:
gather_subset:
- "!hardware"
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.ansible_facts.ansible_net_interfaces is defined"
- "result.ansible_facts.ansible_net_memfree_mb is not defined"
- name: test interface facts
dellos10_facts:
gather_subset:
- interfaces
provider: "{{ cli }}"
register: result
- assert:
that:
- "result.changed == false"
- "result.ansible_facts.ansible_net_interfaces is defined"
- "result.ansible_facts.ansible_net_memfree_mb is not defined"
- debug: msg="END cli/facts.yaml"
Loading…
Cancel
Save