diff options
author | John R Barker <john@johnrbarker.com> | 2017-01-20 20:18:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-20 20:18:12 +0000 |
commit | a12033a6e0ea280fbd5b3643b640ff39f434553b (patch) | |
tree | 96c3cc393297ef1ad020f6e5e8c040749edda147 /test/integration/targets/ios_config | |
parent | 7330ab8062545478e3b1951c94ae4c98008244ea (diff) | |
download | ansible-a12033a6e0ea280fbd5b3643b640ff39f434553b.tar.gz |
integration/targets/ios_* work to support IOS (#20414)
* WIP
* Don't set connection: network_cli in the playbook
* ios_config tests now passing
* Create test loopback device
* delete
* ios_* pass (apart from ios_facts)
* Remove provider lines
Diffstat (limited to 'test/integration/targets/ios_config')
17 files changed, 24 insertions, 109 deletions
diff --git a/test/integration/targets/ios_config/meta/main.yml b/test/integration/targets/ios_config/meta/main.yml new file mode 100644 index 0000000000..159cea8d38 --- /dev/null +++ b/test/integration/targets/ios_config/meta/main.yml @@ -0,0 +1,2 @@ +dependencies: + - prepare_ios_tests diff --git a/test/integration/targets/ios_config/tasks/cli.yaml b/test/integration/targets/ios_config/tasks/cli.yaml index d675462dd0..46d86dd698 100644 --- a/test/integration/targets/ios_config/tasks/cli.yaml +++ b/test/integration/targets/ios_config/tasks/cli.yaml @@ -4,6 +4,7 @@ paths: "{{ role_path }}/tests/cli" patterns: "{{ testcase }}.yaml" register: test_cases + delegate_to: localhost - name: set test_items set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}" diff --git a/test/integration/targets/ios_config/tests/cli/backup.yaml b/test/integration/targets/ios_config/tests/cli/backup.yaml index 68a337adee..6549e9b319 100644 --- a/test/integration/targets/ios_config/tests/cli/backup.yaml +++ b/test/integration/targets/ios_config/tests/cli/backup.yaml @@ -9,7 +9,6 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: collect any backup files find: @@ -28,13 +27,13 @@ ios_config: src: basic/config.j2 backup: yes - provider: "{{ cli }}" register: result - assert: that: - "result.changed == true" - - "result.updates is not defined" +# FIXME Bug https://github.com/ansible/ansible/issues/19382 +# - "result.updates is not defined" - name: collect any backup files find: diff --git a/test/integration/targets/ios_config/tests/cli/defaults.yaml b/test/integration/targets/ios_config/tests/cli/defaults.yaml index b78b589d45..aec73f9fe6 100644 --- a/test/integration/targets/ios_config/tests/cli/defaults.yaml +++ b/test/integration/targets/ios_config/tests/cli/defaults.yaml @@ -9,13 +9,11 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: configure device with defaults included ios_config: src: defaults/config.j2 defaults: yes - provider: "{{ cli }}" register: result - debug: var=result @@ -23,13 +21,13 @@ - assert: that: - "result.changed == true" - - "result.updates is not defined" +# FIXME Bug https://github.com/ansible/ansible/issues/19382 +# - "result.updates is not defined" - name: check device with defaults included ios_config: src: defaults/config.j2 defaults: yes - provider: "{{ cli }}" register: result - debug: var=result diff --git a/test/integration/targets/ios_config/tests/cli/save.yaml b/test/integration/targets/ios_config/tests/cli/save.yaml index a886210e61..cad199ca75 100644 --- a/test/integration/targets/ios_config/tests/cli/save.yaml +++ b/test/integration/targets/ios_config/tests/cli/save.yaml @@ -9,13 +9,11 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: save config ios_config: save: true - provider: "{{ cli }}" register: result # FIXME https://github.com/ansible/ansible-modules-core/issues/5008 ignore_errors: true @@ -29,7 +27,6 @@ - name: save should always run ios_config: save: true - provider: "{{ cli }}" register: result # FIXME https://github.com/ansible/ansible-modules-core/issues/5008 ignore_errors: true diff --git a/test/integration/targets/ios_config/tests/cli/src_basic.yaml b/test/integration/targets/ios_config/tests/cli/src_basic.yaml index 177d19f926..84b2a3b533 100644 --- a/test/integration/targets/ios_config/tests/cli/src_basic.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_basic.yaml @@ -9,30 +9,32 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: configure device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" register: result +- name: debug, remove me + debug: + msg: "{{ result }}" - assert: that: - "result.changed == true" # https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.updates is not defined" +# FIXME Bug https://github.com/ansible/ansible/issues/19382 +# - "result.updates is not defined" - name: check device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" register: result - assert: that: - "result.changed == false" # https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.updates is not defined" +# FIXME Bug https://github.com/ansible/ansible/issues/19382 +# - "result.updates is not defined" - debug: msg="END cli/src_basic.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml b/test/integration/targets/ios_config/tests/cli/src_invalid.yaml index 5081f1a736..a06b743159 100644 --- a/test/integration/targets/ios_config/tests/cli/src_invalid.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_invalid.yaml @@ -6,7 +6,6 @@ - name: configure with invalid src ios_config: src: basic/foobar.j2 - provider: "{{ cli }}" register: result ignore_errors: yes diff --git a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml index b55d7a545b..38e1686bfd 100644 --- a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml +++ b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml @@ -9,12 +9,10 @@ parents: - interface Loopback999 match: none - provider: "{{ cli }}" - name: configure device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" match: none register: result @@ -22,12 +20,12 @@ that: - "result.changed == true" # https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.updates is not defined" +# FIXME Bug https://github.com/ansible/ansible/issues/19382 +# - "result.updates is not defined" - name: check device with config ios_config: src: basic/config.j2 - provider: "{{ cli }}" register: result - assert: diff --git a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml.orig b/test/integration/targets/ios_config/tests/cli/src_match_none.yaml.orig deleted file mode 100644 index 1e063d5ef7..0000000000 --- a/test/integration/targets/ios_config/tests/cli/src_match_none.yaml.orig +++ /dev/null @@ -1,49 +0,0 @@ ---- -- debug: msg="START cli/src_match_none.yaml" - -- name: setup - ios_config: - commands: - - no description - - no shutdown - parents: - - interface Loopback999 - match: none - provider: "{{ cli }}" - -- name: configure device with config - ios_config: - src: basic/config.j2 - provider: "{{ cli }}" - match: none - register: result - -- assert: - that: - - "result.changed == true" -# https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.updates is not defined" - -- name: check device with config - ios_config: - src: basic/config.j2 - provider: "{{ cli }}" -<<<<<<< f84b1d496e52b69dab38894e7ec7b90b63857331 -======= - match: none ->>>>>>> Tests for ios_config - register: result - -- assert: - that: - # Idempotent test -# https://github.com/ansible/ansible-modules-core/issues/4807 - - "result.changed == false" - - "result.updates is not defined" -<<<<<<< f84b1d496e52b69dab38894e7ec7b90b63857331 -======= -# FIXME bug https://github.com/ansible/ansible-modules-core/issues/5003 - ignore_errors: true ->>>>>>> Tests for ios_config - -- debug: msg="END cli/src_match_none.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel.yaml b/test/integration/targets/ios_config/tests/cli/sublevel.yaml index a5b13a3a66..662564966b 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel.yaml @@ -6,14 +6,12 @@ lines: - 'no ip access-list extended test' - 'no ip access-list standard test' - provider: "{{ cli }}" match: none - name: configure sub level command ios_config: lines: ['permit ip any any log'] parents: ['ip access-list extended test'] - provider: "{{ cli }}" register: result - assert: @@ -26,7 +24,6 @@ ios_config: lines: ['permit ip any any log'] parents: ['ip access-list extended test'] - provider: "{{ cli }}" register: result - assert: @@ -37,7 +34,6 @@ ios_config: lines: - 'no ip access-list extended test' - provider: "{{ cli }}" match: none - debug: msg="END cli/sublevel.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml index 142ed6ee86..6753dba66b 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_block.yaml @@ -10,7 +10,6 @@ parents: ['ip access-list extended test'] before: ['no ip access-list extended test'] after: ['exit'] - provider: "{{ cli }}" match: none - name: configure sub level command using block resplace @@ -23,7 +22,6 @@ parents: ['ip access-list extended test'] replace: block after: ['exit'] - provider: "{{ cli }}" register: result - assert: @@ -45,7 +43,6 @@ parents: ['ip access-list extended test'] replace: block after: ['exit'] - provider: "{{ cli }}" register: result - assert: @@ -57,6 +54,5 @@ lines: - no ip access-list extended test match: none - provider: "{{ cli }}" - debug: msg="END cli/sublevel_block.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml index 0ef170ffcb..baec330300 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_exact.yaml @@ -13,7 +13,6 @@ before: no ip access-list extended test after: exit match: none - provider: "{{ cli }}" - name: configure sub level command using exact match ios_config: @@ -26,7 +25,6 @@ before: no ip access-list extended test after: exit match: exact - provider: "{{ cli }}" register: result - assert: @@ -48,7 +46,6 @@ - permit ip host 4.4.4.4 any log parents: ip access-list extended test match: exact - provider: "{{ cli }}" register: result - assert: @@ -60,6 +57,5 @@ lines: - no ip access-list extended test match: none - provider: "{{ cli }}" - debug: msg="END cli/sublevel_exact.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml b/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml index f626b94f2d..f227ffcc9f 100644 --- a/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml +++ b/test/integration/targets/ios_config/tests/cli/sublevel_strict.yaml @@ -12,7 +12,6 @@ parents: ip access-list extended test before: no ip access-list extended test match: none - provider: "{{ cli }}" - name: configure sub level command using strict match ios_config: @@ -23,7 +22,6 @@ - permit ip host 4.4.4.4 any log parents: ip access-list extended test match: strict - provider: "{{ cli }}" register: result - assert: @@ -39,7 +37,6 @@ parents: ip access-list extended test after: exit match: strict - provider: "{{ cli }}" register: result - assert: @@ -56,6 +53,5 @@ ios_config: lines: no ip access-list extended test match: none - provider: "{{ cli }}" - debug: msg="END cli/sublevel_strict.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel.yaml b/test/integration/targets/ios_config/tests/cli/toplevel.yaml index 59f4f50c23..9f62d4388e 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel.yaml @@ -3,14 +3,12 @@ - name: setup ios_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" + lines: ['hostname {{ shorter_hostname }}'] match: none - name: configure top level command ios_config: lines: ['hostname foo'] - provider: "{{ cli }}" register: result - assert: @@ -21,7 +19,6 @@ - name: configure top level command idempotent check ios_config: lines: ['hostname foo'] - provider: "{{ cli }}" register: result - assert: @@ -30,8 +27,7 @@ - name: teardown ios_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" + lines: ['hostname {{ shorter_hostname }}'] match: none - debug: msg="END cli/toplevel.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml index e3182491c2..a2333531bd 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_after.yaml @@ -5,15 +5,13 @@ ios_config: lines: - "snmp-server contact ansible" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" + - "hostname {{ shorter_hostname }}" match: none - name: configure top level command with before ios_config: lines: ['hostname foo'] after: ['snmp-server contact bar'] - provider: "{{ cli }}" register: result - assert: @@ -26,7 +24,6 @@ ios_config: lines: ['hostname foo'] after: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -37,8 +34,7 @@ ios_config: lines: - "no snmp-server contact" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" + - "hostname {{ shorter_hostname }}" match: none - debug: msg="END cli/toplevel_after.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml index b459bf194c..eff481be2b 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_before.yaml @@ -5,15 +5,13 @@ ios_config: lines: - "snmp-server contact ansible" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" + - "hostname {{ shorter_hostname }}" match: none - name: configure top level command with before ios_config: lines: ['hostname foo'] before: ['snmp-server contact bar'] - provider: "{{ cli }}" register: result - assert: @@ -26,7 +24,6 @@ ios_config: lines: ['hostname foo'] before: ['snmp-server contact foo'] - provider: "{{ cli }}" register: result - assert: @@ -37,8 +34,7 @@ ios_config: lines: - "no snmp-server contact" - - "hostname {{ inventory_hostname_short }}" - provider: "{{ cli }}" + - "hostname {{ shorter_hostname }}" match: none - debug: msg="END cli/toplevel_before.yaml" diff --git a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml b/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml index 05343549e2..ce787bbdb4 100644 --- a/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml +++ b/test/integration/targets/ios_config/tests/cli/toplevel_nonidempotent.yaml @@ -3,14 +3,12 @@ - name: setup ios_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" + lines: ['hostname {{ shorter_hostname }}'] match: none - name: configure top level command ios_config: lines: ['hostname foo'] - provider: "{{ cli }}" match: strict register: result @@ -22,7 +20,6 @@ - name: configure top level command idempotent check ios_config: lines: ['hostname foo'] - provider: "{{ cli }}" match: strict register: result @@ -32,8 +29,7 @@ - name: teardown ios_config: - lines: ['hostname {{ inventory_hostname_short }}'] - provider: "{{ cli }}" + lines: ['hostname {{ shorter_hostname }}'] match: none - debug: msg="END cli/toplevel_nonidempotent.yaml" |