Skip to content

Commit

Permalink
added basic srl tests to ci runner
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Aug 10, 2021
1 parent 11a9b3f commit 96e3266
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,41 @@ jobs:
name: 03-basic-ceos-log
path: ./tests/out/*.html

srlinux-basic-tests:
runs-on: ubuntu-20.04
strategy:
matrix:
runtime: ["docker", "containerd"]
needs:
- unit-test
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Build containerlab
run: go build && sudo mv ./containerlab /usr/bin/containerlab
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install robotframework
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Run srlinux tests
run: |
bash ./tests/rf-run.sh ${{ matrix.runtime }} ./tests/02-basic-srl
# upload test reports as a zip file
- uses: actions/upload-artifact@v2
if: always()
with:
name: 02-basic-srl-log
path: ./tests/out/*.html

docs-test:
runs-on: ubuntu-20.04
needs: file-changes
Expand Down
20 changes: 14 additions & 6 deletions tests/02-basic-srl/01-two-srls.robot
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,41 @@ Suite Teardown Run Keyword Cleanup

*** Variables ***
${lab-name} 02-01-two-srls
${lab-file-name} 02-srl02.clab.yml
${runtime} docker

*** Test Cases ***
Deploy ${lab-name} lab
Log ${CURDIR}
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab deploy -t ${CURDIR}/02-srl02.clab.yml
... sudo containerlab deploy -t ${CURDIR}/${lab-file-name}
Log ${output}
Should Be Equal As Integers ${rc} 0

Wait 5 seconds
Wait 5 seconds for srl to boot
Sleep 5s

Verify links in node srl1
${rc} ${output} = Run And Return Rc And Output
... sudo docker exec clab-${lab-name}-srl1 ip link show e1-1
... sudo containerlab --runtime ${runtime} exec -t ${CURDIR}/${lab-file-name} --label clab-node-name\=srl1 --cmd "ip link show e1-1"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} state UP

Verify links in node srl2
${rc} ${output} = Run And Return Rc And Output
... sudo docker exec clab-${lab-name}-srl2 ip link show e1-1
... sudo containerlab --runtime ${runtime} exec -t ${CURDIR}/${lab-file-name} --label clab-node-name\=srl2 --cmd "ip link show e1-1"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} state UP

Verify saving config
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab --runtime ${runtime} save -t ${CURDIR}/${lab-file-name}
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} ERRO

*** Keywords ***
Cleanup
Run sudo containerlab destroy -t ${CURDIR}/02-srl02.clab.yml --cleanup
Run rm -rf ${CURDIR}/${lab-name}
Run sudo containerlab destroy -t ${CURDIR}/${lab-file-name} --cleanup
3 changes: 1 addition & 2 deletions tests/02-basic-srl/02-srl02.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ name: 02-01-two-srls
topology:
kinds:
srl:
image: srlinux:21.3.1-410
license: /home/gitlab-runner/srl-lic.key
image: ghcr.io/nokia/srlinux
nodes:
srl1:
kind: srl
Expand Down

0 comments on commit 96e3266

Please sign in to comment.