From 4dd66e6a493186edf7e4b43fb879de9eebbc8757 Mon Sep 17 00:00:00 2001 From: Matthew Stidham Date: Fri, 12 Mar 2021 13:33:14 -0800 Subject: [PATCH] Fixing test_wanlink so it should work now Signed-off-by: Matthew Stidham --- py-json/create_wanlink.py | 4 ++-- py-scripts/test_wanlink.py | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/py-json/create_wanlink.py b/py-json/create_wanlink.py index 74d0d9cc..b35d25f6 100755 --- a/py-json/create_wanlink.py +++ b/py-json/create_wanlink.py @@ -23,13 +23,13 @@ j_printer = pprint.PrettyPrinter(indent=2) # typically you're using resource 1 in stand alone realm resource_id = 1 -def main(): - base_url = "http://localhost:8080" +def main(base_url="http://localhost:8080"): json_post = "" json_response = "" num_wanlinks = -1 # see if there are old wanlinks to remove lf_r = LFRequest.LFRequest(base_url+"/wl/list") + print(lf_r.get_as_json()) port_a ="rd0a" port_b ="rd1a" diff --git a/py-scripts/test_wanlink.py b/py-scripts/test_wanlink.py index 46d308c7..dbd2c62d 100755 --- a/py-scripts/test_wanlink.py +++ b/py-scripts/test_wanlink.py @@ -14,6 +14,7 @@ from LANforge.lfcli_base import LFCliBase from LANforge.LFUtils import * from realm import Realm import time +import create_wanlink class LANtoWAN(Realm): def __init__(self, host, port, ssid, security, password, @@ -59,8 +60,8 @@ class LANtoWAN(Realm): data = { "shelf": shelf, "resource": resource, - "port": "rdd0", - "peer_ifname": "rdd1" + "port": "rd0a", + "peer_ifname": "rd1a" } self.json_post(url, data) @@ -68,8 +69,8 @@ class LANtoWAN(Realm): data = { "shelf": shelf, "resource": resource, - "port": "rdd1", - "peer_ifname": "rdd0" + "port": "rd1a", + "peer_ifname": "rd0a" } self.json_post(url, data) time.sleep(.05) @@ -80,7 +81,7 @@ class LANtoWAN(Realm): "alias": "wlan0", "shelf": shelf, "resource": resource, - "port": "rdd0", + "port": "rd0a", "latency": latency, "max_rate": max_rate } @@ -91,15 +92,16 @@ class LANtoWAN(Realm): "alias": "wlan1", "shelf": shelf, "resource": resource, - "port": "rdd1", + "port": "rd1a", "latency": latency, "max_rate": max_rate } self.json_post(url, data) + create_wanlink.main(base_url='http://'+self.host+':8080') time.sleep(.05) def run(self): - self.cx_profile.use_wpa2(True, self.ssid, self.password) + #self.cx_profile.use_wpa2(True, self.ssid, self.password) self.station_profile.create(radio="wiphy0", num_stations=3, debug=False) def cleanup(self): pass @@ -141,7 +143,7 @@ def main(): lan_port=args.lanport, wan_port=args.wanport) ltw.create_wanlinks() - ltw.run() + #ltw.run() ltw.cleanup() if __name__ == "__main__":