aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TrafficGenerator.py
diff options
context:
space:
mode:
authorCarsten Koester <ckoester@cisco.com>2016-04-10 11:51:18 -0400
committerGerrit Code Review <gerrit@fd.io>2016-04-11 12:10:43 +0000
commit5538ed5471f5de3324924534cd8e43ee7c5a58d5 (patch)
treeadb44e71ac5e15c5713898d1da7e3737ae53488d /resources/libraries/python/TrafficGenerator.py
parentca1b17f089c77380678cb329b044072d4e373f56 (diff)
Fix cosmetic issues in VIRL topologies
Fix cosmetic issues in VIRL topologies: - Replace double whitespace by single whitespace in XML - Remove reserved but unused IP address allocations from VIRL config - Modify "start-testcase" script to handle links without IP address Change-Id: Ie447bd91172df61b30ebb8650b56bdfca0f25fd4 Signed-off-by: Carsten Koester <ckoester@cisco.com>
Diffstat (limited to 'resources/libraries/python/TrafficGenerator.py')
0 files changed, 0 insertions, 0 deletions
class="n">difference = abs(bench - protocol_test_res) if (deviation > 10 and difference > noise_level): # allowing 10% deviation and 'noise_level'% difference missmatchFlag = True missmatchMsg += fmt.format(protocol, bench, protocol_test_res) except KeyError as e: missmatchFlag = True print(e) print("Changes missmatchFlag to True. ", "\n\tProtocol {0} isn't part of classification results on interface {intf}".format( protocol, intf = client_intf )) missmatchMsg += "\n\tProtocol {0} isn't part of classification results on interface {intf}".format( protocol, intf = client_intf ) except ZeroDivisionError as e: print("ZeroDivisionError: %s" % protocol) pass if missmatchFlag: self.fail(missmatchMsg) class CTRexNbar_Test(CTRexNbarBase): """This class defines the NBAR testcase of the TRex traffic generator""" def __init__(self, *args, **kwargs): super(CTRexNbar_Test, self).__init__(*args, **kwargs) self.unsupported_modes = ['loopback'] # obviously no NBar in loopback def setUp(self): super(CTRexNbar_Test, self).setUp() # launch super test class setUp process # self.router.kill_nbar_flows() self.router.clear_cft_counters() self.router.clear_nbar_stats() def test_nbar_simple(self): # test initializtion deviation_compare_value = 0.03 # default value of deviation - 3% self.router.configure_basic_interfaces() self.router.config_pbr(mode = "config") self.router.config_nbar_pd() mult = self.get_benchmark_param('multiplier') core = self.get_benchmark_param('cores') ret = self.trex.start_trex( c = core, m = mult, p = True, nc = True, d = 100, f = 'avl/sfr_delay_10_1g.yaml', l = 1000) trex_res = self.trex.sample_to_run_finish() # trex_res is a CTRexResult instance- and contains the summary of the test results # you may see all the results keys by simply calling here for 'print trex_res.result' print("\nLATEST RESULT OBJECT:") print(trex_res) print("\nLATEST DUMP:") print(trex_res.get_latest_dump()) self.check_general_scenario_results(trex_res, check_latency = False) # NBAR can cause latency self.check_CPU_benchmark(trex_res) self.match_classification() # the name intentionally not matches nose default pattern, including the test should be specified explicitly def NBarLong(self): self.router.configure_basic_interfaces() self.router.config_pbr(mode = "config") self.router.config_nbar_pd() mult = self.get_benchmark_param('multiplier') core = self.get_benchmark_param('cores') ret = self.trex.start_trex( c = core, m = mult, p = True, nc = True, d = 18000, # 5 hours f = 'avl/sfr_delay_10_1g.yaml', l = 1000) trex_res = self.trex.sample_to_run_finish() # trex_res is a CTRexResult instance- and contains the summary of the test results # you may see all the results keys by simply calling here for 'print trex_res.result' print("\nLATEST RESULT OBJECT:") print(trex_res) self.check_general_scenario_results(trex_res, check_latency = False) def tearDown(self): CTRexGeneral_Test.tearDown(self) pass if __name__ == "__main__": pass