diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/results/results_constants.py | 4 | ||||
-rw-r--r-- | core/traffic_controller.py | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/core/results/results_constants.py b/core/results/results_constants.py index ef2df847..967adbf9 100644 --- a/core/results/results_constants.py +++ b/core/results/results_constants.py @@ -69,6 +69,10 @@ class ResultsConstants(object): TEST_START_TIME = "start_time" TEST_STOP_TIME = "stop_time" + # files with traffic capture + CAPTURE_TX = "capture_tx" + CAPTURE_RX = "capture_rx" + @staticmethod def get_traffic_constants(): """Method returns all Constants used to store results. diff --git a/core/traffic_controller.py b/core/traffic_controller.py index d6e7629c..de82dddf 100644 --- a/core/traffic_controller.py +++ b/core/traffic_controller.py @@ -43,6 +43,7 @@ class TrafficController(object): self._duration = None self._lossrate = None self._packet_sizes = None + self._connected = False self._mode = str(settings.getValue('mode')).lower() self._results = [] @@ -51,6 +52,10 @@ class TrafficController(object): """Set configuration values just before test execution so they can be changed during runtime by test steps. """ + if not self._connected: + self._traffic_gen_class.connect() + self._connected = True + self._duration = int(settings.getValue('TRAFFICGEN_DURATION')) self._lossrate = float(settings.getValue('TRAFFICGEN_LOSSRATE')) self._packet_sizes = settings.getValue('TRAFFICGEN_PKT_SIZES') @@ -62,7 +67,7 @@ class TrafficController(object): def __enter__(self): """Call initialisation function. """ - self._traffic_gen_class.connect() + pass def __exit__(self, type_, value, traceback): """Stop traffic, clean up. |