summaryrefslogtreecommitdiff
path: root/test/integration/targets/prepare_nxos_tests
diff options
context:
space:
mode:
authorrahushen <rahul.shenoy.86@gmail.com>2017-08-10 05:29:13 -0400
committerNathaniel Case <this.is@nathanielca.se>2017-08-10 05:29:13 -0400
commit85fc4c67ef81bd62f7245f4dab4d623190c6875c (patch)
treeb0132e71187385b5b446c6af12d51a5dd58b321b /test/integration/targets/prepare_nxos_tests
parent7e2169f6d5d2d230a0bfd294412edf06c6e6d2d6 (diff)
downloadansible-85fc4c67ef81bd62f7245f4dab4d623190c6875c.tar.gz
Add integration tests for nxos_facts, nxos_bgp, nxos_bgp_af, nxos_bgp_neighbor, and nxos_evpn_global (#26924)
* Add new ITs for nxos_bgp, nxos_bgp_af, nxos_bgp_neighbor, and nxos_evpn_global * Add nxos_facts IT and enhance existing tests * switch nxos_feature tests to use bgp * misc. test fixes * Add checks for titanium in IT * Handle non-titanium case in tests
Diffstat (limited to 'test/integration/targets/prepare_nxos_tests')
-rw-r--r--test/integration/targets/prepare_nxos_tests/tasks/main.yml34
1 files changed, 28 insertions, 6 deletions
diff --git a/test/integration/targets/prepare_nxos_tests/tasks/main.yml b/test/integration/targets/prepare_nxos_tests/tasks/main.yml
index 9dfbd13a03..bd9abf9e8f 100644
--- a/test/integration/targets/prepare_nxos_tests/tasks/main.yml
+++ b/test/integration/targets/prepare_nxos_tests/tasks/main.yml
@@ -1,13 +1,31 @@
---
-# NXAPI is enabled differently on NX-OS platforms.
-# Try both commands to enable NXAPI and ignore any errors.
-- name: enable nxapi on remote device
- nxos_feature:
- feature: nxapi
- state: enabled
+# There is a bug currently where the nxapi server can get
+# stuck in a bad state when enabling/disabling rapidly by
+# the integration tests.
+#
+# Toggle the command off/on as mitigation.
+- name: Toggle feature nxapi - Disable
+ nxos_config:
+ lines:
+ - no feature nxapi
provider: "{{ cli }}"
ignore_errors: yes
+# Pause after disabling nxapi
+- pause:
+ seconds: 3
+
+- name: Toggle feature nxapi - Enable
+ nxos_config:
+ lines:
+ - feature nxapi
+ provider: "{{ cli }}"
+ ignore_errors: yes
+
+# Pause after enabling nxapi
+- pause:
+ seconds: 3
+
# Gather the list of interfaces on this device and make the list
# available for integration tests that need them.
#
@@ -52,3 +70,7 @@
# Set platform to N9K-F for fretta
- set_fact: platform="N9K-F"
when: (platform | match("N9K")) and (fretta | search("true"))
+
+# Check if platform is titanium
+- set_fact: titanium={% for row in nxos_inventory_output.stdout_lines[0]['TABLE_inv']['ROW_inv'] if 'NX-OSv' in row['desc']%}"true"{% endfor %}
+ when: platform | match("N7K")