From 87422ea7e740fc57ffa0609d912e5b6cfe415b1e Mon Sep 17 00:00:00 2001 From: Mike Wiebe Date: Mon, 3 Jun 2019 09:03:52 -0400 Subject: [PATCH] nxos_snmp_user, nxos_snmp_host integration test fixes. (#57201) * Fix nxos_snmp tests * Add imagetag check for nxos_snmp_user test --- .../tests/common/sanity_snmp_v3_inform.yaml | 2 +- .../targets/nxos_snmp_user/tests/common/sanity.yaml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/integration/targets/nxos_snmp_host/tests/common/sanity_snmp_v3_inform.yaml b/test/integration/targets/nxos_snmp_host/tests/common/sanity_snmp_v3_inform.yaml index 07f2d80e783..a6b6402e8aa 100644 --- a/test/integration/targets/nxos_snmp_host/tests/common/sanity_snmp_v3_inform.yaml +++ b/test/integration/targets/nxos_snmp_host/tests/common/sanity_snmp_v3_inform.yaml @@ -1,7 +1,7 @@ --- - set_fact: snmp_type="inform" - set_fact: snmp_version="v3" -- set_fact: snmp_auth="noauth" +- set_fact: snmp_auth="priv" - debug: msg="START connection={{ ansible_connection }} nxos_snmp_host {{ snmp_type }} {{ snmp_version }} sanity test" - debug: msg="Using provider={{ connection.transport }}" diff --git a/test/integration/targets/nxos_snmp_user/tests/common/sanity.yaml b/test/integration/targets/nxos_snmp_user/tests/common/sanity.yaml index 6ac8291b476..7f70cbeeb67 100644 --- a/test/integration/targets/nxos_snmp_user/tests/common/sanity.yaml +++ b/test/integration/targets/nxos_snmp_user/tests/common/sanity.yaml @@ -3,6 +3,12 @@ - debug: msg="Using provider={{ connection.transport }}" when: ansible_connection == "local" +- set_fact: delete_last_user_allowed='true' +- set_fact: delete_last_user_allowed='false' + when: imagetag and (imagetag is version_compare('9.1', 'ge')) +- set_fact: delete_last_user_allowed='false' + when: platform is search('N5K|N6K|N9K-F') + - name: Remove snmp user nxos_snmp_user: &remove_snmp_user user: ntc @@ -95,7 +101,7 @@ register: result - assert: *false - when: platform is not search('N5K|N6K|N9K-F') + when: delete_last_user_allowed always: - name: delete snmp user