Skip to content

Commit

Permalink
added tests for inspect command to display ip addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed May 28, 2021
1 parent 62e901c commit c63e4b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
filters: |
code:
- 'clab/**'
- 'runtime/**'
- 'cmd/**'
- 'tests/**'
- '.github/workflows/cicd.yml'
Expand Down
17 changes: 17 additions & 0 deletions tests/01-smoke/01-basic-flow.robot
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*** Settings ***
Library OperatingSystem
Library String
Suite Teardown Run sudo containerlab destroy -t ${CURDIR}/01-linux-nodes.clab.yml --cleanup

*** Variables ***
Expand Down Expand Up @@ -43,6 +44,22 @@ Verify links in node l2
Should Be Equal As Integers ${rc} 0
Should Contain ${output} state UP

Ensure "inspect all" outputs IP addresses
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab inspect --all
Log ${output}
Should Be Equal As Integers ${rc} 0
${line} = String.Get Line ${output} -2
Log ${line}
@{data} = Split String ${line} |
Log ${data}
# verify ipv4 address
${ipv4} = String.Strip String ${data}[10]
Should Match Regexp ${ipv4} ^[\\d\\.]+/\\d{1,2}$
# verify ipv6 address
${ipv6} = String.Strip String ${data}[11]
Should Match Regexp ${ipv6} ^[\\d:]+/\\d{1,2}$

Destroy ${lab-name} lab
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab destroy -t ${CURDIR}/01-linux-nodes.clab.yml --cleanup
Expand Down

0 comments on commit c63e4b2

Please sign in to comment.