Fixing test_wanlink so it should work now

Signed-off-by: Matthew Stidham <stidmatt@protonmail.com>
This commit is contained in:
Matthew Stidham
2021-03-12 13:33:14 -08:00
parent e5a29934d4
commit 4dd66e6a49
2 changed files with 12 additions and 10 deletions

View File

@@ -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"

View File

@@ -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__":