summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/automation/trex_control_plane/client/outer_packages.py30
-rwxr-xr-xscripts/automation/trex_control_plane/examples/client_interactive_example.py7
-rw-r--r--scripts/automation/trex_control_plane/python_lib/termstyle/__init__.py0
3 files changed, 20 insertions, 17 deletions
diff --git a/scripts/automation/trex_control_plane/client/outer_packages.py b/scripts/automation/trex_control_plane/client/outer_packages.py
index a7c34e48..092cad2c 100755
--- a/scripts/automation/trex_control_plane/client/outer_packages.py
+++ b/scripts/automation/trex_control_plane/client/outer_packages.py
@@ -1,29 +1,33 @@
#!/router/bin/python
-import sys,site
-import platform,os
+import sys
+import site
+import platform
+import os
-CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
+
+CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
ROOT_PATH = os.path.abspath(os.path.join(CURRENT_PATH, os.pardir)) # path to trex_control_plane directory
-PATH_TO_PYTHON_LIB = os.path.abspath(os.path.join(ROOT_PATH, 'python_lib'))
+PATH_TO_PYTHON_LIB = os.path.abspath(os.path.join(ROOT_PATH, 'python_lib'))
CLIENT_MODULES = ['enum34-1.0.4',
- # 'jsonrpclib-0.1.3',
- 'jsonrpclib-pelix-0.2.5',
- 'termstyle',
- 'rpc_exceptions-0.1'
- ]
+ 'jsonrpclib-pelix-0.2.5',
+ 'termstyle',
+ 'rpc_exceptions-0.1'
+ ]
+
-def import_client_modules ():
+def import_client_modules():
sys.path.append(ROOT_PATH)
import_module_list(CLIENT_MODULES)
-def import_module_list (modules_list):
+
+def import_module_list(modules_list):
assert(isinstance(modules_list, list))
for p in modules_list:
- full_path = os.path.join(PATH_TO_PYTHON_LIB, p)
- fix_path = os.path.normcase(full_path) #CURRENT_PATH+p)
+ full_path = os.path.join(PATH_TO_PYTHON_LIB, p)
+ fix_path = os.path.normcase(full_path) # (CURRENT_PATH+p)
site.addsitedir(full_path)
import_client_modules()
diff --git a/scripts/automation/trex_control_plane/examples/client_interactive_example.py b/scripts/automation/trex_control_plane/examples/client_interactive_example.py
index e8d358a9..d45e4cef 100755
--- a/scripts/automation/trex_control_plane/examples/client_interactive_example.py
+++ b/scripts/automation/trex_control_plane/examples/client_interactive_example.py
@@ -23,14 +23,13 @@ class InteractiveTRexClient(cmd.Cmd):
cmd.Cmd.__init__(self)
self.verbose = verbose_mode
self.trex = CTRexClient(trex_host, max_history_size, trex_daemon_port = trex_port, verbose = verbose_mode)
- self.DEFAULT_RUN_PARAMS = dict(c = 4,
- m = 1.5,
+ self.DEFAULT_RUN_PARAMS = dict( m = 1.5,
nc = True,
p = True,
d = 100,
f = 'avl/sfr_delay_10_1g.yaml',
l = 1000)
- self.run_params = self.DEFAULT_RUN_PARAMS
+ self.run_params = dict(self.DEFAULT_RUN_PARAMS)
self.decoder = json.JSONDecoder()
@@ -112,7 +111,7 @@ class InteractiveTRexClient(cmd.Cmd):
def do_restore_run_default (self, line):
"""Restores original T-Rex running configuration"""
- self.run_params = self.DEFAULT_RUN_PARAMS
+ self.run_params = dict(self.DEFAULT_RUN_PARAMS)
print termstyle.green("*** End of restoring default run parameters ***")
def do_run_until_finish (self, sample_rate):
diff --git a/scripts/automation/trex_control_plane/python_lib/termstyle/__init__.py b/scripts/automation/trex_control_plane/python_lib/termstyle/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/scripts/automation/trex_control_plane/python_lib/termstyle/__init__.py