From 0f261964f73244e8e8d41613fb6ed4bb32c97285 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Fri, 4 Aug 2017 20:48:57 +0530 Subject: [PATCH] Make junos integration test checks platform independent (#27768) --- .../junos_command/tests/netconf_json/bad_operator.yaml | 4 ++-- .../junos_command/tests/netconf_json/contains.yaml | 5 ++--- .../junos_command/tests/netconf_json/equal.yaml | 10 ++++------ .../junos_command/tests/netconf_json/greaterthan.yaml | 8 ++++---- .../tests/netconf_json/greaterthanorequal.yaml | 8 ++++---- .../junos_command/tests/netconf_json/lessthan.yaml | 8 ++++---- .../tests/netconf_json/lessthanorequal.yaml | 8 ++++---- .../junos_command/tests/netconf_json/notequal.yaml | 4 ++-- .../junos_command/tests/netconf_text/bad_operator.yaml | 4 ++-- .../junos_command/tests/netconf_text/contains.yaml | 4 ++-- .../junos_command/tests/netconf_xml/bad_operator.yaml | 4 ++-- .../junos_command/tests/netconf_xml/greaterthan.yaml | 8 ++++---- .../tests/netconf_xml/greaterthanorequal.yaml | 8 ++++---- .../junos_command/tests/netconf_xml/lessthan.yaml | 8 ++++---- .../tests/netconf_xml/lessthanorequal.yaml | 8 ++++---- 15 files changed, 48 insertions(+), 51 deletions(-) diff --git a/test/integration/targets/junos_command/tests/netconf_json/bad_operator.yaml b/test/integration/targets/junos_command/tests/netconf_json/bad_operator.yaml index 03ada82d340..33fa7e5b9a3 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/bad_operator.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/bad_operator.yaml @@ -5,9 +5,9 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 wait_for: - - "result[0]['software-information'][0]['host-name'][0]['data'] foo fxp0" + - "result[0]['software-information'][0]['host-name'][0]['data'] foo lo0" format: json provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/contains.yaml b/test/integration/targets/junos_command/tests/netconf_json/contains.yaml index 51210f7b8d2..c7b333c3ec2 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/contains.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/contains.yaml @@ -5,11 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[0]['software-information'][0]['host-name'][0]['data'] contains {{ inventory_hostname_short }}" - - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] contains fxp0" + - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] contains lo0" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/equal.yaml b/test/integration/targets/junos_command/tests/netconf_json/equal.yaml index 21848804262..fad9817a94e 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/equal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/equal.yaml @@ -5,10 +5,9 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 wait_for: - - "result[0]['software-information'][0]['host-name'][0]['data'] == {{ inventory_hostname_short }}" - - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] == fxp0" + - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] == lo0" format: json provider: "{{ netconf }}" register: result @@ -23,10 +22,9 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 wait_for: - - "result[0]['software-information'][0]['host-name'][0]['data'] eq {{ inventory_hostname_short }}" - - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] eq fxp0" + - "result[1]['interface-information'][0]['physical-interface'][0]['name'][0]['data'] eq lo0" format: json provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/greaterthan.yaml b/test/integration/targets/junos_command/tests/netconf_json/greaterthan.yaml index 923152c33df..94854b96087 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/greaterthan.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/greaterthan.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] gt 1500" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] gt 5" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] > 1500" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] > 5" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/greaterthanorequal.yaml b/test/integration/targets/junos_command/tests/netconf_json/greaterthanorequal.yaml index 9f52587144e..cab4125cb99 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/greaterthanorequal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/greaterthanorequal.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] ge 1514" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] ge 6" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] >= 1514" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] >= 6" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/lessthan.yaml b/test/integration/targets/junos_command/tests/netconf_json/lessthan.yaml index 68e634d0635..292709b5167 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/lessthan.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/lessthan.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] lt 9000" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] lt 7" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] lt 9000" + - "result[1]['interface-information'][0]['physical-interface'][0]['local-index'][0]['data'] lt 7" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/lessthanorequal.yaml b/test/integration/targets/junos_command/tests/netconf_json/lessthanorequal.yaml index 1242bbf1f26..4a827bcdf77 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/lessthanorequal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/lessthanorequal.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] le 1514" + - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['local-index'] le 6" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['data'] <= 1514" + - "result[1]['interface-information'][0]['physical-interface'][0]['mtu'][0]['local-index'] <= 6" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_json/notequal.yaml b/test/integration/targets/junos_command/tests/netconf_json/notequal.yaml index b737b597c1e..e09fc275cdb 100644 --- a/test/integration/targets/junos_command/tests/netconf_json/notequal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_json/notequal.yaml @@ -5,7 +5,7 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - "result[0]['software-information'][0]['host-name'][0]['data'] neq localhost" @@ -22,7 +22,7 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: json wait_for: - "result[0]['software-information'][0]['host-name'][0]['data'] != localhost" diff --git a/test/integration/targets/junos_command/tests/netconf_text/bad_operator.yaml b/test/integration/targets/junos_command/tests/netconf_text/bad_operator.yaml index 91aac25edcc..26c3e3fe775 100644 --- a/test/integration/targets/junos_command/tests/netconf_text/bad_operator.yaml +++ b/test/integration/targets/junos_command/tests/netconf_text/bad_operator.yaml @@ -5,9 +5,9 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 wait_for: - - "result[1].interface-information[0].physical-interface[0].name[0].data foo fxp0" + - "result[1].interface-information[0].physical-interface[0].name[0].data foo lo0" encoding: text provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_text/contains.yaml b/test/integration/targets/junos_command/tests/netconf_text/contains.yaml index 00745cbe2e3..88dec402a81 100644 --- a/test/integration/targets/junos_command/tests/netconf_text/contains.yaml +++ b/test/integration/targets/junos_command/tests/netconf_text/contains.yaml @@ -5,11 +5,11 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 display: text wait_for: - "result[0] contains {{ inventory_hostname_short }}" - - "result[1] contains fxp0" + - "result[1] contains lo0" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_xml/bad_operator.yaml b/test/integration/targets/junos_command/tests/netconf_xml/bad_operator.yaml index e8ca7c96d97..26ba7409a96 100644 --- a/test/integration/targets/junos_command/tests/netconf_xml/bad_operator.yaml +++ b/test/integration/targets/junos_command/tests/netconf_xml/bad_operator.yaml @@ -5,9 +5,9 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 wait_for: - - "result[1].rpc-reply.interface-information[0].physical-interface[0].name[0].data foo fxp0" + - "result[1].rpc-reply.interface-information[0].physical-interface[0].name[0].data foo lo0" format: xml provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_xml/greaterthan.yaml b/test/integration/targets/junos_command/tests/netconf_xml/greaterthan.yaml index 6e02dad2881..e7bfb240364 100644 --- a/test/integration/targets/junos_command/tests/netconf_xml/greaterthan.yaml +++ b/test/integration/targets/junos_command/tests/netconf_xml/greaterthan.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu gt 1500" + - "result[1].rpc-reply.interface-information.physical-interface.local-index gt 5" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu > 1500" + - "result[1].rpc-reply.interface-information.physical-interface.local-index > 5" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_xml/greaterthanorequal.yaml b/test/integration/targets/junos_command/tests/netconf_xml/greaterthanorequal.yaml index 11e537c705c..b3d7d6675bf 100644 --- a/test/integration/targets/junos_command/tests/netconf_xml/greaterthanorequal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_xml/greaterthanorequal.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu ge 1514" + - "result[1].rpc-reply.interface-information.physical-interface.local-index ge 6" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu >= 1514" + - "result[1].rpc-reply.interface-information.physical-interface.local-index >= 6" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_xml/lessthan.yaml b/test/integration/targets/junos_command/tests/netconf_xml/lessthan.yaml index beea3882ff8..bab8333808c 100644 --- a/test/integration/targets/junos_command/tests/netconf_xml/lessthan.yaml +++ b/test/integration/targets/junos_command/tests/netconf_xml/lessthan.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu lt 9000" + - "result[1].rpc-reply.interface-information.physical-interface.local-index lt 7" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu lt 9000" + - "result[1].rpc-reply.interface-information.physical-interface.mtu lt 7" provider: "{{ netconf }}" register: result diff --git a/test/integration/targets/junos_command/tests/netconf_xml/lessthanorequal.yaml b/test/integration/targets/junos_command/tests/netconf_xml/lessthanorequal.yaml index 973f59203ef..164eb3cf17f 100644 --- a/test/integration/targets/junos_command/tests/netconf_xml/lessthanorequal.yaml +++ b/test/integration/targets/junos_command/tests/netconf_xml/lessthanorequal.yaml @@ -5,10 +5,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu le 1514" + - "result[1].rpc-reply.interface-information.physical-interface.local-index le 6" provider: "{{ netconf }}" register: result @@ -22,10 +22,10 @@ junos_command: commands: - show version - - show interfaces fxp0 + - show interfaces lo0 format: xml wait_for: - - "result[1].rpc-reply.interface-information.physical-interface.mtu <= 1514" + - "result[1].rpc-reply.interface-information.physical-interface.local-index <= 6" provider: "{{ netconf }}" register: result