<Work In Progress>
ByteBlower is a powerful network traffic generator and analyzer developed by Excentis, widely used in broadband gateway testing. It enables simulation of real-world Ethernet and Wi-Fi traffic to validate Broadband devices under various network conditions. It offers both low-level APIs for customized scenarios and a high-level Test Framework API for quick automation and standardized validations
API documentation of ByteBlower is available in https://api.byteblower.com/python/
Our goal is to leverage the API’s exposed by ByteBlower and integrate it with automatics for testing RDKB devices.
The above diagram depicts a high-level integration plan, outlining the components involved in the integration: Automatics Orchestration, Device Manager, Jenkins, the ByteBlower server, and the code repository.
Install HTML plugin in Jenkins using command line.
A dedicated repository is created for ByteBlower test cases. Given that ByteBlower exposes over 2500 APIs, our strategy involves selecting only the most relevant ones for the test cases selected. We will define classes with methods, where each method represents a specific test case. These methods will encapsulate the chosen ByteBlower APIs.
Create an implementation class with the common functions that will be used in multiple test cases. Each python test case can import this class so that the functions in it. A sample Python wrapper file in ByteBlower Repo where the implementations are defined.
from byteblowerll.byteblower import ByteBlower
import logging
class ByteBlowerImplementation:
def __init__(self, server_ip):
self.byteblower_instance = ByteBlower.InstanceGet() or ByteBlower()
self.server = None # Server
self.server_ip = server_ip # Store server IP for later connection
def connectToServer(self):
try:
self.server = self.byteblower_instance.ServerAdd(self.server_ip)
logging.info('Successfully connected to ByteBlower Server %s', self.server.InfoGet())
return True
except Exception as e:
logging.error(f"Failed to connect to ByteBlower server at {self.server_ip}: {e}")
self.server = None
return False
def start_traffic(self):
"""Starts the traffic schedules on the connected ByteBlower server."""
try:
self.byteblower_instance.SchedulesStart()
logging.info("Traffic schedules started.")
except Exception as e:
logging.error(f"Failed to start traffic schedules: {e}")
def stop_traffic(self):
"""Stops the traffic schedules on the connected ByteBlower server."""
try:
self.byteblower_instance.SchedulesStop()
logging.info("Traffic schedules stopped.")
except Exception as e:
logging.error(f"Failed to stop traffic schedules: {e}")
This ByteBlower Implementation class initializes a ByteBlower instance and stores the server IP. It provides a dedicated connectToServer method to establish the connection and then defines start_traffic and stop_traffic methods to control traffic schedules, encapsulating ByteBlower API calls within these functions. Similarly, you can add the common functions which will be used in multiple scripts.
The ByteBlower Test Framework API provides predefined test scenarios, including throughput and latency. It also offers enhanced flexibility for report generation via its built-in API.
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)
When the script is added to Automatics, ensure that the Test Script Type is selected as ‘Python’ on the “Manage Script” page. You can proceed with the same steps that you follow for other 1DOT0 test cases in Automatics.
Since the scripts are written in python, please ensure that the dependencies below are met.
Orchestration Configuration
Tests can be executed from Automatics from the ‘Manage Test Trigger’ page.
By default, ByteBlower will generate HTML and JSON reports. These reports will be copied to the Jenkins Artifacts folder, and a link to them will be provided alongside the results in Automatics when you click the ByteBlower icon. Additionally, individual step-by-step results are available by clicking the default Automatics Report button.
A ByteBlower report summarizes network performance tests, detailing metrics like throughput, latency, and packet loss for various traffic streams. It provides a comprehensive overview of network device behavior under specific load conditions.
The following are the challenges faced
Solution: Firewall issue, port number 9002 in the server machine was blocked. (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]
Solution: Configuration issue, the MAC was incorrectly configured.