aboutsummaryrefslogtreecommitdiffstats
path: root/test/vcpe
diff options
context:
space:
mode:
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>2019-12-17 15:09:26 +0100
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>2020-01-10 08:42:03 +0000
commit01abb5d2270e0495c9b3aeb326610483edc3ac1a (patch)
treec988ef6150dfdbc2230646ec55d9fd3013291b5b /test/vcpe
parentc08278a4a1790461818c0c7905637268b57400a7 (diff)
Support setting custom path to config file in helper scripts
Change-Id: I43b160cfc3d087a0e8b70c9fb4cafa3626f84db8 Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com> Issue-ID: INT-1399
Diffstat (limited to 'test/vcpe')
-rwxr-xr-xtest/vcpe/get_info.py9
-rwxr-xr-xtest/vcpe/loop.py9
2 files changed, 16 insertions, 2 deletions
diff --git a/test/vcpe/get_info.py b/test/vcpe/get_info.py
index 2d52a07b7..62e428ad0 100755
--- a/test/vcpe/get_info.py
+++ b/test/vcpe/get_info.py
@@ -11,11 +11,18 @@ import base64
from vcpecommon import *
import preload
import vcpe_custom_service
+import argparse
+# Run the script with [-h|--help] to get usage info
logging.basicConfig(level=logging.INFO, format='%(message)s')
-vcpecommon = VcpeCommon()
+parser = argparse.ArgumentParser(formatter_class=
+ argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--config',help='Configuration file path',default=None)
+args = parser.parse_args()
+
+vcpecommon = VcpeCommon(cfg_file=args.config)
nodes=['brg', 'bng', 'mux', 'dhcp']
hosts = vcpecommon.get_vm_ip(nodes)
print(json.dumps(hosts, indent=4, sort_keys=True))
diff --git a/test/vcpe/loop.py b/test/vcpe/loop.py
index 3dc1948f8..43255c94c 100755
--- a/test/vcpe/loop.py
+++ b/test/vcpe/loop.py
@@ -12,11 +12,18 @@ from vcpecommon import *
import preload
import commands
import vcpe_custom_service
+import argparse
+# Run the script with [-h|--help] to get usage info
logging.basicConfig(level=logging.INFO, format='%(message)s')
-cpecommon = VcpeCommon()
+parser = argparse.ArgumentParser(formatter_class=
+ argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--config',help='Configuration file path',default=None)
+args = parser.parse_args()
+
+cpecommon = VcpeCommon(cfg_file=args.config)
custom = vcpe_custom_service.CustomService(cpecommon)
nodes=['mux']