From 9fe5485ecc3a83a04d7d49e6bad36a479d2e1db6 Mon Sep 17 00:00:00 2001 From: Roman Dodin Date: Thu, 19 Dec 2024 16:18:11 +0100 Subject: [PATCH] Polish IOL test (#2352) use correct path to the labdir --- tests/10-basic-cisco_iol/01-iol.robot | 65 +++++++++++++++------------ 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/tests/10-basic-cisco_iol/01-iol.robot b/tests/10-basic-cisco_iol/01-iol.robot index 8ea96c480..b810c8d45 100644 --- a/tests/10-basic-cisco_iol/01-iol.robot +++ b/tests/10-basic-cisco_iol/01-iol.robot @@ -61,13 +61,13 @@ Write configuration to NVRAM on router1 Should Contain ${output} [OK] Log IP addresses for router1 - ${rc} ${ipv4_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq '.nodes.router1."mgmt-ipv4-address"' - Log ${ipv4_addr} + ${rc} ${ipv4_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq '.nodes.router1."mgmt-ipv4-address"' + Log \n--> LOG: IPv4 addr - ${ipv4_addr} console=True Should Be Equal As Integers ${rc} 0 - ${rc} ${ipv6_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq '.nodes.router1."mgmt-ipv6-address"' - Log ${ipv6_addr} + ${rc} ${ipv6_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq '.nodes.router1."mgmt-ipv6-address"' + Log \n--> LOG: IPv6 addr - ${ipv6_addr} console=True Write configuration to NVRAM on switch ${rc} ${output} = Run And Return Rc And Output @@ -77,38 +77,42 @@ Write configuration to NVRAM on switch Should Contain ${output} [OK] Log IP addresses for switch - ${rc} ${ipv4_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq '.nodes.switch."mgmt-ipv4-address"' - Log ${ipv4_addr} + ${rc} ${ipv4_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq '.nodes.switch."mgmt-ipv4-address"' + Log \n--> LOG: IPv4 addr - ${ipv4_addr} console=True Should Be Equal As Integers ${rc} 0 - ${rc} ${ipv6_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq '.nodes.switch."mgmt-ipv6-address"' - Log ${ipv6_addr} + ${rc} ${ipv6_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq '.nodes.switch."mgmt-ipv6-address"' + Log \n--> LOG: IPv6 addr - ${ipv6_addr} console=True Destroy ${lab-name} lab - Log ${CURDIR} - ${rc} ${output} = Run And Return Rc And Output - ... sudo -E ${CLAB_BIN} --runtime ${runtime} destroy -t ${CURDIR}/${lab-file-name} - Log ${output} + Log ${CURDIR} + ${rc} ${output} = Run And Return Rc And Output + ... sudo -E ${CLAB_BIN} --runtime ${runtime} destroy -t ${CURDIR}/${lab-file-name} + Log ${output} Should Be Equal As Integers ${rc} 0 Re-deploy ${lab-name} lab - Log ${CURDIR} - ${rc} ${output} = Run And Return Rc And Output - ... sudo -E ${CLAB_BIN} --runtime ${runtime} deploy -t ${CURDIR}/${lab-file-name} - Log ${output} + Log ${CURDIR} + ${rc} ${output} = Run And Return Rc And Output + ... sudo -E ${CLAB_BIN} --runtime ${runtime} deploy -t ${CURDIR}/${lab-file-name} + Log ${output} Should Be Equal As Integers ${rc} 0 Wait 60s for nodes to boot Sleep 60s Verify connectivity via new management addresses on router1 - ${rc} ${ipv4_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq -r '.nodes.router1."mgmt-ipv4-address"' + ${rc} ${ipv4_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq -r '.nodes.router1."mgmt-ipv4-address"' Should Be Equal As Integers ${rc} 0 - ${rc} ${ipv6_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq -r '.nodes.router1."mgmt-ipv6-address"' + Log \n--> LOG: IPv4 addr - ${ipv4_addr} console=True + + ${rc} ${ipv6_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq -r '.nodes.router1."mgmt-ipv6-address"' Should Be Equal As Integers ${rc} 0 + Log \n--> LOG: IPv6 addr - ${ipv6_addr} console=True + ${rc} ${output} = Run And Return Rc And Output ... sshpass -p "admin" ssh -o "IdentitiesOnly=yes" admin@clab-${lab-name}-router1 "sh run interface Ethernet0/0" Log ${output} @@ -117,12 +121,16 @@ Verify connectivity via new management addresses on router1 Should Contain ${output} ${ipv6_addr.upper()} Verify connectivity via new management addresses on switch - ${rc} ${ipv4_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq -r '.nodes.switch."mgmt-ipv4-address"' + ${rc} ${ipv4_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq -r '.nodes.switch."mgmt-ipv4-address"' Should Be Equal As Integers ${rc} 0 - ${rc} ${ipv6_addr} = Run And Return Rc And Output - ... cat ${CURDIR}/clab-${lab-name}/topology-data.json | jq -r '.nodes.switch."mgmt-ipv6-address"' + Log \n--> LOG: IPv4 addr - ${ipv4_addr} console=True + + ${rc} ${ipv6_addr} = Run And Return Rc And Output + ... cat clab-${lab-name}/topology-data.json | jq -r '.nodes.switch."mgmt-ipv6-address"' Should Be Equal As Integers ${rc} 0 + Log \n--> LOG: IPv6 addr - ${ipv6_addr} console=True + ${rc} ${output} = Run And Return Rc And Output ... sshpass -p "admin" ssh -o "IdentitiesOnly=yes" admin@clab-${lab-name}-switch "sh run interface Ethernet0/0" Log ${output} @@ -130,6 +138,7 @@ Verify connectivity via new management addresses on switch Should Contain ${output} ${ipv4_addr.upper()} Should Contain ${output} ${ipv6_addr.upper()} + *** Keywords *** Cleanup Run sudo -E ${CLAB_BIN} --runtime ${runtime} destroy -t ${CURDIR}/${lab-file-name} --cleanup