mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 11:48:03 +00:00
test_wanlink.py: changed imports to work the old way; fixes --help by using %% instead of % which is a metacharacter in argparse
Signed-off-by: Jed Reynolds <jed@candelatech.com>
This commit is contained in:
@@ -8,20 +8,18 @@ sample command:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
|
||||||
import importlib
|
|
||||||
if sys.version_info[0] != 3:
|
if sys.version_info[0] != 3:
|
||||||
print("This script requires Python 3")
|
print("This script requires Python 3")
|
||||||
exit(1)
|
exit(1)
|
||||||
if 'lanforge-scripts' not in sys.path:
|
|
||||||
sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../../")))
|
import os
|
||||||
|
import importlib
|
||||||
import argparse
|
import argparse
|
||||||
lfcli_base = importlib.import_module("lanforge-scripts.py-json.LANforge.lfcli_base")
|
sys.path.append("../py-json")
|
||||||
LFCliBase = lfcli_base.LFCliBase
|
import LANforge
|
||||||
LFUtils = importlib.import_module("lanforge-scripts.py-json.LANforge.LFUtils")
|
from LANforge.lfcli_base import LFCliBase
|
||||||
realm = importlib.import_module("lanforge-scripts.py-json.realm")
|
from realm import Realm
|
||||||
Realm = realm.Realm
|
import create_wanlink
|
||||||
create_wanlink = importlib.import_module("lanforge-scripts.py-json.create_wanlink")
|
|
||||||
|
|
||||||
|
|
||||||
class LANtoWAN(Realm):
|
class LANtoWAN(Realm):
|
||||||
@@ -66,12 +64,12 @@ def main():
|
|||||||
optional_args.add_argument('--jitter', help='The max jitter of both ports (ms)', default=None)
|
optional_args.add_argument('--jitter', help='The max jitter of both ports (ms)', default=None)
|
||||||
optional_args.add_argument('--jitter_A', help='The max jitter of port A (ms)', default=None)
|
optional_args.add_argument('--jitter_A', help='The max jitter of port A (ms)', default=None)
|
||||||
optional_args.add_argument('--jitter_B', help='The max jitter of port B (ms)', default=None)
|
optional_args.add_argument('--jitter_B', help='The max jitter of port B (ms)', default=None)
|
||||||
optional_args.add_argument('--jitter_freq', help='The jitter frequency of both ports (%)', default=None)
|
optional_args.add_argument('--jitter_freq', help='The jitter frequency of both ports (%%)', default=None)
|
||||||
optional_args.add_argument('--jitter_freq_A', help='The jitter frequency of port A (%)', default=None)
|
optional_args.add_argument('--jitter_freq_A', help='The jitter frequency of port A (%%)', default=None)
|
||||||
optional_args.add_argument('--jitter_freq_B', help='The jitter frequency of port B (%)', default=None)
|
optional_args.add_argument('--jitter_freq_B', help='The jitter frequency of port B (%%)', default=None)
|
||||||
optional_args.add_argument('--drop', help='The drop frequency of both ports (%)', default=None)
|
optional_args.add_argument('--drop', help='The drop frequency of both ports (%%)', default=None)
|
||||||
optional_args.add_argument('--drop_A', help='The drop frequency of port A (%)', default=None)
|
optional_args.add_argument('--drop_A', help='The drop frequency of port A (%%)', default=None)
|
||||||
optional_args.add_argument('--drop_B', help='The drop frequency of port B (%)', default=None)
|
optional_args.add_argument('--drop_B', help='The drop frequency of port B (%%)', default=None)
|
||||||
# todo: packet loss A and B
|
# todo: packet loss A and B
|
||||||
# todo: jitter A and B
|
# todo: jitter A and B
|
||||||
for group in parser._action_groups:
|
for group in parser._action_groups:
|
||||||
|
|||||||
Reference in New Issue
Block a user