forked from srl-labs/containerlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path05-docker-bridge.robot
39 lines (34 loc) · 1.26 KB
/
05-docker-bridge.robot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
*** Settings ***
Library OperatingSystem
Library String
Suite Setup Setup
Suite Teardown Cleanup
*** Variables ***
${lab-name} 05-docker-bridge
${lab-file} 05-docker-bridge.clab.yml
${runtime} docker
*** Test Cases ***
Deploy ${lab-name} lab
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} deploy -t ${CURDIR}/${lab-file}
Log ${output}
Should Be Equal As Integers ${rc} 0
Ensure inspect outputs IP addresses
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} inspect -n ${lab-name}
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}[7]
Should Match Regexp ${ipv4} ^[\\d\\.]+/\\d{1,2}$
*** Keywords ***
Setup
# skipping this test suite for podman for now
Skip If '${runtime}' == 'podman'
Cleanup
${rc} ${output} = Run And Return Rc And Output sudo containerlab --runtime ${runtime} destroy -t ${CURDIR}/${lab-file} --cleanup
Log ${output}