<Work In Progress>
ByteBlower is a network testing tool that helps in testing network devices. Apart from the UI, it exposes a set of Python API’s which can help automation. Our goal is to leverage the API’s exposed by ByteBlower and integrate it with automatics for testing RDKB devices.
API documentation of ByteBlower is available in https://api.byteblower.com/python/
Jpype framework has to be used to import all the java dependencies (e.g.: to update the result). When a python test is triggered, the python wrapper class will be executed. Inside the wrapper class we are starting a JVM instance. The required java dependencies (API’s) to execute the testcase will be imported.
A separate repo will be created for ByteBlower testcases.
There are more than 2500 API’s exposed by ByteBlower. To start with , we will be picking the most relevant or the priority APIs for automation , define a class with methods (testcases), with the API’s that correspond to actual or desired ByteBlower functionality.
from byteblowerll.byteblower import ByteBlower
class ByteBlowerImplementation:
def __init__(self, server_ip):
self.byteblower_instance = ByteBlower.InstanceGet() or ByteBlower()
self.server = self.byteblower_instance.ServerAdd(server_ip)
def start_traffic(self):
# Start the traffic using Byteblower API
ByteBlower.SchedulesStart()
def stop_traffic(self):
# Stop the traffic using Bytebliower API
ByteBlower.SchedulesStop()
In the above class, we create a ByteBlower instance and the required ByteBlower APIs are encapsulated. The function internally calls the ScheduleStart() and ScheduleStop() ByteBlower API’s. All the Byte blower reusable functions will be available present in the above ‘ByteBlowerImplementation’ class.
Follow some guidelines while writing the testcase
import ByteBlowerImplementation
@TestCaseId('TC_BYTEBLOWER_TRAFFICFLOW_001')
def testTrafficFlow(dut) :
start_traffic(dut.getIpaddress)
stop_traffic(dut.getIPaddress)
Since the scripts are written in python, please ensure that the below dependencies are met.
The test cases can be triggered from automatics just like triggering other Python test cases using trigger the execution “Trigger Execution Manually” option in Manage Test Trigger Tab. Continue with the normal flow of execution by selecting the testcase and devices.
Once the python test is triggered, the python wrapper class will be executed. Inside the wrapper class we are starting a JVM and the required java dependencies will are imported.
Similar to CD-Router, we are planning to include “Byte Blower” field in test type to filter ByteBlower testcases.
On triggering the execution, a Jenkins job will be created, and the test scripts will be executed and logged.
By default, ByteBlower will generate an HTML and JSON report. If the reports can be copied to Jenkins Artifact folder, then the link can be provided along with the result. If the testcase is just to verify some checkpoint meets some predefined KPI values, or checking any Boolean condition , it can be handled in the code.
The following are the challenges faced ( will be updated when a new challenge is faced)
Firewall issue : Port number 9002 in the server machine was blocking.(Resolved by raising an IT helpdesk ticket)
Solution: setx PATH "%PATH%;C:\Users\nidhinrv\AppData\Local\Programs\Python\Python310" [ path is set to 3.10]