From cf6249ac7a284fad4988fd9c347e4e6dc61c5c19 Mon Sep 17 00:00:00 2001 From: Logan Lipke Date: Wed, 20 May 2020 12:56:03 -0700 Subject: [PATCH] Added a station creation request to ensure necessary station exists --- connectTest.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/connectTest.py b/connectTest.py index 51bdd3ce..22b74c71 100755 --- a/connectTest.py +++ b/connectTest.py @@ -6,6 +6,7 @@ import sys if 'py-json' not in sys.path: sys.path.append('py-json') +import subprocess import json import pprint from LANforge import LFRequest @@ -16,7 +17,14 @@ import create_genlink as genl if sys.version_info[0] != 3: print("This script requires Python 3") - exit() + exit(1) + +checkForGUI = subprocess.run(["pgrep", "java"], capture_output=True) +if checkForGUI.stdout == b'': + print("GUI not found, test will not be started") + exit(1) + + mgrURL = "http://localhost:8080/" @@ -68,6 +76,22 @@ print("See home/lanforge/Documents/connectTestLogs/connectTestLatest for specifi print("Creating endpoints and cross connects") + +url = "cli-json/add_sta" +data = { +data = { +"shelf":1, +"resource":1, +"radio":"wiphy0", +"sta_name":"sta00000", +"ssid":"jedway-wpa2-x64-3-1", +"key"::"jedway-wpa2-x64-3-1", +"mode":1, +"mac":"xx:xx:xx:xx:*:xx", +"flags":0x400 +} + + #create cx for tcp and udp cmd = ("./lf_firemod.pl --action create_cx --cx_name testTCP --use_ports sta00000,eth1 --use_speeds 360000,150000 --endp_type tcp > /home/lanforge/Documents/connectTestLogs/connectTestLatest.log") execWrap(cmd)