Skip to content

Commit

Permalink
added tools cert command
Browse files Browse the repository at this point in the history
  • Loading branch information
hellt committed Jun 23, 2021
1 parent 5938293 commit 5f1c02b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/01-smoke/06-tools-certs.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
*** Comments ***
This test suite verifies that `tools cert` commands are working fine

*** Settings ***
Library OperatingSystem
Library String
# ensure we remove any certs from prev runs
Suite Setup Cleanup
Suite Teardown Cleanup

*** Variables ***
${root-ca-dir} /tmp/clab-tests/certs/06-ca
${node-cert-dir} /tmp/clab-tests/certs/06-node-cert

*** Test Cases ***
Create CA certificate
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab tools cert ca create --path ${root-ca-dir} --name root-ca --expiry 1m
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Certificate attributes: CN=containerlab.srlinux.dev, C=Internet, L=Server, O=Containerlab, OU=Containerlab Tools, Validity period=1m

Create and sign end node certificates
${rc} ${output} = Run And Return Rc And Output
... sudo containerlab tools cert sign --ca-cert ${root-ca-dir}/root-ca.pem --ca-key ${root-ca-dir}/root-ca-key.pem --hosts node.io,192.168.0.1 --path ${node-cert-dir}
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Creating and signing certificate: Hosts=[\\"node.io\\" \\"192.168.0.1\\"], CN=containerlab.srlinux.dev, C=Internet, L=Server, O=Containerlab, OU=Containerlab Tools

*** Keywords ***
Cleanup
Run rm -rf ${root-ca-dir}
Run rm -rf ${node-cert-dir}

0 comments on commit 5f1c02b

Please sign in to comment.