diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/traffic_controller.py | 17 | ||||
-rw-r--r-- | core/traffic_controller_rfc2544.py | 5 | ||||
-rw-r--r-- | core/traffic_controller_rfc2889.py | 7 |
3 files changed, 9 insertions, 20 deletions
diff --git a/core/traffic_controller.py b/core/traffic_controller.py index a6c1bd8d..b1911536 100644 --- a/core/traffic_controller.py +++ b/core/traffic_controller.py @@ -21,7 +21,6 @@ import time from core.results.results_constants import ResultsConstants from conf import settings -from conf import get_test_param class TrafficController(object): """Base class which defines a common functionality for all traffic @@ -41,21 +40,13 @@ class TrafficController(object): self._traffic_gen_class = traffic_gen_class() self._traffic_started = False self._traffic_started_call_count = 0 - self._duration = int(get_test_param('duration', 30)) - self._lossrate = float(get_test_param('lossrate', 0.0)) + self._duration = int(settings.getValue('TRAFFICGEN_DURATION')) + self._lossrate = float(settings.getValue('TRAFFICGEN_LOSSRATE')) + self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES') + self._mode = settings.getValue('mode').lower() self._results = [] - # If set, comma separated packet_sizes value from --test_params - # on cli takes precedence over value in settings file. - self._packet_sizes = None - packet_sizes_cli = get_test_param('pkt_sizes') - if packet_sizes_cli: - self._packet_sizes = [int(x.strip()) - for x in packet_sizes_cli.split(',')] - else: - self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES') - def __enter__(self): """Call initialisation function. """ diff --git a/core/traffic_controller_rfc2544.py b/core/traffic_controller_rfc2544.py index 874c3ae7..980205f6 100644 --- a/core/traffic_controller_rfc2544.py +++ b/core/traffic_controller_rfc2544.py @@ -15,7 +15,7 @@ """ from core.traffic_controller import TrafficController from core.results.results import IResults -from conf import get_test_param +from conf import settings class TrafficControllerRFC2544(TrafficController, IResults): @@ -32,7 +32,7 @@ class TrafficControllerRFC2544(TrafficController, IResults): """ super(TrafficControllerRFC2544, self).__init__(traffic_gen_class) self._type = 'rfc2544' - self._tests = int(get_test_param('rfc2544_tests', 1)) + self._tests = int(settings.getValue('TRAFFICGEN_RFC2544_TESTS')) def send_traffic(self, traffic): """See TrafficController for description @@ -85,4 +85,3 @@ class TrafficControllerRFC2544(TrafficController, IResults): result = self._traffic_gen_class.wait_rfc2544_throughput() result = self._append_results(result, packet_size) self._results.append(result) - diff --git a/core/traffic_controller_rfc2889.py b/core/traffic_controller_rfc2889.py index a2e12e6d..210d5f5f 100644 --- a/core/traffic_controller_rfc2889.py +++ b/core/traffic_controller_rfc2889.py @@ -15,7 +15,7 @@ """ from core.traffic_controller import TrafficController from core.results.results import IResults -from conf import get_test_param +from conf import settings class TrafficControllerRFC2889(TrafficController, IResults): @@ -32,7 +32,7 @@ class TrafficControllerRFC2889(TrafficController, IResults): """ super(TrafficControllerRFC2889, self).__init__(traffic_gen_class) self._type = 'rfc2889' - self._trials = int(get_test_param('rfc2889_trials', 1)) + self._trials = int(settings.getValue('TRAFFICGEN_RFC2889_TRIALS')) def send_traffic(self, traffic): """See TrafficController for description @@ -83,7 +83,6 @@ class TrafficControllerRFC2889(TrafficController, IResults): else: function['function']() result = self._traffic_gen_class.wait_rfc2889_forwarding( - traffic, trials=self._trials, duration=self._duration) + traffic, trials=self._trials, duration=self._duration) result = self._append_results(result, packet_size) self._results.append(result) - |