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 sport cars 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 customer. High performance integration testing is essential for cutting down the development costs and time-to market to minimum, but keeping the high quality of the product.
lighty.io utilizes OpenDaylight components and adds agility and flexibility beyond 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 northbound interface, NETCONF on southbound interface.
- lighty.io NETCONF toaster device simulator (Toaster device simulator is based on lighty.io NETCONF device library and internally uses famous toaster model)
- lighty.io NETCONF topology device simulator. (Netwotk 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 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 small test network and exercise all layers involved using different ports on localhost.
Mission of this test exercise will be
- 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. Advantage is that the unit test logic has access to internal APIs of all 3 layers, so 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.
A. JUnit test initialization
- Initializes test network consisting of 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
B. JUnit test execution
- testRestClientCreateSubscriptionAll duration: ~0.3s
This is RESTCONF notification test. The test subscribes to notification on Topology NETCONF device and triggers them via a 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.
C. JUnit test shutdown
Stop all components and wait untill 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 matters. Lighty.io offers 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 small test network, to running tests and full stop?