aboutsummaryrefslogtreecommitdiffstats
path: root/core/traffic_controller.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2016-11-11 08:04:54 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-11 08:04:54 +0000
commit9f3fce18b414e10724549dbee8113c6bdfa2f5db (patch)
treeca0cef2a6ec1ee810332dbba7121e4bb006a20a7 /core/traffic_controller.py
parent131fd1cccc824371fa3b1e7a8477818a03fa1d35 (diff)
parenteabc66eef336b3c47c366027b205d26db10a3c21 (diff)
Merge "cli: Modify configuration via CLI"
Diffstat (limited to 'core/traffic_controller.py')
-rw-r--r--core/traffic_controller.py17
1 files changed, 4 insertions, 13 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.
"""