Skip to content

Commit

Permalink
added bind mount test
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 23, 2021
1 parent 5f1c02b commit 2179a68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/01-smoke/01-basic-flow.robot
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Settings ***
Library OperatingSystem
Library String
Suite Setup Setup
Suite Teardown Run sudo containerlab --runtime ${runtime} destroy -t ${CURDIR}/01-linux-nodes.clab.yml --cleanup

*** Variables ***
Expand All @@ -9,6 +10,7 @@ ${runtime} docker
# runtime command to execute tasks in a container
# 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

*** Test Cases ***
Deploy ${lab-name} lab
Expand Down Expand Up @@ -69,8 +71,20 @@ Ensure "inspect all" outputs IP addresses
${ipv6} = String.Strip String ${data}[11]
Should Match Regexp ${ipv6} ^[\\d:abcdef]+/\\d{1,2}$

Verify bind mount in l1 node
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} exec -t ${CURDIR}/01-linux-nodes.clab.yml --label clab-node-name=l1 cat 01-test.txt
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Hello, containerlab

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
Log ${output}
Should Be Equal As Integers ${rc} 0

*** Keywords ***
Setup
Run rm -rf ${bind-orig-path}
OperatingSystem.Create File ${bind-orig-path} Hello, containerlab
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 @@ -10,6 +10,8 @@ topology:
kind: linux
image: alpine:3
cmd: ash -c "sleep 9999"
binds:
- /tmp/clab-01-test.txt:/01-test.txt
l2:
kind: linux
image: alpine:3
Expand Down

0 comments on commit 2179a68

Please sign in to comment.