Commit 3a9f5c24 authored by David José Araújo Ferreira's avatar David José Araújo Ferreira
Browse files

Merge branch 'feat/158-fixing-containerlab-lab-example' of...

Merge branch 'feat/158-fixing-containerlab-lab-example' of https://labs.etsi.org/rep/tfs/controller into feat/158-fixing-containerlab-lab-example
parents 185fbeb3 c816a439
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -83,19 +83,19 @@ $ssh admin@clab-tfs-scenario-srl1


# Check configurations done:
gnmic -a 172.100.100.101 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/network-instances' > srl1-nis.json
gnmic -a 172.100.100.101 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/interfaces' > srl1-ifs.json
gnmic -a 172.100.100.102 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/network-instances' > srl2-nis.json
gnmic -a 172.100.100.102 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/interfaces' > srl2-ifs.json
gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/network-instances' > srl1-nis.json
gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/interfaces' > srl1-ifs.json
gnmic -a clab-tfs-scenario-srl2 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/network-instances' > srl2-nis.json
gnmic -a clab-tfs-scenario-srl2 -u admin -p NokiaSrl1! --skip-verify -e json_ietf get --path '/interfaces' > srl2-ifs.json


# Delete elements:
gnmic -a 172.100.100.101 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/network-instances/network-instance[name=b19229e8]'
gnmic -a 172.100.100.101 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]'
gnmic -a 172.100.100.101 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]'
gnmic -a 172.100.100.102 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/network-instances/network-instance[name=b19229e8]'
gnmic -a 172.100.100.102 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]'
gnmic -a 172.100.100.102 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]'
gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/network-instances/network-instance[name=b19229e8]'
gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]'
gnmic -a clab-tfs-scenario-srl1 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]'
gnmic -a clab-tfs-scenario-srl2 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/network-instances/network-instance[name=b19229e8]'
gnmic -a clab-tfs-scenario-srl2 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]'
gnmic -a clab-tfs-scenario-srl2 -u admin -p NokiaSrl1! --skip-verify -e json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]'

# Run gNMI Driver in standalone mode (advanced)
PYTHONPATH=./src python -m src.device.tests.test_gnmi
+4 −4
Original line number Diff line number Diff line
set / interface ethernet-1/2 admin-state enable
set / interface ethernet-1/2 subinterface 0 admin-state enable
set / interface ethernet-1/2 subinterface 0 ipv4 admin-state enable
set / interface ethernet-1/2 subinterface 0 ipv4 address 172.16.1.1/24

set / interface ethernet-1/1 admin-state enable
set / interface ethernet-1/1 subinterface 0 admin-state enable
set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable
set / interface ethernet-1/1 subinterface 0 ipv4 address 172.0.0.1/30

set / network-instance default
set / network-instance default interface ethernet-1/1.0
set / network-instance default interface ethernet-1/2.0

set / network-instance default next-hop-groups group group1 nexthop 1 ip-address 172.0.0.2 admin-state enable
set / network-instance default static-routes route 172.16.2.0/24 next-hop-group group1 admin-state enable

set / system gnmi-server network-instance mgmt admin-state enable
 No newline at end of file
set / system management openconfig admin-state enable
set / system gnmi-server network-instance mgmt yang-models openconfig
 No newline at end of file
+7 −7
Original line number Diff line number Diff line
set / interface ethernet-1/2 admin-state enable
set / interface ethernet-1/2 subinterface 0 admin-state enable
set / interface ethernet-1/2 subinterface 0 ipv4 admin-state enable
set / interface ethernet-1/2 subinterface 0 ipv4 address 172.16.2.1/24

set / interface ethernet-1/1 admin-state enable
set / interface ethernet-1/1 subinterface 0 admin-state enable
set / interface ethernet-1/1 subinterface 0 ipv4 address 172.0.0.1/30
set / interface ethernet-1/1 subinterface 0 ipv4 admin-state enable
set / interface ethernet-1/1 subinterface 0 ipv4 address 172.0.0.2/30

set / network-instance default
set / network-instance default interface ethernet-1/1.0
set / network-instance default interface ethernet-1/2.0

set / network-instance default next-hop-groups group group1 nexthop 1 ip-address 172.0.0.2 admin-state enable
set / network-instance default static-routes route 172.16.2.0/24 next-hop-group group1 admin-state enable
set / network-instance default next-hop-groups group group1 nexthop 1 ip-address 172.0.0.1 admin-state enable
set / network-instance default static-routes route 172.16.1.0/24 next-hop-group group1 admin-state enable

set / system gnmi-server network-instance mgmt admin-state enable
 No newline at end of file
set / system management openconfig admin-state enable
set / system gnmi-server network-instance mgmt yang-models openconfig
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ mgmt:
topology:
  kinds:
    nokia_srlinux:
      image: ghcr.io/nokia/srlinux:21.11.3
      image: ghcr.io/nokia/srlinux:23.10.3
    linux:
      image: ghcr.io/hellt/network-multitool
  nodes:
@@ -31,14 +31,14 @@ topology:
      kind: nokia_srlinux
      type: ixr6
      cpu: 0.5
      memory: 1GB
      memory: 2GB
      mgmt-ipv4: 172.100.100.101
      startup-config: srl1.cli
    srl2:
      kind: nokia_srlinux
      type: ixr6
      cpu: 0.5
      memory: 1GB
      memory: 2GB
      mgmt-ipv4: 172.100.100.102
      startup-config: srl2.cli
    client1:
+25 −0
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2024 ETSI OSG/SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


PROJECTDIR=`pwd`

cd $PROJECTDIR/src
RCFILE=$PROJECTDIR/coverage/.coveragerc

# Run unitary tests and analyze coverage of code at same time
# helpful pytest flags: --log-level=INFO -o log_cli=true --verbose --maxfail=1 --durations=0
coverage run --rcfile=$RCFILE --append -m pytest --log-level=INFO -o log_cli=true --verbose \
    device/tests/test_unitary_openconfig_ocnos.py
Loading