Skip to content

Commit

Permalink
Polish IOL test (#2352)
Browse files Browse the repository at this point in the history
use correct path to the labdir
  • Loading branch information
hellt authored Dec 19, 2024
1 parent 2c89855 commit 9fe5485
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions tests/10-basic-cisco_iol/01-iol.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -117,19 +121,24 @@ 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}
Should Be Equal As Integers ${rc} 0
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

0 comments on commit 9fe5485

Please sign in to comment.