Commit f2eda4dc authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

End-to-end test - L2 VPN gNMI OpenConfig:

- Added ContainerLab scenario and scripts
- Added test scripts and code
- Added TFS descriptors
parent 26a57404
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI 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.

clab-*/
images/
*.clab.yml.bak
*.tar
*.tar.gz
+86 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI 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.

FROM python:3.9-slim

# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
    apt-get --yes --quiet --quiet install wget g++ git && \
    rm -rf /var/lib/apt/lists/*

# Set Python to show logs as they occur
ENV PYTHONUNBUFFERED=0

# Get generic Python packages
RUN python3 -m pip install --upgrade 'pip==25.2'
RUN python3 -m pip install --upgrade 'setuptools==79.0.0' 'wheel==0.45.1'
RUN python3 -m pip install --upgrade 'pip-tools==7.3.0'

# Get common Python packages
# Note: this step enables sharing the previous Docker build steps among all the Python components
WORKDIR /var/teraflow
COPY common_requirements.in common_requirements.in
RUN pip-compile --quiet --output-file=common_requirements.txt common_requirements.in
RUN python3 -m pip install -r common_requirements.txt

# Add common files into working directory
WORKDIR /var/teraflow/common
COPY src/common/. ./
RUN rm -rf proto

# Create proto sub-folder, copy .proto files, and generate Python code
RUN mkdir -p /var/teraflow/common/proto
WORKDIR /var/teraflow/common/proto
RUN touch __init__.py
COPY proto/*.proto ./
RUN python3 -m grpc_tools.protoc -I=. --python_out=. --grpc_python_out=. *.proto
RUN rm *.proto
RUN find . -type f -exec sed -i -E 's/^(import\ .*)_pb2/from . \1_pb2/g' {} \;

# Create component sub-folders, get specific Python packages
RUN mkdir -p /var/teraflow/tests/l2_vpn_gnmi_oc
WORKDIR /var/teraflow/tests/l2_vpn_gnmi_oc
COPY src/tests/l2_vpn_gnmi_oc/requirements.in requirements.in
RUN pip-compile --quiet --output-file=requirements.txt requirements.in
RUN python3 -m pip install -r requirements.txt

# Add component files into working directory
WORKDIR /var/teraflow
COPY src/__init__.py ./__init__.py
COPY src/common/*.py ./common/
COPY src/common/tests/. ./common/tests/
COPY src/common/tools/. ./common/tools/
COPY src/context/__init__.py context/__init__.py
COPY src/context/client/. context/client/
COPY src/device/__init__.py device/__init__.py
COPY src/device/client/. device/client/
COPY src/monitoring/__init__.py monitoring/__init__.py
COPY src/monitoring/client/. monitoring/client/
COPY src/service/__init__.py service/__init__.py
COPY src/service/client/. service/client/
COPY src/slice/__init__.py slice/__init__.py
COPY src/slice/client/. slice/client/
COPY src/vnt_manager/__init__.py vnt_manager/__init__.py
COPY src/vnt_manager/client/. vnt_manager/client/
COPY src/tests/*.py ./tests/
COPY src/tests/l2_vpn_gnmi_oc/__init__.py ./tests/l2_vpn_gnmi_oc/__init__.py
COPY src/tests/l2_vpn_gnmi_oc/data/. ./tests/l2_vpn_gnmi_oc/data/
COPY src/tests/l2_vpn_gnmi_oc/tests/. ./tests/l2_vpn_gnmi_oc/tests/
COPY src/tests/l2_vpn_gnmi_oc/scripts/. ./

RUN apt-get --yes --quiet --quiet update && \
    apt-get --yes --quiet --quiet install tree && \
    rm -rf /var/lib/apt/lists/*

RUN tree -la /var/teraflow
+14 −0
Original line number Diff line number Diff line
# Copyright 2022-2025 ETSI 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.
+74 −0
Original line number Diff line number Diff line
! Command: show running-config
! device: r1 (cEOSLab, EOS-4.33.5M-43712898.4335M (engineering build))
!
no aaa root
!
username admin privilege 15 role network-admin secret sha512 $6$OmfaAwJRg/r44r5U$9Fca1O1G6Bgsd4NKwSyvdRJcHHk71jHAR3apDWAgSTN/t/j1iroEhz5J36HjWjOF/jEVC/R8Wa60VmbX6.cr70
!
management api http-commands
   no shutdown
!
no service interface inactive port-id allocation disabled
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname r1
!
spanning-tree mode mstp
!
system l1
   unsupported speed action error
   unsupported error-correction action error
!
management api gnmi
   transport grpc default
!
management api netconf
   transport ssh default
!
interface Ethernet2
   no switchport
   ip address 10.0.12.1/30
   mpls ldp interface
!
interface Ethernet10
   no switchport
!
interface Loopback0
   ip address 1.1.1.1/32
!
interface Management0
   ip address 172.20.20.101/24
!
ip routing
!
ip route 0.0.0.0/0 172.20.20.1
ip route 2.2.2.2/32 10.0.12.2
!
mpls ip
!
mpls ldp
   router-id interface Loopback0
   no shutdown
   !
   pseudowires
      pseudowire pw-dc1-dc2
         neighbor 2.2.2.2
         pseudowire-id 100
         mtu 1500
!
patch panel
   patch dc1-pw
      connector 1 interface Ethernet10 dot1q vlan 100
      connector 2 pseudowire ldp pw-dc1-dc2
!
router multicast
   ipv4
      software-forwarding kernel
   !
   ipv6
      software-forwarding kernel
!
end
+74 −0
Original line number Diff line number Diff line
! Command: show running-config
! device: r2 (cEOSLab, EOS-4.33.5M-43712898.4335M (engineering build))
!
no aaa root
!
username admin privilege 15 role network-admin secret sha512 $6$OmfaAwJRg/r44r5U$9Fca1O1G6Bgsd4NKwSyvdRJcHHk71jHAR3apDWAgSTN/t/j1iroEhz5J36HjWjOF/jEVC/R8Wa60VmbX6.cr70
!
management api http-commands
   no shutdown
!
no service interface inactive port-id allocation disabled
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname r2
!
spanning-tree mode mstp
!
system l1
   unsupported speed action error
   unsupported error-correction action error
!
management api gnmi
   transport grpc default
!
management api netconf
   transport ssh default
!
interface Ethernet1
   no switchport
   ip address 10.0.12.2/30
   mpls ldp interface
!
interface Ethernet10
   no switchport
!
interface Loopback0
   ip address 2.2.2.2/32
!
interface Management0
   ip address 172.20.20.102/24
!
ip routing
!
ip route 0.0.0.0/0 172.20.20.1
ip route 1.1.1.1/32 10.0.12.1
!
mpls ip
!
mpls ldp
   router-id interface Loopback0
   no shutdown
   !
   pseudowires
      pseudowire pw-dc1-dc2
         neighbor 1.1.1.1
         pseudowire-id 100
         mtu 1500
!
patch panel
   patch dc2-pw
      connector 1 interface Ethernet10 dot1q vlan 100
      connector 2 pseudowire ldp pw-dc1-dc2
!
router multicast
   ipv4
      software-forwarding kernel
   !
   ipv6
      software-forwarding kernel
!
end
Loading