Full NETCONF/RESTCONF controller integration test under 12s!
Can your SDN controller do that?
With lighty.io – you can. Just like in a high-performance sports car world, the drag race is used to set winners and losers apart.
Faster is better, it is as simple as that. In SDN business, you have to test and re-test really hard before you deploy or deliver to the customer. High-performance integration testing is essential for cutting down the development costs and time-to-market to a minimum but keeping the high quality of the product.
How does lighty.io do it?
lighty.io utilizes OpenDaylight components and adds agility and flexibility beyond the upstream OpenDaylight convention. Continuous integration, delivery, and deployment, known collectively as CI/CD, is an integral part of modern development intended to reduce errors during integration and deployment while increasing project velocity.
CI/CD is a philosophy and set of practices often augmented by robust tooling that emphasize automated testing at each stage of the software pipeline. CI/CD pipelines help shepherd changes through automated testing cycles, out to staging environments, and finally to production.
The more comprehensive your testing pipelines are, the greater assurance you have that changes won’t introduce unforeseen side effects into your production deployment.
Let’s take a look at how lighty.io achieves high-performance integration testing.
lighty.io components used in this test are:
- lighty.io based SDN controller
RESTCONF on the northbound interface, NETCONF on the southbound interface.
- lighty.io NETCONF Toaster Device Simulator
Toaster device simulator is based on lighty.io NETCONF device library and internally uses the famous toaster model
- lighty.io NETCONF Topology Device Simulator
The network device simulator is based on lighty.io NETCONF device library and internally uses network-topology model
- lighty.io RESTCONF Java Client
As you can see, this integration test can start all 3 layers in a single JVM instance. This is possible because lighty.io provides not only components for the SDN controller (layer 2), but also RESTCONF client (layer 1) and NETCONF device simulators (layer 3). YANG models are shared between all layers to achieve data type safety. In fact, this test will start a small test network and exercise all layers involved using different ports on the localhost.
The mission of this test exercise will be
- to start the SDN controller.
- start the first NETCONF test device (Toaster).
- start the second NETCONF test device (Topology Device).
- connect both devices to the SDN controller.
- connect java RESTCONF client to SDN controller.
- get data from device models, listen for device notifications, call RPCs on devices.
- evaluate test data.
- shutdown this test setup.
JUnit test design
As all components involved in this test are written in java, we can start complete network simulation in a single unit test.
The advantage is, that the unit test logic has access to the internal APIs of all 3 layers. This means quite complex tests are very easy to perform. In fact, this test does not require any mocked components. All components involved are used in real deployment as well.
JUnit test initialization
- Initializes test network consisting of the SDN controller and two NETCONF test devices.
- Waits until all components are up and running.
- Connect REST client to SDN controller using RESTCONF and HTTP2.
- Connect Toaster and Topology device to SDN controller.
- Duration ~10s
JUnit test execution
- testRestClientCreateSubscriptionAll duration: ~0.3s
This is the RESTCONF notification test. The test subscribes to a notification on the Topology NETCONF device and triggers them via an RPC call.
- testToasterReadDeleteDatastoreOperations: ~0.1s
This test uses datastore operation of Toaster device in order to read and delete
- testTopologyDeviceRPCInputOutput: ~0.6s
This test calls RPCs on topology device.
JUnit test shutdown
Stop all components and wait until stopped.
- Duration: ~0.08s
Total test run: ~12s
Hardware configuration: Intel i7-4810MQ CPU, 16GB DDR3 RAM, JDK 8, Ubuntu 18.04 LTS
Links to project source code:
Speed and flexibility matter. Lighty.io offers a set of components to achieve record-breaking speeds in integration testing and continuous integration.
After moving from upstream OpenDaylight to lighty.io, our projects are compiled and tested in seconds or minutes, rather than hours. How fast can your test system go from starting a small test network to running tests and full stop?
If you are interested, click on the Contact Us button on the menu of this page.