From c75c4cbfc88196f0279061905036a9b69520f854 Mon Sep 17 00:00:00 2001 From: Ricardo Carrillo Cruz Date: Wed, 11 Oct 2017 12:10:11 +0200 Subject: [PATCH] Introspect the management IP on ios_ping (#31571) On our CI we don't have external connectivity, so let's ping to the management interface IP. Also, ignore errors on the expected failures tests. --- .../targets/ios_ping/tests/cli/ping.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/integration/targets/ios_ping/tests/cli/ping.yaml b/test/integration/targets/ios_ping/tests/cli/ping.yaml index 353ce9ff9f4..12e39c78e07 100644 --- a/test/integration/targets/ios_ping/tests/cli/ping.yaml +++ b/test/integration/targets/ios_ping/tests/cli/ping.yaml @@ -1,9 +1,19 @@ --- - debug: msg="START cli/ping.yaml" +- name: Get show ip interface GigabitEthernet0/0 output + ios_command: + commands: + - show ip interface GigabitEthernet0/0 | include Internet address + authorize: yes + register: show_ip_interface_result + +- name: Extract the IP address from registered output + set_fact: management_ip="{{ show_ip_interface_result.stdout[0].split()[-1].split('/')[0] }}" + - name: expected successful ping ios_ping: &valid_ip - dest: '8.8.8.8' + dest: '{{ management_ip }}' authorize: yes register: esp @@ -13,6 +23,7 @@ timeout: 45 authorize: yes register: uup + ignore_errors: yes - name: unexpected successful ping ios_ping: @@ -20,6 +31,7 @@ state: 'absent' authorize: yes register: usp + ignore_errors: yes - name: expected unsuccessful ping ios_ping: