|
| 1 | +*** Settings *** |
| 2 | +Library OperatingSystem |
| 3 | +Resource ../ssh.robot |
| 4 | +Resource ../common.robot |
| 5 | + |
| 6 | +Suite Teardown Run Keyword Cleanup |
| 7 | + |
| 8 | + |
| 9 | +*** Variables *** |
| 10 | +${lab-name} sr03 |
| 11 | +${lab-file-name} 03-srsim-dist.clab.yml |
| 12 | +${runtime} docker |
| 13 | +${key-name} clab-test-key |
| 14 | + |
| 15 | + |
| 16 | +*** Test Cases *** |
| 17 | +Set key-path Variable |
| 18 | + ${key-path} = OperatingSystem.Normalize Path ~/.ssh/${key-name} |
| 19 | + Set Suite Variable ${key-path} |
| 20 | + |
| 21 | +Create SSH keypair - RSA |
| 22 | + ${rc} ${output} = Run And Return Rc And Output |
| 23 | + ... ssh-keygen -t rsa -N "" -f ${key-path}-rsa |
| 24 | + |
| 25 | +Deploy ${lab-name} lab |
| 26 | + Log ${CURDIR} |
| 27 | + ${rc} ${output} = Run And Return Rc And Output |
| 28 | + ... ${CLAB_BIN} --runtime ${runtime} deploy -t ${CURDIR}/${lab-file-name} |
| 29 | + Log ${output} |
| 30 | + Should Be Equal As Integers ${rc} 0 |
| 31 | + |
| 32 | +Ensure sros is reachable over ssh |
| 33 | + Login via SSH with username and password |
| 34 | + ... address=clab-${lab-name}-sros-a |
| 35 | + ... username=admin |
| 36 | + ... password=NokiaSros1! |
| 37 | + ... try_for=10 |
| 38 | + |
| 39 | +Verify links in node l1 |
| 40 | + ${rc} ${output} = Run And Return Rc And Output |
| 41 | + ... ${CLAB_BIN} --runtime ${runtime} exec -t ${CURDIR}/${lab-file-name} --label clab-node-name\=l1 --cmd "ip link show eth1" |
| 42 | + Log ${output} |
| 43 | + Should Be Equal As Integers ${rc} 0 |
| 44 | + Should Contain ${output} state UP |
| 45 | + |
| 46 | +Ensure l1 can ping sros over 1/1/1 interface |
| 47 | + Sleep 30s give some time for linecards to come up |
| 48 | + ${rc} ${output} = Run And Return Rc And Output |
| 49 | + ... ${CLAB_BIN} --runtime ${runtime} exec -t ${CURDIR}/${lab-file-name} --label clab-node-name\=l1 --cmd "ping 10.0.0.2 -c2 -w 3" |
| 50 | + Log ${output} |
| 51 | + Should Be Equal As Integers ${rc} 0 |
| 52 | + Should Contain ${output} 0% packet loss |
| 53 | + |
| 54 | + |
| 55 | +*** Keywords *** |
| 56 | +Cleanup |
| 57 | + Run ${CLAB_BIN} --runtime ${runtime} destroy -t ${CURDIR}/${lab-file-name} --cleanup |
| 58 | + Run rm -f ${key-path}* |
0 commit comments