From 2ca39c5e180e9761190115c5a4bde668569a4d48 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 16:40:43 -0700 Subject: [PATCH 1/9] LFUtils.py: fixes typo reference --- py-json/LANforge/LFUtils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 8cd2e0ee..72dd2b57 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -313,7 +313,7 @@ def waitUntilPortsAppear(resource_id=1, base_url="http://localhost:8080", port_l else: lf_r = LFRequest.LFRequest(base_url+"/cli-form/nc_show_ports") lf_r.addPostData({"shelf":1, "resource":resource_id, "port":port_name, "flags":1}) - lr_r.formPost() + lf_r.formPost() sleep(2) print("These stations appeared: "+", ".join(found_stations)) return None From 72a2af3e5c7affd3013202a0e96da0c48bee06e6 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 16:41:43 -0700 Subject: [PATCH 2/9] LFRequest.py: quiets logging on 404 error, fixes renamed ref --- py-json/LANforge/LFRequest.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/py-json/LANforge/LFRequest.py b/py-json/LANforge/LFRequest.py index 1ff342e6..8d8867d9 100644 --- a/py-json/LANforge/LFRequest.py +++ b/py-json/LANforge/LFRequest.py @@ -127,13 +127,13 @@ class LFRequest: if (show_error): print("----- get() HTTPError: --------------------------------------------") print("<%s> HTTP %s: %s"%(myrequest.get_full_url(), error.code, error.reason, )) - - print("Error: ", sys.exc_info()[0]) - print("Request URL:", myrequest.get_full_url()) - print("Request Content-type:", myrequest.get_header('Content-type')) - print("Request Accept:", myrequest.get_header('Accept')) - print("Request Data:") - LFUtils.debug_printer.pprint(myrequest.data) + if (error.code != 404): + print("Error: ", sys.exc_info()[0]) + print("Request URL:", myrequest.get_full_url()) + print("Request Content-type:", myrequest.get_header('Content-type')) + print("Request Accept:", myrequest.get_header('Accept')) + print("Request Data:") + LFUtils.debug_printer.pprint(myrequest.data) if (error.headers): # the HTTPError is of type HTTPMessage a subclass of email.message @@ -143,7 +143,7 @@ class LFRequest: if (len(myresponses) > 0): print("----- Response: --------------------------------------------------------") - LFUtils.debug_printer.pprint(responses[0].reason) + LFUtils.debug_printer.pprint(myresponses[0].reason) print("------------------------------------------------------------------------") except urllib.error.URLError as uerror: if (show_error): From e025387472413fc54d3d86c6b008c4a311acaeee Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 16:42:52 -0700 Subject: [PATCH 3/9] LFUtils.py: fixes string comparators --- py-json/LANforge/LFUtils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index 72dd2b57..e0f3f63f 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -255,7 +255,7 @@ def waitUntilPortsAdminDown(resource_id=1, base_url="http://localhost:8080", por continue if "interface" in json_response: json_response = json_response['interface'] - if json_response['down'] is "false": + if json_response['down'] == "false": up_stations.append(port_name) sleep(1) return None @@ -275,7 +275,7 @@ def waitUntilPortsAdminUp(resource_id=1, base_url="http://localhost:8080", port_ continue if "interface" in json_response: json_response = json_response['interface'] - if json_response['down'] is "true": + if json_response['down'] == "true": down_stations.append(port_name) sleep(1) return None From e199faaefba9ef576474e11afc2c449a80475234 Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 17:04:07 -0700 Subject: [PATCH 4/9] LFUtils.py: gains methods used in connectTest.py --- py-json/LANforge/LFUtils.py | 60 ++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/py-json/LANforge/LFUtils.py b/py-json/LANforge/LFUtils.py index e0f3f63f..03236b9a 100644 --- a/py-json/LANforge/LFUtils.py +++ b/py-json/LANforge/LFUtils.py @@ -2,6 +2,7 @@ # Define useful common methods - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - import sys +import os if sys.version_info[0] != 3: print("This script requires Python 3") exit() @@ -318,4 +319,61 @@ def waitUntilPortsAppear(resource_id=1, base_url="http://localhost:8080", port_l print("These stations appeared: "+", ".join(found_stations)) return None - ### +def removePort(resource, port_name, baseurl="http://localhost:8080/"): + lf_r = LFRequest.LFRequest(baseurl+"cli-json/rm_vlan") + lf_r.addPostData({ + "shelf": 1, + "resource": resource, + "port": port_name + }) + lf_r.jsonPost(False) + +def removePortByName(port_name, baseurl="http://localhost:8080/"): + if ((port_name is None) or (port_name == "")): + print("No port name") + return; + if (port_name.index(".") < 0): + print("removePortByName: Please use short EID port names like: 2.sta1") + return + + resource = port_name[0 : port_name.index(".")] + name = port_name[port_name.index(".")+1 : ] + if (name.index(".") >= 0): + name = name[name.index(".")+1 : ] + lf_r = LFRequest.LFRequest(baseurl+"cli-json/rm_vlan") + lf_r.addPostData({ + "shelf": 1, + "resource": resource, + "port": name + }) + lf_r.jsonPost(True) + +def removeCX(mgrURL, cxNames): + for name in cxNames: + #print(f"Removing CX {name}") + data = { + "test_mgr":"all", + "cx_name":name + } + lf_r = LFRequest.LFRequest(mgrURL+"cli-json/rm_cx") + lf_r.addPostData(data) + lf_r.jsonPost() + +def removeEndps(mgrURL, endpNames): + for name in endpNames: + #print(f"Removing endp {name}") + data = { + "endp_name":name + } + lf_r = LFRequest.LFRequest(mgrURL+"cli-json/rm_endp") + lf_r.addPostData(data) + lf_r.jsonPost() + + +def execWrap(cmd): + if os.system(cmd) != 0: + print("\nError with " + cmd + ",bye\n") + exit(1) + + +### From 4f3bdde8edda8c4710a25df7506836b5132bc4cc Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 17:10:14 -0700 Subject: [PATCH 5/9] connectTest.py: several changes: - whitespace, prefer indenting dicts - moved subroutines out to LFUtils - renamed a few variables - fixes inspecting possibly null return values --- connectTest.py | 263 ++++++++++++++++++++++--------------------------- 1 file changed, 119 insertions(+), 144 deletions(-) diff --git a/connectTest.py b/connectTest.py index 34058b46..7d44a92a 100755 --- a/connectTest.py +++ b/connectTest.py @@ -11,36 +11,33 @@ import json import pprint from LANforge import LFRequest from LANforge import LFUtils +from LANforge.LFUtils import * + import create_genlink as genl debugOn = True - if sys.version_info[0] != 3: print("This script requires Python 3") exit(1) mgrURL = "http://localhost:8080/" -def execWrap(cmd): - if os.system(cmd) != 0: - print("\nError with " + cmd + ",bye\n") - exit(1) - - -def jsonReq(mgrURL, reqURL, data, debug=False): +def jsonReq(mgrURL, reqURL, data, exitWhenCalled=False): lf_r = LFRequest.LFRequest(mgrURL + reqURL) lf_r.addPostData(data) - if debug: - json_response = lf_r.jsonPost(debug) - LFUtils.debug_printer.pprint(json_response) + if exitWhenCalled: + json_response = lf_r.jsonPost(True) + print("jsonReq: debugdie Response: ") + LFUtils.debug_printer.pprint(vars(json_response)) + print("jsonReq: bye") sys.exit(1) else: - lf_r.jsonPost(debug) + lf_r.jsonPost(exitWhenCalled) -def getJsonInfo(mgrURL, reqURL): +def getJsonInfo(mgrURL, reqURL, debug=False): lf_r = LFRequest.LFRequest(mgrURL + reqURL) - json_response = lf_r.getAsJson(debugOn) + json_response = lf_r.getAsJson(debug) return json_response #print(name) #j_printer = pprint.PrettyPrinter(indent=2) @@ -48,70 +45,63 @@ def getJsonInfo(mgrURL, reqURL): #for record in json_response[key]: # j_printer.pprint(record) -def removeEndps(mgrURL, endpNames): - for name in endpNames: - #print(f"Removing endp {name}") - data = { - "endp_name":name - } - jsonReq(mgrURL, "cli-json/rm_endp", data) - -def removeCX(mgrURL, cxNames): - for name in cxNames: - #print(f"Removing CX {name}") - data = { - "test_mgr":"all", - "cx_name":name - } - jsonReq(mgrURL,"cli-json/rm_cx", data) print("Checking for LANforge Client") response = getJsonInfo(mgrURL, 'port/1/1/wiphy0') -timeout = 0 -while response == None and timeout != 300: +duration = 0 +while ((response == None) and (duration < 300)): print("LANforge Client not found sleeping 5 seconds") - timeout += 5 - time.sleep(5) + duration += 2 + time.sleep(2) response = getJsonInfo(mgrURL, 'port/1/1/wiphy0') - #print(response) -if timeout == 300: + +if duration >= 300: print("Could not connect to LANforge Client") sys.exit(1) - - print("See home/lanforge/Documents/connectTestLogs/connectTestLatest for specific values on latest test") #Create stations and turn dhcp on print("Creating station and turning on dhcp") -url = "cli-json/add_sta" +url = "port/1/1/sta00000" +debugOn = True +response = getJsonInfo(mgrURL, url) +if (response is not None): + if (response["interface"] is not None): + print("removing old station") + LFUtils.removePortByName("1.1.sta00000", mgrURL) + time.sleep(1) + +url = "cli-json/add_sta" data = { -"shelf":1, -"resource":1, -"radio":"wiphy0", -"sta_name":"sta00000", -"ssid":"jedway-wpa2-x2048-5-1", -"key":"jedway-wpa2-x2048-5-1", -"mode":1, -"mac":"xx:xx:xx:xx:*:xx", -"flags":1024 #0x400 | 1024 + "shelf":1, + "resource":1, + "radio":"wiphy0", + "sta_name":"sta00000", + "ssid":"jedway-wpa2-x2048-5-1", + "key":"jedway-wpa2-x2048-5-1", + "mode":1, + "mac":"xx:xx:xx:xx:*:xx", + "flags":1024 #0x400 | 1024 } +print("adding new station") jsonReq(mgrURL, url, data) -time.sleep(5) +time.sleep(1) reqURL = "cli-json/set_port" data = { -"shelf":1, -"resource":1, -"port":"sta00000", -"current_flags": 2147483648, #0x80000000 | 2147483648 -"interest":16386 # 0x4002 | 16386 + "shelf":1, + "resource":1, + "port":"sta00000", + "current_flags": 2147483648, #0x80000000 | 2147483648 + "interest":16386 # 0x4002 | 16386 } -jsonReq(mgrURL,reqURL,data) +print("configuring port") +jsonReq(mgrURL, reqURL, data) -time.sleep(10) +time.sleep(5) eth1IP = getJsonInfo(mgrURL, "port/1/1/eth1") if eth1IP['interface']['ip'] == "0.0.0.0": @@ -122,27 +112,26 @@ data = { "shelf":1, "resource":1, "port":"sta0000", "probe_flags":1 } -jsonReq(mgrURL,reqURL,data) +jsonReq(mgrURL, reqURL, data) -staIP = getJsonInfo(mgrURL, "port/1/1/sta00000") -timeout = 0 +station_info = getJsonInfo(mgrURL, "port/1/1/sta00000?fields=port,ip") +duration = 0 maxTime = 300 -while staIP['interface']['ip'] == "0.0.0.0" and timeout != maxTime: +ip = "0.0.0.0" +while ((ip == "0.0.0.0") and (duration < maxTime)): print("Station failed to get IP. Waiting 10 seconds...") - staIP = getJsonInfo(mgrURL, "port/1/1/sta00000") - timeout += 10 - time.sleep(10) -if timeout == maxTime: + station_info = getJsonInfo(mgrURL, "port/1/1/sta00000?fields=port,ip") + + LFUtils.debug_printer.pprint(station_info) + if ((station_info is not None) and ("interface" in station_info) and ("ip" in station_info["interface"])): + ip = station_info["interface"]["ip"] + duration += 2 + time.sleep(2) + +if duration >= maxTime: print("sta00000 failed to get an ip. Ending test") print("Cleaning up...") - reqURL = "cli-json/rm_vlan" - data = { - "shelf":1, - "resource":1, - "port":"sta00000" - } - - jsonReq(mgrURL, reqURL, data) + removePortByName("1.sta00000", mgrURL) sys.exit(1) @@ -160,14 +149,14 @@ time.sleep(.5) #create l4 endpoint url = "cli-json/add_l4_endp" data = { -"alias":"l4Test", -"shelf":1, -"resource":1, -"port":"sta00000", -"type":"l4_generic", -"timeout":1000, -"url_rate":600, -"url":"dl http://10.40.0.1/ /dev/null" + "alias":"l4Test", + "shelf":1, + "resource":1, + "port":"sta00000", + "type":"l4_generic", + "timeout":1000, + "url_rate":600, + "url":"dl http://10.40.0.1/ /dev/null" } jsonReq(mgrURL, url, data) @@ -176,10 +165,10 @@ time.sleep(.5) #create cx for l4_endp url = "cli-json/add_cx" data = { -"alias":"CX_l4Test", -"test_mgr":"default_tm", -"tx_endp":"l4Test", -"rx_endp":"NA" + "alias":"CX_l4Test", + "test_mgr":"default_tm", + "tx_endp":"l4Test", + "rx_endp":"NA" } jsonReq(mgrURL, url, data) @@ -188,12 +177,12 @@ time.sleep(.5) #create fileio endpoint url = "cli-json/add_file_endp" data = { -"alias":"fioTest", -"shelf":1, -"resource":1, -"port":"sta00000", -"type":"fe_nfs", -"directory":"/mnt/fe-test" + "alias":"fioTest", + "shelf":1, + "resource":1, + "port":"sta00000", + "type":"fe_nfs", + "directory":"/mnt/fe-test" } jsonReq(mgrURL,url,data) @@ -202,10 +191,10 @@ time.sleep(.5) #create fileio cx url = "cli-json/add_cx" data = { -"alias":"CX_fioTest", -"test_mgr":"default_tm", -"tx_endp":"fioTest", -"rx_endp":"NA" + "alias":"CX_fioTest", + "test_mgr":"default_tm", + "tx_endp":"fioTest", + "rx_endp":"NA" } jsonReq(mgrURL,url,data) @@ -223,10 +212,10 @@ time.sleep(.5) #create generic cx url = "cli-json/add_cx" data = { -"alias":"CX_genTest1", -"test_mgr":"default_tm", -"tx_endp":"genTest1", -"rx_endp":"genTest2" + "alias":"CX_genTest1", + "test_mgr":"default_tm", + "tx_endp":"genTest1", + "rx_endp":"genTest2" } jsonReq(mgrURL,url,data) @@ -235,20 +224,20 @@ time.sleep(.5) #create redirects for wanlink url = "cli-json/add_rdd" data = { -"shelf":1, -"resource":1, -"port":"rdd0", -"peer_ifname":"rdd1" + "shelf":1, + "resource":1, + "port":"rdd0", + "peer_ifname":"rdd1" } jsonReq(mgrURL,url,data) url = "cli-json/add_rdd" data = { -"shelf":1, -"resource":1, -"port":"rdd1", -"peer_ifname":"rdd0" + "shelf":1, + "resource":1, + "port":"rdd1", + "peer_ifname":"rdd0" } jsonReq(mgrURL,url,data) @@ -257,18 +246,18 @@ time.sleep(.5) #reset redirect ports url = "cli-json/reset_port" data = { -"shelf":1, -"resource":1, -"port":"rdd0" + "shelf":1, + "resource":1, + "port":"rdd0" } jsonReq(mgrURL,url,data) url = "cli-json/reset_port" data = { -"shelf":1, -"resource":1, -"port":"rdd1" + "shelf":1, + "resource":1, + "port":"rdd1" } jsonReq(mgrURL,url,data) @@ -278,24 +267,24 @@ time.sleep(.5) #create wanlink endpoints url = "cli-json/add_wl_endp" data = { -"alias":"wlTest1", -"shelf":1, -"resource":1, -"port":"rdd0", -"latency":20, -"max_rate":1544000 + "alias":"wlTest1", + "shelf":1, + "resource":1, + "port":"rdd0", + "latency":20, + "max_rate":1544000 } jsonReq(mgrURL,url,data) url = "cli-json/add_wl_endp" data = { -"alias":"wlTest2", -"shelf":1, -"resource":1, -"port":"rdd1", -"latency":30, -"max_rate":1544000 + "alias":"wlTest2", + "shelf":1, + "resource":1, + "port":"rdd1", + "latency":30, + "max_rate":1544000 } jsonReq(mgrURL,url,data) @@ -304,10 +293,10 @@ time.sleep(.5) #create wanlink cx url = "cli-json/add_cx" data = { -"alias":"CX_wlTest1", -"test_mgr":"default_tm", -"tx_endp":"wlTest1", -"rx_endp":"wlTest2" + "alias":"CX_wlTest1", + "test_mgr":"default_tm", + "tx_endp":"wlTest1", + "rx_endp":"wlTest2" } jsonReq(mgrURL,url,data) @@ -349,14 +338,7 @@ except Exception as e: print("Something went wrong") print(e) print("Cleaning up...") - reqURL = "cli-json/rm_vlan" - data = { - "shelf":1, - "resource":1, - "port":"sta00000" - } - - jsonReq(mgrURL, reqURL, data) + LFUtils.removePortByName("1.sta00000", mgrURL) endpNames = ["testTCP-A", "testTCP-B", "testUDP-A", "testUDP-B", @@ -522,14 +504,7 @@ print("\n") #remove all endpoints and cxs print("Cleaning up...") -reqURL = "cli-json/rm_vlan" -data = { -"shelf":1, -"resource":1, -"port":"sta00000" -} - -jsonReq(mgrURL, reqURL, data) +LFUtils.removePortByName("1.sta00000", mgrURL) endpNames = ["testTCP-A", "testTCP-B", "testUDP-A", "testUDP-B", From 68e104f2f337e154aebc87b6555aa59e2b05c3ce Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Tue, 26 May 2020 17:10:56 -0700 Subject: [PATCH 6/9] connectTest.py: quieter --- connectTest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connectTest.py b/connectTest.py index 7d44a92a..ecd8df05 100755 --- a/connectTest.py +++ b/connectTest.py @@ -122,7 +122,7 @@ while ((ip == "0.0.0.0") and (duration < maxTime)): print("Station failed to get IP. Waiting 10 seconds...") station_info = getJsonInfo(mgrURL, "port/1/1/sta00000?fields=port,ip") - LFUtils.debug_printer.pprint(station_info) + #LFUtils.debug_printer.pprint(station_info) if ((station_info is not None) and ("interface" in station_info) and ("ip" in station_info["interface"])): ip = station_info["interface"]["ip"] duration += 2 From 9008d2040840cedb59b8ab2d65180ff33e09d9f7 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 27 May 2020 06:41:43 -0700 Subject: [PATCH 7/9] kpi: Add historical graphs for pass/fail totals. Provides a nice way to check on overall results and test coverage. --- gui/kpi.java | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 6 deletions(-) diff --git a/gui/kpi.java b/gui/kpi.java index 6b611199..a1489e66 100644 --- a/gui/kpi.java +++ b/gui/kpi.java @@ -52,6 +52,8 @@ public class kpi { public static String HTML_COLOR_FAIL = "#f9c5c0"; public static String HTML_COLOR_WARNING = "#f8f6ad"; + public static String PF = "PASS-FAIL"; + public kpi() { priv_init(); } @@ -124,6 +126,9 @@ public class kpi { Vector test_namesv = new Vector(); Vector runs = new Vector(); + test_names.put(PF, PF); + test_namesv.add(PF); + try { DirectoryStream stream = Files.newDirectoryStream(Paths.get(dir)); for (Path file: stream) { @@ -220,6 +225,28 @@ public class kpi { runs.sort(new SortbyDate()); + // Create meta-test results for each run. + for (int i = 0; i test_id_links = new Hashtable(); @@ -344,8 +371,10 @@ public class kpi { String hk_str = hk; Run last = test_id_links.get(hk); - if (last != null) { - hk_str = "" + hk + ""; + if (!hk.equals(PF)) { + if (last != null) { + hk_str = "" + hk + ""; + } } StringBuffer change = new StringBuffer(); @@ -359,7 +388,7 @@ public class kpi { } } - String row_str = ("" + hk_str + "" + title + "" + String row_str = ("" + hk_str + "" + title + "" + change + "\n"); if (csv.getPriority() >= 100) { scores.append(row_str); @@ -462,11 +491,13 @@ public class kpi { String hk_str = hk; Run last = test_id_links.get(hk); - if (last != null) { - hk_str = "" + hk + ""; + if (!hk.equals(PF)) { + if (last != null) { + hk_str = "" + hk + ""; + } } - groups.append("" + hk_str + "" + title + "\n"); + groups.append("" + hk_str + "" + title + "\n"); } catch (Exception ee) { @@ -1070,6 +1101,13 @@ class Run { return ""; } + String getDutSerNum() { + Test t = getFirstTest(); + if (t != null) + return t.getDutSerialNum(); + return ""; + } + String getDutModelNum() { Test t = getFirstTest(); if (t != null) From f5ed685dad8d2bd4e445af40499adf5d1b9b32c4 Mon Sep 17 00:00:00 2001 From: Ben Greear Date: Wed, 27 May 2020 06:56:38 -0700 Subject: [PATCH 8/9] kpi: Add comments/documentation for kpi.java classes. To help me and others remember how this all fits together. --- gui/kpi.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gui/kpi.java b/gui/kpi.java index a1489e66..d03b655d 100644 --- a/gui/kpi.java +++ b/gui/kpi.java @@ -28,6 +28,13 @@ import java.net.URL; import java.util.*; import java.nio.file.*; +/** Process a set of test results generated by the CI/CD process for a test type in a single testbed. + * There are currently no automated comparisons done across different testbeds. + * Generate historical graphs and links to each test run. + * Each test results directory would be packaged up by the lf_gui_report_summary.pl script, + * called by the basic_regression.bash automated regression test script. + * Example: java kpi --dir /var/www/html/tip/testbeds/ferndale-basic-01/reports/basic + */ public class kpi { String lc_osname; String home_dir; @@ -638,6 +645,12 @@ public class kpi { } } + +/** This holds a datapoint for a particular test result for each of the Runs. + * This is used to generate historical graphs and comparisons. + * If a test generates two KPI results, there will be two HistRows for that + * test case. + */ class HistRow { String fname; String name; @@ -685,6 +698,9 @@ class HistRow { } } +/** This holds all HistRow objects for each test name for each run. + * It is used for generating historical graphs and comparisons. + */ class History { String name; Vector csv = new Vector(); @@ -709,6 +725,9 @@ class History { } } +/** A Row represents a single KPI csv data point. The csv is split into tokens + * for easier manipulation by other code. + */ class Row { Vector rdata = new Vector(); String short_desc_key = null; @@ -790,6 +809,11 @@ class Row { } } +/** A test contains information on one executation of one test. For instance, + * a wifi-capacity-test would be a single test. It may create a KPI.csv file with + * multiple rows. It may also have logs for this test run, and KPI graph images. + * A Run consists of multiple tests. + */ class Test { String name; Vector titles = null; @@ -1001,6 +1025,10 @@ class Test { }//Test +/** A Run is a collection of tests. This class encompasses the entire regression test + * for a particular flavor of test (basic, fast, etc). + * The CI/CD process will create one or more Runs per build artifact per testbed. + */ class Run { String name; Hashtable tests = new Hashtable(); From 515151f80b4fa0866d6310e9aa982a3f382b0fbd Mon Sep 17 00:00:00 2001 From: Jed Reynolds Date: Wed, 27 May 2020 12:47:48 -0700 Subject: [PATCH 9/9] updateTest: various improvements --- updateTest.bash | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/updateTest.bash b/updateTest.bash index 2fdc4820..ef7a28e6 100755 --- a/updateTest.bash +++ b/updateTest.bash @@ -1,21 +1,29 @@ #!/bin/bash export DISPLAY=:1 +HL="/home/lanforge" +HLD="${HL}/Documents" +scripts="${HLD}/lanforge-scripts" GUILog="/home/lanforge/Documents/GUILog.txt" GUIUpdate="/home/lanforge/Documents/GUIUpdateLog.txt" CTLGUI="/home/lanforge/Documents/connectTestGUILog.txt" CTLH="/home/lanforge/Documents/connectTestHLog.txt" verNum="5.4.2" -python3 /home/lanforge/Documents/lanforge-scripts/auto-install-gui.py --versionNumber $verNum &> $GUIUpdate +for f in $GUILog $GUIUpdate $CTLGUI $CTLH; do rm -f $f; done +python3 ${scripts}/auto-install-gui.py --versionNumber $verNum &> $GUIUpdate +sleep 5 grep -q "Current GUI version up to date" $GUIUpdate && exit -python3 /home/lanforge/Documents/lanforge-scripts/connectTest.py &> $CTLGUI - +python3 ${scripts}/connectTest.py &> $CTLGUI +sleep 1 pgrep java | xargs kill +sleep 1 -/home/lanforge/LANforgeGUI_5.4.2/lfclient.bash -daemon -s localhost &> $GUILog & -python3 /home/lanforge/Documents/lanforge-scripts/connectTest.py &> $CTLH +${HL}/LANforgeGUI_5.4.2/lfclient.bash -daemon -s localhost &> $GUILog & +sleep 5 +python3 ${scripts}/connectTest.py &> $CTLH +sleep 1 -echo "Logs Attached" | mail -s 'GUI Update Logs' -a $GUILog -a $GUIUpdate -a $CTLGUI -a $CTLH test.notice@candelatech.com +echo "Logs Attached" | mail -s 'GUI Update Logs' -a $GUILog -a $GUIUpdate -a $CTLGUI -a $CTLH "test.notice@candelatech.com"