Skip to content

dbono711/nso-l2vpn-eline

Repository files navigation

nso-l2vpn-eline

A Cisco NSO service package for provisioning L2VPN E-LINE (point-to-point Ethernet Virtual Circuit) services using EoMPLS. The package orchestrates network service configurations across devices managed by NSO.

Prerequisites

Repository Structure

nso-l2vpn-eline/
├── l2vpn-eline/                # NSO service package
│   ├── package-meta-data.xml   # Package registration
│   ├── src/yang/               # YANG data models
│   ├── python/l2vpn_eline/     # Service logic (cb_create, application class)
│   ├── templates/              # XML config templates applied to devices
│   └── test/                   # Lux scaffold (ncs-make-package artifact, not actively maintained)
├── tests/                      # pytest integration tests
│   ├── conftest.py             # MAAPI session fixture
│   ├── test_service.py         # Service lifecycle tests
│   └── requirements.txt        # Test dependencies
└── Makefile                    # Build and test targets

Device Templates

The XML config templates in l2vpn-eline/templates/ contain stanzas for IOS/IOS-XE devices using the L2VPN Protocol-Based CLIs. These commands primarily replaced the legacy xconnect syntax and are available in Cisco IOS XE Release 3.7S and Cisco IOS Release 15.3(1)S and later.

Build

Compiles YANG models to FXS:

make build

After building, reload the package in your running NSO instance:

ncs_cmd -c 'maction /ncs:packages/ncs:reload'

Testing

Tests are written in pytest and interact with a live NSO instance via MAAPI. They require:

  • NSO running with the l2vpn-eline package loaded
  • NETSIM devices available in NSO (see NETSIM Setup)

Run the tests:

make test

The test target manages its own isolated Python virtual environment and tears it down after each run.

What is tested

Each test run executes a full service lifecycle against the running NSO instance:

  1. Create — commits a service instance with the minimum required parameters
  2. Read — asserts the instance exists in the CDB
  3. Delete — removes the instance and asserts it is gone

Tests validate service behavior (correct CDB state, correct device config generation), not NSO infrastructure.

NETSIM Setup

Documentation for NETSIM device setup will be added as the service model stabilizes.

Update the device name(s) in tests/test_service.py to match your NETSIM environment before running.

Lux Tests

The l2vpn-eline/test/ directory contains a Lux test scaffold generated by ncs-make-package. It is kept as a reference artifact and is not actively maintained alongside the evolving service model. This testing validates NSO infrastructure, not service behavior. For example; that the Python VM worker started and the package loaded successfully or that the cb_create service callback was invoked when a service instance was committed

About

Cisco NSO sample service package for orchestrating MPLS Layer 2 VPN E-LINE services

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors