Reference scenarios are basics scenario bricks to help build more complex scenarios. They are maintained in OpenBACH with naming conventions and formal organisation as described above.
Each scenario aims to standardize a metrology test; for instance, the network_delay
reference scenario gives a “standard” way to evaluate a link delay in OpenBACH.
These scenario can be launched on their own using executors or can be integrated in upper code as an API. Each scenario module define two kind of functions:
build
functions: it selects the right scenario function based on “meta” parameters and can add post-processing jobs if required based on the presence of the post_processing_entity
parameter.
Each reference scenario must define at least one reference scenario function and the build
function.
You can also import reference scenarios (or some parts) and add them as subscenarios. In the same example network_delay which:
network_delay_simultaneous_core
or network_delay_sequential_core
(allowing to compare the RTT measurement of fping, hping and owamp jobs).As you can see in the import modules of the scenario, we are importing the helpers and the openbach functions StartJobInstance/StartScenarioInstance to launch our reference subscenario and the postprocessing jobs.
from scenario_builder import Scenario from scenario_builder.helpers.network.owamp import owamp_measure_owd from scenario_builder.helpers.network.fping import fping_measure_rtt from scenario_builder.helpers.network.hping import hping_measure_rtt from scenario_builder.helpers.postprocessing.time_series import time_series_on_same_graph from scenario_builder.helpers.postprocessing.histogram import cdf_on_same_graph, pdf_on_same_graph from scenario_builder.openbach_functions import StartJobInstance, StartScenarioInstance
Below, you can see how to use subscenarios thanks to the :
scenario.add_function('start_scenario_instance')
) and network_delay_simultaneous_core
and network_delay_sequential_core
) with their arguments (start_scenario_core.configure(scenario_core, srv_ip=srv_ip, duration=duration)
). if simultaneous: scenario_core = network_delay_simultaneous_core(clt_entity) else: scenario_core = network_delay_sequential_core(clt_entity) start_scenario_core = scenario.add_function( 'start_scenario_instance') start_scenario_core.configure( scenario_core, srv_ip=srv_ip, duration=duration)