Skip to content

Commit

Permalink
added tests for host mode networking
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 23, 2021
1 parent ffd11b4 commit 9dcc3ca
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/01-smoke/01-linux-nodes.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ topology:
- 56180:80
mgmt_ipv4: 172.20.20.100
mgmt_ipv6: 2001:172:20:20::100
l3:
kind: linux
image: nginx:stable-alpine
network-mode: host

links:
- endpoints: ["l1:eth1", "l2:eth1"]
Expand Down
15 changes: 15 additions & 0 deletions tests/01-smoke/02-destroy-all.robot
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
*** Comments ***
This suite tests:
- the destroy --all operation
- the host mode networking for l3 node

*** Settings ***
Library OperatingSystem
Suite Teardown Run sudo containerlab --runtime ${runtime} destroy --all --cleanup
Expand All @@ -18,6 +23,16 @@ Deploy second lab
Log ${output}
Should Be Equal As Integers ${rc} 0

Verify host mode networking for node l3
# l3 node is launched with host mode networking
# since it is the nginx container, by launching it in the host mode
# we should be able to curl localhost:80
${rc} ${output} = Run And Return Rc And Output
... curl localhost:80
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Thank you for using nginx

Destroy all labs
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} destroy --all --cleanup
Expand Down

0 comments on commit 9dcc3ca

Please sign in to comment.