From 46263d77f145ffd46a0ff05ce61c5b96026c02f8 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Mon, 8 Jan 2018 10:56:47 -0500 Subject: [PATCH] Fixes for nxos_config integration tests (#34579) * deletage_to: localhost -> connection: local * Fix test setup --- .../targets/nxos_config/tests/common/backup.yaml | 10 ++++------ .../nxos_config/tests/common/sublevel_block.yaml | 13 +++---------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/test/integration/targets/nxos_config/tests/common/backup.yaml b/test/integration/targets/nxos_config/tests/common/backup.yaml index 15340fd6d46..a9e2f1f82be 100644 --- a/test/integration/targets/nxos_config/tests/common/backup.yaml +++ b/test/integration/targets/nxos_config/tests/common/backup.yaml @@ -17,11 +17,11 @@ provider: "{{ connection }}" - name: collect any backup files - find: + find: &backups paths: "{{ role_path }}/backup" pattern: "{{ inventory_hostname_short }}_config*" + connection: local register: backup_files - delegate_to: localhost - name: delete backup files file: @@ -46,11 +46,9 @@ - "result.updates is defined" - name: collect any backup files - find: - paths: "{{ role_path }}/backup" - pattern: "{{ inventory_hostname_short }}_config*" + find: *backups + connection: local register: backup_files - delegate_to: localhost - assert: that: diff --git a/test/integration/targets/nxos_config/tests/common/sublevel_block.yaml b/test/integration/targets/nxos_config/tests/common/sublevel_block.yaml index c70e8f51eb1..7a4864664d5 100644 --- a/test/integration/targets/nxos_config/tests/common/sublevel_block.yaml +++ b/test/integration/targets/nxos_config/tests/common/sublevel_block.yaml @@ -4,12 +4,8 @@ when: ansible_connection == "local" - name: setup - nxos_config: - lines: - - 10 permit ip 1.1.1.1/32 any log - - 20 permit ip 2.2.2.2/32 any log - - 30 permit ip 3.3.3.3/32 any log - parents: ip access-list test + nxos_config: &clear + lines: no ip access-list test provider: "{{ connection }}" match: none @@ -51,9 +47,6 @@ - "result.changed == false" - name: teardown - nxos_config: - lines: no ip access-list test - provider: "{{ connection }}" - match: none + nxos_config: *clear - debug: msg='END connection={{ ansible_connection }}/sublevel_block.yaml'