What's on this page

Behaviour Testing

Once you have created and saved your VNF or Network Service Design, you can proceed to creating behaviour driven tests in the behaviour testing tab in the Design page.

Behaviour Driven Tests allow you to automate the testing of your VNF or Network Service. This can then be used in a CI/CD pipeline to automate the entire process. It allows you to sing up a test environment, add test resources such as traffic generators and monitors, then run through a set of automated test scenarios that test the entire lifecycle of your VNF/NS such as auto-scaling, healing etc. The results are stored in Kafka for further analysis.

There are three steps to create and run behaviour driven tests, seen in the image below.

Test Steps

Create Test Assembly Configuration

In order to test your VNF/NS, you might need to set up some test assemblies. For example, you might need to add a Traffic generator to generate traffic to run through your VNF/NS, or a test network to stand up your VNF/NS. This can be done in the Assembly Configuration section as seen below.

Assembly Configuration

To create a test assembly click the “Create Assembly Configuration” button. This opens up a new screen that allows you to select the assembly you want to use, and provide a name and description. Once you select the assembly descriptor, the properties for that are populated within the same popup window. You can change or use the defaults in the screen below.

Create Test Assembly

Create Test Scenario

Once the Test Assemblies have all been defined, you then click on “Create Scenario”. This is where you define the actual test cases and conditions that should be run. You provide a name and a scenario description. All saved scenarios will show up in the Scenario screen in a list from where you can edit or remove them.

Create Test Scenario

Once created, you are then presented with the scenario designer. On the right hand side you have your palette of steps you can chose to include in your scenario. For example you first chose the test assembly configuration you created, by simply drag-and-drop to the middle canvas. You can then decide what state you want the test assembly in when you start the scenario, and what to do once the scenario is run.

After you have selected the assembly configuration, you then need to design the stages for the scenario by drag-and-drop a step from the right hand side onto the stage. You can define multiple stages, and one stage can include multiple steps. See below for an overview.

Test Scenario

The behaviour driven test tools also include inbuilt metrics visualization when the scenario is run. For example you want to test auto-scaling and record and view the various metrics that are being produced while performing the test scenario. You can create the scenario so that it instantiates the Assembly, then defines the metrics it should monitor for, then start recording those metrics.

You can continue the design by then introducing or changing a Test Assembly to produce more test traffic (e.g. by upgrading a Traffic Monitor Test Assembly to one that produces more traffic), and then define that you expect to see an auto-scale-out.

Once that is completed you design the steps in the opposite order so that it stops recording the metrics, and removes the test assembly. This example is shown in the image below.

Scale Test Example

Once you have completed the scenario design, you can save it.

Run Test Scenario

You can then run the Test Scenario. Once you run the scenario, you will see the ongoing scenario screen.

On the right hand side you will see metrics (if any). In the middle you see the stages and steps as it is executing these and you will see if these fail or pass. it will continue to move through the tests until the final step is passed.

In the example below the Intent Engine has instantiated the assembly configurations that were defined for this test scenario (in this case a load generator), and then proceeded to run the scenario while recording the defined metrics. In this example, you can see the Load metrics that are being recorded on the graph on the right side.

NOTE, while the test scenario is ongoing, you can go to Recent Assembly Instances screen in the Operations view of Stratoss LM, to see the Intent Execution graph. You will see all the tasks the Intent Engine is performing to automatically bring the assembly configurations through their lifecycle.

Run Test Scenario

Once the scenario is run, you can see these in the Results page in the Behaviour Driven test functionality. You can open all executed test scenarios or delete them.

Test Results