Skip to content

Commit

Permalink
fix ipv5 mgmt address getter and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 23, 2021
1 parent 7491226 commit 7e1fda3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions tests/01-smoke/01-basic-flow.robot
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ${runtime} docker
# defaults to docker exec. Will be rewritten to containerd `ctr` if needed in "Define runtime exec" test
${runtime-cli-exec-cmd} sudo docker exec
${bind-orig-path} /tmp/clab-01-test.txt
${n2-ipv4} 172.20.20.100/24
${n2-ipv6} 2001:172:20:20::100/64

*** Test Cases ***
Deploy ${lab-name} lab
Expand Down Expand Up @@ -85,6 +87,16 @@ Verify port forwarding for node l2
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Thank you for using nginx

Verify static mgmt addressing for l2
${rc} ${ipv4} = Run And Return Rc And Output
... ${runtime-cli-exec-cmd} clab-2-linux-nodes-l2 ip -o -4 a sh eth0 | cut -d ' ' -f7
Log ${ipv4}
Should Be Equal As Strings ${ipv4} ${n2-ipv4}
${rc} ${ipv6} = Run And Return Rc And Output
... ${runtime-cli-exec-cmd} clab-2-linux-nodes-l2 ip -o -6 a sh eth0 | cut -d ' ' -f7 | head -1
Log ${ipv6}
Should Be Equal As Strings ${ipv6} ${n2-ipv6}

Destroy ${lab-name} lab
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} destroy -t ${CURDIR}/01-linux-nodes.clab.yml --cleanup
Expand Down
2 changes: 2 additions & 0 deletions tests/01-smoke/01-linux-nodes.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ topology:
image: nginx:stable-alpine
ports:
- 56180:80
mgmt_ipv4: 172.20.20.100
mgmt_ipv6: 2001:172:20:20::100

links:
- endpoints: ["l1:eth1", "l2:eth1"]
Expand Down
2 changes: 1 addition & 1 deletion types/node_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (n *NodeDefinition) GetMgmtIPv6() string {
if n == nil {
return ""
}
return n.MgmtIPv4
return n.MgmtIPv6
}

func (n *NodeDefinition) GetPublish() []string {
Expand Down

0 comments on commit 7e1fda3

Please sign in to comment.