diff --git a/.gitignore b/.gitignore index 83e4a229f..465460e48 100644 --- a/.gitignore +++ b/.gitignore @@ -149,4 +149,6 @@ pytest/* !pytest/test_*.py !pytest/helpers !pytest/pytest.ini -pytest/nightly*log \ No newline at end of file +pytest/nightly*log + +test_everything.xml \ No newline at end of file diff --git a/CICD_AP_CLOUDSDK/automationTests/APIClient.java b/CICD_AP_CLOUDSDK/automationTests/APIClient.java deleted file mode 100644 index 1c0f1ae9c..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/APIClient.java +++ /dev/null @@ -1,319 +0,0 @@ -package automationTests; - - -/** - * TestRail API binding for Java (API v2, available since TestRail 3.0) - * Updated for TestRail 5.7 - * - * Learn more: - * - * http://docs.gurock.com/testrail-api2/start - * http://docs.gurock.com/testrail-api2/accessing - * - * Copyright Gurock Software GmbH. See license.md for details. - */ - -import java.net.URL; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.util.Base64; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; - - -public class APIClient -{ - private String m_user; - private String m_password; - private String m_url; - - public APIClient(String base_url) - { - if (!base_url.endsWith("/")) - { - base_url += "/"; - } - - this.m_url = base_url + "index.php?/api/v2/"; - } - - /** - * Get/Set User - * - * Returns/sets the user used for authenticating the API requests. - */ - public String getUser() - { - return this.m_user; - } - - public void setUser(String user) - { - this.m_user = user; - } - - /** - * Get/Set Password - * - * Returns/sets the password used for authenticating the API requests. - */ - public String getPassword() - { - return this.m_password; - } - - public void setPassword(String password) - { - this.m_password = password; - } - - /** - * Send Get - * - * Issues a GET request (read) against the API and returns the result - * (as Object, see below). - * - * Arguments: - * - * uri The API method to call including parameters - * (e.g. get_case/1) - * - * Returns the parsed JSON response as standard object which can - * either be an instance of JSONObject or JSONArray (depending on the - * API method). In most cases, this returns a JSONObject instance which - * is basically the same as java.util.Map. - * - * If 'get_attachment/:attachment_id', returns a String - */ - public Object sendGet(String uri, String data) - throws MalformedURLException, IOException, APIException - { - return this.sendRequest("GET", uri, data); - } - - public Object sendGet(String uri) - throws MalformedURLException, IOException, APIException - { - return this.sendRequest("GET", uri, null); - } - - /** - * Send POST - * - * Issues a POST request (write) against the API and returns the result - * (as Object, see below). - * - * Arguments: - * - * uri The API method to call including parameters - * (e.g. add_case/1) - * data The data to submit as part of the request (e.g., - * a map) - * If adding an attachment, must be the path - * to the file - * - * Returns the parsed JSON response as standard object which can - * either be an instance of JSONObject or JSONArray (depending on the - * API method). In most cases, this returns a JSONObject instance which - * is basically the same as java.util.Map. - */ - public Object sendPost(String uri, Object data) - throws MalformedURLException, IOException, APIException - { - return this.sendRequest("POST", uri, data); - } - - private Object sendRequest(String method, String uri, Object data) - throws MalformedURLException, IOException, APIException - { - URL url = new URL(this.m_url + uri); - // Create the connection object and set the required HTTP method - // (GET/POST) and headers (content type and basic auth). - HttpURLConnection conn = (HttpURLConnection)url.openConnection(); - - String auth = getAuthorization(this.m_user, this.m_password); - conn.addRequestProperty("Authorization", "Basic " + auth); - - if (method.equals("POST")) - { - conn.setRequestMethod("POST"); - // Add the POST arguments, if any. We just serialize the passed - // data object (i.e. a dictionary) and then add it to the - // request body. - if (data != null) - { - if (uri.startsWith("add_attachment")) // add_attachment API requests - { - String boundary = "TestRailAPIAttachmentBoundary"; //Can be any random string - File uploadFile = new File((String)data); - - conn.setDoOutput(true); - conn.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + boundary); - - OutputStream ostreamBody = conn.getOutputStream(); - BufferedWriter bodyWriter = new BufferedWriter(new OutputStreamWriter(ostreamBody)); - - bodyWriter.write("\n\n--" + boundary + "\r\n"); - bodyWriter.write("Content-Disposition: form-data; name=\"attachment\"; filename=\"" - + uploadFile.getName() + "\""); - bodyWriter.write("\r\n\r\n"); - bodyWriter.flush(); - - //Read file into request - InputStream istreamFile = new FileInputStream(uploadFile); - int bytesRead; - byte[] dataBuffer = new byte[1024]; - while ((bytesRead = istreamFile.read(dataBuffer)) != -1) - { - ostreamBody.write(dataBuffer, 0, bytesRead); - } - - ostreamBody.flush(); - - //end of attachment, add boundary - bodyWriter.write("\r\n--" + boundary + "--\r\n"); - bodyWriter.flush(); - - //Close streams - istreamFile.close(); - ostreamBody.close(); - bodyWriter.close(); - } - else // Not an attachment - { - conn.addRequestProperty("Content-Type", "application/json"); - byte[] block = JSONValue.toJSONString(data). - getBytes("UTF-8"); - - conn.setDoOutput(true); - OutputStream ostream = conn.getOutputStream(); - ostream.write(block); - ostream.close(); - } - } - } - else // GET request - { - conn.addRequestProperty("Content-Type", "application/json"); - } - - // Execute the actual web request (if it wasn't already initiated - // by getOutputStream above) and record any occurred errors (we use - // the error stream in this case). - int status = conn.getResponseCode(); - - InputStream istream; - if (status != 200) - { - istream = conn.getErrorStream(); - if (istream == null) - { - throw new APIException( - "TestRail API return HTTP " + status + - " (No additional error message received)" - ); - } - } - else - { - istream = conn.getInputStream(); - } - - // If 'get_attachment' (not 'get_attachments') returned valid status code, save the file - if ((istream != null) - && (uri.startsWith("get_attachment/"))) - { - FileOutputStream outputStream = new FileOutputStream((String)data); - - int bytesRead = 0; - byte[] buffer = new byte[1024]; - while ((bytesRead = istream.read(buffer)) > 0) - { - outputStream.write(buffer, 0, bytesRead); - } - - outputStream.close(); - istream.close(); - return (String) data; - } - - // Not an attachment received - // Read the response body, if any, and deserialize it from JSON. - String text = ""; - if (istream != null) - { - BufferedReader reader = new BufferedReader( - new InputStreamReader( - istream, - "UTF-8" - ) - ); - - String line; - while ((line = reader.readLine()) != null) - { - text += line; - text += System.getProperty("line.separator"); - } - - reader.close(); - } - - Object result; - if (!text.equals("")) - { - result = JSONValue.parse(text); - } - else - { - result = new JSONObject(); - } - - // Check for any occurred errors and add additional details to - // the exception message, if any (e.g. the error message returned - // by TestRail). - if (status != 200) - { - String error = "No additional error message received"; - if (result != null && result instanceof JSONObject) - { - JSONObject obj = (JSONObject) result; - if (obj.containsKey("error")) - { - error = '"' + (String) obj.get("error") + '"'; - } - } - - throw new APIException( - "TestRail API returned HTTP " + status + - "(" + error + ")" - ); - } - - return result; - } - - private static String getAuthorization(String user, String password) - { - try - { - return new String(Base64.getEncoder().encode((user + ":" + password).getBytes())); - } - catch (IllegalArgumentException e) - { - // Not thrown - } - - return ""; - } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/APIException.java b/CICD_AP_CLOUDSDK/automationTests/APIException.java deleted file mode 100644 index 33e88836e..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/APIException.java +++ /dev/null @@ -1,20 +0,0 @@ -package automationTests; - -/** - * TestRail API binding for Java (API v2, available since TestRail 3.0) - * - * Learn more: - * - * http://docs.gurock.com/testrail-api2/start - * http://docs.gurock.com/testrail-api2/accessing - * - * Copyright Gurock Software GmbH. See license.md for details. - */ - -public class APIException extends Exception -{ - public APIException(String message) - { - super(message); - } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/AccountTest.java b/CICD_AP_CLOUDSDK/automationTests/AccountTest.java deleted file mode 100644 index dcc5f5232..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/AccountTest.java +++ /dev/null @@ -1,486 +0,0 @@ -package automationTests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; - -import org.junit.AfterClass; -import org.junit.Test; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; - -import java.util.Map; - -public class AccountTest{ - WebDriver driver; - static APIClient client; - static long runId; - @BeforeClass - public static void startTest() throws Exception - { - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connectus123$"); - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String date = "UI Automation Run - " + cal.get(Calendar.DATE) + "/" + month + "/" + cal.get(Calendar.YEAR); - - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); -// options.addArguments("--disable-dev-shm-usage"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - } - - void closeBrowser() { - driver.close(); - } - - public void logIn() { - driver.findElement(By.id("login_email")).sendKeys("support@example.com"); - driver.findElement(By.id("login_password")).sendKeys("support"); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - public void accountsScreen() throws Exception { - driver.findElement(By.linkText("Accounts")).click(); - } - - public void addAccountButton(int testId) throws MalformedURLException, IOException, APIException { - try { - Actions act = new Actions(driver); - act.moveToElement(driver.findElement(By.cssSelector("[title^='addaccount']"))).click().perform(); - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Fail"); - } - - } - - public void verifyAddAccountPopup(int testId) throws MalformedURLException, IOException, APIException { - Map data = new HashMap(); - try { - if (driver.findElement(By.id("rcDialogTitle0")).getText().equals("Add User")) { - //pass - } else { - - data.put("status_id", new Integer(5)); - data.put("comment", "Incorrect popup displayed"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail(); - } - } catch (Exception E) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Fail"); - } - } - - public void addAccount(String account, String password, String confirmPassword, int testId) throws MalformedURLException, IOException, APIException { - try { - addAccountButton(testId); - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(account).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(password).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(confirmPassword).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Fail"); - } - - } - - public void blankEmailWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("Please input your e-mail")) { - //pass - } else { - //System.out.print(driver.findElement(By.cssSelector("[role^='alert']")).getText()); - - fail("Incorrect warning displayed"); - } - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("No warning displayed"); - } - } - - public void invalidPasswordsWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("The two passwords do not match")) { - //pass - } else { - System.out.print(driver.findElement(By.cssSelector(".ant-form-item-explain > div")).getText()); - - fail("Incorrect warning displayed"); - } - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("No warning displayed"); - } - } - - public void invalidEmailWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("The input is not a valid e-mail")) { - //pass - } else { - System.out.print(driver.findElement(By.cssSelector(".ant-form-item-explain > div")).getText()); - - fail("Incorrect error displayed"); - } - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("No error displayed"); - } - } - - public void editAccount(String oldName, String newName, int testId) throws Exception { - try { - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - breakP: - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - breakP: - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = driver.findElements(By.cssSelector("[class^='chart']")); - List lines = driver.findElements(By.cssSelector("[class^='highcharts-tracker-line']")); - - if (lines.size()!= 5) { - failure(testId); - fail(); - } - - } - - public int countRows(int testId) throws MalformedURLException, IOException, APIException { - try { - - }catch (Exception E) { - failure(testId); - fail(); - } - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - return rows.size()-2; - } - - public int findProfile(int testId) throws MalformedURLException, IOException, APIException { - try { - - }catch (Exception E) { - failure(testId); - fail(); - } - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - int count = 0; - - - //row iteration - for(int i=2; i cols = rows.get(i).findElements(By.tagName("td")); - - if (!cols.get(7).getText().equals("")) { - count++; - } - - } - return count; - } - - public void verifyClientDevicesGraphs(int testId) throws MalformedURLException, IOException, APIException, InterruptedException { - List points = driver.findElements(By.cssSelector("[class^='highcharts-point']")); - points.get(1).click(); - points.get(2).click(); - Thread.sleep(1000); - List lines = driver.findElements(By.cssSelector("[class^='highcharts-tracker-line']")); - if (!lines.get(1).getAttribute("visibility").equals("hidden")||!lines.get(2).getAttribute("visibility").equals("hidden")) { - failure(testId); - fail(); - } - } - - public void verifyTrafficGraphs(int testId) throws MalformedURLException, IOException, APIException, InterruptedException { - List points = driver.findElements(By.cssSelector("[class^='highcharts-point']")); - points.get(3).click(); - points.get(4).click(); - Thread.sleep(1000); - List lines = driver.findElements(By.cssSelector("[class^='highcharts-tracker-line']")); - if (!lines.get(3).getAttribute("visibility").equals("hidden")||!lines.get(4).getAttribute("visibility").equals("hidden")) { - failure(testId); - fail(); - } - } - - public void verifyDashboardScreenDetails(int testId) throws MalformedURLException, IOException, APIException { - Map data = new HashMap(); - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div.index-module__infoWrapper___2MqZn > div:nth-child(1) > div.ant-card-head > div > div")).getText().equals("Access Point")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div.index-module__infoWrapper___2MqZn > div:nth-child(2) > div.ant-card-head > div > div")).getText().equals("Client Devices")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div.index-module__infoWrapper___2MqZn > div:nth-child(3) > div.ant-card-head > div > div")).getText().equals("Usage Information (24 hours)")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div:nth-child(2) > div:nth-child(1) > div > div.ant-card-head > div > div.ant-card-head-title")).getText().equals("Inservice APs (24 hours)")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div:nth-child(2) > div:nth-child(2) > div > div.ant-card-head > div > div.ant-card-head-title")).getText().equals("Client Devices (24 hours)")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div:nth-child(2) > div:nth-child(3) > div > div.ant-card-head > div > div.ant-card-head-title")).getText().equals("Traffic (24 hours)")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div:nth-child(3) > div:nth-child(1) > div > div.ant-card-head > div > div")).getText().equals("AP Vendors")) { - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > div:nth-child(3) > div:nth-child(2) > div > div.ant-card-head > div > div")).getText().equals("Client Vendors")) { - - fail("Dashboard section not displayed"); - } - } catch (Exception E) { - - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Dashboard section not displayed"); - } - - } - //C5218 - @Test - public void apDetailsTest() throws Exception { - Map data = new HashMap(); - DashboardTest obj = new DashboardTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - int displayed = obj.verifyAPNumber(5218); - Thread.sleep(1000); - obj.networkScreen(); - Thread.sleep(5000); - obj.loadAllProfiles(5218); - Thread.sleep(3000); - int actual = obj.countRows(5218); - Assert.assertEquals(displayed, actual); - obj.closeBrowser(); - - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5218", data); - } - - //C5221 - @Test - public void displayGraphsTest() throws Exception { - Map data = new HashMap(); - DashboardTest obj = new DashboardTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(5000); - obj.verifyGraphs(5221); - Thread.sleep(2000); - obj.closeBrowser(); - - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5221", data); - - } - - //C5220 - @Test - public void displayAllSectionsTest() throws Exception { - Map data = new HashMap(); - DashboardTest obj = new DashboardTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(5000); - obj.verifyDashboardScreenDetails(5220); - obj.closeBrowser(); - - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5220", data); - - } - - //C5634 - @Test - public void clientDevicesGraphsTest() throws Exception { - int testId = 5634; - Map data = new HashMap(); - DashboardTest obj = new DashboardTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(5000); - obj.verifyClientDevicesGraphs(testId); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - //C5635 - @Test - public void trafficGraphsTest() throws Exception { - int testId = 5635; - - DashboardTest obj = new DashboardTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(5000); - obj.verifyTrafficGraphs(testId); - Thread.sleep(2000); - obj.closeBrowser(); - - Map data = new HashMap(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - -// @Test -// void devicesDetailsTest() throws Exception { -// DashboardTest obj = new DashboardTest(); -// obj.launchBrowser(); -// obj.logIn(); -// Thread.sleep(3000); -// int displayed = obj.verifyDevicesNumber(); -// Thread.sleep(1000); -// obj.networkScreen(); -// Thread.sleep(5000); -// obj.clientDevicesScreen(); -// Thread.sleep(5000); -// obj.loadAllProfiles(); -// Thread.sleep(1000); -// int actual = obj.findProfile(); -// Assert.assertEquals(displayed, actual); -// } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/LoginTest.java b/CICD_AP_CLOUDSDK/automationTests/LoginTest.java deleted file mode 100644 index 5983c7590..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/LoginTest.java +++ /dev/null @@ -1,777 +0,0 @@ -package automationTests; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; - -import static org.junit.jupiter.api.Assertions.*; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Map; - -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.runner.JUnitCore; -import org.junit.runner.Result; -import org.junit.Test; -import org.junit.internal.TextListener; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; - -public class LoginTest { - - WebDriver driver, driver2; - static APIClient client; - static long runId; -// static String Url = System.getenv("CLOUD_SDK_URL"); -// static String trUser = System.getenv("TR_USER"); -// static String trPwd = System.getenv("TR_PWD"); -// static String cloudsdkUser = "support@example.com"; -// static String cloudsdkPwd="support"; - - @BeforeClass - public static void startTest() throws Exception - { - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connect123$"); - - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String day = Integer.toString(cal.get(Calendar.DATE)); - if (day.length()<2) { - day = "0"+day; - } - String date = "UI Automation Run - " + day + "/" + month + "/" + cal.get(Calendar.YEAR); - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { -// System.setProperty("webdriver.chrome.driver", "/Users/mohammadrahman/Downloads/chromedriver"); - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - - } - - public void failure(int testId) throws MalformedURLException, IOException, APIException { - driver.close(); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - public void login(String email, String password) { - driver.findElement(By.id("login_email")).sendKeys(email); - driver.findElement(By.id("login_password")).sendKeys(password); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - - - public void checkHover(String box, int testId) throws Exception { - try { - String colour, colour2; - if (box.equals("confirm")) { - colour = driver.findElement(By.cssSelector("#login > button")).getCssValue("background-color"); - WebElement button = driver.findElement(By.cssSelector("#login > button")); - - Actions mouse = new Actions(driver); - mouse.moveToElement(button).perform(); - Thread.sleep(500); - - colour2 = driver.findElement(By.cssSelector("#login > button")).getCssValue("background-color"); - - } else if (box.equals("email")) { - colour = driver.findElement(By.cssSelector("#login_email")).getCssValue("border-color"); - WebElement button = driver.findElement(By.cssSelector("#login_email")); - - Actions mouse = new Actions(driver); - mouse.moveToElement(button).perform(); - Thread.sleep(500); - - colour2 = driver.findElement(By.cssSelector("#login_email")).getCssValue("border-color"); - - } else { - colour = driver.findElement(By.cssSelector("#login_password")).getCssValue("background-color"); - WebElement button = driver.findElement(By.cssSelector("#login_password")); - - Actions mouse = new Actions(driver); - mouse.moveToElement(button).perform(); - Thread.sleep(500); - - colour2 = driver.findElement(By.cssSelector("#login_password")).getCssValue("background-color"); - } - if (colour.equals(colour2)) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("failure"); - //Assert.assertNotEquals("Colours did not change when in focus", colour, colour2); - - } - } catch (Exception E) { - failure(testId); - fail(); - } - - - - } - - public void checkEmailFocus(int testId) throws Exception { - try { - WebElement email= driver.findElement(By.id("login_email")); - boolean emailFocus = email.equals(driver.switchTo().activeElement()); - if (!emailFocus) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("Email field is not in focus", true, emailFocus); - } catch (Exception E){ - failure(testId); - fail(); - } - - - } - - public void checkTab(int testId) throws Exception { - try { - Actions browse = new Actions(driver); - browse.sendKeys(Keys.TAB).perform(); - Thread.sleep(1000); - WebElement email= driver.findElement(By.id("login_email")); -// System.out.print(driver.switchTo().activeElement()); - boolean emailFocus = email.equals(driver.switchTo().activeElement()); - - if (!emailFocus) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - Assert.assertEquals("Email field is not in focus",true, emailFocus); - - browse.sendKeys(Keys.TAB).perform(); - Thread.sleep(1000); - WebElement password= driver.findElement(By.id("login_password")); - boolean passwordFocus = password.equals(driver.switchTo().activeElement()); - - if (!passwordFocus) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("Password field is not in focus",true, passwordFocus); - - browse.sendKeys(Keys.TAB).perform(); - Thread.sleep(1000); - WebElement confirm= driver.findElement(By.cssSelector("#login > button")); - boolean confirmFocus = confirm.equals(driver.switchTo().activeElement()); - - if (!confirmFocus) { - - } - Assert.assertEquals("Login button is not in focus", true, confirmFocus); - }catch (Exception E){ - failure(testId); - fail(); - } - - } - - public void coverPassword(String password, int testId) throws Exception { - try { - driver.findElement(By.id("login_password")).sendKeys(password); - - WebElement passwordCovered = driver.findElement(By.id("login_password")); - boolean passwordTest = (passwordCovered.getAttribute("type").equals("password")); - if (!passwordTest) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("Password is uncovered", true, passwordTest); - Thread.sleep(1500); - - driver.findElement(By.cssSelector("#login > div.ant-row.ant-form-item.ant-form-item-has-success > div.ant-col.ant-col-15.ant-form-item-control > div > div > span > span > span > svg")).click();; - Thread.sleep(1500); - - WebElement passwordUncovered = driver.findElement(By.id("login_password")); - boolean passwordTest2 = (passwordCovered.getAttribute("type").equals("text")); - if (!passwordTest2) { - - } - Assert.assertEquals("Password is still hidden", true, passwordTest2); - } catch (Exception E){ - failure(testId); - fail(); - } - - - } - - public void copyPassword(String password, int testId) throws Exception { - try { - driver.findElement(By.id("login_password")).sendKeys(password); - - WebElement passwordCovered = driver.findElement(By.id("login_password")); - - WebElement locOfOrder = driver.findElement(By.id("login_password")); - Actions act = new Actions(driver); - act.moveToElement(locOfOrder).doubleClick().build().perform(); - - driver.findElement(By.id("login_password")).sendKeys(Keys.chord(Keys.CONTROL,"c")); - // now apply the command to paste - driver.findElement (By.id("login_email")).sendKeys(Keys.chord(Keys.CONTROL, "v")); - - //Assert.assertEquals(expected, actual); - } catch (Exception E){ - failure(testId); - fail(); - } - - } - - public void logout(int testId) throws Exception { - driver.findElement(By.cssSelector(".anticon-setting > svg")).click(); - Thread.sleep(2500); - driver.findElement(By.linkText("Log Out")).click(); - - } - public void loginEnter(String email, String password, int testId) { - driver.findElement(By.id("login_email")).sendKeys(email); - driver.findElement(By.id("login_password")).sendKeys(password); - driver.findElement(By.id("login_password")).sendKeys(Keys.ENTER); - //driver.sendKeys(Keys.RETURN); - } - public void backButton() { - driver.navigate().back(); - } - - public void loginBlank(int testId) { - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - public void errorNotification(int testId) throws Exception { - try { - boolean found = false; - if (driver.findElement(By.cssSelector(".ant-notification-notice-description")).getText().equals("Invalid e-mail or password.")) { - found = true; - } - if (!found) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("No error message displayed", true, found); - } catch (Exception E){ - failure(testId); - fail(); - } - - } - - public void emailField(int testId) throws Exception { - try { - if (!driver.findElement(By.id("login_email")).isDisplayed()) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("Email field not found", true, driver.findElement(By.id("login_email")).isDisplayed()); - } catch (Exception E) { - failure(testId); - fail(); - } - - - } - - public void passwordField(int testId) throws Exception { - try { - if (!driver.findElement(By.id("login_password")).isDisplayed()) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Password field not found"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - Assert.assertEquals("Password field not found", true, driver.findElement(By.id("login_password")).isDisplayed()); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void verifyLoginPass(int testId) throws Exception { - try { - String URL = driver.getCurrentUrl(); - if (!URL.equals("https://wlan-ui.qa.lab.wlan.tip.build/dashboard")) { - - } - Assert.assertEquals("Incorrect URL", URL, "https://wlan-ui.qa.lab.wlan.tip.build/dashboard"); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void verifyLoginFail(int testId) throws Exception { - try { - String URL = driver.getCurrentUrl(); - if (!URL.equals("https://wlan-ui.qa.lab.wlan.tip.build/login")) { - - } - Assert.assertEquals("Incorrect URL", URL, "https://wlan-ui.qa.lab.wlan.tip.build/login"); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void closeBrowser() { - driver.close(); - } - - - //C4099, C4164, C4172 - @Test - public void loginTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support"); - Thread.sleep(3000); - obj.verifyLoginPass(4099); - Thread.sleep(1000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4099", data); - JSONObject t = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4164", data); - JSONObject s = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4172", data); - - } - - //C4097 - @Test - public void verifyEmailFieldTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.emailField(4097); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4097", data); - - } - - //C4098 - @Test - public void verifyPasswordFieldTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.passwordField(4098); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4098", data); - - } - - //C4157 - @Test - public void loginTestUppercase() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("SUPPORT@EXAMPLE.COM", "support"); - Thread.sleep(3000); - obj.verifyLoginPass(4157); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4157", data); - - } - - //C4166 - @Test - public void loginTestPasswordFail() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support1"); - Thread.sleep(3000); - obj.verifyLoginFail(4166); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4166", data); - - } - - //C4167 - @Test - public void loginTestEmailFail() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support1@example.com", "support"); - Thread.sleep(3000); - obj.verifyLoginFail(4167); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4167", data); - - } - - //C4165 - @Test - public void loginTestEmailPasswordFail() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support1@example.com", "support1"); - Thread.sleep(3000); - obj.verifyLoginFail(4165); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4165", data); - - } - //C4168 - @Test - public void loginTestBlankFail() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.loginBlank(4168); - Thread.sleep(3000); - obj.verifyLoginFail(4168); - Thread.sleep(1000); - obj.closeBrowser(); - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4168", data); - - } - //C4163 - @Test - public void loginEnterKeyTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.loginEnter("support@example.com", "support", 4163); - Thread.sleep(3000); - obj.verifyLoginPass(4163); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4163", data); - - } - //C4169 - @Test - public void loginBackButtonTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support"); - Thread.sleep(3000); - obj.verifyLoginPass(4169); - obj.backButton(); - Thread.sleep(3000); - obj.verifyLoginPass(4169); - Thread.sleep(1500); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4169", data); - - } - //C4171 - @Test - public void logoutTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support"); - Thread.sleep(3000); - obj.verifyLoginPass(4171); - obj.logout(4171); - Thread.sleep(3000); - obj.verifyLoginFail(4171); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4171", data); - - } - - //C4160 - @Test - public void logoutBackButtonTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support"); - Thread.sleep(3000); - obj.verifyLoginPass(4160); - obj.logout(4160); - Thread.sleep(3000); - obj.backButton(); - Thread.sleep(2000); - obj.verifyLoginFail(4160); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4160", data); - } - - ///C4103 - @Test - public void showPasswordTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.coverPassword("support", 4103); - Thread.sleep(3000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4103", data); - } - - //C4105 - @Test - public void errorNotificationTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.login("support@example.com", "support1"); - Thread.sleep(2000); - obj.errorNotification(4105); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4105", data); - } - //C4162 - @Test - public void tabFunctionalityTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(3000); - obj.checkTab(4162); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4162", data); - } - //C4100 - @Test - public void hoverLoginButtonTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(3000); - obj.checkHover("confirm", 4100); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4100", data); - } - //C4101 - @Test - public void hoverEmailFieldTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(3000); - obj.checkHover("email", 4101); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4101", data); - } - //C4102 - @Test - public void hoverPwdFieldTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(3000); - obj.checkHover("password", 4102); - Thread.sleep(1000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4102", data); - } -// @Test -// public void stayLoggedInTest() throws Exception { -// Map data = new HashMap(); -// LoginTest obj = new LoginTest(); -// obj.launchBrowser(); -// Thread.sleep(2000); -// obj.login("support@example.com", "support"); -// Thread.sleep(3000); -// obj.verifyLoginPass(); -// Thread.sleep(1000); -// obj.closeBrowser(); -// Thread.sleep(2000); -// obj.launchPortal(); -// Thread.sleep(2500); -// obj.launchSecondWindow(); -// obj.closeBrowser(); -// data.put("status_id", new Integer(1)); -// data.put("comment", "This test worked fine!"); -// JSONObject r = (JSONObject) client.sendPost("add_result_for_case/812/5036", data); -// } -// @Test -// public void newBrowserTest() throws Exception { -// Map data = new HashMap(); -// LoginTest obj = new LoginTest(); -// obj.launchBrowser(); -// Thread.sleep(2000); -// obj.login("support@example.com", "support"); -// Thread.sleep(3000); -// obj.verifyLoginPass(); -// Thread.sleep(1000); -// obj.launchPortal(); -// obj.verifyLoginPass(); -// obj.closeBrowser(); -// data.put("status_id", new Integer(1)); -// data.put("comment", "This test worked fine!"); -// JSONObject r = (JSONObject) client.sendPost("add_result_for_case/812/5036", data); -// } - - //C4159 - @Test - public void copyPasswordTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.copyPassword("support", 4159); - Thread.sleep(3000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4159", data); - } - //C4161 - @Test - public void initialFocusTest() throws Exception { - Map data = new HashMap(); - LoginTest obj = new LoginTest(); - obj.launchBrowser(); - Thread.sleep(2000); - obj.checkEmailFocus(4161); - Thread.sleep(3000); - obj.closeBrowser(); - - System.out.print("passed"); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4161", data); - } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/NetworkTest.java b/CICD_AP_CLOUDSDK/automationTests/NetworkTest.java deleted file mode 100644 index 658a842b3..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/NetworkTest.java +++ /dev/null @@ -1,952 +0,0 @@ -package automationTests; - -import static org.junit.jupiter.api.Assertions.fail; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; - - -public class NetworkTest { - WebDriver driver; - static APIClient client; - static long runId; -// static String Url = System.getenv("CLOUD_SDK_URL"); -// static String trUser = System.getenv("TR_USER"); -// static String trPwd = System.getenv("TR_PWD"); -// static String cloudsdkUser = "support@example.com"; -// static String cloudsdkPwd="support"; - - @BeforeClass - public static void startTest() throws Exception - { - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connect123$"); - - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String day = Integer.toString(cal.get(Calendar.DATE)); - if (day.length()<2) { - day = "0"+day; - } - String date = "UI Automation Run - " + day + "/" + month + "/" + cal.get(Calendar.YEAR); - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { -// System.setProperty("webdriver.chrome.driver", "/Users/mohammadrahman/Downloads/chromedriver"); - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - } - - public void failure(int testId) throws MalformedURLException, IOException, APIException { - driver.close(); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - void closeBrowser() { - driver.close(); - } - - //Log into the CloudSDK portal - public void logIn() { - driver.findElement(By.id("login_email")).sendKeys("support@example.com"); - driver.findElement(By.id("login_password")).sendKeys("support"); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - public void networkScreen(int testId) throws Exception { - try { - driver.findElement(By.linkText("Network")).click(); - }catch (Exception E) { - failure(testId); - fail("Fail"); - } - - } - - public void loadAllProfiles(int testId) throws Exception { - try { - while (driver.findElements(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[3]/button/span")).size() != 0) { - driver.findElement(By.xpath("/html/body/div/section/main/div/div/div[3]/button/span")).click(); - Thread.sleep(2000); - } - }catch (Exception E) { - failure(testId); - fail("Fail"); - } - - } - - public void addLocation(String loc, int testId) throws Exception { - try { - driver.findElement(By.cssSelector(".ant-tree-node-content-wrapper:nth-child(3) > .ant-tree-title > span")).click(); - } catch (Exception E) { - failure(testId); - - fail("Locations not found"); - } - - Thread.sleep(1000); - - try { - driver.findElement(By.xpath("//span[contains(.,'Add Location')]")).click(); - } catch (Exception E) { - failure(testId); - - fail("Add location button not found"); - } - Thread.sleep(1000); - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(loc).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - Thread.sleep(2000); - - if (!driver.findElement(By.cssSelector(".ant-tree-treenode-switcher-close .ant-tree-title > span")).getText().equals(loc)) { - failure(testId); - fail("Fail"); - } - } - - public void deleteLocation(String loc, int testId) throws Exception { - driver.findElement(By.cssSelector(".ant-tree-treenode-switcher-close .ant-tree-title > span")).click(); - Thread.sleep(1000); - driver.findElement(By.xpath("//span[contains(.,'Delete Location')]")).click(); - Thread.sleep(2000); - if (!driver.findElement(By.cssSelector(".ant-modal-body > p > i")).getText().equals(loc)) { - failure(testId); - fail("Location not deleted"); - } - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - Thread.sleep(2000); - } - - //Verifies no field is blank in the column - public void verifyNetworkFields(boolean expected, String profile, int column, int testId) throws MalformedURLException, IOException, APIException { - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - - //row iteration - for(int i=2; i cols = rows.get(i).findElements(By.tagName("td")); - System.out.print(cols.get(column).getText()); - if (cols.get(column).getText().equals(profile) && !expected) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Fail"); - } - } - } - - //Verifies whether profile exists and clicks - public void findNetwork(String profile, int testId) throws MalformedURLException, IOException, APIException { - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - - breakP: - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j div > div > div.index-module__leftWrapContent___2iZZo > p:nth-child(1)")).getText().equals(profile)) { - //Pass - } - else { - //System.out.print(driver.findElement(By.cssSelector(".index-module__DeviceDetailCard___2CFDA.ant-card-bordered > div > div > div.index-module__leftWrapContent___2iZZo > p:nth-child(1)")).getText()); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Wrong profile"); - } - } catch (Exception E) { - failure(testId); - fail("Profile title not found"); - } - } - - - public void verifyAP(String profile, int testId) throws MalformedURLException, IOException, APIException { - try { - if (driver.findElement(By.cssSelector("#root > section > main > div > div > div.index-module__mainContent___1X1X6 > div > div.ant-card.ant-card-bordered.ant-card-contain-tabs > div.ant-card-head > div.ant-card-head-wrapper > div.ant-card-head-title > div > div > div:nth-child(1)")).getText().equals(profile)) { - //Correct profile - } - else { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Fail"); - } - } catch (Exception E) { - failure(testId); - fail("Profile title not found"); - } - } - - - public void verifyAPLocation(int testId) throws MalformedURLException, IOException, APIException { - try { - String location = driver.findElement(By.cssSelector(".ant-breadcrumb-link")).getText(); - - driver.findElement(By.cssSelector("[id^='rc-tabs-0-tab-location']")).click(); - Thread.sleep(2000); - String dropdownVerification = "[title^='"+location+"']"; - if (driver.findElements(By.cssSelector(dropdownVerification)).size()==0) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Wrong location"); - } - - } catch (Exception E) { - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - fail("Profile title not found"); - } - } - - public void refreshButton(int testId) throws Exception { - try { - driver.findElement(By.cssSelector("[title^='reload']")).click(); - } catch (Exception E) { - failure(testId); - fail ("Reload button not visible"); - } - - Thread.sleep(1000); - } - - - public void clientBlockedListButton(int testId) throws Exception { - driver.findElement(By.xpath("//span[contains(.,'Blocked List')]")).click(); - Thread.sleep(2000); - String URL = driver.getCurrentUrl(); - - if (!URL.equals("https://wlan-ui.qa.lab.wlan.tip.build/system/blockedlist")) { - failure(testId); - - fail (); - } - //Assert.assertEquals(URL, "https://portal.dev1.netexperience.com/configure/system/blockedlist"); - - } - - public void refreshNotificationAP(int testId) throws MalformedURLException, IOException, APIException { - - if (driver.findElement(By.cssSelector(".ant-notification-notice-description")).getText().equals("Access points reloaded.")) { - - } else { - failure(testId); - fail("Notification did not appear"); - } - } - public void refreshNotificationClientDevice(int testId) throws MalformedURLException, IOException, APIException { - if (driver.findElement(By.cssSelector(".ant-notification-notice-description")).getText().equals("Client devices reloaded.")) { - - } else { - failure(testId); - fail("Notification did not appear"); - } - } - - public void clientDevicesScreen(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.linkText("Client Devices")).click(); - } catch (Exception E) { - failure(testId); - fail("Client Devices tab not visible"); - } - - } - - //C5603 - @Test - public void verifyNameFields() throws Exception { - int testId = 5603; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 0, testId); - obj.verifyNetworkFields(false, "N/A", 0, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5604 - @Test - public void verifyAlarmFields() throws Exception { - int testId = 5604; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 1, testId); - obj.verifyNetworkFields(false, "N/A", 1, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5605 - @Test - public void verifyModelField() throws Exception { - int testId = 5605; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 2, testId); - obj.verifyNetworkFields(false, "N/A", 2, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5606 - @Test - public void verifyIPField() throws Exception { - int testId = 5606; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 3, testId); - obj.verifyNetworkFields(false, "N/A", 3, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5607 - @Test - public void verifyMACField() throws Exception { - int testId = 5607; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 4, testId); - obj.verifyNetworkFields(false, "N/A", 4, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5608 - @Test - public void verifyManufacturerField() throws Exception { - int testId = 5608; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 5, testId); - obj.verifyNetworkFields(false, "N/A", 5, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5609 - @Test - public void verifyFirmwareField() throws Exception { - int testId = 5609; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 6, testId); - obj.verifyNetworkFields(false, "N/A", 6, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5610 - @Test - public void verifyAssetIdField() throws Exception { - int testId = 5610; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 7, testId); - obj.verifyNetworkFields(false, "N/A", 7, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5611 - @Test - public void verifyUpTimeField() throws Exception { - int testId = 5611; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 8, testId); - obj.verifyNetworkFields(false, "N/A", 8, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5612 - @Test - public void verifyProfileField() throws Exception { - int testId = 5612; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 9, testId); - obj.verifyNetworkFields(false, "N/A", 9, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5613 - @Test - public void verifyChannelField() throws Exception { - int testId = 5613; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 10, testId); - obj.verifyNetworkFields(false, "N/A", 10, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5614 - @Test - public void verifyOccupancyField() throws Exception { - int testId = 5614; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 11, testId); - obj.verifyNetworkFields(false, "N/A", 11, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5615 - @Test - public void verifyNoiseFloorField() throws Exception { - int testId = 5615; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 12, testId); - obj.verifyNetworkFields(false, "N/A", 12, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5616 - @Test - public void verifyDevicesField() throws Exception { - int testId = 5616; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(testId); - Thread.sleep(5000); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 13, testId); - obj.verifyNetworkFields(false, "N/A", 13, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/" + testId, data); - } - - //C5618 - @Test - public void viewAPTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5618); - Thread.sleep(4500); - obj.findNetwork("Open_AP_21P10C69907629", 5618); - Thread.sleep(3000); - obj.verifyAP("Open_AP_21P10C69907629", 5618); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5618", data); - - } - - //C5617 - @Test - public void refreshButtonTestAccessPoints() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5617); - Thread.sleep(4500); - obj.refreshButton(5617); - Thread.sleep(2000); - obj.refreshNotificationAP(5617); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5617", data); - - } - - //C5590 - @Test - public void refreshButtonTestClientDevices() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5590); - Thread.sleep(4500); - obj.clientDevicesScreen(5590); - Thread.sleep(3500); - obj.refreshButton(5590); - Thread.sleep(2000); - obj.refreshNotificationClientDevice(5590); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5590", data); - - } - - //C5592 - @Test - public void viewDeviceTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5592); - Thread.sleep(4500); - obj.clientDevicesScreen(5592); - Thread.sleep(3500); - obj.findNetwork("Mohammads-MBP", 5592); - Thread.sleep(3000); - obj.verifyDevice("Mohammads-MBP", 5592); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5592", data); - - } - - //C5619 - @Test - public void addLocationTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5619); - Thread.sleep(4500); - obj.addLocation("Test", 5619); - Thread.sleep(3000); - obj.deleteLocation("Test", 5619); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5619", data); - - } - - //C5620 - @Test - public void deleteLocationTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5620); - Thread.sleep(4500); - obj.addLocation("TestLoc", 5620); - Thread.sleep(2000); - obj.deleteLocation("TestLoc", 5620); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5620", data); - - } - - //C5591 - @Test - public void clientBlockedListTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5591); - Thread.sleep(4500); - obj.clientDevicesScreen(5591); - Thread.sleep(3500); - obj.clientBlockedListButton(5591); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5591", data); - - } - - //C5594 - @Test - public void verifyDevicesMACField() throws Exception { - int testId = 5594; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 1, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5595 - @Test - public void verifyDevicesManufacturerField() throws Exception { - int testId = 5595; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 2, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5596 - @Test - public void verifyDevicesIPField() throws Exception { - int testId = 5596; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 3, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5597 - @Test - public void verifyDevicesHostNameField() throws Exception { - int testId = 5597; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 4, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5598 - @Test - public void verifyDevicesAPField() throws Exception { - int testId = 5598; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 5, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5599 - @Test - public void verifyDevicesSSIDField() throws Exception { - int testId = 5599; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 6, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5600 - @Test - public void verifyDevicesBandField() throws Exception { - int testId = 5600; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 7, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5601 - @Test - public void verifyDevicesSignalField() throws Exception { - int testId = 5601; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 8, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - //C5602 - @Test - public void verifyDevicesStatusField() throws Exception { - int testId = 5602; - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(2500); - obj.networkScreen(testId); - Thread.sleep(4500); - obj.clientDevicesScreen(testId); - Thread.sleep(2500); - obj.loadAllProfiles(testId); - obj.verifyNetworkFields(false, "", 9, testId); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - //C5623 - @Test - public void verifyAPLocationTest() throws Exception { - Map data = new HashMap(); - NetworkTest obj = new NetworkTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.networkScreen(5623); - Thread.sleep(4500); - obj.findNetwork("Open_AP_21P10C69907629", 5623); - Thread.sleep(3000); - obj.verifyAPLocation(5623); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5623", data); - - } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/ProfilesTest.java b/CICD_AP_CLOUDSDK/automationTests/ProfilesTest.java deleted file mode 100644 index 349204f91..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/ProfilesTest.java +++ /dev/null @@ -1,798 +0,0 @@ -package automationTests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; -import org.openqa.selenium.support.ui.Select; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeAll; -import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; - -public class ProfilesTest { - WebDriver driver; - - static APIClient client; - static long runId; - -// static String Url = System.getenv("CLOUD_SDK_URL"); -// static String trUser = System.getenv("TR_USER"); -// static String trPwd = System.getenv("TR_PWD"); -// static String cloudsdkUser = "support@example.com"; -// static String cloudsdkPwd="support"; - @BeforeClass - public static void startTest() throws Exception - { - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connect123$"); - - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String day = Integer.toString(cal.get(Calendar.DATE)); - if (day.length()<2) { - day = "0"+day; - } - String date = "UI Automation Run - " + day + "/" + month + "/" + cal.get(Calendar.YEAR); - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); -// System.setProperty("webdriver.chrome.driver", "/Users/mohammadrahman/Downloads/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - } - - void closeBrowser() { - driver.close(); - } - - //Log into the CloudSDK portal - public void logIn() { - driver.findElement(By.id("login_email")).sendKeys("support@example.com"); - driver.findElement(By.id("login_password")).sendKeys("support"); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - public void failure(int testId) throws MalformedURLException, IOException, APIException { - driver.close(); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - //Navigates to profiles tab - public void profileScreen() throws Exception { - driver.findElement(By.linkText("Profiles")).click(); - } - - public void loadAllProfiles(int testId) throws Exception { - try { - while (driver.findElements(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[3]/button/span")).size() != 0) { - driver.findElement(By.xpath("/html/body/div/section/main/div/div/div[3]/button/span")).click(); - Thread.sleep(1400); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - //Verifies whether profile exists - public void findProfile(boolean expected, String profile, int testId) throws Exception { - try { - Thread.sleep(2500); - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - breakP: - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j .ant-card .ant-card-head-title")).getText().equals("Edit "+ profile)) { - //Correct profile - } - else { - failure(testId); - fail("Incorrect Profile selected"); - } - } catch (Exception E) { - failure(testId); - fail("No title found for profile"); - } - } - - public void deleteProfileButton(int testId) throws Exception { - try { - driver.findElement(By.cssSelector("[title^='delete-AutomationTest Profile']")).click(); - Thread.sleep(2000); - - if (driver.findElement(By.cssSelector(".ant-modal-title")).getText().equals("Are you sure?")){ - //No further steps needed - } else { - - fail("Popup displays incorrect text"); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - - } - - public void deleteProfile(int testId) throws Exception { - try { - deleteProfileButton(testId); - Thread.sleep(1000); - driver.findElement(By.cssSelector(".ant-btn.index-module__Button___3SCd4.ant-btn-danger")).click(); - Thread.sleep(1000); - driver.navigate().refresh(); - Thread.sleep(3000); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void cancelDeleteProfile(int testId) throws Exception { - try { - deleteProfileButton(testId); - Thread.sleep(1000); - driver.findElement(By.cssSelector("body > div:nth-child(9) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-footer > div > button:nth-child(1) > span")).click(); - Thread.sleep(1000); - driver.navigate().refresh(); - Thread.sleep(1500); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - //Clicks add profile button - public void addProfileButton(int testId) throws Exception { - try { - driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[1]/div/a/button/span")).click(); - Thread.sleep(1000); - String URL = driver.getCurrentUrl(); - Assert.assertEquals("Incorrect URL", URL, "https://wlan-ui.qa.lab.wlan.tip.build/addprofile"); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - //Clicks refresh button - public void refreshButton(int testId) throws Exception { - try { - //Select SSID from the drop-down - driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[1]/div/button")).click(); - Thread.sleep(1000); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void refreshNotification(int testId) throws MalformedURLException, IOException, APIException { - - try { - if (driver.findElement(By.cssSelector(".ant-notification-notice-description")).getText().equals("Profiles reloaded")) { - //pass - } - } catch (Exception E) { - failure(testId); - fail("Notification not found"); - } - - - } - - public void ssidDetails(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.xpath("//*[@id=\"name\"]")).sendKeys("AutomationTest Profile"); - driver.findElement(By.xpath("//*[@id=\"ssid\"]")).sendKeys("Automation Test SSID"); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void saveProfile(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div/div/button/span")).click(); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void abortCreatingProfile(int testId) throws Exception { - try { - driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div/button/span[2]")).click(); - Thread.sleep(1000); - driver.findElement(By.cssSelector("body > div:nth-child(9) > div > div.ant-modal-wrap > div > div.ant-modal-content > " - + "div.ant-modal-footer > div > button.ant-btn.index-module__Button___3SCd4.ant-btn-primary")).click(); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void useCaptivePortal(int testId) throws Exception { - try { - driver.findElement(By.xpath("//*[@id=\"captivePortal\"]/label[2]/span[1]/input")).click(); - Thread.sleep(1000); - - if (driver.findElements(By.xpath("//*[@id=\"captivePortalId\"]")).size()>0) { - //successfully found drop-down - } else { - - fail("No options for captive portal found"); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void ssidList(int testId) throws Exception { - try { - //System.out.print(driver.findElements(By.className("ant-select-selection-search-input")).size()); - Actions cursor = new Actions(driver); - WebElement input = driver.findElement(By.cssSelector("#rc_select_1")); - cursor.click(input); - cursor.sendKeys(input, "EA8300_5G_WPA2").perform(); - cursor.sendKeys(input, Keys.ENTER).perform(); - Thread.sleep(3000); - - if (driver.findElements(By.className("ant-table-empty")).size()!=0) { - failure(testId); - fail("Table not displaying SSIDs"); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - - } - - public void bandwidthDetails(int testId) throws Exception { - try { - WebElement bandwidth = driver.findElement(By.xpath("//*[@id=\"bandwidthLimitDown\"]")); - //Actions action = new Actions(driver); - bandwidth.sendKeys(Keys.BACK_SPACE); - bandwidth.sendKeys("123"); - Thread.sleep(500); - - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(1) > div.ant-card-body > div:nth-child(3) > div.ant-col.ant-col-12.ant-form-item-control > div > div > div > div.ant-row.ant-form-item.ant-form-item-with-help.ant-form-item-has-error > div > div.ant-form-item-explain > div")) - .getText().equals("Downstream bandwidth limit can be a number between 0 and 100.")){ - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - bandwidth.sendKeys(Keys.BACK_SPACE); - bandwidth.sendKeys(Keys.BACK_SPACE); - bandwidth.sendKeys(Keys.BACK_SPACE); - - bandwidth.sendKeys("-10"); - Thread.sleep(500); - - - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(1) > div.ant-card-body > div:nth-child(3) > div.ant-col.ant-col-12.ant-form-item-control > div > div > div > div.ant-row.ant-form-item.ant-form-item-with-help.ant-form-item-has-error > div > div.ant-form-item-explain > div")) - .getText().equals("Downstream bandwidth limit can be a number between 0 and 100.")){ - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail(); - - } - - bandwidth.sendKeys(Keys.BACK_SPACE); - bandwidth.sendKeys(Keys.BACK_SPACE); - bandwidth.sendKeys(Keys.BACK_SPACE); - - bandwidth.sendKeys("10"); - Thread.sleep(500); - - - if (driver.findElements(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(1) > div.ant-card-body > div:nth-child(3) > div.ant-col.ant-col-12.ant-form-item-control > div > div > div > div.ant-row.ant-form-item.ant-form-item-with-help.ant-form-item-has-error > div > div.ant-form-item-explain > div")) - .size()!=0){ - failure(testId); - fail(); - - } - } catch (Exception E) { - failure(testId); - fail(); - } - - - } - - public void selectSSID(int testId) throws Exception { - try { - Actions cursor = new Actions(driver); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.ENTER).perform(); - cursor.sendKeys(Keys.ENTER).perform(); - - Thread.sleep(1000); - - boolean found = true; - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(1) > div.ant-card-head > div > div")).getText().equals("SSID")) { - found = false; - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(2) > div.ant-card-head > div > div")).getText().equals("Network Connectivity")) { - found = false; - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(3) > div.ant-card-head > div > div")).getText().equals("Security and Encryption")) { - found = false; - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(4) > div.ant-card-head > div > div")).getText().equals("Roaming")) { - found = false; - } - } catch (Exception E) { - failure(testId); - fail(); - - } - Assert.assertEquals(true, found); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void selectAP(int testId) throws Exception { - try { - Actions cursor = new Actions(driver); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.TAB).perform(); - cursor.sendKeys(Keys.ENTER).perform(); - cursor.sendKeys(Keys.ARROW_DOWN).perform(); - cursor.sendKeys(Keys.ENTER).perform(); - Thread.sleep(1500); - - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(1) > div.ant-card-head > div > div")).getText().equals("LAN and Services")) { - failure(testId); - fail(); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div > div > form > div.index-module__ProfilePage___OaO8O > div:nth-child(2) > div.ant-card-head > div > div")).getText().equals("Wireless Networks (SSIDs) Enabled on This Profile")) { - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - - //Assert.assertEquals(true, found); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - //C4807 - @Test - public void addProfileButtonTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4807); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4807", data); - } - - //C4808 - @Test - public void ssidOptionsVerificationTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4808); - Thread.sleep(1000); - obj.selectSSID(4088); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4808", data); - } - - //C4809 - @Test - public void apOptionsVerificationTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4809); - Thread.sleep(1000); - obj.selectAP(4809); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4809", data); - - } - //C4824 - @Test - public void refreshButtonTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.refreshButton(4824); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4824", data); - - } - //C4818 - @Test - public void bandwidthTest() throws Exception { - Map data = new HashMap(); - - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4818); - Thread.sleep(1000); - obj.selectSSID(4818); - obj.ssidDetails(4818); - obj.bandwidthDetails(4818); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4818", data); - - } - - //C4819 - @Test - public void captivePortalDropdownTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4819); - Thread.sleep(1000); - obj.selectSSID(4819); - obj.ssidDetails(4819); - obj.useCaptivePortal(4819); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4819", data); - } - - //C4822 - @Test - public void ssidListTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4822); - Thread.sleep(1000); - obj.selectAP(4822); - Thread.sleep(500); - obj.ssidList(4822); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4822", data); - } - //C4810 - @Test - public void createProfileTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4810); - Thread.sleep(600); - obj.selectSSID(4810); - obj.ssidDetails(4810); - obj.saveProfile(4810); - Thread.sleep(1000); - obj.loadAllProfiles(4810); - obj.findProfile(true, "AutomationTest Profile",4810); - obj.deleteProfile(4810); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4810", data); - } - //C4811 - @Test - public void profileNotCreatedTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4811); - Thread.sleep(600); - obj.selectSSID(4811); - obj.ssidDetails(4811); - obj.abortCreatingProfile(4811); - Thread.sleep(1000); - obj.loadAllProfiles(4811); - obj.findProfile(false, "AutomationTest Profile",4811); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4811", data); - } - //C4814 - @Test - public void deleteProfileTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4814); - Thread.sleep(600); - obj.selectSSID(4814); - obj.ssidDetails(4814); - obj.saveProfile(4814); - Thread.sleep(1000); - obj.loadAllProfiles(4814); - Thread.sleep(1000); - obj.findProfile(true, "AutomationTest Profile",4814); - obj.deleteProfile(4814); - obj.loadAllProfiles(4814); - Thread.sleep(1500); - obj.findProfile(false, "AutomationTest Profile",4814); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4814", data); - } - - //C4813 - @Test - public void cancelDeleteProfileTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4813); - Thread.sleep(600); - obj.selectSSID(4813); - obj.ssidDetails(4813); - obj.saveProfile(4813); - Thread.sleep(1000); - obj.loadAllProfiles(4813); - obj.findProfile(true, "AutomationTest Profile", 4813); - obj.cancelDeleteProfile(4813); - Thread.sleep(1500); - obj.loadAllProfiles(4813); - obj.findProfile(true, "AutomationTest Profile",4813); - //Delete profile at the end of the test - obj.deleteProfile(4813); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4813", data); - } - //C4812 - @Test - public void verifyDeleteConfirmationTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.addProfileButton(4812); - Thread.sleep(600); - obj.selectSSID(4812); - obj.ssidDetails(4812); - obj.saveProfile(4812); - Thread.sleep(2000); - obj.loadAllProfiles(4812); - obj.findProfile(true, "AutomationTest Profile",4812); - obj.deleteProfileButton(4812); - obj.driver.navigate().refresh(); - Thread.sleep(2000); - obj.loadAllProfiles(4812); - obj.findProfile(true, "AutomationTest Profile",4812); - //Delete profile at the end of the test - obj.deleteProfile(4812); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4812", data); - } - //C4815 - @Test - public void viewProfileTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.findProfile("ECW5410 Automation",4815); - Thread.sleep(5000); - obj.verifyProfile("ECW5410 Automation",4815); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/4815", data); - } - //C5035 - @Test - public void verifyFieldsTest() throws Exception { - Map data = new HashMap(); - ProfilesTest obj = new ProfilesTest(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.profileScreen(); - Thread.sleep(2500); - obj.loadAllProfiles(5035); - obj.findProfile(false, "",5035); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5035", data); - } -} diff --git a/CICD_AP_CLOUDSDK/automationTests/SystemTests.java b/CICD_AP_CLOUDSDK/automationTests/SystemTests.java deleted file mode 100644 index 9b2829761..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/SystemTests.java +++ /dev/null @@ -1,1385 +0,0 @@ -package automationTests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.internal.TextListener; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.Test; -import org.junit.runner.JUnitCore; -import org.junit.runner.Result; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; - -public class SystemTests { - WebDriver driver; - static APIClient client; - static long runId; -// static String Url = System.getenv("CLOUD_SDK_URL"); -// static String trUser = System.getenv("TR_USER"); -// static String trPwd = System.getenv("TR_PWD"); -// static String cloudsdkUser = "support@example.com"; -// static String cloudsdkPwd="support"; - - @BeforeClass - public static void startTest() throws Exception - { -// client.setUser(trUser); -// client.setPassword(trPwd); - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connect123$"); - - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String day = Integer.toString(cal.get(Calendar.DATE)); - if (day.length()<2) { - day = "0"+day; - } - String date = "UI Automation Run - " + day + "/" + month + "/" + cal.get(Calendar.YEAR); - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); -// System.setProperty("webdriver.chrome.driver", "/Users/mohammadrahman/Downloads/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - } - - public void closeBrowser() { - driver.close(); - } - - public void failure(int testId) throws MalformedURLException, IOException, APIException { - driver.close(); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - //Log into the CloudSDK portal - public void logIn() { - driver.findElement(By.id("login_email")).sendKeys("support@example.com"); - driver.findElement(By.id("login_password")).sendKeys("support"); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - //Navigates to systems tab - public void systemScreen(int testId) throws Exception { - try { - driver.findElement(By.linkText("System")).click(); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void ouiError(int testId) throws Exception { - try { - Actions cursor = new Actions(driver); - WebElement oui = driver.findElement(By.xpath("//*[@id=\"oui\"]")); - cursor.sendKeys(oui, "abc").build().perform(); - cursor.sendKeys(Keys.ENTER).build().perform(); - Thread.sleep(1000); - - - if (!driver.findElement(By.cssSelector(".ant-notification-notice-description")).getText().equals("No matching manufacturer found for OUI")) { - failure(testId); - fail(); - - } - } catch (Exception E) { - failure(testId); - fail(); - } - } - - public void ouiFormats(int testId) throws Exception { - Actions cursor = new Actions(driver); - WebElement oui = driver.findElement(By.xpath("//*[@id=\"oui\"]")); - cursor.sendKeys(oui, "88:12:4E").build().perform(); - cursor.sendKeys(Keys.ENTER).build().perform(); - Thread.sleep(1000); - - boolean found = false; - if (driver.findElements(By.cssSelector(".ant-notification-notice-description")).size()>0) { - found = true; - } - if (found) { - failure(testId); - fail(); - } - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - - cursor.sendKeys(oui, "88124E").build().perform(); - cursor.sendKeys(Keys.ENTER).build().perform(); - Thread.sleep(1000); - - if (driver.findElements(By.cssSelector(".ant-notification-notice-description")).size()>0) { - found = true; - } - if (found) { - failure(testId); - fail(); - } - - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - cursor.sendKeys(Keys.BACK_SPACE).perform(); - - cursor.sendKeys(oui, "88-12-4E").build().perform(); - cursor.sendKeys(Keys.ENTER).build().perform(); - Thread.sleep(2000); - - if (driver.findElements(By.cssSelector(".ant-notification-notice-description")).size()>0) { - failure(testId); - fail(); - } - } - - public void ouiLength(int testId) throws Exception { - try { - Actions cursor = new Actions(driver); - WebElement oui = driver.findElement(By.xpath("//*[@id=\"oui\"]")); - cursor.sendKeys(oui, "123456789").build().perform(); - cursor.sendKeys(Keys.ENTER).build().perform(); - Thread.sleep(3000); - - if (oui.getAttribute("value").length()>8) { - failure(testId); - fail(); - } - - } catch (Exception E) { - failure(testId); - fail(); - } - } - - public void addVersion(int testId) throws Exception { - try { - Thread.sleep(2000); - driver.findElement(By.xpath("//span[contains(.,'Add Version')]")).click(); - driver.findElement(By.xpath("//*[@id=\"modelId\"]")).sendKeys("TEST"); - driver.findElement(By.xpath("//*[@id=\"versionName\"]")).sendKeys("TEST"); - driver.findElement(By.xpath("//*[@id=\"filename\"]")).sendKeys("TEST"); - driver.findElement(By.xpath("//*[@id=\"validationCode\"]")).sendKeys("TEST"); - driver.findElement(By.cssSelector(".ant-btn.index-module__Button___3SCd4.ant-btn-primary")).click(); - Thread.sleep(1000); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void addBlankVersion(int testId) throws Exception { - - try { - driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div[2]/div[3]/button/span")).click(); - driver.findElement(By.xpath("//*[@id=\"modelId\"]")).sendKeys("TEST"); - driver.findElement(By.xpath("//*[@id=\"filename\"]")).sendKeys("TEST"); - driver.findElement(By.xpath("//*[@id=\"validationCode\"]")).sendKeys("TEST"); - driver.findElement(By.cssSelector(".ant-btn.index-module__Button___3SCd4.ant-btn-primary")).click(); - Thread.sleep(1000); - - try { - if (driver.findElement(By.cssSelector("body > div:nth-child(8) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > form > div.ant-row.ant-form-item.ant-form-item-with-help.ant-form-item-has-error > div.ant-col.ant-col-15.ant-form-item-control > div.ant-form-item-explain > div")).getText().equals("Please input your Version Name")) { - //error message found - } else { - failure(testId); - fail("Incorrect error message displayed"); - } - } catch (Exception E) { - failure(testId); - fail("Error message not displayed"); - } - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void addClient(String mac, int testId) throws Exception { - try { - try { - driver.findElement(By.xpath("//span[contains(.,'Add Client')]")).click(); - } catch (Exception E) { - failure(testId); - fail("Add Client button not found"); - } - - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(mac).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - } catch (Exception E) { - failure(testId); - fail(); - } - - - } - public void addInvalidClient(String mac, int testId) throws Exception { - try { - driver.findElement(By.xpath("//span[contains(.,'Add Client')]")).click(); - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(mac).perform(); - Thread.sleep(500); -// driver.findElement(By.cssSelector("body > div:nth-child(8) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > form > div > div.ant-col.ant-col-12.ant-form-item-control > div.ant-form-item-explain > div")) -// .click(); - try { - if (!driver.findElement(By.cssSelector("body > div:nth-child(8) > div > div.ant-modal-wrap > div > div.ant-modal-content > div.ant-modal-body > form > div > div.ant-col.ant-col-12.ant-form-item-control > div.ant-form-item-explain > div")) - .getText().equals("Please enter a valid MAC Address.")){ - failure(testId); - fail("Incorrect error message displayed"); - } - } catch (Exception E) { - failure(testId); - fail("Error message not displayed"); - } - - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - }catch (Exception E) { - failure(testId); - fail(); - } - - - } - - public void cancelAddClient(String mac, int testId) throws Exception { - try { - try { - driver.findElement(By.xpath("//span[contains(.,'Add Client')]")).click(); - } catch (Exception E) { - - fail("Add Client button not found"); - } - - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(mac).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - }catch (Exception E) { - failure(testId); - fail(); - } - - - } - - //Looks for the version given in the parameter and tests to see if it is the expected result - public void findVersion(boolean expected, String version, int testId) throws MalformedURLException, IOException, APIException { - - try { - WebElement tbl = driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div[2]/div[4]/div/div/div/div/div/table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j section > main > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - //column iteration - for(int j=0; j section > main > div:nth-child(2) > div > form > div:nth-child(1) > div.ant-card-head > div > div")).getText().equals("Upload Manufacturer OUI Data")) { - - fail("Upload data section title incorrect"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div:nth-child(2) > div > form > div:nth-child(2) > div.ant-card-head > div > div")).getText().equals("Set a Manufacturer Alias")) { - - fail("Set manufacturer data section title incorrect"); - } - }catch (Exception E) { - failure(testId); - fail(); - } - //Assert.assertEquals(true, found); - } - - public void autoprovisionScreenDetails(boolean enabled, int testId) throws MalformedURLException, IOException, APIException { - if (enabled) { - try { - if (!driver.findElement(By.cssSelector("#root > section > main > div:nth-child(2) > form > div.index-module__Content___2GmAx > div:nth-child(1) > div.ant-card-head > div > div")).getText().equals("Target Location")) { - failure(testId); - fail("Target Location title incorrect"); - } else if (!driver.findElement(By.cssSelector("#root > section > main > div:nth-child(2) > form > div.index-module__Content___2GmAx > div:nth-child(2) > div.ant-card-head > div > div.ant-card-head-title")).getText().equals("Target Equipment Profiles")) { - - fail("Target equipment profiles title incorrect"); - } - } catch (Exception E) { - failure(testId); - fail(); - } - } else { - if (driver.findElements(By.cssSelector("#root > section > main > div:nth-child(2) > form > div.index-module__Content___2GmAx > div:nth-child(1) > div.ant-card-head > div > div")).size()!=0) { - - failure(testId); - fail(); - - - } - } - } - - public void clickSwitch() { - driver.findElement(By.cssSelector("#enabled")).click();; - } - - public void firmwareScreen(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-firmware\"]")).click(); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void autoprovisionScreen(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-autoprovision\"]")).click(); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void clientBListScreen(int testId) throws MalformedURLException, IOException, APIException { - try { - driver.findElement(By.xpath("//*[@id=\"rc-tabs-0-tab-blockedlist\"]")).click(); - }catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void deleteMacButton(String name, int testId) throws Exception { - try { - driver.findElement(By.cssSelector("[title^='delete-mac-" + name + "']")).click(); - Thread.sleep(2000); - try { - if (driver.findElement(By.xpath("//*[@id=\"rcDialogTitle1\"]")).getText().equals("Are you sure?")){ - //No further steps needed - } else if (driver.findElement(By.xpath("//*[@id=\"rcDialogTitle2\"]")).getText().equals("Are you sure?")){ - //Will have this Id when version edit button has been clicked prior - } else { - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void deleteMac(String name, int testId) throws Exception { - try { - deleteMacButton(name,testId); - Thread.sleep(1000); - Actions browse = new Actions(driver); - browse.sendKeys(Keys.TAB).perform(); - browse.sendKeys(Keys.TAB).perform(); - browse.sendKeys(Keys.TAB).perform(); - browse.sendKeys(Keys.ENTER).perform(); - Thread.sleep(1000); - driver.navigate().refresh(); - } catch (Exception E) { - failure(testId); - fail(); - } - - } - - public void uniqueVersion(int testId) throws MalformedURLException, IOException, APIException { - - try { - WebElement tbl = driver.findElement(By.cssSelector("#root > section > main > div:nth-child(2) > div:nth-child(2) > div > div > div > div > div > table")); - List rows = tbl.findElements(By.tagName("tr")); - List ids = new ArrayList(); - - boolean found = false; - //row iteration - for(int i=1; i cols = rows.get(i).findElements(By.tagName("td")); - - if (ids.contains(cols.get(0).getText())) { - failure(testId); - fail(); - } else { -// System.out.print(cols.get(0).getText()); - ids.add(cols.get(0).getText()); - } - - } - - }catch (Exception E) { - failure(testId); - fail(); - } - } - - public List listOfVersions(int table, int testId) throws MalformedURLException, IOException, APIException { - List ids = new ArrayList(); - try { - WebElement tbl; - if (table == 1) { - tbl = driver.findElement(By.xpath("//table")); - } else { - tbl = driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div[2]/div[4]/div/div/div/div/div/table")); - } - - List rows = tbl.findElements(By.tagName("tr")); - //List ids = new ArrayList(); - - boolean found = false; - //row iteration - for(int i=1; i cols = rows.get(i).findElements(By.tagName("td")); - - if (!ids.contains(cols.get(0).getText())) { - ids.add(cols.get(0).getText()); - } - } - - return ids; - - }catch (Exception E) { - failure(testId); - fail(); - } - return ids; - } - - public int addModelAndClickDropdown(int testId) throws Exception { - driver.findElement(By.xpath("//span[contains(.,'Add Model Target Version')]")).click(); - Thread.sleep(1000); - Actions browse = new Actions(driver); - Thread.sleep(1000); - browse.sendKeys(Keys.TAB).perform(); - browse.sendKeys(Keys.TAB).perform(); - - browse.sendKeys(Keys.ENTER).perform(); - List versions = driver.findElements(By.cssSelector(".ant-select-item.ant-select-item-option")); - browse.sendKeys(Keys.ESCAPE).perform(); - System.out.print(versions.size()); - return versions.size(); - - } - - //C5037 - @Test - public void manufacturerScreenTest() throws Exception { - Map data = new HashMap(); - - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(4000); - obj.systemScreen(5037); - Thread.sleep(2500); - obj.manufacturerScreenDetails(5037); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5037", data); - - } - //C5036 - @Test - public void ouiDetailsTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5036); - Thread.sleep(2500); - obj.ouiError(5036); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5036", data); - - } - //C5639 - @Test - public void ouiLengthTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5639); - Thread.sleep(2500); - obj.ouiLength(5639); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5639", data); - } - //C5640 - @Test - public void ouiFormatTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5640); - Thread.sleep(2500); - obj.ouiFormats(5640); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5640", data); - } - //C5040 - @Test - public void createVersionTest() throws Exception { - Map data = new HashMap(); - - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5040); - Thread.sleep(2500); - //obj.manufacturerScreenDetails(); - obj.firmwareScreen(5040); - Thread.sleep(1000); - obj.addVersion(5040); - Thread.sleep(1000); - obj.findVersion(true, "TEST", 5040); - Thread.sleep(2000); - obj.deleteVersion(5040); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5040", data); - - - } - //C5038 - @Test - public void allVersionFieldsTest() throws Exception { - Map data = new HashMap(); - - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5038); - Thread.sleep(2500); - obj.firmwareScreen(5038); - Thread.sleep(1000); - obj.findVersion(false, "", 5038); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5038", data); - - } - //C5039 - @Test - public void modelTargetVersionFieldsTest() throws Exception { - Map data = new HashMap(); - - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5039); - Thread.sleep(2500); - obj.firmwareScreen(5039); - Thread.sleep(1000); - obj.findModelTargetVersion(false, "", 5039); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5039", data); - - } - //C5057 - @Test - public void deleteVersionTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5057); - Thread.sleep(2500); - //obj.manufacturerScreenDetails(); - obj.firmwareScreen(5057); - Thread.sleep(1000); - obj.addVersion(5057); - Thread.sleep(3000); - obj.findVersion(true, "TEST", 5057); - Thread.sleep(2000); - obj.deleteVersion(5057); - Thread.sleep(1000); - obj.findVersion(false, "TEST", 5057); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5057", data); - - } - //C5056 - @Test - public void editVersionTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5056); - Thread.sleep(2500); - obj.firmwareScreen(5056); - Thread.sleep(1000); - obj.addVersion(5056); - Thread.sleep(1000); - obj.editVersion(5056); - Thread.sleep(1500); - obj.findVersion(true, "TEST123", 5056); - obj.deleteVersion(5056); - Thread.sleep(6000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5056", data); - - } - //C5064 - @Test - public void abortEditVersionTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5064); - Thread.sleep(2500); - obj.firmwareScreen(5064); - Thread.sleep(1000); - obj.addVersion(5064); - Thread.sleep(1000); - obj.abortEditVersion(5064); - Thread.sleep(1500); - obj.findVersion(false, "TEST123", 5064); - obj.deleteVersion(5064); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5064", data); - - } - //C5065 - @Test - public void createBlankVersionTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5065); - Thread.sleep(2500); - obj.firmwareScreen(5065); - Thread.sleep(1000); - obj.addBlankVersion(5065); - Thread.sleep(1000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5065", data); - - } - //C5041 - @Test - public void autoProvEnbableSwitchTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5041); - Thread.sleep(2500); - obj.autoprovisionScreen(5041); - Thread.sleep(1000); - obj.autoprovisionScreenDetails(true, 5041); - obj.clickSwitch(); - Thread.sleep(1000); - obj.autoprovisionScreenDetails(false, 5041); - obj.clickSwitch(); - Thread.sleep(1000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5041", data); - - } - - //C5054 - @Test - public void targetEquipmentFieldsTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5054); - Thread.sleep(2500); - obj.autoprovisionScreen(5054); - Thread.sleep(1000); - obj.findTargetEquipmentProfile(false, "", 5054); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5054", data); - - } - //C5042 - @Test - public void createTargetEquipmentTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5042); - Thread.sleep(2500); - obj.autoprovisionScreen(5042); - Thread.sleep(1000); - obj.createTargetEquipmentProfile(5042); - Thread.sleep(1000); - obj.findTargetEquipmentProfile(true, "TEST", 5042); - obj.deleteTarget("TEST", 5042); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5042", data); - - } - //C5052 - @Test - public void deleteTargetEquipmentTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5052); - Thread.sleep(2500); - obj.autoprovisionScreen(5052); - Thread.sleep(1000); - obj.createTargetEquipmentProfile(5052); - Thread.sleep(1000); - obj.deleteTarget("TEST", 5052); - Thread.sleep(2000); - obj.findTargetEquipmentProfile(false, "TEST", 5052); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5052", data); - - } - //C5053 - @Test - public void editTargetEquipmentTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5053); - Thread.sleep(2500); - obj.autoprovisionScreen(5053); - Thread.sleep(1000); - obj.createTargetEquipmentProfile(5053); - Thread.sleep(1000); - obj.editTarget("TEST123", 5058); - Thread.sleep(1000); - obj.findTargetEquipmentProfile(true, "TEST123", 5053); - obj.editTarget("TEST", 5053); - Thread.sleep(1000); - obj.deleteTarget("TEST", 5053); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5053", data); - - } - //C5058 - @Test - public void autoProvDropdownTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5058); - Thread.sleep(2500); - obj.autoprovisionScreen(5058); - Thread.sleep(1000); - obj.testAutoProvDropdown(5058); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5058", data); - - } - - //C5060 - @Test - public void addClientTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5060); - Thread.sleep(1000); - obj.clientBListScreen(5060); - Thread.sleep(2500); - obj.addClient("6c:e8:5c:63:3b:5f", 5060); - Thread.sleep(1500); - obj.findMacAddress(true, "6c:e8:5c:63:3b:5f", 5060); - Thread.sleep(2000); - obj.deleteMac("6c:e8:5c:63:3b:5f", 5060); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5060", data); - - } - - //C5061 - @Test - public void deleteClientTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5061); - Thread.sleep(1000); - obj.clientBListScreen(5061); - Thread.sleep(2500); - obj.addClient("6c:e8:5c:63:3b:5f", 5061); - Thread.sleep(3500); - obj.findMacAddress(true, "6c:e8:5c:63:3b:5f", 5061); - Thread.sleep(2000); - obj.deleteMac("6c:e8:5c:63:3b:5f", 5061); - Thread.sleep(2000); - obj.findMacAddress(false, "6c:e8:5c:63:3b:5f", 5061); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5061", data); - - } - //C5063 - @Test - public void cancelAddingClientTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5063); - Thread.sleep(1000); - obj.clientBListScreen(5063); - Thread.sleep(2500); - obj.cancelAddClient("6c:e8:5c:63:3b:5f", 5063); - Thread.sleep(1500); - obj.findMacAddress(false, "6c:e8:5c:63:3b:5f", 5063); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5063", data); - - } - //C5062 - @Test - public void addInvalidClientTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5062); - Thread.sleep(1000); - obj.clientBListScreen(5062); - Thread.sleep(2500); - obj.addInvalidClient("abc", 5062); - Thread.sleep(1500); - obj.findMacAddress(false, "abc", 5062); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5062", data); - } - - //C5638 - @Test - public void uniqueFieldsTest() throws Exception { - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(5638); - Thread.sleep(4500); - obj.firmwareScreen(5638); - Thread.sleep(1000); - obj.uniqueVersion(5638); - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/5638", data); - } - - //C5637 - @Test - public void versionsAvailableTest() throws Exception { - int testId = 5637; - Map data = new HashMap(); - SystemTests obj = new SystemTests(); - obj.launchBrowser(); - obj.logIn(); - Thread.sleep(3000); - obj.systemScreen(testId); - Thread.sleep(2500); - obj.firmwareScreen(testId); - Thread.sleep(1000); - List ids = obj.listOfVersions(2, testId); - int dropdownOptions = obj.addModelAndClickDropdown(testId); - List modTarg = obj.listOfVersions(1, testId); - int expected = ids.size() - modTarg.size(); - if (dropdownOptions!= expected) { - fail(); - } - - Thread.sleep(2000); - obj.closeBrowser(); - data.put("status_id", new Integer(1)); - data.put("comment", "This test worked fine!"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - -} diff --git a/CICD_AP_CLOUDSDK/automationTests/UsersTest.java b/CICD_AP_CLOUDSDK/automationTests/UsersTest.java deleted file mode 100644 index 715e8610e..000000000 --- a/CICD_AP_CLOUDSDK/automationTests/UsersTest.java +++ /dev/null @@ -1,470 +0,0 @@ -package automationTests; - -import static org.junit.jupiter.api.Assertions.*; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; - -import org.junit.AfterClass; -import org.junit.Test; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.openqa.selenium.By; -import org.openqa.selenium.Keys; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.WebElement; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; -import org.openqa.selenium.interactions.Actions; -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; - -import java.util.Map; - -public class UsersTest{ - WebDriver driver; - static APIClient client; - static long runId; - -// static String Url = System.getenv("CLOUD_SDK_URL"); -// static String trUser = System.getenv("TR_USER"); -// static String trPwd = System.getenv("TR_PWD"); -// static String cloudsdkUser = "support@example.com"; -// static String cloudsdkPwd="support"; - @BeforeClass - public static void startTest() throws Exception - { - client = new APIClient("https://telecominfraproject.testrail.com"); - client.setUser("syama.devi@connectus.ai"); - client.setPassword("Connect123$"); - JSONArray c = (JSONArray) client.sendGet("get_runs/5"); - runId = new Long(0); - - Calendar cal = Calendar.getInstance(); - //Months are indexed 0-11 so add 1 for current month - int month = cal.get(Calendar.MONTH) + 1; - String day = Integer.toString(cal.get(Calendar.DATE)); - if (day.length()<2) { - day = "0"+day; - } - String date = "UI Automation Run - " + day + "/" + month + "/" + cal.get(Calendar.YEAR); - - for (int a = 0; a < c.size(); a++) { - if (((JSONObject) c.get(a)).get("name").equals(date)) { - runId = (Long) ((JSONObject) c.get(a)).get("id"); - } - } - } - - public void launchBrowser() { - System.setProperty("webdriver.chrome.driver", "/home/netex/nightly_sanity/ui-scripts/chromedriver"); -// System.setProperty("webdriver.chrome.driver", "/Users/mohammadrahman/Downloads/chromedriver"); - ChromeOptions options = new ChromeOptions(); - options.addArguments("--no-sandbox"); - options.addArguments("--headless"); - options.addArguments("--window-size=1920,1080"); - driver = new ChromeDriver(options); - driver.get("https://wlan-ui.qa.lab.wlan.tip.build"); - } - - void closeBrowser() { - driver.close(); - } - - public void logIn() { - driver.findElement(By.id("login_email")).sendKeys("support@example.com"); - driver.findElement(By.id("login_password")).sendKeys("support"); - driver.findElement(By.xpath("//*[@id=\"login\"]/button/span")).click(); - } - - public void failure(int testId) throws MalformedURLException, IOException, APIException { - driver.close(); - Map data = new HashMap(); - data.put("status_id", new Integer(5)); - data.put("comment", "Fail"); - JSONObject r = (JSONObject) client.sendPost("add_result_for_case/"+runId+"/"+testId, data); - } - - public void accountsScreen(int testId) throws Exception { - try { - driver.findElement(By.linkText("Users")).click(); - } catch (Exception E) { - failure(testId); - fail("Fail"); - } - - } - - public void addAccountButton(int testId) throws MalformedURLException, IOException, APIException { - try { - Actions act = new Actions(driver); - act.moveToElement(driver.findElement(By.cssSelector("[title^='addaccount']"))).click().perform(); - } catch (Exception E) { - failure(testId); - fail("Fail"); - } - - } - - public void verifyAddAccountPopup(int testId) throws MalformedURLException, IOException, APIException { - Map data = new HashMap(); - try { - if (driver.findElement(By.id("rcDialogTitle0")).getText().equals("Add User")) { - //pass - } else { - - failure(testId); - fail(); - } - } catch (Exception E) { - failure(testId); - fail("Fail"); - } - } - - public void addAccount(String account, String password, String confirmPassword, int testId) throws MalformedURLException, IOException, APIException { - try { - addAccountButton(testId); - Actions browser = new Actions(driver); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(account).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(password).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(confirmPassword).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.TAB).perform(); - browser.sendKeys(Keys.ENTER).perform(); - } catch (Exception E) { - failure(testId); - fail("Fail"); - } - - } - - public void blankEmailWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("Please input your e-mail")) { - //pass - } else { - - failure(testId); - fail("Incorrect warning displayed"); - } - } catch (Exception E) { - failure(testId); - fail("No warning displayed"); - } - } - - public void invalidPasswordsWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("The two passwords do not match")) { - //pass - } else { - - failure(testId); - fail("Incorrect warning displayed"); - } - } catch (Exception E) { - failure(testId); - fail("No warning displayed"); - } - } - - public void invalidEmailWarning(int testId) throws Exception { - try { - if (driver.findElement(By.cssSelector("[role^='alert']")).getText().equals("The input is not a valid e-mail")) { - //pass - } else { - - failure(testId); - fail("Incorrect error displayed"); - } - } catch (Exception E) { - failure(testId); - fail("No error displayed"); - } - } - - public void editAccount(String oldName, String newName, int testId) throws Exception { - try { - WebElement tbl = driver.findElement(By.xpath("//table")); - List rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - breakP: - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - breakP: - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j rows = tbl.findElements(By.tagName("tr")); - boolean found = false; - //row iteration - for(int i=0; i cols = rows.get(i).findElements(By.tagName("td")); - - //column iteration - for(int j=0; j 0) { - System.out.println("Tests failed."); - System.exit(1); - } else { - System.out.println("Tests finished successfully."); - System.exit(0); - } - - } -} diff --git a/NOLA-README.md b/NOLA-README.md deleted file mode 100644 index 2c16ad01d..000000000 --- a/NOLA-README.md +++ /dev/null @@ -1,138 +0,0 @@ -# TIP CICD Sanity Scripts -This directory contains scripts and modules designed for automated full-system testing. - -# Libraries needed to run this code successfully -sudo pip3 install artifactory -sudo pip3 install xlsxwriter -sudo pip3 install pandas -sudo pip3 install paramiko -sudo pip3 install scp -sudo pip3 install pexpect -sudo pip3 install pexpect-serial -sudo yum install pytest - -# Clone these repositories to get started: -git@github.com:Telecominfraproject/wlan-testing.git # This repo - -# LANforge scripts repo. This *MUST* be located or linked at wlan-testing/lanforge/lanforge-scripts -git@github.com:Telecominfraproject/wlan-lanforge-scripts.git - -# Cloud-services, so that you can find the API document -git@github.com:Telecominfraproject/wlan-cloud-services - -# Find the cloud-sdk API document here: -https://github.com/Telecominfraproject/wlan-cloud-services/tree/master/portal-services/src/main/resources/ - -# You need access to the 'ubuntu' jumphost. Send your public ssh key to greearb@candelatech.com -# and he will add this to the jumphost. -# For ease of use, add this to your /etc/hosts file: 3.130.51.163 orch - -# Examples in this code often assume you are using ssh port redirects to log into the testbeds, -# for instance, this is for working on the NOLA-01 testbed. The 3.130.51.163 (aka orch) -# system has its /etc/hosts file updated, so that 'lf1' means LANforg system in testbed NOLA-01 -# You can find other testbed info in TIP Confluence -# https://telecominfraproject.atlassian.net/wiki/spaces/WIFI/pages/307888428/TIP+Testbeds -# Please communicate with Ben Greear or Jaspreet Sachdev before accessing a testbed -# at leat until we have a reservation system in place. - -# NOLA-01 testbed -ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 ubuntu@orch -# Example of accessing AP over serial console through jumphost -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 \ - -m ecw5410 --cmd "cat /etc/banner" -# Example of accessing NOLA-01's cloud controller (https://wlan-portal-svc.cicd.lab.wlan.tip.build) -./query_sdk.py --testrail-user-id NONE --model ecw5410 --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build --sdk-user-id \ - support@example.com --sdk-user-password support --equipment_id 3 --type profile --cmd get --brief true -# Configure wpa, wpa2 SSIDs on NOLA-01 -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01" --lanforge-ip-address localhost \ - --lanforge-port-number 8802 --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ - --skip-radius - -# NOLA-04 testbed -# testbed ssh tunnel -ssh -C -L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 ubuntu@orch -# Example of accessing AP over serial console through jumphost -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port 8813 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 -m ecw5410 --cmd "cat /etc/banner" - - -# NOLA-12 testbed -# testbed ssh tunnel -ssh -C -L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 ubuntu@orch -# Create profiles. -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8823 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-12" --lanforge-ip-address localhost --lanforge-port-number 8822 --default_ap_profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --skip_radius - - -Then, you would use port 8802 for connecting to the LANforge-GUI for the python LANforge test logic, -and port 8803 to access the lab jumphost. Port 8800 could connect a locally running LANforge GUI to the -testbed for monitoring the test, and port 8801 will connect VNC to the LANforge machine. - -# This automated test logic is found in the wlan-testing/unit_tests directory. These notes -# assume you are in that directory unless otherwise specified. - -# Interesting files in this repo - -* ap_ssh.py: Library methods to access the AP over direct ssh connection or serial console. For NOLA - testbeds, currently serial console is the only viable way to connect. - -* cloudsdk.py: Library methods to access the cloud controller API using REST/JSON. This is how you configure - the AP. - -* lab_ap_info.py: Holds some variables related to lab config. I prefer to use this as little as possible. - Instead, use command line arguments, possibly specifying a particular config file on the cmd line if - needed. - -* UnitTestBase.py: Base class for all test cases. Handles bulk of command-line-argument processing and importing - of various modules needed for testing. Test cases should normally inherit from this. - -* Nightly_Sanity.py: All-in-one script that updates firmware, creates cloud controller profiles, and runs LANforge - tests. This is only partially functional for now. Much of the logic in it needs to be moved to library files - so that other test cases can take advantage of the logic. - -* query_ap.py: Calls into ap_ssh.py to do some actions on APs, including running arbitrary commands. This would - be a good example to use as starting point for writing new test cases that need to access the AP. - Try: ./query_ap.py --help for example of how to use. - -* query_sdk.py: Calls into cloudsdk.py to do some actions on cloud controller. This would - be a good example to use as starting point for writing new test cases that need to access the cloud controller. - Try: ./query_sdk.py --help for example of how to use. - - - -# This is how the nightly sanity script is launched for the NOLA-01 testbed. - -./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --skip-upgrade True --testbed "NOLA-01h" \ - --lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios --skip_radius --skip_profiles \ - --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 - - - -## Nightly Sanity details: -This script is used to look for and test new firmware available for the APs. AP equipment IDs and SSID information used in test is stored in the lab_ap_info file - -1. Check current CloudSDK version -2. Find latest dev firmware on TIP jfrog and create instances on CloudSDK (if necessary) -3. Create report_data.json file with information about versions and test case pass/fail -4. For each AP model: - 1. Check current AP firmware *(If AP already running newest firmware, test will skip)* - 2. Create Testrail test run with required test cases included - 3. Upgrade AP via CloudSDK API - 4. Check if AP upgrade and CloudSDK connection successful - 5. For each SSID mode (bridge, NAT and VLAN), marking TestRail and report_data.json with pass/fail: - 1. Create SSID Profiles for various security modes and radio types - 2. Create AP Profile for SSID mode - 3. Apply AP profile to AP - 5. Check that SSID have been applied properly on AP - 4. Perform client connectivity tests - 6. Update sanity_status.json with **overall** pass/fail - -## Throughput Test -This script is used to test UDP and TCP throughput on different modes of SSIDs, on multiple AP models. It is designed to run on APs that have successfully passed through Nightly_Sanity test. - -For each AP model: -1) Read sanity_status.json to see if throughput should be run, if yes: - 1) Run throughput tests on SSIDs modes - 2) Record results to CSV file -2) Update sanity_status.json that throughput tests have been run - diff --git a/README.md b/README.md index b322f7d21..531a44b7c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ All code must be written in python 3 and conform to PEP 8 style guide. The test ```bash ├── tests ├── libs -│ ├── cloudsdk +│ ├── cloudsdk_tests │ ├── apnos │ ├── lanforge │ ├── perfecto diff --git a/cicd/README.txt b/cicd/README.txt deleted file mode 100644 index 184cb3f73..000000000 --- a/cicd/README.txt +++ /dev/null @@ -1,109 +0,0 @@ -Potential polling method for CICD integration. - -* Polling should decrease network security head-aches such as setting - up VPN access for all test beds. - -*** - -Implementation: - -* Web server accessible to all CICD test beds runs a 'test orchestrator' logic, henceforth TO - * This TO will periodically query jfrog for latest openwrt builds (see jfrog.pl) - * If new build is found, a work-item file containing pertinent info, including the HW platform - will be created, example: - -CICD_TYPE=fast -CICD_RPT_NAME=ea8300 -CICD_RPT_DIR=greearb@192.168.100.195:/var/www/html/tip/testbeds//ferndale-basic-01/reports -CICD_HW=ea8300 -CICD_FILEDATE= -CICD_GITHASH= -CICD_URL=https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ -CICD_FILE_NAME=ea8300 -CICD_URL_DATE=24-Apr-2020 16:32 - - * TO has manually configured list of test-beds, with some info about each test - bed, including the DUT HW platform and testing capabilities. - * It picks a test bed that matches the new build HW. - * That test bed will have a URL directory for it and it alone. - * The TO writes a new test configuration file into this directory. - The test configuration file will have the info above, and also have other - info including the tests to run and where to upload results when complete. - * TO looks for any completed results, and removes the work-item if result is found. - * TO will re-calculate historical charts and publish those if new results are found for a testbed. - It could generate email and/or poke the results into testrails or similar at this point. - * TO should run periodically every 1 minute or so to check on progress. - - -* Test bed polling: - * The test-bed (hence forth TB) will poll its directory on the TO web server to look for new jobs. - * When new job is found, the TB will download the test config file, and use scp to upload a file - to the TO to indicate it is working on the test. - * When test is complete, TB will upload results to TO server. TO now knows test bed is available - for more jobs. - * TB should pause for 2 minutes after uploading results to make sure TO notices the new results and - removes the old work item so that TB does not re-test the same work item. - - -* If we can implement something like CTF, it may take place of the Test Orchestrator. - - - - - -************* Installation / Usage *************** - -The jfrog.pl runs on the web server. This is the Test Orchestrator. -Create a directory structure looking similar to this: - -[greearb@ben-dt4 html]$ find tip -name "*" -print -tip -tip/testbeds -tip/testbeds/ferndale-basic-01 -tip/testbeds/ferndale-basic-01/pending_work -tip/testbeds/ferndale-basic-01/reports - -Copy the TESTBED_INFO from wlan-testing git to the tip/testbeds directory: - -[greearb@ben-dt4 testbeds]$ pwd -/var/www/html/tip/testbeds -cp -ar /home/greearb/git/tip/wlan-testing/cicd/ferndale-basic-01/ ./ - - -Run the jfrog.pl script from the tip/testbeds directory: - -/home/greearb/git/tip/wlan-testing/cicd/jfrog.pl --passwd secret --tb_url_base greearb@192.168.100.195:/var/www/html/tip/testbeds/ - -A work-item file will be created as needed, in my case, it is here: - -[greearb@ben-dt4 testbeds]$ cat ferndale-basic-01/pending_work/fast/CICD_TEST-ea8300 -CICD_TEST=fast -CICD_RPT_DIR=greearb@192.168.100.195:/var/www/html/tip/testbeds//ferndale-basic-01/reports/fast -CICD_RPT_NAME=ea8300 -CICD_HW=ea8300 -CICD_FILEDATE= -CICD_GITHASH= -CICD_URL=https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ -CICD_FILE_NAME=ea8300 -CICD_URL_DATE=24-Apr-2020 16:32 - - - -************ Installation / Usage on Test Controller ************** - -# This runs on the test controller or Jump-Box. - -# Set up OS -sudo needs to work w/out password. - -sudo chmod a+rwx /dev/ttyUSB* -sudo pip3 install pexpect-serial - -Run testbed_poll.pl from the cicd testbed directory: - -The 192.168.100.195 system is the jfrog / Orchestrator machine. The jfrog -password is so that it can download the OpenWrt binary file from jfrog. - -cd ~/tip/wlan-testing/cicd/ferndale-basic-01 - -../testbed_poll.pl --jfrog_passwd secret --url http://192.168.100.195/tip/testbeds/testbed-ferndale-01/pending_work/ diff --git a/cicd/ben-home-ecw5410/TESTBED_INFO.txt b/cicd/ben-home-ecw5410/TESTBED_INFO.txt deleted file mode 100644 index f1cf1e6c3..000000000 --- a/cicd/ben-home-ecw5410/TESTBED_INFO.txt +++ /dev/null @@ -1,4 +0,0 @@ -TESTBED_HW=ecw5410 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/ben-home-ecw5410 diff --git a/cicd/ben-home-ecw5410/loop.bash b/cicd/ben-home-ecw5410/loop.bash deleted file mode 100755 index 5b3cc75d5..000000000 --- a/cicd/ben-home-ecw5410/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://192.168.100.195/tip/testbeds/ben-home-ecw5410/pending_work/ || exit 1 - sleep 120 -done - diff --git a/cicd/ben-home/TESTBED_INFO.txt b/cicd/ben-home/TESTBED_INFO.txt deleted file mode 100644 index 327145c98..000000000 --- a/cicd/ben-home/TESTBED_INFO.txt +++ /dev/null @@ -1,4 +0,0 @@ -TESTBED_HW=mr8300 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/ben-home diff --git a/cicd/ferndale-basic-01/TESTBED_INFO.txt b/cicd/ferndale-basic-01/TESTBED_INFO.txt deleted file mode 100644 index b3a846ca9..000000000 --- a/cicd/ferndale-basic-01/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ea8300 -TESTBED_NAME=Ferndale-01 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/ferndale-basic-01 - -TESTBED_CASEID_FAST=C1308 -TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/ferndale-basic-01/loop.bash b/cicd/ferndale-basic-01/loop.bash deleted file mode 100755 index 7891f8126..000000000 --- a/cicd/ferndale-basic-01/loop.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/ferndale-basic-01/pending_work/ - sleep 120 -done diff --git a/cicd/ferndale-basic-01/loop1.bash b/cicd/ferndale-basic-01/loop1.bash deleted file mode 100755 index 168ae0654..000000000 --- a/cicd/ferndale-basic-01/loop1.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/ferndale-basic-01/pending_work/ - exit 0 -done diff --git a/cicd/jfrog.pl b/cicd/jfrog.pl deleted file mode 100755 index 207b38964..000000000 --- a/cicd/jfrog.pl +++ /dev/null @@ -1,493 +0,0 @@ -#!/usr/bin/perl - -# Query jfrog URL and get list of builds. -# This will be run on the test-bed orchestrator -# Run this in directory that contains the testbed_$hw/ directories -# Assumes cicd.class is found in ~/git/tip/wlan-lanforge-scripts/gui/ - -use strict; -use warnings; -use Getopt::Long; - -my $user = "cicd_user"; -my $passwd = ""; -my $url = "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware"; -my @platforms = ("ea8300", "ecw5410", "ec420", "eap102", "wf188n"); # Add more here as we have test beds that support them. -my $files_processed = "jfrog_files_processed.txt"; -my $tb_url_base = "cicd_user\@tip.cicd.cloud.com/testbeds"; # Used by SSH: scp -R results_dir cicd_user@tip.cicd.cloud.com/testbeds/ -my $help = 0; -my $cicd_prefix = "CICD_TEST"; -my $kpi_dir = "/home/greearb/git/tip/wlan-lanforge-scripts/gui/"; -my @ttypes = ("fast", "basic"); -my $duplicate_work = 1; -my $slack = ""; # file that holds slack URL in case we want the kpi tool to post slack announcements. - -#my $ul_host = "www"; -my $ul_host = ""; -my $ul_dir = "candela_html/examples/cicd/"; # used by scp -my $ul_dest = "$ul_host:$ul_dir"; # used by scp -my $other_ul_dest = ""; # used by scp -my $result_url_base = "http://localhost/tip/cicd"; - -my $usage = qq($0 - [--user { jfrog user (default: cicd_user) } - [--passwd { jfrog password } - [--slack { file holding slack webhook URL } - [--result_url_base { http://foo.com/tip/cicd } - [--url { jfrog URL, default is OpenWrt URL: https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ } - [--files_processed { text file containing file names we have already processed } - [--tb_url_base { Where to report the test results? } - [--kpi_dir { Where the kpi java binary is found } - [--ul_host { Host that results should be copied too } - [--duplicate_work { Should we send work items to all available test beds? Default is 1 (true). Set to 0 to only send to one. } - -Example: - -# Use TIP jfrog repo -$0 --user cicd_user --passwd secret --url https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ \\ - --files_processed jfrog_files_processed.txt \\ - --tb_url_base cicd_user\@tip.cicd.cloud.com/testbeds - -# Download images from candelatech.com web site (for developer testing and such) -$0 --tb_url_base greearb@192.168.100.195:/var/www/html/tip/testbeds/ \\ - --url http://www.candelatech.com/downloads/tip/test_images - -# This is what is used in TIP testbed orchestrator -$0 --passwd tip-read --user tip-read --tb_url_base lanforge\@orch:/var/www/html/tip/testbeds/ \\ - --kpi_dir /home/lanforge/git/tip/wlan-lanforge-scripts/gui \\ - --slack /home/lanforge/slack.txt \\ - --result_url_base http://3.130.51.163/tip/testbeds - -); - -GetOptions -( - 'user=s' => \$user, - 'passwd=s' => \$passwd, - 'slack=s' => \$slack, - 'url=s' => \$url, - 'files_processed=s' => \$files_processed, - 'tb_url_base=s' => \$tb_url_base, - 'result_url_base=s' => \$result_url_base, - 'kpi_dir=s' => \$kpi_dir, - 'ul_host=s' => \$ul_host, - 'duplicate_work=i' => \$duplicate_work, - 'help|?' => \$help, -) || (print($usage) && exit(1)); - -if ($help) { - print($usage) && exit(0); -} - -#if ($passwd eq "") { -# print("ERROR: You must specify jfrog password.\n"); -# exit(1); -#} - -my $slack_fname = ""; -if ($slack ne "") { - $slack_fname = "--slack_fname $slack"; -} - -my $i; - -my $pwd = `pwd`; -chomp($pwd); - -my $listing; -my @lines; -my $j; -my $do_nightly = 0; - -my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); -my $last_hr = `cat last_jfrog_hour.txt`; -my $lh = 24; -if ($last_hr ne "") { - $lh = int($last_hr); - if ($lh > $hour) { - # tis the wee hours again, run a nightly. - $do_nightly = 1; - } -} -else { - $do_nightly = 1; -} -`echo $hour > last_jfrog_hour.txt`; - -# Check for any completed reports. -for ($j = 0; $j<@ttypes; $j++) { - my $ttype = $ttypes[$j]; - $listing = `ls */reports/$ttype/NEW_RESULTS-*`; - @lines = split(/\n/, $listing); - for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - if ($ln =~ /(.*)\/NEW_RESULTS/) { - my $process = $1; # For example: ben-home/reports/fast - my $completed = `cat $ln`; # Contents of the results file - chomp($completed); - if ($ln =~ /(.*)\/reports\/$ttype\/NEW_RESULTS/) { - my $tbed = $1; - my $cmd; - my $caseid = ""; - my $tb_pretty_name = $tbed; - my $tb_hw_type = ""; - - my $tb_info = `cat $tbed/TESTBED_INFO.txt`; - if ($tb_info =~ /TESTBED_HW=(.*)/g) { - $tb_hw_type = $1; - } - if ($tb_info =~ /TESTBED_NAME=(.*)/g) { - $tb_pretty_name = $1; - } - - print "Processing new results, line: $ln process: $process completed: $completed testbed: $tbed\n"; - - # Figure out the new directory from the work-item. - my $wi = `cat ./$tbed/pending_work/$completed`; - - `mv ./$tbed/pending_work/$completed /tmp/`; - - if ($wi =~ /CICD_CASE_ID=(\S+)/) { - $caseid = "--caseid $1"; - } - - if ($wi =~ /CICD_RPT_NAME=(.*)/) { - my $widir = $1; - - if ($ul_host ne "") { - # Ensure we have a place to copy the new report - $cmd = "ssh $ul_host \"mkdir -p $ul_dir/$tbed/$ttype\""; - print "Ensure directory exists: $cmd\n"; - `$cmd`; - - # Upload the report directory - $cmd = "scp -C -r $process/$widir $ul_dest/$tbed/$ttype/"; - print "Uploading: $cmd\n"; - `$cmd`; - } - } - else { - print "WARNING: No CICD_RPT_NAME line found in work-item contents:\n$wi\n"; - } - - $caseid .= " --results_url $result_url_base/$tbed/reports/$ttype"; - - $cmd = "cd $kpi_dir && java kpi $slack_fname --testbed_name \"$tb_pretty_name $tb_hw_type $ttype\" $caseid --dir \"$pwd/$process\" && cd -"; - print ("Running kpi: $cmd\n"); - `$cmd`; - `rm $ln`; - if ($ul_host ne "") { - $cmd = "scp -C $process/*.png $process/*.html $process/*.csv $process/*.ico $process/*.css $ul_dest/$tbed/$ttype/"; - print "Uploading: $cmd"; - `$cmd`; - } - - # This might need similar partial-upload logic as that above, if it is ever actually - # enabled. - if ($other_ul_dest ne "") { - $cmd = "scp -C -r $process $other_ul_dest/$tbed/"; - print "Uploading to secondary location: $cmd"; - `$cmd`; - } - } - } - } -} - -#Read in already_processed builds -my @processed = (); -$listing = `cat $files_processed`; -@lines = split(/\n/, $listing); -for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - print("Reported already processed: $ln\n"); - push(@processed, $ln); -} - -my $z; -if ($do_nightly) { - # Remove last 'pending' instance of each HW type so that we re-run the test for it. - for ($z = 0; $z < @platforms; $z++) { - my $q; - my $hw = $platforms[$z]; - for ($q = @processed - 1; $q >= 0; $q--) { - if ($processed[$q] =~ /$hw/) { - print("Nightly, re-doing: $processed[$q]\n"); - $processed[$q] = ""; - last; - } - } - } -} - -for ($z = 0; $z<@platforms; $z++) { - my $pf = $platforms[$z]; - # Interesting builds are now found in hardware sub-dirs - my @subdirs = ("trunk", "dev"); - for (my $sidx = 0; $sidx<@subdirs; $sidx++) { - my $sdir = $subdirs[$sidx]; - my $cmd = "curl -u $user:$passwd $url/$pf/$sdir/"; - print ("Calling command: $cmd\n"); - $listing = `$cmd`; - @lines = split(/\n/, $listing); - for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - - #print("ln -:$ln:-\n"); - - if (($ln =~ /href=\"(.*)\">(.*)<\/a>\s+(.*)\s+\S+\s+\S+/) - || ($ln =~ /class=\"indexcolname\">(.*)<\/a>.*class=\"indexcollastmod\">(\S+)\s+.*/)) { - my $fname = $1; - my $name = $2; - my $date = $3; - - # Skip header - if ($ln =~ /Last modified/) { - next; - } - - # Skip parent-dir - if ($ln =~ /Parent Directory/) { - next; - } - - # Skip artifacts directory - if ($ln =~ /artifacts/) { - next; - } - - # Skip staging builds - if ($ln =~ /staging/) { - next; - } - - # Skip dev directory - #if ($ln =~ /href=\"dev\/\">dev\/<\/a>/) { - # next; - #} - - #print("line matched -:$ln:-\n"); - #print("fname: $fname name: $name date: $date\n"); - - if ( grep( /^$fname\s+/, @processed ) ) { - # Skip this one, already processed. - next; - } - - my $hw = ""; - my $fdate = ""; - my $githash = ""; - - if ($fname =~ /^(\S+)-(\d\d\d\d-\d\d-\d\d)-(\S+).tar.gz/) { - $hw = $1; - $fdate = $2; - $githash = $3; - } else { - print "ERROR: Un-handled filename syntax: $fname, assuming file-name is hardware name.\n"; - $hw = $fname; - } - - # Find the least used testbed for this hardware. - my $dirs = `ls`; - my @dira = split(/\n/, $dirs); - my $best_tb = ""; - my $best_backlog = 0; - my $di; - for ($di = 0; $di<@dira; $di++) { - my $dname = $dira[$di]; - chomp($dname); - if (! -d $dname) { - next; - } - if (! -f "$dname/TESTBED_INFO.txt") { - next; - } - my $tb_info = `cat $dname/TESTBED_INFO.txt`; - my $tb_hw_type = ""; - if ($tb_info =~ /TESTBED_HW=(.*)/g) { - $tb_hw_type = $1; - } - if (!hw_matches($tb_hw_type, $hw)) { - print "Skipping test bed $dname, jfrog hardware type: -:$hw:- testbed hardware type: -:$tb_hw_type:-\n"; - next; - } - print "Checking testbed $dname backlog..\n"; - my $bklog = `ls $dname/pending_work/$cicd_prefix-*`; - my $bklog_count = split(/\n/, $bklog); - if ($best_tb eq "") { - $best_tb = $dname; - $best_backlog = $bklog_count; - } else { - if ($best_backlog > $bklog_count) { - $best_tb = $dname; - $best_backlog = $bklog_count; - } - } - } - - if ($best_tb eq "") { - print "ERROR: No test bed found for hardware type: $hw\n"; - last; - } - - my $fname_nogz = $fname; - if ($fname =~ /(.*)\.tar\.gz/) { - $fname_nogz = $1; - } - - my @tbs = ($best_tb); - - # For more test coverage, send work to rest of the available test beds as well. - if ($duplicate_work) { - for ($di = 0; $di<@dira; $di++) { - my $dname = $dira[$di]; - chomp($dname); - if (! -d $dname) { - next; - } - if ($dname eq $best_tb) { - next; # processed this one above - } - if (! -f "$dname/TESTBED_INFO.txt") { - next; - } - - my $tb_info = `cat $dname/TESTBED_INFO.txt`; - my $tb_hw_type = ""; - if ($tb_info =~ /TESTBED_HW=(.*)/g) { - $tb_hw_type = $1; - } - - if (!hw_matches($tb_hw_type, $hw)) { - print "Skipping test bed $dname, jfrog hardware type: -:$hw:- testbed hardware type: -:$tb_hw_type:-\n"; - next; - } - - push(@tbs, "$dname"); - } - } - - my $q; - for ($q = 0; $q < @tbs; $q++) { - $best_tb = $tbs[$q]; - my $caseid_fast = ""; - my $caseid_basic = ""; - - my $tb_info = `cat $best_tb/TESTBED_INFO.txt`; - if ($tb_info =~ /TESTBED_CASEID_FAST=(.*)/g) { - $caseid_fast = $1; - } - if ($tb_info =~ /TESTBED_CASEID_BASIC=(.*)/g) { - $caseid_basic = $1; - } - - my $ttype = "fast"; - # Ensure duplicate runs show up individually. - my $extra_run = 0; - if (-e "$best_tb/reports/$ttype/${fname_nogz}") { - $extra_run = 1; - while (-e "$best_tb/reports/$ttype/${fname_nogz}-$extra_run") { - $extra_run++; - } - } - - my $erun = ""; - if ($extra_run > 0) { - $erun = "-$extra_run"; - } - - my $work_fname = "$best_tb/pending_work/$cicd_prefix-$fname_nogz-$ttype"; - my $work_fname_a = $work_fname; - - system("mkdir -p $best_tb/pending_work"); - system("mkdir -p $best_tb/reports/$ttype"); - - open(FILE, ">", "$work_fname"); - - print FILE "CICD_TYPE=$ttype\n"; - print FILE "CICD_RPT_NAME=$fname_nogz$erun\n"; - print FILE "CICD_RPT_DIR=$tb_url_base/$best_tb/reports/$ttype\n"; - - print FILE "CICD_HW=$hw\nCICD_FILEDATE=$fdate\nCICD_GITHASH=$githash\n"; - print FILE "CICD_URL=$url/$pf/$sdir\nCICD_FILE_NAME=$fname\nCICD_URL_DATE=$date\n"; - if ($caseid_fast ne "") { - print FILE "CICD_CASE_ID=$caseid_fast\n"; - } - - close(FILE); - - print("Next: File Name: $fname Display Name: $name Date: $date TType: $ttype\n"); - print("Work item placed at: $work_fname\n"); - - - $ttype = "basic"; - # Ensure duplicate runs show up individually. - $extra_run = 0; - if (-e "$best_tb/reports/$ttype/${fname_nogz}") { - $extra_run = 1; - while (-e "$best_tb/reports/$ttype/${fname_nogz}-$extra_run") { - $extra_run++; - } - } - - $erun = ""; - if ($extra_run > 0) { - $erun = "-$extra_run"; - } - - $work_fname = "$best_tb/pending_work/$cicd_prefix-$fname_nogz-$ttype"; - - system("mkdir -p $best_tb/reports/$ttype"); - - open(FILE, ">", "$work_fname"); - - print FILE "CICD_TYPE=$ttype\n"; - print FILE "CICD_RPT_NAME=$fname_nogz$erun\n"; - print FILE "CICD_RPT_DIR=$tb_url_base/$best_tb/reports/$ttype\n"; - - print FILE "CICD_HW=$hw\nCICD_FILEDATE=$fdate\nCICD_GITHASH=$githash\n"; - print FILE "CICD_URL=$url/$pf/$sdir\nCICD_FILE_NAME=$fname\nCICD_URL_DATE=$date\n"; - if ($caseid_basic ne "") { - print FILE "CICD_CASE_ID=$caseid_basic\n"; - } - - close(FILE); - - print("Next: File Name: $fname Display Name: $name Date: $date TType: $ttype\n"); - print("Work item placed at: $work_fname\n"); - #print("To download: curl --location -o /tmp/$fname -u $user:$passwd $url/$pf/$fname\n"); - } # for all testbeds - - # Note this one is processed - `echo -n "$fname " >> $files_processed`; - `date >> $files_processed`; - } - - #print "$ln\n"; - }# for all lines in a directory listing - }# For all sub directories -}# for all URLs to process - -exit 0; - - -sub hw_matches { - my $a = shift; - my $b = shift; - - # Normalize equivalent HW types. - if ($a eq "mr8300") { - $a = "ea8300"; - } - if ($b eq "mr8300") { - $b = "ea8300"; - } - - if ($a eq $b) { - return 1; - } - return 0; -} diff --git a/cicd/nola-basic-01/TESTBED_INFO.txt b/cicd/nola-basic-01/TESTBED_INFO.txt deleted file mode 100644 index 549d48660..000000000 --- a/cicd/nola-basic-01/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ecw5410 -TESTBED_NAME=NOLA-01 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-01 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-01/loop.bash b/cicd/nola-basic-01/loop.bash deleted file mode 100755 index abb0e2079..000000000 --- a/cicd/nola-basic-01/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-01/pending_work/ - sleep 120 -done - diff --git a/cicd/nola-basic-02/TESTBED_INFO.txt b/cicd/nola-basic-02/TESTBED_INFO.txt deleted file mode 100644 index d2c9f6fa8..000000000 --- a/cicd/nola-basic-02/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ecw5410 -TESTBED_NAME=NOLA-02 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-02 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-02/loop.bash b/cicd/nola-basic-02/loop.bash deleted file mode 100755 index 13f3dea28..000000000 --- a/cicd/nola-basic-02/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-02/pending_work/ - sleep 120 -done - diff --git a/cicd/nola-basic-03/TESTBED_INFO.txt b/cicd/nola-basic-03/TESTBED_INFO.txt deleted file mode 100644 index 92ac16791..000000000 --- a/cicd/nola-basic-03/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ec420 -TESTBED_NAME=NOLA-03 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-03 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-03/loop.bash b/cicd/nola-basic-03/loop.bash deleted file mode 100755 index c41e101bc..000000000 --- a/cicd/nola-basic-03/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-03/pending_work/ - sleep 120 -done - diff --git a/cicd/nola-basic-04/TESTBED_INFO.txt b/cicd/nola-basic-04/TESTBED_INFO.txt deleted file mode 100644 index 623738a65..000000000 --- a/cicd/nola-basic-04/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ecw5410 -TESTBED_NAME=NOLA-04 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-04 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-04/loop.bash b/cicd/nola-basic-04/loop.bash deleted file mode 100755 index f5296983d..000000000 --- a/cicd/nola-basic-04/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-04/pending_work/ - sleep 120 -done - diff --git a/cicd/nola-basic-12/TESTBED_INFO.txt b/cicd/nola-basic-12/TESTBED_INFO.txt deleted file mode 100644 index 6bb8a2bb7..000000000 --- a/cicd/nola-basic-12/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=wf188n -TESTBED_NAME=NOLA-12 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-12 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-12/loop.bash b/cicd/nola-basic-12/loop.bash deleted file mode 100755 index 95ab66ba0..000000000 --- a/cicd/nola-basic-12/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-12/pending_work/ --dut_passwd openwifi --dut_user root --log stdout - sleep 120 -done - diff --git a/cicd/nola-basic-13/TESTBED_INFO.txt b/cicd/nola-basic-13/TESTBED_INFO.txt deleted file mode 100644 index 820bc53a4..000000000 --- a/cicd/nola-basic-13/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=eap102 -TESTBED_NAME=NOLA-13 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-13 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-13/loop.bash b/cicd/nola-basic-13/loop.bash deleted file mode 100755 index 50f30df0a..000000000 --- a/cicd/nola-basic-13/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-13/pending_work/ --dut_passwd openwifi --dut_user root - sleep 120 -done - diff --git a/cicd/nola-basic-14/TESTBED_INFO.txt b/cicd/nola-basic-14/TESTBED_INFO.txt deleted file mode 100644 index 18610f0ed..000000000 --- a/cicd/nola-basic-14/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=eap102 -TESTBED_NAME=NOLA-14 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-14 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-14/loop.bash b/cicd/nola-basic-14/loop.bash deleted file mode 100755 index 2d268a657..000000000 --- a/cicd/nola-basic-14/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-14/pending_work/ --dut_passwd openwifi --dut_user root - sleep 120 -done - diff --git a/cicd/nola-basic-15/TESTBED_INFO.txt b/cicd/nola-basic-15/TESTBED_INFO.txt deleted file mode 100644 index 754466a69..000000000 --- a/cicd/nola-basic-15/TESTBED_INFO.txt +++ /dev/null @@ -1,8 +0,0 @@ -TESTBED_HW=ecw5410 -TESTBED_NAME=NOLA-15 - -# Controller's view of the test bed, from wlan-testing/cicd/[testbed] directory -TESTBED_DIR=../../testbeds/nola-basic-15 - -#TESTBED_CASEID_FAST=C1308 -#TESTBED_CASEID_BASIC=C1309 diff --git a/cicd/nola-basic-15/loop.bash b/cicd/nola-basic-15/loop.bash deleted file mode 100755 index b7313265d..000000000 --- a/cicd/nola-basic-15/loop.bash +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -while true -do - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read --url http://orch/tip/testbeds/nola-basic-15/pending_work/ --dut_passwd openwifi --dut_user root - sleep 120 -done - diff --git a/cicd/testbed_poll.pl b/cicd/testbed_poll.pl deleted file mode 100755 index 387010f1d..000000000 --- a/cicd/testbed_poll.pl +++ /dev/null @@ -1,525 +0,0 @@ -#!/usr/bin/perl - -# Query test-bed orchestator URL to see if there are new tests for us to run. -# This is expected to be run on the test-bed controller (not orchestrator) -# One of these processes will run for each test bed controlled by the controller. - -use strict; -use warnings; -use Getopt::Long; - -my $user = ""; -my $passwd = ""; -my $jfrog_user = "cicd_user"; -my $jfrog_passwd = ""; -my $url = ""; -my $next_info = "__next_test.txt"; -my $help = 0; -my $owt_log = ""; -my $dut_passwd = ""; -my $dut_user = "root"; -my $sysupgrade_n = 0; -#my $prompt = "root\@OpenAp"; -my $prompt = "root\@Open"; # match OpenWrt and OpenAp-foo -my $log = ""; - -my $usage = qq($0 - [--jfrog_user { jfrog user (default: cicd_user) } - [--jfrog_passwd { jfrog password } - [--user { for accessing URL } - [--passwd { for accessing URL } - [--dut_user { for accessing DUT } - [--dut_passwd { for accessing DUT } - [--url { test-orchestrator URL for this test bed } - [--next_info { output text file containing info about the next test to process } - [--sysupgrade-n { 0 | 1 } 1 means use the -n option when doing sysupgrade. - [--log {location} For instance: --log stdout, for openwrt_ctl expect script. - -Example: -$0 --user to_user --passwd secret --jfrog_user tip-read --jfrog_passwd tip-read \\ - --url https://tip.cicd.mycloud.com/testbed-ferndale-01/ --dut_passwd owrt --dut_user root - -# Use specific scenario file. -SCENARIO_CFG_FILE=/home/lanforge/git/wlan-testing/testbeds/ferndale-basic-01/scenario_small.txt \\ - ../testbed_poll.pl --jfrog_passwd tip-read --jfrog_user tip-read \\ - --url http://192.168.100.195/tip/testbeds/ferndale-basic-01/pending_work/ - -); - -GetOptions -( - 'jfrog_user=s' => \$jfrog_user, - 'jfrog_passwd=s' => \$jfrog_passwd, - 'user=s' => \$user, - 'passwd=s' => \$passwd, - 'dut_passwd=s' => \$dut_passwd, - 'dut_user=s' => \$dut_user, - 'url=s' => \$url, - 'next_info=s' => \$next_info, - 'sysupgrade_n=i' => \$sysupgrade_n, - 'log=s' => \$log, - 'help|?' => \$help, -) || (print($usage) && exit(1)); - -if ($help) { - print($usage) && exit(0); -} - -if ($jfrog_passwd eq "") { - print("ERROR: You must specify jfrog password.\n"); - exit(1); -} - -if ($user ne "" && $passwd eq "") { - print("ERROR: You must specify a password if specifying a user.\n"); - exit(1); -} - -if ($log ne "") { - $owt_log = "--log $log"; -} -my $owt_args = " --prompt $prompt"; - -if ($dut_user ne "") { - $owt_args .= " --user $dut_user"; -} - -if ($dut_passwd ne "") { - $owt_args .= " --passwd $dut_passwd"; -} - -$owt_log .= $owt_args; - -my $i; - -my $cuser = "-u $user:$passwd"; -if ($user eq "") { - $cuser = ""; -} - -my $cmd = "curl $cuser $url"; - -print_note("Checking Test-Orchestrator for new work-items"); -my $listing = do_system($cmd); -my @lines = split(/\n/, $listing); - -# First, if any have 'fast' in them, they get precedence. -for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - my $fast = 0; - if ($ln =~ /href=\"(CICD_TEST-.*-fast)\">(.*)<\/a>\s+(.*)\s+\S+\s+\S+/) { - $fast = 1; - } - elsif ($ln =~ /href=\"(CICD_TEST-.*-fast)\">(.*)<\/a>/) { - $fast = 1; - } - if ($fast) { - @lines[0] = $ln; - last; - } -} - -for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - - my $fname = ""; - my $name = ""; - my $date = ""; - - if ($ln =~ /href=\"(CICD_TEST-.*)\">(.*)<\/a>\s+(.*)\s+\S+\s+\S+/) { - $fname = $1; - $name = $2; - $date = $3; - } - elsif ($ln =~ /href=\"(CICD_TEST-.*)\">(.*)<\/a>/) { - $fname = $1; - } - - if ($fname ne "") { - # Grab that test file - $cmd = "curl --location $cuser -o $next_info $url/$fname"; - do_system($cmd); - - # Read in that file - my $jurl = ""; - my $jfile = ""; - my $report_to = ""; - my $report_name = ""; - my $swver = ""; - my $fdate = ""; - my $ttype = ""; - my $listing = do_system("cat $next_info"); - my @lines = split(/\n/, $listing); - for ($i = 0; $i<@lines; $i++) { - my $ln = $lines[$i]; - chomp($ln); - if ($ln =~ /^CICD_URL=(.*)/) { - $jurl = $1; - } - elsif ($ln =~ /^CICD_TYPE=(.*)/) { - $ttype = $1; - } - elsif ($ln =~ /^CICD_FILE_NAME=(.*)/) { - $jfile = $1; - } - elsif ($ln =~ /^CICD_RPT_DIR=(.*)/) { - $report_to = $1; - } - elsif ($ln =~ /^CICD_RPT_NAME=(.*)/) { - $report_name = $1; - } - elsif ($ln =~ /^CICD_GITHASH=(.*)/) { - $swver = $1; - } - elsif ($ln =~ /^CICD_FILEDATE=(.*)/) { - $fdate = $1; - } - } - - if ($swver eq "") { - $swver = $fdate; - } - - if ($swver eq "") { - $swver = "$jfile"; - } - - if ($jurl eq "") { - print("ERROR: No CICD_URL found, cannot download file.\n"); - exit(1); - } - if ($jfile eq "") { - print("ERROR: No CICD_FILE_NAME found, cannot download file.\n"); - exit(1); - } - - # Refresh wlan-ap repo if it exists. - if ( -d "../../../wlan-ap") { - do_system("cd ../../../wlan-ap && git pull && cd -"); - } - - print_note("Download latest AP Build from jfrog repository."); - my $cmd = "curl --location -o $jfile -u $jfrog_user:$jfrog_passwd $jurl/$jfile"; - do_system($cmd); - - do_system("rm -f openwrt-*.bin"); - do_system("rm -f *sysupgrade.*"); # just in case openwrt prefix changes. - do_system("tar xf $jfile"); - - # Detect if we are using full pkg or new trimmed sysupgrade image - my $full_owrt_pkg = 0; - my @listing = glob("*sysupgrade*"); - if (@listing > 0) { - print("NOTE: Found full openwrt package.\n"); - $full_owrt_pkg = 1; - } - else { - print("NOTE: Found trimmed sysupgrade openwrt package.\n"); - } - - print_note("Copy AP build to LANforge so LANforge can serve the file to AP"); - # Next steps here are to put the OpenWrt file on the LANforge system - my $tb_info = do_system("cat TESTBED_INFO.txt"); - my $tb_dir = ""; - if ($tb_info =~ /TESTBED_DIR=(.*)/) { - $tb_dir = $1; - } - - my $env = do_system(". $tb_dir/test_bed_cfg.bash && env"); - my $lfmgr = ""; - my $serial = ""; - my $cloud_sdk = ""; - - if ($env =~ /LFMANAGER=(.*)/) { - $lfmgr = $1; - } - else { - print("ERRROR: Could not find LFMANAGER in environment, configuration error!\n"); - print("env: $env\n"); - exit(1); - } - - if ($env =~ /USE_CLOUD_SDK=(\S+)/) { - $cloud_sdk = $1; - print("NOTE: Using cloud controller: $cloud_sdk\n"); - } - else { - print("NOTE: NOT Using cloud controller\n"); - } - #print("env: $env"); - #exit(0); - - if ($env =~ /AP_SERIAL=(.*)/) { - $serial = $1; - } - else { - print("ERRROR: Could not find AP_SERIAL in environment, configuration error!\n"); - exit(1); - } - - my $gmport = "3990"; - my $gmanager = $lfmgr; - my $scenario = "tip-auto"; # matches basic_regression.bash - - if ($env =~ /GMANAGER=(.*)/) { - $gmanager = $1; - } - if ($env =~ /GMPORT=(.*)/) { - $gmport = $1; - } - - print_note("Restart LANforge GUI to be sure it is in known state."); - # Restart the GUI on the LANforge system - do_system("ssh lanforge\@$lfmgr pkill -f \"miglayout.*8080\""); - - # and then get it onto the DUT, reboot DUT, re-configure as needed, - print_note("Request AP DUT to install the test image."); - if ($full_owrt_pkg) { - do_system("scp *sysupgrade.* lanforge\@$lfmgr:tip-$jfile"); - } - else { - do_system("scp $jfile lanforge\@$lfmgr:tip-$jfile"); - } - - - # TODO: Kill anything using the serial port - do_system("sudo lsof -t $serial | sudo xargs --no-run-if-empty kill -9"); - - print_note("Find AP DUT default gateway."); - # and then kick off automated regression test. - # Default gateway on the AP should be one of the ports on the LANforge system, so we can use - # that to scp the file to the DUT, via serial-console connection this controller has to the DUT. - my $ap_route = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"ip route show\""); - my $ap_gw = ""; - if ($ap_route =~ /default via (\S+)/) { - $ap_gw = $1; - } - if ($ap_gw eq "") { - print("ERROR: Could not find default gateway for AP, route info:\n$ap_route\n"); - if ($ap_route =~ /pexpect.exceptions.TIMEOUT/) { - # In case AP went into boot-loader, deal with that. - if ($ap_route =~ /\(IPQ\)/) { - print("WARNING: Detected Bootloader, will attempt to reset and recover.\n"); - do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py --prompt \"(IPQ)\" --scheme serial --tty $serial --action cmd --value \"reset\""); - sleep(20); - $ap_route = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"ip route show\""); - if ($ap_route =~ /default via (\S+)/) { - $ap_gw = $1; - } - if ($ap_gw eq "") { - if ($ap_route =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out (find default GW, after bootloader reset).\n"); - exit(55); - } - } - } - else { - print("FATAL-ERROR: DUT is in bad state, bail out (find default GW).\n"); - exit(33); - } - } - # Re-apply scenario so the LANforge gateway/NAT is enabled for sure. - my $out = do_system("../../lanforge/lanforge-scripts/lf_gui_cmd.pl --manager $gmanager --port $gmport --scenario $scenario"); - # TODO: Use power-controller to reboot the AP and retry. - if ($out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(34); - } - - $out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action reboot"); - print ("Reboot DUT to try to recover networking:\n$out\n"); - if ($out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(35); - } - sleep(15); - - $ap_route = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"ip route show\""); - if ($ap_route =~ /default via (\S+)/g) { - $ap_gw = $1; - } - if ($ap_route =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(36); - } - if ($ap_gw eq "") { - exit(1); - } - } - - print_note("Request AP DUT to install the test image and reboot."); - # TODO: Change this to curl download?? - my $ap_out; - if ($sysupgrade_n) { - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action sysupgrade-n --value \"lanforge\@$ap_gw:tip-$jfile\""); - } - else { - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action sysupgrade --value \"lanforge\@$ap_gw:tip-$jfile\""); - } - print ("Sys-upgrade results:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(37); - } - # TODO: Verify this (and reboot below) worked. DUT can get wedged and in that case it will need - # a power-cycle to continue. - - # System should be rebooted at this point. - sleep(10); # Give it some more time - - if ($cloud_sdk eq "") { - print_note("Initialize AP, disable OpenVsync since this is stand-alone testbed."); - # Disable openvsync, it will re-write /etc/config/wireless - # This code should not be used when we get cloud-sdk wired up. - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"service opensync stop\""); - print ("Stop openvsync:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(38); - } - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"service opensync disable\""); - print ("Disable openvsync:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(39); - } - } - else { - print_note("Initialize AP, enable OpenVsync since this testbed is using Cloud-Controler: $cloud_sdk."); - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"service opensync enable\""); - print ("Enable openvsync:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(40); - } - } - - # Enable bugcheck script - my $etc_bugcheck = "$tb_dir/OpenWrt-overlay/etc/config/bugcheck"; - open(FILE, ">", "$etc_bugcheck"); - print FILE "DO_BUGCHECK=1 -export DO_BUGCHECK -"; - close(FILE); - - # Re-apply overlay - print_note("Apply default AP configuration for this test bed."); - if ($cloud_sdk eq "") { - $ap_out = do_system("cd $tb_dir/OpenWrt-overlay && tar -cvzf ../overlay_tmp.tar.gz * && scp ../overlay_tmp.tar.gz lanforge\@$lfmgr:tip-overlay.tar.gz"); - } - else { - # Create /etc/hosts file that points us towards correct cloud-sdk machine - my $etc_hosts = "$tb_dir/OpenWrt-overlay/etc/hosts"; - open(FILE, ">", "$etc_hosts"); - print FILE "# Auto-Created by CICD process -127.0.0.1 localhost - -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -$cloud_sdk opensync-mqtt-broker -$cloud_sdk opensync-wifi-controller -$cloud_sdk opensync.zone1.art2wave.com -"; - - # Leave 'wireless' out of the overlay since opensync will be designed to work with default config. - $ap_out = do_system("cd $tb_dir/OpenWrt-overlay && tar -cvzf ../overlay_tmp.tar.gz --exclude etc/config/wireless * && scp ../overlay_tmp.tar.gz lanforge\@$lfmgr:tip-overlay.tar.gz"); - unlink($etc_hosts); - close(FILE); - } - - - print ("Copy overlay to DUT\n"); - - for (my $q = 0; $q<10; $q++) { - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action download --value \"lanforge\@$ap_gw:tip-overlay.tar.gz\" --value2 \"overlay.tgz\""); - print ("Download overlay to DUT:\n$ap_out\n"); - if ($ap_out =~ /ERROR: Could not connect to LANforge/g) { - # Try to restart the network - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"/etc/init.d/network restart\""); - print ("Request restart of DUT networking:\n$ap_out\n"); - if ($q == 9) { - # We have failed to apply overlay at this point, bail out. - print("ERROR: Could not apply overlay to DUT, exiting test attempt.\n"); - exit(1); - } - print("Will retry overlay download in 10 seconds, try $q / 10\n"); - sleep(10); - } - else { - last; - } - } - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"cd / && tar -xzf /tmp/overlay.tgz\""); - print ("Un-zip overlay on DUT:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(41); - } - - print_note("Reboot AP so that new configuration is applied."); - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action reboot"); - print ("Rebooted DUT so overlay takes effect:\n$ap_out\n"); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(42); - } - - my $dt = `date`; - print_note("$dt"); - - if ($ttype eq "fast") { - print_note("Start 'Fast' LANforge regression test."); - $ap_out = do_system("cd $tb_dir && APGW=$ap_gw DUT_SW_VER=$swver OWRTCTL_ARGS=\"$owt_args\" ./run_basic_fast.bash"); - } - else { - print_note("Start 'Fast' LANforge regression test."); - $ap_out = do_system("cd $tb_dir && APGW=$ap_gw DUT_SW_VER=$swver OWRTCTL_ARGS=\"$owt_args\" ./run_basic.bash"); - } - print("Regression $ttype test script output:\n$ap_out\n"); - - print_note("Upload results."); - - #When complete, upload the results to the requested location. - if ($ap_out =~ /Results-Dir: (.*)/) { - my $rslts_dir = $1; - if ($rslts_dir =~ /(.*)\'/) { - $rslts_dir = $1; - } - print ("Found results at: $rslts_dir\n"); - do_system("rm -fr /tmp/$report_name"); - do_system("mv $rslts_dir /tmp/$report_name"); - do_system("chmod -R a+r /tmp/$report_name"); - do_system("scp -C -r /tmp/$report_name $report_to/"); - do_system("echo $fname > /tmp/NEW_RESULTS-$fname"); - do_system("scp /tmp/NEW_RESULTS-$fname $report_to/"); - - # This will indirectly stop logread if it is running. - $ap_out = do_system("../../lanforge/lanforge-scripts/openwrt_ctl.py $owt_log --scheme serial --tty $serial --action cmd --value \"uptime\""); - if ($ap_out =~ /pexpect.exceptions.TIMEOUT/) { - print("FATAL-ERROR: DUT is in bad state, bail out.\n"); - exit(43); - } - } - - exit(0); - } - - #print "$ln\n"; -} - -exit 0; - -sub do_system { - my $cmd = shift; - print ">>> $cmd\n"; - return `$cmd 2>&1`; -} - -sub print_note { - my $n = shift; - my $hdr = "###############################################################"; - print "\n\n\n$hdr\n### $n\n$hdr\n\n"; -} diff --git a/libs/EXAMPLE-JSON-OBJECTS.txt b/libs/EXAMPLE-JSON-OBJECTS.txt deleted file mode 100644 index 688982af0..000000000 --- a/libs/EXAMPLE-JSON-OBJECTS.txt +++ /dev/null @@ -1,207 +0,0 @@ -#RF Profile looks like this (as of Feb 10, 2021) -# Default RF profile is 10 currently. -{ - "childProfileIds": [], - "createdTimestamp": 0, - "customerId": 2, - "details": { - "model_type": "RfConfiguration", - "profileType": "rf", - "rfConfigMap": { - "is2dot4GHz": { - "activeScanSettings": { - "enabled": true, - "model_type": "ActiveScanSettings", - "scanDurationMillis": 65, - "scanFrequencySeconds": 10 - }, - "autoChannelSelection": false, - "beaconInterval": 100, - "bestApEnabled": null, - "bestApSettings": { - "dropInSnrPercentage": 20, - "minLoadFactor": 50, - "mlComputed": true, - "model_type": "RadioBestApSettings" - }, - "channelBandwidth": "is20MHz", - "channelHopSettings": { - "model_type": "ChannelHopSettings", - "noiseFloorThresholdInDB": -75, - "noiseFloorThresholdTimeInSeconds": 180, - "nonWifiThresholdInPercentage": 50, - "nonWifiThresholdTimeInSeconds": 180, - "obssHopMode": "NON_WIFI" - }, - "clientDisconnectThresholdDb": -90, - "eirpTxPower": 18, - "forceScanDuringVoice": "disabled", - "managementRate": "auto", - "maxNumClients": 100, - "mimoMode": "twoByTwo", - "minAutoCellSize": -65, - "model_type": "RfElementConfiguration", - "multicastRate": "auto", - "neighbouringListApConfig": { - "maxAps": 25, - "minSignal": -85, - "model_type": "NeighbouringAPListConfiguration" - }, - "perimeterDetectionEnabled": true, - "probeResponseThresholdDb": -90, - "radioMode": "modeN", - "radioType": "is2dot4GHz", - "rf": "TipWlan-rf", - "rtsCtsThreshold": 65535, - "rxCellSizeDb": -90 - }, - "is5GHz": { - "activeScanSettings": { - "enabled": true, - "model_type": "ActiveScanSettings", - "scanDurationMillis": 65, - "scanFrequencySeconds": 10 - }, - "autoChannelSelection": false, - "beaconInterval": 100, - "bestApEnabled": null, - "bestApSettings": { - "dropInSnrPercentage": 30, - "minLoadFactor": 40, - "mlComputed": true, - "model_type": "RadioBestApSettings" - }, - "channelBandwidth": "is80MHz", - "channelHopSettings": { - "model_type": "ChannelHopSettings", - "noiseFloorThresholdInDB": -75, - "noiseFloorThresholdTimeInSeconds": 180, - "nonWifiThresholdInPercentage": 50, - "nonWifiThresholdTimeInSeconds": 180, - "obssHopMode": "NON_WIFI" - }, - "clientDisconnectThresholdDb": -90, - "eirpTxPower": 18, - "forceScanDuringVoice": "disabled", - "managementRate": "auto", - "maxNumClients": 100, - "mimoMode": "twoByTwo", - "minAutoCellSize": -65, - "model_type": "RfElementConfiguration", - "multicastRate": "auto", - "neighbouringListApConfig": { - "maxAps": 25, - "minSignal": -85, - "model_type": "NeighbouringAPListConfiguration" - }, - "perimeterDetectionEnabled": true, - "probeResponseThresholdDb": -90, - "radioMode": "modeAC", - "radioType": "is5GHz", - "rf": "TipWlan-rf", - "rtsCtsThreshold": 65535, - "rxCellSizeDb": -90 - }, - "is5GHzL": { - "activeScanSettings": { - "enabled": true, - "model_type": "ActiveScanSettings", - "scanDurationMillis": 65, - "scanFrequencySeconds": 10 - }, - "autoChannelSelection": false, - "beaconInterval": 100, - "bestApEnabled": null, - "bestApSettings": { - "dropInSnrPercentage": 30, - "minLoadFactor": 40, - "mlComputed": true, - "model_type": "RadioBestApSettings" - }, - "channelBandwidth": "is80MHz", - "channelHopSettings": { - "model_type": "ChannelHopSettings", - "noiseFloorThresholdInDB": -75, - "noiseFloorThresholdTimeInSeconds": 180, - "nonWifiThresholdInPercentage": 50, - "nonWifiThresholdTimeInSeconds": 180, - "obssHopMode": "NON_WIFI" - }, - "clientDisconnectThresholdDb": -90, - "eirpTxPower": 18, - "forceScanDuringVoice": "disabled", - "managementRate": "auto", - "maxNumClients": 100, - "mimoMode": "twoByTwo", - "minAutoCellSize": -65, - "model_type": "RfElementConfiguration", - "multicastRate": "auto", - "neighbouringListApConfig": { - "maxAps": 25, - "minSignal": -85, - "model_type": "NeighbouringAPListConfiguration" - }, - "perimeterDetectionEnabled": true, - "probeResponseThresholdDb": -90, - "radioMode": "modeAC", - "radioType": "is5GHzL", - "rf": "TipWlan-rf", - "rtsCtsThreshold": 65535, - "rxCellSizeDb": -90 - }, - "is5GHzU": { - "activeScanSettings": { - "enabled": true, - "model_type": "ActiveScanSettings", - "scanDurationMillis": 65, - "scanFrequencySeconds": 10 - }, - "autoChannelSelection": false, - "beaconInterval": 100, - "bestApEnabled": null, - "bestApSettings": { - "dropInSnrPercentage": 30, - "minLoadFactor": 40, - "mlComputed": true, - "model_type": "RadioBestApSettings" - }, - "channelBandwidth": "is80MHz", - "channelHopSettings": { - "model_type": "ChannelHopSettings", - "noiseFloorThresholdInDB": -75, - "noiseFloorThresholdTimeInSeconds": 180, - "nonWifiThresholdInPercentage": 50, - "nonWifiThresholdTimeInSeconds": 180, - "obssHopMode": "NON_WIFI" - }, - "clientDisconnectThresholdDb": -90, - "eirpTxPower": 18, - "forceScanDuringVoice": "disabled", - "managementRate": "auto", - "maxNumClients": 100, - "mimoMode": "twoByTwo", - "minAutoCellSize": -65, - "model_type": "RfElementConfiguration", - "multicastRate": "auto", - "neighbouringListApConfig": { - "maxAps": 25, - "minSignal": -85, - "model_type": "NeighbouringAPListConfiguration" - }, - "perimeterDetectionEnabled": true, - "probeResponseThresholdDb": -90, - "radioMode": "modeAC", - "radioType": "is5GHzU", - "rf": "TipWlan-rf", - "rtsCtsThreshold": 65535, - "rxCellSizeDb": -90 - } - } - }, - "id": 10, - "lastModifiedTimestamp": 0, - "model_type": "Profile", - "name": "TipWlan-rf", - "profileType": "rf" -} - diff --git a/libs/JfrogHelper.py b/libs/JfrogHelper.py deleted file mode 100644 index ec4aeb907..000000000 --- a/libs/JfrogHelper.py +++ /dev/null @@ -1,62 +0,0 @@ -import ssl -import base64 -import urllib.request -from bs4 import BeautifulSoup -import re -from ap_ssh import ssh_cli_active_fw -from lab_ap_info import * - - -class GetBuild: - def __init__(self, jfrog_user, jfrog_passwd, build, url=None): - self.user = jfrog_user - self.password = jfrog_passwd - ssl._create_default_https_context = ssl._create_unverified_context - if url: - self.jfrog_url = url - else: - self.jfrog_url = 'https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/' - self.build = build - - def get_user(self): - return self.user - - def get_passwd(self): - return self.password - - def get_latest_image(self, model, for_build=None): - - build_name = self.build - if for_build: - build_name = for_build - - url = self.jfrog_url + model + "/dev/" - print("JfrogHelper::get_latest_image, url: ", url) - - auth = str( - base64.b64encode( - bytes('%s:%s' % (self.user, self.password), 'utf-8') - ), - 'ascii' - ).strip() - headers = {'Authorization': 'Basic ' + auth} - - ''' FIND THE LATEST FILE NAME''' - # print(url) - req = urllib.request.Request(url, headers=headers) - response = urllib.request.urlopen(req) - html = response.read() - soup = BeautifulSoup(html, features="html.parser") - - # find the last pending link on dev - last_link = soup.find_all('a', href=re.compile(build_name))[-1] - latest_file = last_link['href'] - latest_fw = latest_file.replace('.tar.gz', '') - return latest_fw - - def check_latest_fw(self, ap_model=None): - for model in ap_models: - if model == ap_model: - return self.get_latest_image(model) - else: - continue diff --git a/libs/ap_plus_sdk.py b/libs/ap_plus_sdk.py deleted file mode 100644 index a6257fc55..000000000 --- a/libs/ap_plus_sdk.py +++ /dev/null @@ -1,8 +0,0 @@ -from lab_ap_info import * -from JfrogHelper import GetBuild -from ap_ssh import ssh_cli_active_fw - - -def get_ap_info(args): - return ssh_cli_active_fw(args) - pass diff --git a/libs/apnos/README.md b/libs/apnos/README.md index 95b2d6956..cc67c8b34 100644 --- a/libs/apnos/README.md +++ b/libs/apnos/README.md @@ -1 +1,4 @@ ## AP NOS Library +###apnos.py : This Library Consists of the following- + 1. class APNOS : Library to SSH and Pull the information from AP + diff --git a/libs/apnos/ap_ssh.py b/libs/apnos/ap_ssh.py deleted file mode 100755 index a41d77539..000000000 --- a/libs/apnos/ap_ssh.py +++ /dev/null @@ -1,229 +0,0 @@ -################################################################################## -# Module contains functions to get specific data from AP CLI using SSH -# -# Used by Nightly_Sanity and Throughput_Test ##################################### -################################################################################## - -import paramiko -from paramiko import SSHClient -import socket -import logging - -owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi" - -def ssh_cli_connect(command_line_args): - client = paramiko.SSHClient() - client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - - ap_ip = command_line_args.ap_ip - ap_username = command_line_args.ap_username - ap_password = command_line_args.ap_password - - jumphost_ip = command_line_args.ap_jumphost_address - jumphost_username = command_line_args.ap_jumphost_username - jumphost_password = command_line_args.ap_jumphost_password - jumphost_port = command_line_args.ap_jumphost_port - - if command_line_args.ap_jumphost_address != None: - print("Connecting to jumphost: %s@%s:%s with password: %s"%(jumphost_username, jumphost_ip, jumphost_port, jumphost_password)) - client.connect(jumphost_ip, username=jumphost_username, password=jumphost_password, - port=jumphost_port, timeout=10) - else: - print("Connecting to AP with ssh: %s@%s with password: %s"%(ap_username, ap_ip, jumphost_password)) - client.connect(ap_ip, username=ap_username, password=ap_password, timeout=10) - return client - -def ssh_cli_active_fw(command_line_args): - try: - client = ssh_cli_connect(command_line_args) - - jumphost_wlan_testing = command_line_args.ap_jumphost_wlan_testing - jumphost_tty = command_line_args.ap_jumphost_tty - - ap_cmd = "/usr/opensync/bin/ovsh s AWLAN_Node -c | grep FW_IMAGE_ACTIVE" - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - version_matrix = str(stdout.read(), 'utf-8') - err = str(stderr.read(), 'utf-8') - print("version-matrix: %s stderr: %s"%(version_matrix, err)) - version_matrix_split = version_matrix.partition('FW_IMAGE_ACTIVE","')[2] - cli_active_fw = version_matrix_split.partition('"],[')[0] - #print("Active FW is",cli_active_fw) - - ap_cmd = "/usr/opensync/bin/ovsh s Manager -c | grep status" - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - status = str(stdout.read(), 'utf-8') - err = str(stderr.read(), 'utf-8') - - print("status: %s stderr: %s"%(status, err)) - - if "ACTIVE" in status: - #print("AP is in Active state") - state = "active" - elif "BACKOFF" in status: - #print("AP is in Backoff state") - state = "backoff" - else: - #print("AP is not in Active state") - state = "unknown" - - cli_info = { - "state": state, - "active_fw": cli_active_fw - } - - return(cli_info) - - except paramiko.ssh_exception.AuthenticationException: - print("Authentication Error, Check Credentials") - return "ERROR" - except paramiko.SSHException: - print("Cannot SSH to the AP") - return "ERROR" - except socket.timeout: - print("AP Unreachable") - return "ERROR" - -def iwinfo_status(command_line_args): - try: - client = ssh_cli_connect(command_line_args) - - jumphost_wlan_testing = command_line_args.ap_jumphost_wlan_testing - jumphost_tty = command_line_args.ap_jumphost_tty - - ap_cmd = "iwinfo | grep ESSID" - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - for line in stdout.read().splitlines(): - print(line) - - except paramiko.ssh_exception.AuthenticationException: - print("Authentication Error, Check Credentials") - return "ERROR" - except paramiko.SSHException: - print("Cannot SSH to the AP") - return "ERROR" - except socket.timeout: - print("AP Unreachable") - return "ERROR" - - -def ap_ssh_ovsh_nodec(command_line_args, key): - try: - jumphost_wlan_testing = command_line_args.ap_jumphost_wlan_testing - jumphost_tty = command_line_args.ap_jumphost_tty - - client = ssh_cli_connect(command_line_args) - - ap_cmd = "/usr/opensync/bin/ovsh s AWLAN_Node -c" - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - output = str(stdout.read(), 'utf-8') - - #print("ovsdh cmd: ", cmd) - #print("ovsh output: ", output) - - if key != None: - for line in output.splitlines(): - toks = line.split(':', 1) - try: - k = toks[0].strip(' ') - v = toks[1].strip(' ') - if k == 'id': - return v - except Exception as e1: - print(e1) - print(line) - print(toks) - - return output - - except paramiko.ssh_exception.AuthenticationException: - print("Authentication Error, Check Credentials") - return "ERROR" - except paramiko.SSHException: - print("Cannot SSH to the AP") - return "ERROR" - except socket.timeout: - print("AP Unreachable") - return "ERROR" - -def ap_ssh_ovsh_by_key(command_line_args, ovsh_cmd, key): - jumphost_wlan_testing = command_line_args.ap_jumphost_wlan_testing - jumphost_tty = command_line_args.ap_jumphost_tty - - client = ssh_cli_connect(command_line_args) - - ap_cmd = ovsh_cmd - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - output = str(stdout.read(), 'utf-8') - - if key != None: - rv = [] - for line in output.splitlines(): - toks = line.split(':', 1) - if (len(toks) < 2): - #print("ovsh-by-key, ignoring line: %s"%(line)) - continue - - try: - k = toks[0].strip(' ') - v = toks[1].strip(' ') - #print("ovsh-by-key, k -:%s:- v -:%s:- searching for key -:%s:-"%(k, v, key)) - if k == key: - rv.append(v) - except Exception as e1: - print(e1) - print(line) - print(toks) - print("Output:\n", output) - logging.error(logging.traceback.format_exc()) - return rv - - return output - -# This can throw exceptions, calling code beware. -def ap_ssh_cmd(command_line_args, ap_cmd): - jumphost_wlan_testing = command_line_args.ap_jumphost_wlan_testing - jumphost_tty = command_line_args.ap_jumphost_tty - - client = ssh_cli_connect(command_line_args) - - if command_line_args.ap_jumphost_address != None: - cmd = "cd %s/lanforge/lanforge-scripts/ && ./openwrt_ctl.py %s -t %s --action cmd --value \"%s\""%(jumphost_wlan_testing, owrt_args, jumphost_tty, ap_cmd) - stdin, stdout, stderr = client.exec_command(cmd) - else: - stdin, stdout, stderr = client.exec_command(ap_cmd) - - output = str(stdout.read(), 'utf-8') - return output - -def get_vif_config(command_line_args): - ap_cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_Config -c" - return ap_ssh_ovsh_by_key(command_line_args, ap_cmd, "ssid") - -def get_vif_state(command_line_args): - ap_cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_State -c" - return ap_ssh_ovsh_by_key(command_line_args, ap_cmd, "ssid") diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py new file mode 100644 index 000000000..c111a2add --- /dev/null +++ b/libs/apnos/apnos.py @@ -0,0 +1,134 @@ +""" +APNOS Library : Used to execute SSH Commands in AP Using Direct-AP-SSH/ Jumphost-Serial Console + +Currently Having Methods: + 1. Get iwinfo + 2. AP Manager Satus + 3. Vif Config ssid's + 4. Vif State ssid's + 5. Get current Firmware + +""" + +import paramiko + + +class APNOS: + + def __init__(self, credentials=None): + self.owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi" + if credentials is None: + print("No credentials Given") + exit() + self.ip = credentials['ip'] # if mode=1, enter jumphost ip else ap ip address + self.username = credentials['username'] # if mode=1, enter jumphost username else ap username + self.password = credentials['password'] # if mode=1, enter jumphost password else ap password + self.port = credentials['port'] # if mode=1, enter jumphost ssh port else ap ssh port + self.mode = credentials['mode'] # 1 for jumphost, 0 for direct ssh + if self.mode == 1: + self.tty = credentials['jumphost_tty'] # /dev/ttyAP1 + + # Method to connect AP-CLI/ JUMPHOST-CLI + def ssh_cli_connect(self): + client = paramiko.SSHClient() + client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + print("Connecting to jumphost: %s@%s:%s with password: %s" % ( + self.username, self.ip, self.port, self.password)) + client.connect(self.ip, username=self.username, password=self.password, + port=self.port, timeout=10, allow_agent=False, banner_timeout=200) + + return client + + # Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI + def iwinfo_status(self): + client = self.ssh_cli_connect() + cmd = 'iwinfo' + if self.mode == 1: + cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + client.close() + return output + + # Method to get the vif_config of AP using AP-CLI/ JUMPHOST-CLI + def get_vif_config(self): + client = self.ssh_cli_connect() + cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_Config -c" + if self.mode == 1: + cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + client.close() + return output + + # Method to get the vif_state of AP using AP-CLI/ JUMPHOST-CLI + def get_vif_state(self): + client = self.ssh_cli_connect() + cmd = "/usr/opensync/bin/ovsh s Wifi_VIF_State -c" + if self.mode == 1: + cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + client.close() + return output + + # Method to get the vif_config ssid's of AP using AP-CLI/ JUMPHOST-CLI + def get_vif_config_ssids(self): + stdout = self.get_vif_config() + ssid_list = [] + for i in stdout.splitlines(): + ssid = str(i).replace(" ", "").split(".") + if ssid[0].split(":")[0] == "b'ssid": + ssid_list.append(ssid[0].split(":")[1].replace("'", "")) + return ssid_list + + # Method to get the vif_state ssid's of AP using AP-CLI/ JUMPHOST-CLI + def get_vif_state_ssids(self): + stdout = self.get_vif_state() + ssid_list = [] + for i in stdout.splitlines(): + ssid = str(i).replace(" ", "").split(".") + if ssid[0].split(":")[0] == "b'ssid": + ssid_list.append(ssid[0].split(":")[1].replace("'", "")) + return ssid_list + + # Method to get the active firmware of AP using AP-CLI/ JUMPHOST-CLI + def get_active_firmware(self): + try: + client = self.ssh_cli_connect() + cmd = '/usr/opensync/bin/ovsh s AWLAN_Node -c | grep FW_IMAGE_ACTIVE' + if self.mode == 1: + cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \ + f" --action cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + # print(output) + version_matrix = str(output.decode('utf-8').splitlines()) + version_matrix_split = version_matrix.partition('FW_IMAGE_ACTIVE","')[2] + cli_active_fw = version_matrix_split.partition('"],[')[0] + client.close() + except Exception as e: + print(e) + cli_active_fw = "Error" + return cli_active_fw + + # Method to get the manager state of AP using AP-CLI/ JUMPHOST-CLI + def get_manager_state(self): + try: + client = self.ssh_cli_connect() + cmd = '/usr/opensync/bin/ovsh s Manager -c | grep status' + if self.mode == 1: + cmd = f"cd /home/lanforge/lanforge-scripts/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty}" \ + f" --action cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read() + status = str(output.decode('utf-8').splitlines()) + client.close() + except Exception as e: + print(e) + status = "Error" + return status + diff --git a/libs/cloudsdk/README.md b/libs/cloudsdk/README.md index e6dfffea6..577d811e9 100644 --- a/libs/cloudsdk/README.md +++ b/libs/cloudsdk/README.md @@ -1 +1,100 @@ -## Cloud SDK Library +# Cloud SDK Library + +###cloudsdk.py : This Library Consists of the following- + 1. class ConfigureCloudSDK : Base Configuration Class + 2. class CloudSDK(ConfigureCloudSDK) : Main Cloudsdk Class + 3. class ProfileUtility : Used to CRUD over CloudSDK Profiles Utility + 4. class JFrogUtility : Used for Artifactory Utils, Get latest Build, Upload Firmware etc. + +###Note: cloudsdk.py has libraries that uses Swagger Autogenerated Code. +### Setup The Environment For using the cloudsdk library + +Using Swagger Autogenerated CloudSDK Library pypi package (implemented with [swagger codegen](https://github.com/swagger-api/swagger-codegen)). +Using [pytest] as the test execution framework. +Using [pylint](http://pylint.pycqa.org) for code quality monitoring. +Using [allure](https://docs.qameta.io/allure/#_about) with Github Pages to report test outcome. + +### Follow the setps below to setup the environment for your development Environment + +```shell +mkdir ~/.pip +echo "[global]" > ~/.pip/pip.conf +echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf +echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf +``` + +after that do the following in this folder +```shell +pip3 install -r requirements.txt +``` + +Now your cloud sdk code is downloaded with all of the dependencies and you can start working on the solution + +### Docker + +Alternatively you can use provided dockerfiles to develop\lint your code: + +```shell +docker build -t wlan-cloud-test -f dockerfile . +docker build -t wlan-cloud-lint -f dockerfile-lint . +``` + +and then you can do something like this to lint your code: + +```shell +docker run -it --rm -v %path_to_this_dir%/tests wlan-tip-lint -d protected-access *py # for now +docker run -it --rm -v %path_to_this_dir%/tests wlan-tip-lint *py # for future +``` + +to have a better output (sorted by line numbers) you can do something like this: + +```shell +docker run -it --rm --entrypoint sh -v %path_to_this_dir%/tests wlan-tip-lint -- -c 'pylint *py | sort -t ":" -k 2,2n' +``` + +and you can use something like this to develop your code: + +```shell +docker run -it -v %path_to_this_dir%/tests wlan-tip-test +``` + +### General guidelines + +This testing code adheres to generic [pep8](https://www.python.org/dev/peps/pep-0008/#introduction) style guidelines, most notably: + +1. [Documentation strings](https://www.python.org/dev/peps/pep-0008/#documentation-strings) +2. [Naming conventions](https://www.python.org/dev/peps/pep-0008/#prescriptive-naming-conventions) +3. [Sphynx docstring format](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html) + +We are using the `pylint` package to do the linting. Documentation for it can be found [here](http://pylint.pycqa.org/en/latest/). +In general, the customizations are possible via the `.pylintrc` file: + +1. Line length below 120 characters is fine (search for max-line-length) +2. No new line at the end of file is fine (search for missing-final-newline) +3. Multiple new lines at the end of file are fine (search for trailing-newlines) +4. Indent using 4 spaces (search for indent-string) +5. todo + +In future we should enforce a policy, where we cannot merge a code where the pylint scoe goes below 7: + +```shell +pylint --fail-under=7 *py +``` + +the command above would produce a non-zero exit code if the score drops below 7. + +### Reporting + +Currently the plan is to use pytest integrated with [allure](https://docs.qameta.io/allure/#_pytest) to create visual reports for the test outcomes + +### Miscelanneous + +1. Do not use old style string formatting: `"Hello %s" % var`; use `f"Hello {var}` instead +2. use `"""` in Docstrings +3. todo + +### Useful links + +https://docs.pytest.org/en/latest/example/markers.html +https://docs.pytest.org/en/latest/usage.html +http://pythontesting.net/framework/pytest/pytest-introduction/ \ No newline at end of file diff --git a/libs/cloudsdk/__init__.py b/libs/cloudsdk/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/libs/cloudsdk/cloudsdk.py b/libs/cloudsdk/cloudsdk.py old mode 100755 new mode 100644 index ab2f7211d..827df19b9 --- a/libs/cloudsdk/cloudsdk.py +++ b/libs/cloudsdk/cloudsdk.py @@ -1,1603 +1,767 @@ -#!/usr/bin/python3 - -################################################################################## -# Module contains functions to interact with CloudSDK using APIs -# Start by calling get_bearer to obtain bearer token, then other APIs can be used -# -# Used by Nightly_Sanity and Throughput_Test ##################################### -################################################################################## - +# !/usr/local/lib64/python3.8 +""" + Library for setting up the configuration for cloud connectivity + 1. testbed/ sdk_base_url + 2. login credentials +""" import base64 -import urllib.request -from bs4 import BeautifulSoup -import ssl -import subprocess, os -from artifactory import ArtifactoryPath -import tarfile -import paramiko -from paramiko import SSHClient -from scp import SCPClient -import os -import pexpect -from pexpect import pxssh -import sys -import paramiko -from scp import SCPClient -import pprint -from pprint import pprint -from os import listdir -import re -import requests -import json -import testrail_api -import logging import datetime +import json +import re +import ssl import time -from ap_ssh import ssh_cli_active_fw -import lab_ap_info -import ap_ssh +import urllib + +import requests +import swagger_client +from swagger_client import FirmwareManagementApi +from swagger_client import EquipmentGatewayApi +from bs4 import BeautifulSoup + +from testbed_info import SDK_BASE_URLS +from testbed_info import LOGIN_CREDENTIALS -###Class for CloudSDK Interaction via RestAPI -class CloudSDK: - def __init__(self, command_line_args): - self.user = command_line_args.sdk_user_id - self.password = command_line_args.sdk_user_password - self.assert_bad_response = False - self.verbose = command_line_args.verbose - self.base_url = command_line_args.sdk_base_url - self.cloud_type = "v1" - self.refresh_bearer() +class ConfigureCloudSDK: - def refresh_bearer(self): - self.bearer = self.get_bearer(self.base_url, self.cloud_type) + def __init__(self): + self.configuration = swagger_client.Configuration() - def get_bearer(self, cloudSDK_url, cloud_type): - cloud_login_url = cloudSDK_url + "/management/" + cloud_type + "/oauth2/token" - payload = ''' - { - "userId": "''' + self.user + '''", - "password": "''' + self.password + '''" - } - ''' - headers = { - 'Content-Type': 'application/json' - } - try: - token_response = requests.request("POST", cloud_login_url, headers=headers, data=payload) - self.check_response("POST", token_response, headers, payload, cloud_login_url) - except requests.exceptions.RequestException as e: - raise SystemExit("Exiting Script! Cloud not get bearer token for reason:", e) - token_data = token_response.json() - bearer_token = token_data['access_token'] - bearer = bearer_token - return (bearer_token) - - def check_response(self, cmd, response, headers, data_str, url): - if response.status_code >= 500 or self.verbose: - if response.status_code >= 500: - print("check-response: ERROR, url: ", url) - else: - print("check-response: url: ", url) - print("Command: ", cmd) - print("response-status: ", response.status_code) - print("response-headers: ", response.headers) - print("response-content: ", response.content) - print("headers: ", headers) - print("data-str: ", data_str) - - if response.status_code >= 500: - if self.assert_bad_response: - raise NameError("Invalid response code.") + def set_credentials(self, user_id=None, password=None): + if user_id is None or password is None: + self.configuration.username = LOGIN_CREDENTIALS['userId'] + self.configuration.password = LOGIN_CREDENTIALS['password'] + print("Login Credentials set to default: \n user_id: %s\n password: %s\n" % (LOGIN_CREDENTIALS['userId'], + LOGIN_CREDENTIALS['password'])) return False + else: + LOGIN_CREDENTIALS['user_id'] = user_id + self.configuration.username = user_id + LOGIN_CREDENTIALS['password'] = password + self.configuration.password = password + print("Login Credentials set to custom: \n user_id: %s\n password: %s\n" % (LOGIN_CREDENTIALS['userId'], + LOGIN_CREDENTIALS['password'])) + return True + + def select_testbed(self, testbed=None): + if testbed is None: + print("No Testbed Selected") + exit() + self.sdk_base_url = testbed + self.configuration.host = self.sdk_base_url + print("Testbed Selected: %s\n SDK_BASE_URL: %s\n" % (testbed, self.sdk_base_url)) return True - def should_upgrade_ap_fw(self, force_upgrade, skip_upgrade, report_data, latest_ap_image, fw_model, ap_cli_fw, - logger, key): - do_upgrade = False - if ap_cli_fw == latest_ap_image and force_upgrade != True: - print('FW does not require updating') - if report_data: - report_data['fw_available'][key] = "No" - if logger: - logger.info(fw_model + " does not require upgrade.") - cloudsdk_cluster_info = { - "date": "N/A", - "commitId": "N/A", - "projectVersion": "N/A" - } - if report_data: - report_data['cloud_sdk'][key] = cloudsdk_cluster_info + def set_sdk_base_url(self, sdk_base_url=None): + if sdk_base_url is None: + print("URL is None") + exit() + self.configuration.host = sdk_base_url + return True - if ap_cli_fw != latest_ap_image and skip_upgrade == True: - print('FW needs updating, but skip_upgrade is True, so skipping upgrade') - if report_data: - report_data['fw_available'][key] = "No" - if logger: - logger.info(fw_model + " firmware upgrade skipped, running with " + ap_cli_fw) - cloudsdk_cluster_info = { - "date": "N/A", - "commitId": "N/A", - "projectVersion": "N/A" - } - if report_data: - report_data['cloud_sdk'][key] = cloudsdk_cluster_info - if (ap_cli_fw != latest_ap_image or force_upgrade == True) and not skip_upgrade: - print('Updating firmware, old: %s new: %s' % (ap_cli_fw, latest_ap_image)) - do_upgrade = True - if report_data: - report_data['fw_available'][key] = "Yes" - report_data['fw_under_test'][key] = latest_ap_image +""" + Library for cloudsdk_tests generic usages, it instantiate the bearer and credentials. + It provides the connectivity to the cloud. +""" - return do_upgrade - # client is testrail client - def do_upgrade_ap_fw(self, command_line_args, report_data, test_cases, testrail_client, ap_image, cloudModel, model, - jfrog_user, jfrog_pwd, testrails_rid, customer_id, equipment_id, logger): - # Test Create Firmware Version - key = model - rid = testrails_rid - cloudSDK_url = self.base_url - bearer = self.bearer - if test_cases: - test_id_fw = test_cases["create_fw"] - print(cloudModel) - firmware_list_by_model = self.CloudSDK_images(cloudModel, cloudSDK_url, bearer) - print("Available", cloudModel, "Firmware on CloudSDK:", firmware_list_by_model) +class CloudSDK(ConfigureCloudSDK): + """ + constructor for cloudsdk_tests library : can be used from pytest framework + """ - if ap_image in firmware_list_by_model: - print("Latest Firmware", ap_image, "is already on CloudSDK, need to delete to test create FW API") - old_fw_id = self.get_firmware_id(ap_image, cloudSDK_url, bearer) - delete_fw = self.delete_firmware(str(old_fw_id), cloudSDK_url, bearer) - fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + ap_image + ".tar.gz" - commit = ap_image.split("-")[-1] - try: - fw_upload_status = self.firwmare_upload(commit, cloudModel, ap_image, fw_url, cloudSDK_url, - bearer) - fw_id = fw_upload_status['id'] - print("Upload Complete.", ap_image, "FW ID is", fw_id) - if testrail_client: - testrail_client.update_testrail(case_id=test_id_fw, run_id=rid, status_id=1, - msg='Create new FW version by API successful') - if report_data: - report_data['tests'][key][test_id_fw] = "passed" - except: - fw_upload_status = 'error' - print("Unable to upload new FW version. Skipping Sanity on AP Model") - if testrail_client: - testrail_client.update_testrail(case_id=test_id_fw, run_id=rid, status_id=5, - msg='Error creating new FW version by API') - if report_data: - report_data['tests'][key][test_id_fw] = "failed" - return False - else: - print("Latest Firmware is not on CloudSDK! Uploading...") - fw_url = "https://" + jfrog_user + ":" + jfrog_pwd + "@tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + key + "/dev/" + ap_image + ".tar.gz" - commit = ap_image.split("-")[-1] - try: - fw_upload_status = self.firwmare_upload(commit, cloudModel, ap_image, fw_url, cloudSDK_url, - bearer) - fw_id = fw_upload_status['id'] - print("Upload Complete.", ap_image, "FW ID is", fw_id) - if testrail_client: - testrail_client.update_testrail(case_id=test_id_fw, run_id=rid, status_id=1, - msg='Create new FW version by API successful') - if report_data: - report_data['tests'][key][test_id_fw] = "passed" - except: - fw_upload_status = 'error' - print("Unable to upload new FW version. Skipping Sanity on AP Model") - if testrail_client: - testrail_client.update_testrail(case_id=test_id_fw, run_id=rid, status_id=5, - msg='Error creating new FW version by API') - if report_data: - report_data['tests'][key][test_id_fw] = "failed" - return False + def __init__(self, testbed=None, customer_id=None): + super().__init__() + if customer_id is None: + print("Invalid Customer Id") + exit() + self.customer_id = customer_id + # Setting the CloudSDK Client Configuration + self.select_testbed(testbed=testbed) + self.set_credentials() + # self.configuration.refresh_api_key_hook = self.get_bearer_token - # Upgrade AP firmware - print("Upgrading...firmware ID is: ", fw_id) - upgrade_fw = self.update_firmware(equipment_id, str(fw_id), cloudSDK_url, bearer) - if logger: - logger.info("Lab " + model + " Requires FW update") - print(upgrade_fw) + # Connecting to CloudSDK + self.api_client = swagger_client.ApiClient(self.configuration) + self.login_client = swagger_client.LoginApi(api_client=self.api_client) + self.bearer = self.get_bearer_token() - if "success" in upgrade_fw: - if upgrade_fw["success"] == True: - print("CloudSDK Upgrade Request Success") - if report_data and test_cases: - report_data['tests'][key][test_cases["upgrade_api"]] = "passed" - if testrail_client: - testrail_client.update_testrail(case_id=test_cases["upgrade_api"], run_id=rid, status_id=1, - msg='Upgrade request using API successful') - if logger: - logger.info('Firmware upgrade API successfully sent') - else: - print("Cloud SDK Upgrade Request Error!") - # mark upgrade test case as failed with CloudSDK error - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_cases["upgrade_api"], run_id=rid, status_id=5, - msg='Error requesting upgrade via API') - if report_data: - report_data['tests'][key][test_cases["upgrade_api"]] = "failed" - if logger: - logger.warning('Firmware upgrade API failed to send') - return False - else: - print("Cloud SDK Upgrade Request Error!") - # mark upgrade test case as failed with CloudSDK error - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_cases["upgrade_api"], run_id=rid, status_id=5, - msg='Error requesting upgrade via API') - if report_data: - report_data['tests'][key][test_cases["upgrade_api"]] = "failed" - if logger: - logger.warning('Firmware upgrade API failed to send') - return False - - sdk_ok = False - for i in range(10): - time.sleep(30) - # Check if upgrade success is displayed on CloudSDK - if test_cases: - test_id_cloud = test_cases["cloud_fw"] - cloud_ap_fw = self.ap_firmware(customer_id, equipment_id, cloudSDK_url, bearer) - print('Current AP Firmware from CloudSDK: %s requested-image: %s' % (cloud_ap_fw, ap_image)) - if logger: - logger.info('AP Firmware from CloudSDK: ' + cloud_ap_fw) - if cloud_ap_fw == "ERROR": - print("AP FW Could not be read from CloudSDK") - - elif cloud_ap_fw == ap_image: - print("CloudSDK status shows upgrade successful!") - sdk_ok = True - break - - else: - print("AP FW from CloudSDK status is not latest build. Will try again in 30 seconds.") - - cli_ok = False - if sdk_ok: - for i in range(10): - # Check if upgrade successful on AP CLI - if test_cases: - test_id_cli = test_cases["ap_upgrade"] - try: - ap_cli_info = ssh_cli_active_fw(command_line_args) - ap_cli_fw = ap_cli_info['active_fw'] - print("CLI reporting AP Active FW as:", ap_cli_fw) - if logger: - logger.info('Firmware from CLI: ' + ap_cli_fw) - if ap_cli_fw == ap_image: - cli_ok = True - break - else: - print("probed api-cli-fw: %s != requested-image: %s" % (ap_cli_fw, ap_image)) - continue - except Exception as ex: - ap_cli_info = "ERROR" - print(ex) - logging.error(logging.traceback.format_exc()) - print("Cannot Reach AP CLI to confirm upgrade!") - if logger: - logger.warning('Cannot Reach AP CLI to confirm upgrade!') - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=4, - msg='Cannot reach AP after upgrade to check CLI - re-test required') - continue - - time.sleep(30) - else: - print("ERROR: Cloud did not report firmware upgrade within expiration time.") - - if not (sdk_ok and cli_ok): - return False # Cannot talk to AP/Cloud, cannot make intelligent decision on pass/fail - - # Check status - if cloud_ap_fw == ap_image and ap_cli_fw == ap_image: - print("CloudSDK and AP CLI both show upgrade success, passing upgrade test case") - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=1, - msg='Upgrade to ' + ap_image + ' successful') - testrail_client.update_testrail(case_id=test_id_cloud, run_id=rid, status_id=1, - msg='CLOUDSDK reporting correct firmware version.') - if report_data: - report_data['tests'][key][test_id_cli] = "passed" - report_data['tests'][key][test_id_cloud] = "passed" - print(report_data['tests'][key]) - return True - - elif cloud_ap_fw != ap_image and ap_cli_fw == ap_image: - print("AP CLI shows upgrade success - CloudSDK reporting error!") - ##Raise CloudSDK error but continue testing - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=1, - msg='Upgrade to ' + ap_image + ' successful.') - testrail_client.update_testrail(case_id=test_id_cloud, run_id=rid, status_id=5, - msg='CLOUDSDK reporting incorrect firmware version.') - if report_data: - report_data['tests'][key][test_id_cli] = "passed" - report_data['tests'][key][test_id_cloud] = "failed" - print(report_data['tests'][key]) - return True - - elif cloud_ap_fw == ap_image and ap_cli_fw != ap_image: - print("AP CLI shows upgrade failed - CloudSDK reporting error!") - # Testrail TC fail - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=5, - msg='AP failed to download or apply new FW. Upgrade to ' + ap_image + ' Failed') - testrail_client.update_testrail(case_id=test_id_cloud, run_id=rid, status_id=5, - msg='CLOUDSDK reporting incorrect firmware version.') - if report_data: - report_data['tests'][key][test_id_cli] = "failed" - report_data['tests'][key][test_id_cloud] = "failed" - print(report_data['tests'][key]) - return False - - elif cloud_ap_fw != ap_image and ap_cli_fw != ap_image: - print("Upgrade Failed! Confirmed on CloudSDK and AP CLI. Upgrade test case failed.") - ##fail TR testcase and exit - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=5, - msg='AP failed to download or apply new FW. Upgrade to ' + ap_image + ' Failed') - if report_data: - report_data['tests'][key][test_id_cli] = "failed" - print(report_data['tests'][key]) - return False - - else: - print("Unable to determine upgrade status. Skipping AP variant") - # update TR testcase as error - if test_cases: - if testrail_client: - testrail_client.update_testrail(case_id=test_id_cli, run_id=rid, status_id=4, - msg='Cannot determine upgrade status - re-test required') - if report_data: - report_data['tests'][key][test_id_cli] = "error" - print(report_data['tests'][key]) - return False - - def ap_firmware(self, customer_id, equipment_id, cloudSDK_url, bearer): - equip_fw_url = cloudSDK_url + "/portal/status/forEquipment?customerId=" + customer_id + "&equipmentId=" + equipment_id - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer + self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token + self.status_client = swagger_client.StatusApi(api_client=self.api_client) + self.equipment_client = swagger_client.EquipmentApi(self.api_client) + self.profile_client = swagger_client.ProfileApi(self.api_client) + self.api_client.configuration.api_key_prefix = { + "Authorization": "Bearer " + self.bearer._access_token } - status_response = requests.request("GET", equip_fw_url, headers=headers, data=payload) - self.check_response("GET", status_response, headers, payload, equip_fw_url) - status_code = status_response.status_code - if status_code == 200: - status_data = status_response.json() + self.api_client.configuration.refresh_api_key_hook = self.get_bearer_token() + self.ping_response = self.portal_ping() + self.default_profiles = {} + # print(self.bearer) + if self.ping_response._application_name != 'PortalServer': + print("Server not Reachable") + exit() + print("Connected to CloudSDK Server") + + """ + Login Utilitiesdefault_profile = self.default_profiles['ssid'] + """ + + def get_bearer_token(self): + return self.login_client.get_access_token(LOGIN_CREDENTIALS) + + def portal_ping(self): + return self.login_client.portal_ping() + + def disconnect_cloudsdk(self): + self.api_client.__del__() + + """default_profile = self.default_profiles['ssid'] + Equipment Utilities + """ + + # Returns a List of All the Equipments that are available + def get_equipment_by_customer_id(self, max_items=10): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": """ + str(max_items) + """ + }""" + + equipment_data = self.equipment_client.get_equipment_by_customer_id(customer_id=self.customer_id, + pagination_context=pagination_context) + return equipment_data._items + + def validate_equipment_availability(self, equipment_id=None): + data = self.get_equipment_by_customer_id() + for i in data: + if i._id == equipment_id: + return i._id + return -1 + + def request_ap_reboot(self): + pass + + def request_firmware_update(self): + pass + + def get_model_name(self, equipment_id=None): + if equipment_id is None: + return None + data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id) + return str(data._details._equipment_model) + + # Needs Bug fix from swagger code generation side + def get_ap_firmware_new_method(self, equipment_id=None): + + response = self.status_client.get_status_by_customer_equipment(customer_id=self.customer_id, + equipment_id=equipment_id) + print(response[2]) + + # Old Method, will be depreciated in future + def get_ap_firmware_old_method(self, equipment_id=None): + url = self.configuration.host + "/portal/status/forEquipment?customerId=" + str( + self.customer_id) + "&equipmentId=" + str(equipment_id) + payload = {} + headers = self.configuration.api_key_prefix + response = requests.request("GET", url, headers=headers, data=payload) + if response.status_code == 200: + status_data = response.json() # print(status_data) try: current_ap_fw = status_data[2]['details']['reportedSwVersion'] + print(current_ap_fw) return current_ap_fw - except Exception as ex: - ap_cli_info = "ERROR" - print(ex) - logging.error(logging.traceback.format_exc()) - if not self.verbose: - # Force full logging for this, result is not as expected. - self.verbose = True - self.check_response("GET", status_response, headers, payload, equip_fw_url) - self.verbose = False - return ("ERROR") + except: + current_ap_fw = "error" + return False else: - return ("ERROR") + return False - def CloudSDK_images(self, apModel, cloudSDK_url, bearer): - if apModel and apModel != "None": - getFW_url = cloudSDK_url + "/portal/firmware/version/byEquipmentType?equipmentType=AP&modelId=" + apModel - else: - getFW_url = cloudSDK_url + "/portal/firmware/version/byEquipmentType?equipmentType=AP" - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer + """ + Profile Utilities + """ + + def get_current_profile_on_equipment(self, equipment_id=None): + default_equipment_data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id, async_req=False) + return default_equipment_data._profile_id + + def get_ssids_on_equipment(self, equipment_id=None): + profile_id = self.get_current_profile_on_equipment(equipment_id=equipment_id) + all_profiles = self.profile_client.get_profile_with_children(profile_id=profile_id) + ssid_name_list = [] + for i in all_profiles: + if i._profile_type == "ssid": + ssid_name_list.append(i._details['ssid']) + return all_profiles + + def get_ssid_profiles_from_equipment_profile(self, profile_id=None): + equipment_ap_profile = self.profile_client.get_profile_by_id(profile_id=profile_id) + ssid_name_list = [] + child_profile_ids = equipment_ap_profile.child_profile_ids + for i in child_profile_ids: + profile = self.profile_client.get_profile_by_id(profile_id=i) + if profile._profile_type == "ssid": + ssid_name_list.append(profile._details['ssid']) + return ssid_name_list + + """ + default templates are as follows : + profile_name= TipWlan-rf/ + Radius-Profile/ + TipWlan-2-Radios/ + TipWlan-3-Radios/ + TipWlan-Cloud-Wifi/ + Captive-Portal + """ + + +""" + Library for Profile Utility, Creating Profiles and Pushing and Deleting them +""" + + +class ProfileUtility: + """ + constructor for Access Point Utility library : can be used from pytest framework + to control Access Points + """ + + def __init__(self, sdk_client=None, testbed=None, customer_id=None): + if sdk_client is None: + sdk_client = CloudSDK(testbed=testbed, customer_id=customer_id) + self.sdk_client = sdk_client + self.profile_client = swagger_client.ProfileApi(api_client=self.sdk_client.api_client) + self.profile_creation_ids = { + "ssid": [], + "ap": [], + "radius": [], + "rf": [] } - response = requests.request("GET", getFW_url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, getFW_url) - ap_fw_details = response.json() - ###return ap_fw_details - fwlist = [] - for version in ap_fw_details: - fwlist.append(version.get('versionName')) - return (fwlist) - # fw_versionNames = ap_fw_details[0]['versionName'] - # return fw_versionNames + self.default_profiles = {} + self.profile_ids = [] - def firwmare_upload(self, commit, apModel, latest_image, fw_url, cloudSDK_url, bearer): - fw_upload_url = cloudSDK_url + "/portal/firmware/version" - payload = "{\n \"model_type\": \"FirmwareVersion\",\n \"id\": 0,\n \"equipmentType\": \"AP\",\n \"modelId\": \"" + apModel + "\",\n \"versionName\": \"" + latest_image + "\",\n \"description\": \"\",\n \"filename\": \"" + fw_url + "\",\n \"commit\": \"" + commit + "\",\n \"validationMethod\": \"MD5_CHECKSUM\",\n \"validationCode\": \"19494befa87eb6bb90a64fd515634263\",\n \"releaseDate\": 1596192028877,\n \"createdTimestamp\": 0,\n \"lastModifiedTimestamp\": 0\n}\n\n" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer + def cleanup_objects(self): + self.profile_creation_ids = { + "ssid": [], + "ap": [], + "radius": [], + "rf": [] } + self.default_profiles = {} + self.profile_ids = [] - response = requests.request("POST", fw_upload_url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, fw_upload_url) - # print(response) - upload_result = response.json() - return (upload_result) + def get_profile_by_name(self, profile_name=None): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 1000 + }""" + profiles = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id, + pagination_context=pagination_context) - def get_firmware_id(self, latest_ap_image, cloudSDK_url, bearer): - # print(latest_ap_image) - fw_id_url = cloudSDK_url + "/portal/firmware/version/byName?firmwareVersionName=" + latest_ap_image - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("GET", fw_id_url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, fw_id_url) - fw_data = response.json() - latest_fw_id = fw_data['id'] - return latest_fw_id - - def get_paged_url(self, bearer, url_base): - url = url_base - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - rv = [] - req = 0 - while True: - print("Request %i: in get-paged-url, url: %s" % (req, url)) - response = requests.request("GET", url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, url) - rjson = response.json() - rv.append(rjson) - if not 'context' in rjson: - print(json.dumps(rjson, indent=4, sort_keys=True)) - break - if rjson['context']['lastPage']: - break - context_str = json.dumps(rjson['context']) - # print("context-str: %s"%(context_str)) - url = url_base + "&paginationContext=" + urllib.parse.quote(context_str) - req = req + 1 - # print("Profile, reading another page, context:") - # print(rjson['context']) - # print("url: %s"%(fw_id_url)) - - return rv - - def get_url(self, bearer, url): - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - print("Get-url, url: %s" % (url)) - response = requests.request("GET", url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, url) - return response.json() - - def get_customer_profiles(self, cloudSDK_url, bearer, customer_id, object_id): - if object_id != None: - url_base = cloudSDK_url + "/portal/profile" + "?profileId=" + object_id - return [self.get_url(bearer, url_base)] - else: - url_base = cloudSDK_url + "/portal/profile/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def ping(self, cloudSDK_url, bearer): - url_base = cloudSDK_url + "/ping" - return [self.get_url(bearer, url_base)] - - # This is querys all and filters locally. Maybe there is better way to get cloud to - # do the filtering? - def get_customer_profile_by_name(self, cloudSDK_url, bearer, customer_id, name): - rv = self.get_customer_profiles(cloudSDK_url, bearer, customer_id, None) - for page in rv: - for e in page['items']: - prof_id = str(e['id']) - prof_model_type = e['model_type'] - prof_type = e['profileType'] - prof_name = e['name'] - print("looking for profile: %s checking prof-id: %s model-type: %s type: %s name: %s" % ( - name, prof_id, prof_model_type, prof_type, prof_name)) - if name == prof_name: - return e + for i in profiles._items: + if i._name == profile_name: + return i return None - def delete_customer_profile(self, cloudSDK_url, bearer, profile_id): - url = cloudSDK_url + '/portal/profile/?profileId=' + str(profile_id) - print("Deleting customer profile with url: " + url) + def get_ssid_name_by_profile_id(self, profile_id=None): + profiles = self.profile_client.get_profile_by_id(profile_id=profile_id) + return profiles._details["ssid"] + + def get_default_profiles(self): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 100 + }""" + items = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id, + pagination_context=pagination_context) + + for i in items._items: + # print(i._name, i._id) + if i._name == "TipWlan-Cloud-Wifi": + self.default_profiles['ssid'] = i + if i._name == "TipWlan-3-Radios": + self.default_profiles['equipment_ap_3_radios'] = i + if i._name == "TipWlan-2-Radios": + self.default_profiles['equipment_ap_2_radios'] = i + if i._name == "Captive-Portal": + self.default_profiles['captive_portal'] = i + if i._name == "Radius-Profile": + self.default_profiles['radius'] = i + if i._name == "TipWlan-rf": + self.default_profiles['rf'] = i + + def delete_current_profile(self, equipment_id=None): + equipment_data = self.sdk_client.equipment_client.get_equipment_by_id(equipment_id=equipment_id) + + data = self.profile_client.get_profile_with_children(profile_id=equipment_data._profile_id) + delete_ids = [] + for i in data: + if i._name == "TipWlan-rf": + continue + else: + delete_ids.append(i._id) + # print(delete_ids) + self.get_default_profiles() + self.profile_creation_ids['ap'] = self.default_profiles['equipment_ap_3_radios']._id + # print(self.profile_creation_ids) + self.push_profile_old_method(equipment_id=equipment_id) + self.delete_profile(profile_id=delete_ids) + + def cleanup_profiles(self): + try: + self.get_default_profiles() + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 5000 + }""" + skip_delete_id = [] + for i in self.default_profiles: + skip_delete_id.append(self.default_profiles[i]._id) + + all_profiles = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id, + pagination_context=pagination_context) + + delete_ids = [] + for i in all_profiles._items: + delete_ids.append(i._id) + skip_delete_id = [] + for i in self.default_profiles: + skip_delete_id.append(self.default_profiles[i]._id) + delete_ids = list(set(delete_ids) - set(delete_ids).intersection(set(skip_delete_id))) + for i in delete_ids: + self.set_equipment_to_profile(profile_id=i) + try: + self.delete_profile(profile_id=delete_ids) + except Exception as e: + pass + status = True + except: + status = False + return status + + def delete_profile_by_name(self, profile_name=None): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 5000 + }""" + all_profiles = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id, + pagination_context=pagination_context) + for i in all_profiles._items: + if i._name == profile_name: + counts = self.profile_client.get_counts_of_equipment_that_use_profiles([i._id])[0] + if counts._value2: + self.set_equipment_to_profile(profile_id=i._id) + self.delete_profile(profile_id=[i._id]) + else: + self.delete_profile(profile_id=[i._id]) + + # This method will set all the equipments to default equipment_ap profile, those having the profile_id passed in + # argument + def set_equipment_to_profile(self, profile_id=None): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 5000 + }""" + equipment_data = self.sdk_client.equipment_client.get_equipment_by_customer_id(customer_id=2, + pagination_context=pagination_context) + self.get_default_profiles() + for i in equipment_data._items: + if i._profile_id == profile_id: + self.profile_creation_ids['ap'] = self.default_profiles['equipment_ap_2_radios']._id + self.push_profile_old_method(equipment_id=i._id) + time.sleep(2) + + """ + method call: used to create the rf profile and push set the parameters accordingly and update + """ + + def set_rf_profile(self, profile_data=None): + default_profile = self.default_profiles['rf'] + if profile_data is None: + self.profile_creation_ids['rf'].append(default_profile._id) + return True + + """ + method call: used to create a ssid profile with the given parameters + """ + + def create_open_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'open' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + profile = "error" + + return profile + + def create_wpa_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpaPSK' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + profile = False + return profile + + def create_wpa2_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpa2OnlyPSK' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + profile = False + return profile + + def create_wpa3_personal_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpa3OnlyPSK' + profile_id = self.profile_client.create_profile(body=default_profile)._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + return True + + def create_wpa2_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + try: + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0] + default_profile._child_profile_ids = self.profile_creation_ids["radius"] + default_profile._details['secureMode'] = 'wpa2OnlyRadius' + profile = self.profile_client.create_profile(body=default_profile) + profile_id = profile._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + except Exception as e: + print(e) + profile = False + return profile + + def create_wpa3_enterprise_ssid_profile(self, two4g=True, fiveg=True, profile_data=None): + if profile_data is None: + return False + default_profile = self.default_profiles['ssid'] + default_profile._details['appliedRadios'] = [] + if two4g is True: + default_profile._details['appliedRadios'].append("is2dot4GHz") + if fiveg is True: + default_profile._details['appliedRadios'].append("is5GHzU") + default_profile._details['appliedRadios'].append("is5GHz") + default_profile._details['appliedRadios'].append("is5GHzL") + default_profile._name = profile_data['profile_name'] + default_profile._details['vlanId'] = profile_data['vlan'] + default_profile._details['ssid'] = profile_data['ssid_name'] + default_profile._details['keyStr'] = profile_data['security_key'] + default_profile._details['forwardMode'] = profile_data['mode'] + default_profile._details['secureMode'] = 'wpa3OnlyRadius' + default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0] + default_profile._child_profile_ids = self.profile_creation_ids["radius"] + profile_id = self.profile_client.create_profile(body=default_profile)._id + self.profile_creation_ids['ssid'].append(profile_id) + self.profile_ids.append(profile_id) + return True + + """ + method call: used to create a ap profile that contains the given ssid profiles + """ + + def set_ap_profile(self, profile_data=None): + if profile_data is None: + return False + default_profile = self.default_profiles['equipment_ap_2_radios'] + default_profile._child_profile_ids = [] + for i in self.profile_creation_ids: + if i != 'ap': + for j in self.profile_creation_ids[i]: + default_profile._child_profile_ids.append(j) + + default_profile._name = profile_data['profile_name'] + # print(default_profile) + default_profile = self.profile_client.create_profile(body=default_profile) + self.profile_creation_ids['ap'] = default_profile._id + self.profile_ids.append(default_profile._id) + return default_profile + + """ + method call: used to create a radius profile with the settings given + """ + + def create_radius_profile(self, radius_info=None): + default_profile = self.default_profiles['radius'] + default_profile._name = radius_info['name'] + default_profile._details['primaryRadiusAuthServer']['ipAddress'] = radius_info['ip'] + default_profile._details['primaryRadiusAuthServer']['port'] = radius_info['port'] + default_profile._details['primaryRadiusAuthServer']['secret'] = radius_info['secret'] + default_profile = self.profile_client.create_profile(body=default_profile) + self.profile_creation_ids['radius'] = [default_profile._id] + self.profile_ids.append(default_profile._id) + return default_profile + + """ + method to push the profile to the given equipment + """ + + # Under a Bug, depreciated until resolved, should be used primarily + def push_profile(self, equipment_id=None): + pagination_context = """{ + "model_type": "PaginationContext", + "maxItemsPerPage": 100 + }""" + default_equipment_data = self.sdk_client.equipment_client.get_equipment_by_id(equipment_id=11, async_req=False) + # default_equipment_data._details[] = self.profile_creation_ids['ap'] + # print(default_equipment_data) + # print(self.sdk_client.equipment_client.update_equipment(body=default_equipment_data, async_req=True)) + + """ + method to verify if the expected ssid's are loaded in the ap vif config + """ + + def update_ssid_name(self, profile_name="Sanity-ecw5410-2G_WPA2_E_VLAN", new_profile_name="Shivam-Thakur"): + try: + profile = self.get_profile_by_name(profile_name=profile_name) + profile._details['ssid'] = new_profile_name + self.profile_client.update_profile(profile) + return True + except: + return False + pass + + """ + method to delete a profile by its id + """ + + def delete_profile(self, profile_id=None): + for i in profile_id: + self.profile_client.delete_profile(profile_id=i) + + # Need to be depreciated by using push_profile method + def push_profile_old_method(self, equipment_id=None): + if equipment_id is None: + return 0 + url = self.sdk_client.configuration.host + "/portal/equipment?equipmentId=" + str(equipment_id) payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("DELETE", url, headers=headers, data=payload) - self.check_response("DELETE", response, headers, payload, url) - return (response) - - def delete_equipment(self, cloudSDK_url, bearer, eq_id): - url = cloudSDK_url + '/portal/equipment/?equipmentId=' + eq_id - print("Deleting equipment with url: " + url) - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("DELETE", url, headers=headers, data=payload) - self.check_response("DELETE", response, headers, payload, url) - return (response) - - def get_customer_locations(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/location/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_equipment(self, customer_id): - url = self.base_url + "/portal/equipment/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(self.bearer, url) - - def get_customer_portal_users(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/portalUser/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_status(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/status/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_client_sessions(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/client/session/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_clients(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/client/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_alarms(self, cloudSDK_url, bearer, customer_id): - url_base = cloudSDK_url + "/portal/alarm/forCustomer" + "?customerId=" + customer_id - return self.get_paged_url(bearer, url_base) - - def get_customer_service_metrics(self, cloudSDK_url, bearer, customer_id, fromTime, toTime): - url_base = cloudSDK_url + "/portal/serviceMetric/forCustomer" + "?customerId=" + customer_id + "&fromTime=" + fromTime + "&toTime=" + toTime - return self.get_paged_url(bearer, url_base) - - def get_customer_system_events(self, cloudSDK_url, bearer, customer_id, fromTime, toTime): - url_base = cloudSDK_url + "/portal/systemEvent/forCustomer" + "?customerId=" + customer_id + "&fromTime=" + fromTime + "&toTime=" + toTime - return self.get_paged_url(bearer, url_base) - - def get_customer(self, cloudSDK_url, bearer, customer_id): - fw_id_url = cloudSDK_url + "/portal/customer" + "?customerId=" + customer_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("GET", fw_id_url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, fw_id_url) - return response.json() - - def delete_firmware(self, fw_id, cloudSDK_url, bearer): - url = cloudSDK_url + '/portal/firmware/version?firmwareVersionId=' + fw_id - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("DELETE", url, headers=headers, data=payload) - self.check_response("DELETE", response, headers, payload, url) - return (response) - - def update_firmware(self, equipment_id, latest_firmware_id, cloudSDK_url, bearer): - url = cloudSDK_url + "/portal/equipmentGateway/requestFirmwareUpdate?equipmentId=" + equipment_id + "&firmwareVersionId=" + latest_firmware_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - response = requests.request("POST", url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, url) - # print(response.text) - return response.json() - - # This one is not yet tested, coded from spec, could have bugs. - def ap_reboot(self, equipment_id, cloudSDK_url, bearer): - url = cloudSDK_url + "/portal/equipmentGateway/requestApReboot?equipmentId=" + equipment_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - response = requests.request("POST", url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, url) - # print(response.text) - return response.json() - - # This one is not yet tested, coded from spec, could have bugs. - def ap_switch_sw_bank(self, equipment_id, cloudSDK_url, bearer): - url = cloudSDK_url + "/portal/equipmentGateway/requestApSwitchSoftwareBank?equipmentId=" + equipment_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - response = requests.request("POST", url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, url) - # print(response.text) - return response.json() - - # This one is not yet tested, coded from spec, could have bugs. - def ap_factory_reset(self, equipment_id, cloudSDK_url, bearer): - url = cloudSDK_url + "/portal/equipmentGateway/requestApFactoryReset?equipmentId=" + equipment_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - response = requests.request("POST", url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, url) - # print(response.text) - return response.json() - - # This one is not yet tested, coded from spec, could have bugs. - def ap_channel_change(self, equipment_id, cloudSDK_url, bearer): - url = cloudSDK_url + "/portal/equipmentGateway/requestChannelChange?equipmentId=" + equipment_id - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - - response = requests.request("POST", url, headers=headers, data=payload) - self.check_response("POST", response, headers, payload, url) - # print(response.text) - return response.json() - - def set_ap_profile(self, equipment_id, test_profile_id): - ###Get AP Info - url = self.base_url + "/portal/equipment?equipmentId=" + equipment_id - payload = {} - headers = { - 'Authorization': 'Bearer ' + self.bearer - } - + headers = self.sdk_client.configuration.api_key_prefix response = requests.request("GET", url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, url) - print(response) - - ###Add Lab Profile ID to Equipment equipment_info = response.json() - # print(equipment_info) - equipment_info["profileId"] = test_profile_id - print(equipment_info) - - ###Update AP Info with Required Profile ID - url = self.base_url + "/portal/equipment" + equipment_info['profileId'] = self.profile_creation_ids['ap'] + url = self.sdk_client.configuration.host + "/portal/equipment" headers = { 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + self.bearer + 'Authorization': self.sdk_client.configuration.api_key_prefix['Authorization'] } response = requests.request("PUT", url, headers=headers, data=json.dumps(equipment_info)) - self.check_response("PUT", response, headers, payload, url) - print(response) - - def get_cloudsdk_version(self, cloudSDK_url, bearer): - # print(latest_ap_image) - url = cloudSDK_url + "/ping" - - payload = {} - headers = { - 'Authorization': 'Bearer ' + bearer - } - response = requests.request("GET", url, headers=headers, data=payload) - self.check_response("GET", response, headers, payload, url) - cloud_sdk_version = response.json() - return cloud_sdk_version - - def create_ap_profile(self, cloudSDK_url, bearer, customer_id, template, name, child_profiles): - # TODO: specify default ap profile. - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, template) - - profile["name"] = name - profile["childProfileIds"] = child_profiles - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - - data_str = json.dumps(profile) - print("Creating new ap-profile, data: %s" % (data_str)) - response = requests.request("POST", url, headers=headers, data=data_str) - self.check_response("POST", response, headers, data_str, url) - ap_profile = response.json() - print("New AP profile: ", ap_profile) - ap_profile_id = ap_profile['id'] - return ap_profile_id - - def create_or_update_ap_profile(self, cloudSDK_url, bearer, customer_id, template, name, child_profiles): - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, name) - if profile == None: - return self.create_ap_profile(cloudSDK_url, bearer, customer_id, template, name, child_profiles) - - if self.verbose: - print("AP Profile before modification:") - print(json.dumps(profile, indent=4, sort_keys=True)) - - profile["name"] = name - profile["childProfileIds"] = child_profiles - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - - data_str = json.dumps(profile) - print("Updating ap-profile, data: %s" % (data_str)) - response = requests.request("PUT", url, headers=headers, data=data_str) - self.check_response("PUT", response, headers, data_str, url) - print(response) - - if self.verbose: - p2 = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, name) - print("AP Profile: %s after update:" % (name)) - print(json.dumps(p2, indent=4, sort_keys=True)) - - return profile['id'] - - def create_ssid_profile(self, cloudSDK_url, bearer, customer_id, template, name, ssid, passkey, radius, security, - mode, vlan, radios, radius_profile=None): - print("create-ssid-profile, template: %s" % (template)) - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, template) - - profile['name'] = name - profile['details']['ssid'] = ssid - profile['details']['keyStr'] = passkey - profile['details']['radiusServiceName'] = radius - profile['details']['secureMode'] = security - profile['details']['forwardMode'] = mode - profile['details']['vlanId'] = vlan - profile['details']['appliedRadios'] = radios - if radius_profile is not None: - profile['details']['radiusServiceId'] = radius_profile - profile['childProfileIds'].append(radius_profile) - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - data_str = json.dumps(profile) - time.sleep(5) - print("shivamgogoshots radius :", radius_profile, "\n\n", profile, "\n\n", data_str) - response = requests.request("POST", url, headers=headers, data=data_str) - self.check_response("POST", response, headers, data_str, url) - ssid_profile = response.json() - return ssid_profile['id'] - - def create_or_update_ssid_profile(self, cloudSDK_url, bearer, customer_id, template, name, - ssid, passkey, radius, security, mode, vlan, radios, radius_profile=None): - # First, see if profile of this name already exists. - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, name) - if profile == None: - # create one then - return self.create_ssid_profile(cloudSDK_url, bearer, customer_id, template, name, - ssid, passkey, radius, security, mode, vlan, radios, radius_profile) - - # Update then. - print("Update existing ssid profile, name: %s" % (name)) - profile['name'] = name - profile['details']['ssid'] = ssid - profile['details']['keyStr'] = passkey - profile['details']['radiusServiceName'] = radius - profile['details']['secureMode'] = security - profile['details']['forwardMode'] = mode - profile['details']['vlanId'] = vlan - profile['details']['appliedRadios'] = radios - if radius_profile is not None: - profile['details']['radiusServiceId'] = radius_profile - profile['childProfileIds'].append(radius_profile) - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - - data_str = json.dumps(profile) - time.sleep(10) - print("shivamgogoshots radius :", radius_profile, "\n\n", profile, "\n\n", data_str) - response = requests.request("PUT", url, headers=headers, data=data_str) - self.check_response("PUT", response, headers, data_str, url) - return profile['id'] - - # General usage: get the default profile, modify it accordingly, pass it back to here - # Not tested yet. - def create_rf_profile(self, cloudSDK_url, bearer, customer_id, template, name, new_prof): - print("create-rf-profile, template: %s" % (template)) - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - data_str = json.dumps(profile) - response = requests.request("POST", url, headers=headers, data=data_str) - self.check_response("POST", response, headers, data_str, url) - ssid_profile = response.json() - return ssid_profile['id'] - - # Not tested yet. - def create_or_update_rf_profile(self, cloudSDK_url, bearer, customer_id, template, name, - new_prof): - # First, see if profile of this name already exists. - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, name) - if profile == None: - # create one then - return self.create_rf_profile(cloudSDK_url, bearer, customer_id, template, name, new_prof) - - # Update then. - print("Update existing ssid profile, name: %s" % (name)) - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - data_str = json.dumps(new_profile) - response = requests.request("PUT", url, headers=headers, data=data_str) - self.check_response("PUT", response, headers, data_str, url) - return profile['id'] - - def create_radius_profile(self, cloudSDK_url, bearer, customer_id, template, name, subnet_name, subnet, subnet_mask, - region, server_name, server_ip, secret, auth_port): - print("Create-radius-profile called, template: %s" % (template)) - profile = self.get_customer_profile_by_name(cloudSDK_url, bearer, customer_id, template) - - profile['name'] = name - - subnet_config = profile['details']['subnetConfiguration'] - old_subnet_name = list(subnet_config.keys())[0] - subnet_config[subnet_name] = subnet_config.pop(old_subnet_name) - profile['details']['subnetConfiguration'][subnet_name]['subnetAddress'] = subnet - profile['details']['subnetConfiguration'][subnet_name]['subnetCidrPrefix'] = subnet_mask - profile['details']['subnetConfiguration'][subnet_name]['subnetName'] = subnet_name - - region_map = profile['details']['serviceRegionMap'] - old_region = list(region_map.keys())[0] - region_map[region] = region_map.pop(old_region) - profile['details']['serviceRegionName'] = region - profile['details']['subnetConfiguration'][subnet_name]['serviceRegionName'] = region - profile['details']['serviceRegionMap'][region]['regionName'] = region - - server_map = profile['details']['serviceRegionMap'][region]['serverMap'] - old_server_name = list(server_map.keys())[0] - server_map[server_name] = server_map.pop(old_server_name) - profile['details']['serviceRegionMap'][region]['serverMap'][server_name][0]['ipAddress'] = server_ip - profile['details']['serviceRegionMap'][region]['serverMap'][server_name][0]['secret'] = secret - profile['details']['serviceRegionMap'][region]['serverMap'][server_name][0]['authPort'] = auth_port - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - - data_str = json.dumps(profile) - print("Sending json to create radius: %s" % (data_str)) - response = requests.request("POST", url, headers=headers, data=data_str) - self.check_response("POST", response, headers, data_str, url) - radius_profile = response.json() - print(radius_profile) - radius_profile_id = radius_profile['id'] - return radius_profile_id - - def create_or_update_radius_profile(self, cloudSDK_url, bearer, customer_id, template, name, subnet_name, subnet, - subnet_mask, - region, server_name, server_ip, secret, auth_port): - null = None - profile = {"model_type": "Profile", "id": 129, "customerId": 2, "profileType": "radius", "name": "Lab-RADIUS", - "details": {"model_type": "RadiusProfile", - "primaryRadiusAuthServer": {"model_type": "RadiusServer", "ipAddress": "10.10.10.203", - "secret": "testing123", "port": 1812, "timeout": 5}, - "secondaryRadiusAuthServer": null, "primaryRadiusAccountingServer": null, - "secondaryRadiusAccountingServer": null, "profileType": "radius"}, - "createdTimestamp": 1602263176599, "lastModifiedTimestamp": 1611708334061, "childProfileIds": []} - profile['name'] = name - profile['customerId'] = customer_id - profile['details']["primaryRadiusAuthServer"]['ipAddress'] = server_ip - profile['details']["primaryRadiusAuthServer"]['secret'] = secret - profile['details']["primaryRadiusAuthServer"]['port'] = auth_port - - url = cloudSDK_url + "/portal/profile" - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + bearer - } - - json_profile_data = json.dumps(profile).encode("utf-8") - response = requests.request("POST", url, headers=headers, data=json_profile_data) - radius_profile = response.json() - radius_profile_id = radius_profile['id'] - return radius_profile_id -# Library for creating AP Profiles -class CreateAPProfiles: +""" + Jfrog Utility for Artifactory Management +""" - def __init__(self, - command_line_args, - cloud=None, - cloud_type="v1", - client=None, - fw_model=None, - sleep=5 - ): - self.profile_test_data = {"ssid_config": {}, "vif_config": {}} - self.rid = None - self.fiveG_wpa2 = None - self.fiveG_wpa = None - self.fiveG_eap = None - self.twoFourG_wpa2 = None - self.twoFourG_wpa = None - self.twoFourG_eap = None - self.command_line_args = command_line_args - self.radius_profile = None - self.radius_name = None - self.cloud = cloud - self.client = client - self.cloud_type = cloud_type - self.customer_id = command_line_args.customer_id - self.ap_cli_info = ssh_cli_active_fw(self.command_line_args) - if self.cloud == None: - print("cloud cannot be None") +class JFrogUtility: + + def __init__(self, credentials=None): + if credentials is None: exit() - self.ap_cli_fw = self.ap_cli_info['active_fw'] - self.bearer = self.cloud.get_bearer(self.command_line_args.sdk_base_url, self.cloud_type) - self.radius_info = { + self.user = credentials["user"] + self.password = credentials["password"] + self.jfrog_url = "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + self.build = "pending" + ssl._create_default_https_context = ssl._create_unverified_context - "name": "Lab-RADIUS", - "subnet_name": "Lab", - "subnet": "8.189.25.141", - "subnet_mask": 16, - "region": "Toronto", - "server_name": "Lab-RADIUS", - "server_ip": "18.189.25.141", - "secret": "testing123", - "auth_port": 1812 - } - self.ap_models = ["ec420", "ea8300", "ecw5211", "ecw5410"] - self.fw_model = fw_model - self.report_data = {} - self.sleep = sleep - self.report_data['tests'] = dict.fromkeys(self.ap_models, "") - self.test_cases = { - "radius_profile": None, + def get_latest_build(self, model=None): + jfrog_url = self.jfrog_url + model + "/dev/" + auth = str( + base64.b64encode( + bytes('%s:%s' % (self.user, self.password), 'utf-8') + ), + 'ascii' + ).strip() + headers = {'Authorization': 'Basic ' + auth} - "ssid_5g_eap_bridge": None, - "ssid_5g_wpa2_bridge": None, - "ssid_5g_wpa_bridge": None, - "ssid_2g_eap_bridge": None, - "ssid_2g_wpa2_bridge": None, - "ssid_2g_wpa_bridge": None, + ''' FIND THE LATEST FILE NAME''' + # print(url) + req = urllib.request.Request(jfrog_url, headers=headers) + response = urllib.request.urlopen(req) + html = response.read() + soup = BeautifulSoup(html, features="html.parser") + ##find the last pending link on dev + last_link = soup.find_all('a', href=re.compile(self.build))[-1] + latest_file = last_link['href'] + latest_fw = latest_file.replace('.tar.gz', '') + return latest_fw - "ssid_5g_eap_nat": None, - "ssid_5g_wpa2_nat": None, - "ssid_5g_wpa_nat": None, - "ssid_2g_eap_nat": None, - "ssid_2g_wpa2_nat": None, - "ssid_2g_wpa_nat": None, + def get_revisions(self, model=None): + pass - "ssid_5g_eap_vlan": None, - "ssid_5g_wpa2_vlan": None, - "ssid_5g_wpa_vlan": None, - "ssid_2g_eap_vlan": None, - "ssid_2g_wpa2_vlan": None, - "ssid_2g_wpa_vlan": None, - "ap_bridge": None, - "ap_nat": None, - "ap_vlan": None, +class FirmwareUtility(JFrogUtility): - "bridge_vifc": None, - "bridge_vifs": None, + def __init__(self, sdk_client=None, jfrog_credentials=None, testbed=None, customer_id=None): + super().__init__(credentials=jfrog_credentials) + if sdk_client is None: + sdk_client = CloudSDK(testbed=testbed, customer_id=customer_id) + self.sdk_client = sdk_client + self.firmware_client = FirmwareManagementApi(api_client=sdk_client.api_client) + self.jfrog_client = JFrogUtility(credentials=jfrog_credentials) + self.equipment_gateway_client = EquipmentGatewayApi(api_client=sdk_client.api_client) - "nat_vifc": None, - "nat_vifs": None, + def get_current_fw_version(self, equipment_id=None): + # Write a logic to get the currently loaded firmware on the equipment + self.current_fw = "something" + return self.current_fw - "vlan_vifc": None, - "vlan_vifs": None - } - self.profile_data, self.prof_names, self.prof_names_eap = self.create_profile_data(self.command_line_args, - self.fw_model) - self.ssid_data, self.psk_data = self.create_ssid_data(self.command_line_args, self.fw_model) - self.profile_ids = [] + def get_latest_fw_version(self, model="ecw5410"): + # Get The equipment model + self.latest_fw = self.get_latest_build(model=model) + return self.latest_fw - def create_profile_data(self, args, fw_model): - profile_data = { - "5g": {"eap": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "5G_EAP"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "5G_EAP_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "5G_EAP_VLAN") - }, - "wpa": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA_VLAN") - }, - "wpa2": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA2"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA2_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "5G_WPA2_VLAN") - } - }, - "2g": {"eap": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "2G_EAP"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "2G_EAP_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "2G_EAP_VLAN") - }, - "wpa": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA_VLAN") - }, - "wpa2": - { - "bridge": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA2"), - "nat": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA2_NAT"), - "vlan": "%s-%s-%s" % (args.testbed, fw_model, "2G_WPA2_VLAN") - } - } - } - prof_names = [profile_data["5g"]["wpa2"]["bridge"], profile_data["5g"]["wpa"]["bridge"], - profile_data["2g"]["wpa2"]["bridge"], profile_data["2g"]["wpa"]["bridge"], - profile_data["5g"]["wpa2"]["nat"], profile_data["5g"]["wpa"]["nat"], - profile_data["2g"]["wpa2"]["nat"], profile_data["2g"]["wpa"]["nat"], - profile_data["5g"]["wpa2"]["vlan"], profile_data["5g"]["wpa"]["vlan"], - profile_data["2g"]["wpa2"]["vlan"], profile_data["2g"]["wpa"]["vlan"]] - - prof_names_eap = [profile_data["5g"]["eap"]["bridge"], profile_data["2g"]["eap"]["bridge"], - profile_data["5g"]["eap"]["nat"], profile_data["2g"]["eap"]["nat"], - profile_data["5g"]["eap"]["vlan"], profile_data["2g"]["eap"]["vlan"]] - - return profile_data, prof_names, prof_names_eap - - def create_ssid_data(self, args, fw_model): - ssid_data = self.profile_data.copy() - psk_data = { - "5g": - { - "wpa": - { - "bridge": "%s-%s" % (fw_model, "5G_WPA"), - "nat": "%s-%s" % (fw_model, "5G_WPA_NAT"), - "vlan": "%s-%s" % (fw_model, "5G_WPA_VLAN") - }, - "wpa2": - { - "bridge": "%s-%s" % (fw_model, "5G_WPA2"), - "nat": "%s-%s" % (fw_model, "5G_WPA2_NAT"), - "vlan": "%s-%s" % (fw_model, "5G_WPA2_VLAN") - } - }, - "2g": - { - "wpa": - { - "bridge": "%s-%s" % (fw_model, "2G_WPA"), - "nat": "%s-%s" % (fw_model, "2G_WPA_NAT"), - "vlan": "%s-%s" % (fw_model, "2G_WPA_VLAN") - }, - "wpa2": - { - "bridge": "%s-%s" % (fw_model, "2G_WPA2"), - "nat": "%s-%s" % (fw_model, "2G_WPA2_NAT"), - "vlan": "%s-%s" % (fw_model, "2G_WPA2_VLAN") - } - } - - } - return ssid_data, psk_data - - def set_ssid_psk_data(self, - ssid_2g_wpa=None, - ssid_5g_wpa=None, - psk_2g_wpa=None, - psk_5g_wpa=None, - ssid_2g_wpa2=None, - ssid_5g_wpa2=None, - psk_2g_wpa2=None, - psk_5g_wpa2=None): - if psk_5g_wpa2 is not None: - self.psk_data["5g"]["wpa2"]["bridge"] = psk_5g_wpa2 - self.psk_data["5g"]["wpa2"]["nat"] = psk_5g_wpa2 - self.psk_data["5g"]["wpa2"]["vlan"] = psk_5g_wpa2 - if psk_5g_wpa is not None: - self.psk_data["5g"]["wpa"]["bridge"] = psk_5g_wpa - self.psk_data["5g"]["wpa"]["nat"] = psk_5g_wpa - self.psk_data["5g"]["wpa"]["vlan"] = psk_5g_wpa - if psk_2g_wpa2 is not None: - self.psk_data["2g"]["wpa2"]["bridge"] = psk_2g_wpa2 - self.psk_data["2g"]["wpa2"]["nat"] = psk_2g_wpa2 - self.psk_data["2g"]["wpa2"]["vlan"] = psk_2g_wpa2 - if psk_2g_wpa is not None: - self.psk_data["2g"]["wpa"]["bridge"] = psk_2g_wpa - self.psk_data["2g"]["wpa"]["nat"] = psk_2g_wpa - self.psk_data["2g"]["wpa"]["nat"] = psk_2g_wpa - if ssid_5g_wpa2 is not None: - self.ssid_data["5g"]["wpa2"]["bridge"] = ssid_5g_wpa2 - self.ssid_data["5g"]["wpa2"]["nat"] = ssid_5g_wpa2 - self.ssid_data["5g"]["wpa2"]["vlan"] = ssid_5g_wpa2 - if ssid_5g_wpa is not None: - self.ssid_data["5g"]["wpa"]["bridge"] = ssid_5g_wpa - self.ssid_data["5g"]["wpa"]["nat"] = ssid_5g_wpa - self.ssid_data["5g"]["wpa"]["vlan"] = ssid_5g_wpa - if ssid_2g_wpa2 is not None: - self.ssid_data["2g"]["wpa2"]["bridge"] = ssid_2g_wpa2 - self.ssid_data["2g"]["wpa2"]["nat"] = ssid_2g_wpa2 - self.ssid_data["2g"]["wpa2"]["vlan"] = ssid_2g_wpa2 - if ssid_2g_wpa is not None: - self.ssid_data["2g"]["wpa"]["bridge"] = ssid_2g_wpa - self.ssid_data["2g"]["wpa"]["nat"] = ssid_2g_wpa - self.ssid_data["2g"]["wpa"]["vlan"] = ssid_2g_wpa - - def create_radius_profile(self, radius_name=None, radius_template=None, rid=None, key=None): - - ### Create RADIUS profile - used for all EAP SSIDs - self.radius_name = radius_name - self.radius_template = radius_template # Default radius profile found in cloud-sdk - self.subnet_name = self.radius_info['subnet_name'] - self.subnet = self.radius_info['subnet'] - self.subnet_mask = self.radius_info['subnet_mask'] - self.region = self.radius_info['region'] - self.server_name = self.radius_info['server_name'] - self.server_ip = self.radius_info['server_ip'] - self.secret = self.radius_info['secret'] - self.auth_port = self.radius_info['auth_port'] - self.rid = rid - self.key = key - if self.command_line_args.skip_radius == False: - try: - print("Into") - self.radius_profile = self.cloud.create_or_update_radius_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.radius_template, self.radius_name, - self.subnet_name, - self.subnet, - self.subnet_mask, self.region, - self.server_name, self.server_ip, - self.secret, self.auth_port) - print("radius profile Id is", self.radius_profile) - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["radius_profile"], run_id=self.rid, status_id=1, - msg='RADIUS profile created successfully') - self.test_cases["radius_profile"] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("RADIUS Profile Create Error, will skip radius profile.") - # Set backup profile ID so test can continue - self.radius_profile = None - self.radius_name = None - self.server_name = "Lab-RADIUS" - self.client.update_testrail(case_id=self.test_cases["radius_profile"], run_id=self.rid, status_id=5, - msg='Failed to create RADIUS profile') - self.test_cases["radius_profile"] = "failed" - - def create_ssid_profiles(self, ssid_template=None, skip_wpa2=False, skip_wpa=False, skip_eap=False, mode="bridge"): - - self.ssid_template = ssid_template - if mode == "vlan": - self.mode = "bridge" - self.value = 100 + def upload_fw_on_cloud(self, fw_version=None, force_upload=False): + # if fw_latest available and force upload is False -- Don't upload + # if fw_latest available and force upload is True -- Upload + # if fw_latest is not available -- Upload + fw_id = self.is_fw_available(fw_version=fw_version) + if fw_id and not force_upload: + print("Firmware Version Already Available, Skipping upload", "Force Upload :", force_upload) + # Don't Upload the fw + return fw_id else: - self.mode = mode - self.value = 1 - self.fiveG_eap = None - self.twoFourG_eap = None - self.fiveG_wpa2 = None - self.twoFourG_wpa2 = None - self.fiveG_wpa = None - self.twoFourG_wpa = None - if skip_eap: - self.radius_profile = None - # 5G SSID's - print("CreateAPProfile::create_ssid_profile, skip-wpa: ", skip_wpa, " skip-wpa2: ", skip_wpa2, " skip-eap: ", - skip_eap) + if fw_id and force_upload: + print("Firmware Version Already Available, Deleting and Uploading Again") + self.firmware_client.delete_firmware_version(firmware_version_id=fw_id) + print("Force Upload :", force_upload, " Deleted current Image") + time.sleep(2) + # if force_upload is true and latest image available, then delete the image + firmware_data = { + "id": 0, + "equipmentType": "AP", + "modelId": fw_version.split("-")[0], + "versionName": fw_version + ".tar.gz", + "description": "ECW5410 FW VERSION TEST", + "filename": "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/" + fw_version.split("-")[ + 0] + "/dev/" + fw_version + ".tar.gz", + "commit": fw_version.split("-")[5] + } + firmware_id = self.firmware_client.create_firmware_version(body=firmware_data) + print("Force Upload :", force_upload, " Uploaded the Image") + return firmware_id._id - if not skip_eap: - self.profile_test_data["vif_config"]["ssid_5g_eap"] = None - self.profile_test_data["vif_config"]["ssid_2g_eap"] = None - self.profile_test_data["ssid_config"]["ssid_5g_eap"] = None - self.profile_test_data["ssid_config"]["ssid_2g_eap"] = None - - # 5G eap + def upgrade_fw(self, equipment_id=None, force_upgrade=False, force_upload=False): + if equipment_id is None: + print("No Equipment Id Given") + exit() + if (force_upgrade is True) or (self.should_upgrade_ap_fw(equipment_id=equipment_id)): + model = self.sdk_client.get_model_name(equipment_id=equipment_id).lower() + latest_fw = self.get_latest_fw_version(model=model) + firmware_id = self.upload_fw_on_cloud(fw_version=latest_fw, force_upload=force_upload) + time.sleep(5) try: - print("sssss", self.radius_profile) - self.fiveG_eap = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['5g']['eap'][mode], - self.ssid_data['5g']['eap'][mode], - None, - self.radius_name, - "wpa2OnlyRadius", self.mode.upper(), self.value, - ["is5GHzU", "is5GHz", "is5GHzL"], - radius_profile=self.radius_profile) + obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id, + firmware_version_id=firmware_id) + print("Request firmware upgrade Success! waiting for 100 sec") + time.sleep(100) + except Exception as e: + obj = False + return obj + # Write the upgrade fw logic here - time.sleep(self.sleep) - print("5G EAP SSID created successfully - " + mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_5g_eap_" + mode], - run_id=self.rid, - status_id=1, - msg='5G EAP SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_5g_eap_" + mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.fiveG_eap = None - print("5G EAP SSID create failed - " + mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_5g_eap_" + mode], run_id=self.rid, - status_id=5, - msg='5G EAP SSID create failed - ' + mode + ' mode') - self.test_cases["ssid_5g_eap_" + mode] = "failed" - - # 2.4G eap - try: - print("shivamgogoshots", self.radius_profile) - self.twoFourG_eap = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['2g']['eap'][mode], - self.ssid_data['2g']['eap'][mode], - None, - self.radius_name, "wpa2OnlyRadius", - self.mode.upper(), self.value, - ["is2dot4GHz"], - radius_profile=self.radius_profile) - print("2.4G EAP SSID created successfully - " + mode + " mode") - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["ssid_5g_eap_" + mode], run_id=self.rid, - status_id=1, - msg='2.4G EAP SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_5g_eap_" + mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.twoFourG_eap = None - print("2.4G EAP SSID create failed - bridge mode") - self.client.update_testrail(case_id=self.test_cases["ssid_5g_eap_" + mode], run_id=self.rid, - status_id=5, - msg='2.4G EAP SSID create failed - bridge mode') - self.test_cases["ssid_5g_eap_" + mode] = "failed" - - if not skip_wpa2: - self.profile_test_data["vif_config"]["ssid_5g_wpa2"] = None - self.profile_test_data["vif_config"]["ssid_2g_wpa2"] = None - self.profile_test_data["ssid_config"]["ssid_5g_wpa2"] = None - self.profile_test_data["ssid_config"]["ssid_2g_wpa2"] = None - - # 5g wpa2 - try: - self.fiveG_wpa2 = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['5g']['wpa2'][mode], - self.ssid_data['5g']['wpa2'][mode], - self.psk_data['5g']['wpa2'][mode], - "Radius-Accounting-Profile", "wpa2OnlyPSK", - self.mode.upper(), self.value, - ["is5GHzU", "is5GHz", "is5GHzL"]) - print("5G WPA2 SSID created successfully - " + mode + " mode") - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["ssid_5g_wpa2_" + mode], run_id=self.rid, - status_id=1, - msg='5G WPA2 SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_5g_wpa2_" + mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.fiveG_wpa2 = None - print("5G WPA2 SSID create failed - " + mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_5g_wpa2_" + mode], run_id=self.rid, - status_id=5, - msg='5G WPA2 SSID create failed - ' + mode + ' mode') - self.test_cases["ssid_5g_wpa2_" + mode] = "failed" - - # 2.4G wpa2 - try: - self.twoFourG_wpa2 = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['2g']['wpa2'][ - mode], - self.ssid_data['2g']['wpa2'][mode], - self.psk_data['2g']['wpa2'][mode], - "Radius-Accounting-Profile", - "wpa2OnlyPSK", self.mode.upper(), self.value, - ["is2dot4GHz"]) - print("2.4G WPA2 SSID created successfully - " + mode + " mode") - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["ssid_2g_wpa2_" + mode], run_id=self.rid, - status_id=1, - msg='2.4G WPA2 SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_2g_wpa2_" + mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.twoFourG_wpa2 = None - print("2.4G WPA2 SSID create failed - " + mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_2g_wpa2_" + mode], run_id=self.rid, - status_id=5, - msg='2.4G WPA2 SSID create failed - ' + mode + ' mode') - self.test_cases["ssid_2g_wpa2_" + mode] = "failed" - - if not skip_wpa: - self.profile_test_data["vif_config"]["ssid_5g_wpa"] = None - self.profile_test_data["vif_config"]["ssid_2g_wpa"] = None - self.profile_test_data["ssid_config"]["ssid_5g_wpa"] = None - self.profile_test_data["ssid_config"]["ssid_2g_wpa"] = None - - # 5g wpa - try: - self.fiveG_wpa = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['5g']['wpa'][mode], - self.ssid_data['5g']['wpa'][mode], - self.psk_data['5g']['wpa'][mode], - "Radius-Accounting-Profile", "wpaPSK", - self.mode.upper(), self.value, - ["is5GHzU", "is5GHz", "is5GHzL"]) - print("5G WPA SSID created successfully - " + mode + " mode") - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["ssid_5g_wpa_" + mode], - run_id=self.rid, - status_id=1, - msg='5G WPA SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_5g_wpa_" + mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.fiveG_wpa = None - print("5G WPA SSID create failed - " + mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_5g_wpa_" + mode], run_id=self.rid, - status_id=5, - msg='5G WPA SSID create failed - ' + mode + ' mode') - self.test_cases["ssid_5g_wpa_" + mode] = "failed" - - # 2.4G wpa - try: - self.twoFourG_wpa = self.cloud.create_or_update_ssid_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.ssid_template, - self.profile_data['2g']['wpa'][mode], - self.ssid_data['2g']['wpa'][mode], - self.psk_data['2g']['wpa'][mode], - "Radius-Accounting-Profile", "wpaPSK", - self.mode.upper(), self.value, - ["is2dot4GHz"]) - print("2.4G WPA SSID created successfully - " + mode + " mode") - time.sleep(self.sleep) - self.client.update_testrail(case_id=self.test_cases["ssid_2g_wpa_" + mode], run_id=self.rid, - status_id=1, - msg='2.4G WPA SSID created successfully - ' + mode + ' mode') - self.test_cases["ssid_2g_wpa_" + self.mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - self.twoFourG_wpa = None - print("2.4G WPA SSID create failed - " + self.mode + " mode") - self.client.update_testrail(case_id=self.test_cases["ssid_2g_wpa_" + self.mode], run_id=self.rid, - status_id=5, - msg='2.4G WPA SSID create failed - ' + mode + ' mode') - self.test_cases["ssid_2g_wpa_" + self.mode] = "failed" - - def create_ap_profile(self, eq_id=None, fw_model=None, mode="bridge"): - self.ssid_prof_config = [] - self.ssid_config = [] - self.fw_model = fw_model - self.rfProfileId = lab_ap_info.rf_profile - self.child_profiles = [self.rfProfileId] - self.mode = mode - - print("create-ap-bridge-profile: 5G-wpa2: ", self.fiveG_wpa2, " 2g-wpa2: ", self.twoFourG_wpa2) - - if self.fiveG_wpa2: - self.child_profiles.append(self.fiveG_wpa2) - self.profile_ids.append(self.fiveG_wpa2) - self.ssid_prof_config.append(self.profile_data['5g']['wpa2'][self.mode]) - self.ssid_config.append(self.ssid_data['5g']['wpa2'][self.mode]) - - if self.twoFourG_wpa2: - self.child_profiles.append(self.twoFourG_wpa2) - self.profile_ids.append(self.twoFourG_wpa2) - self.ssid_prof_config.append(self.profile_data['2g']['wpa2'][self.mode]) - self.ssid_config.append(self.ssid_data['2g']['wpa2'][self.mode]) - - if self.fiveG_eap: - self.child_profiles.append(self.fiveG_eap) - self.profile_ids.append(self.fiveG_eap) - self.ssid_prof_config.append(self.profile_data['5g']['eap'][self.mode]) - self.ssid_config.append(self.ssid_data['5g']['eap'][self.mode]) - - if self.twoFourG_eap: - self.child_profiles.append(self.twoFourG_eap) - self.profile_ids.append(self.twoFourG_eap) - self.ssid_prof_config.append(self.profile_data['2g']['eap'][self.mode]) - self.ssid_config.append(self.ssid_data['2g']['eap'][self.mode]) - - if self.fiveG_wpa: - self.child_profiles.append(self.fiveG_wpa) - self.profile_ids.append(self.fiveG_wpa) - self.ssid_prof_config.append(self.profile_data['5g']['wpa'][self.mode]) - self.ssid_config.append(self.ssid_data['5g']['wpa'][self.mode]) - - if self.twoFourG_wpa: - self.child_profiles.append(self.twoFourG_wpa) - self.profile_ids.append(self.twoFourG_wpa) - self.ssid_prof_config.append(self.profile_data['2g']['wpa'][self.mode]) - self.ssid_config.append(self.ssid_data['2g']['wpa'][self.mode]) - - if self.radius_profile is not None: - self.child_profiles.append(self.radius_profile) - self.profile_ids.append(self.radius_profile) - # EAP ssid profiles would have been added above if they existed. - - name = self.command_line_args.testbed + "-" + self.fw_model + "_" + self.mode - - print("child profiles: ", self.child_profiles) + def should_upgrade_ap_fw(self, equipment_id=None): + current_fw = self.get_current_fw_version(equipment_id=equipment_id) + model = self.sdk_client.get_model_name(equipment_id=equipment_id).lower() + latest_fw = self.get_latest_fw_version(model=model) + if current_fw == latest_fw: + return False + else: + return True + def is_fw_available(self, fw_version=None): + if fw_version is None: + exit() try: - self.create_ap_profile = self.cloud.create_or_update_ap_profile(self.command_line_args.sdk_base_url, - self.bearer, self.customer_id, - self.command_line_args.default_ap_profile, - name, - self.child_profiles) - self.test_profile_id = self.create_ap_profile - print("Test Profile ID for Test is:", self.test_profile_id) - time.sleep(5) - self.client.update_testrail(case_id=self.test_cases["ap_" + self.mode], run_id=self.rid, status_id=1, - msg='AP profile for ' + mode + ' tests created successfully') - self.test_cases["ap_" + self.mode] = "passed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - create_ap_profile = "error" - print("Error creating AP profile for bridge tests. Will use existing AP profile") - self.client.update_testrail(case_id=self.test_cases["ap_" + self.mode], run_id=self.rid, status_id=5, - msg='AP profile for ' + mode + ' tests could not be created using API') - self.test_cases["ap_" + self.mode] = "failed" + firmware_version = self.firmware_client.get_firmware_version_by_name( + firmware_version_name=fw_version + ".tar.gz") + firmware_version = firmware_version._id + print("Firmware ID: ", firmware_version) + except Exception as e: + firmware_version = False + print("firmware not available: ", firmware_version) + return firmware_version - self.ap_profile = self.cloud.set_ap_profile(eq_id, self.test_profile_id) - self.profile_ids.append(self.ap_profile) - # should be called after test completion - def cleanup_profile(self, equipment_id=None): - profile_info_dict = { - "profile_id": "2", - "childProfileIds": [ - 3647, - 10, - 11, - 12, - 13, - 190, - 191 - ], - "fiveG_WPA2_SSID": "ECW5410_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5410_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5410_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 3647, - "fiveG_WPA_profile": 13, - "fiveG_WPA2-EAP_profile": 191, - "twoFourG_WPA2_profile": 11, - "twoFourG_WPA_profile": 12, - "twoFourG_WPA2-EAP_profile": 190, - "ssid_list": [ - "ECW5410_5G_WPA2", - "ECW5410_5G_WPA", - "ECW5410_5G_WPA2-EAP", - "ECW5410_2dot4G_WPA2", - "ECW5410_2dot4G_WPA", - "ECW5410_2dot4G_WPA2-EAP" - ] - } - ap_profile = self.cloud.set_ap_profile(equipment_id, profile_info_dict["profile_id"]) - time.sleep(5) - for i in self.profile_ids: - if i is not None: - self.cloud.delete_customer_profile(self.command_line_args.sdk_base_url, self.bearer, i) - time.sleep(5) - - def validate_changes(self, mode="bridge"): - - ssid_list_ok = False - vif_state_ok = False - for i in range(18): - ### Check if VIF Config and VIF State reflect AP Profile from CloudSDK - ## VIF Config - - if (ssid_list_ok and vif_state_ok): - print("SSID and VIF state is OK, continuing.") - break - - print("Check: %i/18 Wait 10 seconds for profile push.\n" % (i)) - time.sleep(10) - try: - print("SSIDs in AP Profile:", self.ssid_config) - print("SSID Profiles in AP Profile:", self.ssid_prof_config) - - ssid_list = ap_ssh.get_vif_state(self.command_line_args) - print("SSIDs in AP VIF Config:", ssid_list) - - if set(ssid_list) == set(self.ssid_config): - print("SSIDs in Wifi_VIF_Config Match AP Profile Config") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifc"], run_id=self.rid, status_id=1, - msg='SSIDs in VIF Config matches AP Profile Config') - self.test_cases[mode + "_vifc"] = "passed" - ssid_list_ok = True - else: - print("SSIDs in Wifi_VIF_Config do not match desired AP Profile Config") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifc"], run_id=self.rid, status_id=5, - msg='SSIDs in VIF Config do not match AP Profile Config') - self.test_cases[mode + "_vifc"] = "failed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ssid_list = "ERROR" - print("Error accessing VIF Config from AP CLI") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifc"], run_id=self.rid, status_id=4, - msg='Cannot determine VIF Config - re-test required') - self.test_cases[mode + "_vifc"] = "error" - - # VIF State - try: - ssid_state = ap_ssh.get_vif_state(self.command_line_args) - print("SSIDs in AP VIF State:", ssid_state) - - if set(ssid_state) == set(self.ssid_config): - print("SSIDs properly applied on AP") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifs"], run_id=self.rid, status_id=1, - msg='SSIDs in VIF Config applied to VIF State') - self.test_cases[mode + "_vifs"] = "passed" - vif_state_ok = True - else: - print("SSIDs not applied on AP") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifs"], run_id=self.rid, status_id=5, - msg='SSIDs in VIF Config not applied to VIF State') - self.test_cases[mode + "_vifs"] = "failed" - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ssid_list = "ERROR" - print("Error accessing VIF State from AP CLI") - self.client.update_testrail(case_id=self.test_cases[mode + "_vifs"], run_id=self.rid, status_id=4, - msg='Cannot determine VIF State - re-test required') - self.test_cases[mode + "_vifs"] = "error" - - print("Profiles Created") - self.profile_test_data = {"ssid_config": self.ssid_config, "vif_config": ssid_state} diff --git a/libs/cloudsdk/testbed_info.py b/libs/cloudsdk/testbed_info.py new file mode 100644 index 000000000..694e517bb --- /dev/null +++ b/libs/cloudsdk/testbed_info.py @@ -0,0 +1,23 @@ +""" + A set of constants describing cloud controllers properties +""" +import os + +SDK_BASE_URLS = { + "nola-01": "https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build", + "nola-02": "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", + "nola-04": "https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build", + "nola-ext-03": "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", + "nola-ext-04": "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", + "nola-ext-05": "https://wlan-portal-svc-nola-ext-05.cicd.lab.wlan.tip.build" +} + +LOGIN_CREDENTIALS = { + "userId": "support@example.com", + "password": "support" +} + +JFROG_CREDENTIALS = { + "userId": os.getenv('JFROG_USER'), + "password": os.getenv('JFROG_PWD') +} \ No newline at end of file diff --git a/libs/lab_ap_info.py b/libs/lab_ap_info.py deleted file mode 100755 index b82278560..000000000 --- a/libs/lab_ap_info.py +++ /dev/null @@ -1,1367 +0,0 @@ -#!/usr/bin/python3 - -##AP Models Under Test -ap_models = ["ec420","ea8300","ecw5211","ecw5410", "wf188n", "wf194c", "ex227", "ex447", "eap101", "eap102"] - -##Cloud Type(cloudSDK = v1, CMAP = cmap) -cloud_type = "v1" - -##LANForge Info -lanforge_ip = "10.10.10.201" -lanforge_2dot4g = "wiphy6" -lanforge_5g = "wiphy6" -# For single client connectivity use cases, use full station name for prefix to only read traffic from client under test -lanforge_2dot4g_prefix = "wlan6" -lanforge_5g_prefix = "wlan6" -lanforge_2dot4g_station = "wlan6" -lanforge_5g_station = "wlan6" - -##RADIUS Info -radius_info = { - - "name": "Automation_RADIUS", - "subnet_name": "Lab", - "subnet": "10.10.0.0", - "subnet_mask": 16, - "region": "Toronto", - "server_name": "Lab-RADIUS", - "server_ip": "10.10.10.203", - "secret": "testing123", - "auth_port": 1812 -} -##AP Models for firmware upload -cloud_sdk_models = { - "ec420": "EC420-G1", - "ea8300": "EA8300-CA", - "ecw5211": "ECW5211", - "ecw5410": "ECW5410", - "wf188n": "WF188N", - "wf194c": "WF194C", - "ex227": "EX227", - "ex447": "EX447", - "eap101": "EAP101", - "eap102": "EAP102" -} - -mimo_5g = { - "ec420": "4x4", - "ea8300": "2x2", - "ecw5211": "2x2", - "ecw5410": "4x4", - "wf188n": "2x2", - "wf194c": "8x8", - "ex227": "", - "ex447": "", - "eap101": "2x2", - "eap102": "4x4" -} - -mimo_2dot4g = { - "ec420": "2x2", - "ea8300": "2x2", - "ecw5211": "2x2", - "ecw5410": "4x4", - "wf188n": "2x2", - "wf194c": "4x4", - "ex227": "", - "ex447": "", - "eap101": "2x2", - "eap102": "4x4" -} - -sanity_status = { - "ea8300": "failed", - "ecw5211": 'passed', - "ecw5410": 'failed', - "ec420": 'failed', - "wf188n": "failed", - "wf194c": "failed", - "ex227": "failed", - "ex447": "failed", - "eap101": "failed", - "eap102": "failed" -} - -##Customer ID for testing -customer_id = "2" - -##Equipment IDs for Lab APs under test -equipment_id_dict = { - "ea8300": "115", - "ecw5410": "116", - "ecw5211": "117", - "ec420": "27", - "wf188n": "135", - "ex227": "148", - "eap102": "147", - "wf194c": "152" -} - -equipment_ip_dict = { - "ea8300": "10.10.10.103", - "ecw5410": "10.10.10.105", - "ec420": "10.10.10.104", - "ecw5211": "10.10.10.102", - "wf188n": "10.10.10.179", - "wf194c": "10.10.10.184", - "ex227": "10.10.10.182", - "eap102": "10.10.10.183" -} - -eqiupment_credentials_dict = { - "ea8300": "openwifi", - "ecw5410": "openwifi", - "ec420": "openwifi", - "ecw5211": "admin123", - "wf188n": "openwifi", - "wf194c": "openwifi", - "ex227": "openwifi", - "ex447": "openwifi", - "eap101": "openwifi", - "eap102": "openwifi" -} - -##Test Case information - Maps a generic TC name to TestRail TC numbers -test_cases = { - "ap_upgrade": 2233, - "5g_wpa2_bridge": 2236, - "2g_wpa2_bridge": 2237, - "5g_wpa_bridge": 2419, - "2g_wpa_bridge": 2420, - "2g_wpa_nat": 4323, - "5g_wpa_nat": 4324, - "2g_wpa2_nat": 4325, - "5g_wpa2_nat": 4326, - "2g_eap_bridge": 5214, - "5g_eap_bridge": 5215, - "2g_eap_nat": 5216, - "5g_eap_nat": 5217, - "cloud_connection": 5222, - "cloud_fw": 5247, - "5g_wpa2_vlan": 5248, - "5g_wpa_vlan": 5249, - "5g_eap_vlan": 5250, - "2g_wpa2_vlan": 5251, - "2g_wpa_vlan": 5252, - "2g_eap_vlan": 5253, - "cloud_ver": 5540, - "bridge_vifc": 5541, - "nat_vifc": 5542, - "vlan_vifc": 5543, - "bridge_vifs": 5544, - "nat_vifs": 5545, - "vlan_vifs": 5546, - "upgrade_api": 5547, - "create_fw": 5548, - "ap_bridge": 5641, - "ap_nat": 5642, - "ap_vlan": 5643, - "ssid_2g_eap_bridge": 5644, - "ssid_2g_wpa2_bridge": 5645, - "ssid_2g_wpa_bridge": 5646, - "ssid_5g_eap_bridge": 5647, - "ssid_5g_wpa2_bridge": 5648, - "ssid_5g_wpa_bridge": 5649, - "ssid_2g_eap_nat": 5650, - "ssid_2g_wpa2_nat": 5651, - "ssid_2g_wpa_nat": 5652, - "ssid_5g_eap_nat": 5653, - "ssid_5g_wpa2_nat": 5654, - "ssid_5g_wpa_nat": 5655, - "ssid_2g_eap_vlan": 5656, - "ssid_2g_wpa2_vlan": 5657, - "ssid_2g_wpa_vlan": 5658, - "ssid_5g_eap_vlan": 5659, - "ssid_5g_wpa2_vlan": 5660, - "ssid_5g_wpa_vlan": 5661, - "radius_profile": 5808 -} - -## Other profiles -radius_profile = 4159 -rf_profile = 10 - -###Testing AP Profile Information -profile_info_dict = { - "ecw5410": { - "profile_id": "2", - "childProfileIds": [ - 3647, - 10, - 11, - 12, - 13, - 190, - 191 - ], - "fiveG_WPA2_SSID": "ECW5410_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5410_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5410_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 3647, - "fiveG_WPA_profile": 13, - "fiveG_WPA2-EAP_profile": 191, - "twoFourG_WPA2_profile": 11, - "twoFourG_WPA_profile": 12, - "twoFourG_WPA2-EAP_profile": 190, - "ssid_list": [ - "ECW5410_5G_WPA2", - "ECW5410_5G_WPA", - "ECW5410_5G_WPA2-EAP", - "ECW5410_2dot4G_WPA2", - "ECW5410_2dot4G_WPA", - "ECW5410_2dot4G_WPA2-EAP" - ] - }, - - "ea8300": { - "profile_id": "153", - "childProfileIds": [ - 17, - 18, - 201, - 202, - 10, - 14, - 15 - ], - "fiveG_WPA2_SSID": "EA8300_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EA8300_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EA8300_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EA8300_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 14, - "fiveG_WPA_profile": 15, - "fiveG_WPA2-EAP_profile": 202, - "twoFourG_WPA2_profile": 17, - "twoFourG_WPA_profile": 18, - "twoFourG_WPA2-EAP_profile": 201, - # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! - "ssid_list": [ - "EA8300_5G_WPA2", - "EA8300_5G_WPA2", - "EA8300_5G_WPA", - "EA8300_5G_WPA", - "EA8300_5G_WPA2-EAP", - "EA8300_5G_WPA2-EAP", - "EA8300_2dot4G_WPA2", - "EA8300_2dot4G_WPA", - "EA8300_2dot4G_WPA2-EAP" - ] - }, - - "ec420": { - "profile_id": "20", - "childProfileIds": [ - 209, - 210, - 21, - 22, - 24, - 25, - 10 - ], - "fiveG_WPA2_SSID": "EC420_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EC420_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EC420_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EC420_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EC420_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 21, - "fiveG_WPA_profile": 22, - "fiveG_WPA2-EAP_profile": 210, - "twoFourG_WPA2_profile": 24, - "twoFourG_WPA_profile": 25, - "twoFourG_WPA2-EAP_profile": 209, - "ssid_list": [ - "EC420_5G_WPA2", - "EC420_5G_WPA", - "EC420_5G_WPA2-EAP", - "EC420_2dot4G_WPA2", - "EC420_2dot4G_WPA", - "EC420_2dot4G_WPA2-EAP" - ] - }, - - "ecw5211": { - "profile_id": "27", - "childProfileIds": [ - 32, - 10, - 28, - 29, - 205, - 206, - 31 - ], - "fiveG_WPA2_SSID": "ECW5211_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5211_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5211_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "ECW5211_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 28, - "fiveG_WPA_profile": 29, - "fiveG_WPA2-EAP_profile": 206, - "twoFourG_WPA2_profile": 31, - "twoFourG_WPA_profile": 32, - "twoFourG_WPA2-EAP_profile": 205, - "ssid_list": [ - "ECW5211_5G_WPA2", - "ECW5211_5G_WPA", - "ECW5211_5G_WPA2-EAP", - "ECW5211_2dot4G_WPA2", - "ECW5211_2dot4G_WPA", - "ECW5211_2dot4G_WPA2-EAP" - ] - }, - - "wf188n": { - "profile_id": "3724", - "childProfileIds": [ - 3718, - 3719, - 3720, - 3721, - 3722, - 3723, - 10 - ], - "fiveG_WPA2_SSID": "WF188N_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF188N_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF188N_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "WF188N_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "WF188N_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "WF188N_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF188N_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF188N_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 3719, - "fiveG_WPA_profile": 3720, - "fiveG_WPA2-EAP_profile": 3718, - "twoFourG_WPA2_profile": 3722, - "twoFourG_WPA_profile": 3723, - "twoFourG_WPA2-EAP_profile": 3721, - "ssid_list": [ - "WF188N_5G_WPA2", - "WF188N_5G_WPA", - "WF188N_5G_WPA2-EAP", - "WF188N_2dot4G_WPA2", - "WF188N_2dot4G_WPA", - "WF188N_2dot4G_WPA2-EAP" - ] - }, - - "wf194c": { - "profile_id": "4306", - "childProfileIds": [ - 4307, - 4308, - 4309, - 4310, - 4311, - 4312, - 10 - ], - "fiveG_WPA2_SSID": "WF194C_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF194C_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF194C_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "WF194C_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "WF194C_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "WF194C_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF194C_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF194C_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 4308, - "fiveG_WPA_profile": 4307, - "fiveG_WPA2-EAP_profile": 4309, - "twoFourG_WPA2_profile": 4311, - "twoFourG_WPA_profile": 4310, - "twoFourG_WPA2-EAP_profile": 4312, - "ssid_list": [ - "WF194C_5G_WPA2", - "WF194C_5G_WPA", - "WF194C_5G_WPA2-EAP", - "WF194C_2dot4G_WPA2", - "WF194C_2dot4G_WPA", - "WF194C_2dot4G_WPA2-EAP" - ] - }, - - "ex227": { - "profile_id": "4964", - "childProfileIds": [ - 4958, - 4959, - 4960, - 4961, - 4962, - 4963, - 10 - ], - "fiveG_WPA2_SSID": "EX227_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX227_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX227_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EX227_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EX227_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EX227_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX227_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX227_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 4959, - "fiveG_WPA_profile": 4960, - "fiveG_WPA2-EAP_profile": 4958, - "twoFourG_WPA2_profile": 4962, - "twoFourG_WPA_profile": 4963, - "twoFourG_WPA2-EAP_profile": 4961, - "ssid_list": [ - "EX227_5G_WPA2", - "EX227_5G_WPA", - "EX227_5G_WPA2-EAP", - "EX227_2dot4G_WPA2", - "EX227_2dot4G_WPA", - "EX227_2dot4G_WPA2-EAP" - ] - }, - - "ex447": { - "profile_id": "5008", - "childProfileIds": [ - 5002, - 5003, - 5004, - 5005, - 5006, - 5007, - 10 - ], - "fiveG_WPA2_SSID": "EX447_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX447_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX447_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EX447_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EX447_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EX447_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX447_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX447_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 5003, - "fiveG_WPA_profile": 5004, - "fiveG_WPA2-EAP_profile": 5002, - "twoFourG_WPA2_profile": 5006, - "twoFourG_WPA_profile": 5007, - "twoFourG_WPA2-EAP_profile": 5005, - "ssid_list": [ - "EX447_5G_WPA2", - "EX447_5G_WPA", - "EX447_5G_WPA2-EAP", - "EX447_2dot4G_WPA2", - "EX447_2dot4G_WPA", - "EX447_2dot4G_WPA2-EAP" - ] - }, - - "eap101": { - "profile_id": "5029", - "childProfileIds": [ - 5023, - 5024, - 5025, - 5026, - 5027, - 5028, - 10 - ], - "fiveG_WPA2_SSID": "EAP101_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP101_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP101_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EAP101_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EAP101_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EAP101_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP101_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP101_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 5024, - "fiveG_WPA_profile": 5025, - "fiveG_WPA2-EAP_profile": 5023, - "twoFourG_WPA2_profile": 5027, - "twoFourG_WPA_profile": 5028, - "twoFourG_WPA2-EAP_profile": 5026, - "ssid_list": [ - "EAP101_5G_WPA2", - "EAP101_5G_WPA", - "EAP101_5G_WPA2-EAP", - "EAP101_2dot4G_WPA2", - "EAP101_2dot4G_WPA", - "EAP101_2dot4G_WPA2-EAP" - ] - }, - - "eap102": { - "profile_id": "5050", - "childProfileIds": [ - 5044, - 5045, - 5046, - 5057, - 5048, - 5049, - 10 - ], - "fiveG_WPA2_SSID": "EAP102_5G_WPA2", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP102_5G_WPA", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP102_5G_OPEN", - "fiveG_WPA2-EAP_SSID": "EAP102_5G_WPA2-EAP", - "twoFourG_OPEN_SSID": "EAP102_2dot4G_OPEN", - "twoFourG_WPA2_SSID": "EAP102_2dot4G_WPA2", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP102_2dot4G_WPA", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP102_2dot4G_WPA2-EAP", - "fiveG_WPA2_profile": 5045, - "fiveG_WPA_profile": 5046, - "fiveG_WPA2-EAP_profile": 5044, - "twoFourG_WPA2_profile": 5048, - "twoFourG_WPA_profile": 5049, - "twoFourG_WPA2-EAP_profile": 5047, - "ssid_list": [ - "EAP102_5G_WPA2", - "EAP102_5G_WPA", - "EAP102_5G_WPA2-EAP", - "EAP102_2dot4G_WPA2", - "EAP102_2dot4G_WPA", - "EAP102_2dot4G_WPA2-EAP" - ] - }, - - "ecw5410_nat": { - "profile_id": "68", - "childProfileIds": [ - 192, - 81, - 193, - 82, - 10, - 78, - 79 - ], - "fiveG_WPA2_SSID": "ECW5410_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5410_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5410_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 78, - "fiveG_WPA_profile": 79, - "fiveG_WPA2-EAP_profile": 192, - "twoFourG_WPA2_profile": 81, - "twoFourG_WPA_profile": 82, - "twoFourG_WPA2-EAP_profile": 193, - "ssid_list": [ - "ECW5410_5G_WPA2_NAT", - "ECW5410_5G_WPA_NAT", - "ECW5410_5G_WPA2-EAP_NAT", - "ECW5410_2dot4G_WPA2_NAT", - "ECW5410_2dot4G_WPA_NAT", - "ECW5410_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ea8300_nat": { - "profile_id": "67", - "childProfileIds": [ - 72, - 73, - 10, - 75, - 203, - 76, - 204 - ], - "fiveG_WPA2_SSID": "EA8300_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EA8300_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EA8300_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EA8300_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 72, - "fiveG_WPA_profile": 73, - "fiveG_WPA2-EAP_profile": 203, - "twoFourG_WPA2_profile": 75, - "twoFourG_WPA_profile": 76, - "twoFourG_WPA2-EAP_profile": 204, - # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! - "ssid_list": [ - "EA8300_5G_WPA2_NAT", - "EA8300_5G_WPA2_NAT", - "EA8300_5G_WPA_NAT", - "EA8300_5G_WPA_NAT", - "EA8300_5G_WPA2-EAP_NAT", - "EA8300_5G_WPA2-EAP_NAT", - "EA8300_2dot4G_WPA2_NAT", - "EA8300_2dot4G_WPA_NAT", - "EA8300_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ec420_nat": { - "profile_id": "70", - "childProfileIds": [ - 211, - 212, - 90, - 10, - 91, - 93, - 94 - ], - "fiveG_WPA2_SSID": "EC420_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EC420_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EC420_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EC420_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EC420_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 90, - "fiveG_WPA_profile": 91, - "fiveG_WPA2-EAP_profile": 211, - "twoFourG_WPA2_profile": 93, - "twoFourG_WPA_profile": 94, - "twoFourG_WPA2-EAP_profile": 212, - "ssid_list": [ - "EC420_5G_WPA2_NAT", - "EC420_5G_WPA_NAT", - "EC420_5G_WPA2-EAP_NAT", - "EC420_2dot4G_WPA2_NAT", - "EC420_2dot4G_WPA_NAT", - "EC420_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ecw5211_nat": { - "profile_id": "69", - "childProfileIds": [ - 208, - 84, - 85, - 87, - 88, - 10, - 207 - ], - "fiveG_WPA2_SSID": "ECW5211_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5211_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5211_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "ECW5211_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 84, - "fiveG_WPA_profile": 85, - "fiveG_WPA2-EAP_profile": 207, - "twoFourG_WPA2_profile": 87, - "twoFourG_WPA_profile": 88, - "twoFourG_WPA2-EAP_profile": 208, - "ssid_list": [ - "ECW5211_5G_WPA2_NAT", - "ECW5211_5G_WPA_NAT", - "ECW5211_5G_WPA2-EAP_NAT", - "ECW5211_2dot4G_WPA2_NAT", - "ECW5211_2dot4G_WPA_NAT", - "ECW5211_2dot4G_WPA2-EAP_NAT" - ] - }, - - "wf188n_nat": { - "profile_id": "3732", - "childProfileIds": [ - 3728, - 3729, - 3730, - 3731, - 10, - 3726, - 3727 - ], - "fiveG_WPA2_SSID": "WF188N_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF188N_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF188N_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "WF188N_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "WF188N_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "WF188N_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF188N_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF188N_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 3727, - "fiveG_WPA_profile": 3728, - "fiveG_WPA2-EAP_profile": 3726, - "twoFourG_WPA2_profile": 3730, - "twoFourG_WPA_profile": 3731, - "twoFourG_WPA2-EAP_profile": 3729, - "ssid_list": [ - "WF188N_5G_WPA2_NAT", - "WF188N_5G_WPA_NAT", - "WF188N_5G_WPA2-EAP_NAT", - "WF188N_2dot4G_WPA2_NAT", - "WF188N_2dot4G_WPA_NAT", - "WF188N_2dot4G_WPA2-EAP_NAT" - ] - }, - - "wf194c_nat": { - "profile_id": "4416", - "childProfileIds": [ - 4410, - 4411, - 4412, - 4413, - 10, - 4414, - 4415 - ], - "fiveG_WPA2_SSID": "WF194C_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF194C_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF194C_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "WF194C_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "WF194C_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "WF194C_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF194C_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF194C_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 4411, - "fiveG_WPA_profile": 4412, - "fiveG_WPA2-EAP_profile": 4410, - "twoFourG_WPA2_profile": 4414, - "twoFourG_WPA_profile": 4415, - "twoFourG_WPA2-EAP_profile": 4413, - "ssid_list": [ - "WF194C_5G_WPA2_NAT", - "WF194C_5G_WPA_NAT", - "WF194C_5G_WPA2-EAP_NAT", - "WF194C_2dot4G_WPA2_NAT", - "WF194C_2dot4G_WPA_NAT", - "WF194C_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ex227_nat": { - "profile_id": "4971", - "childProfileIds": [ - 4965, - 4966, - 4967, - 4968, - 10, - 4969, - 4970 - ], - "fiveG_WPA2_SSID": "EX227_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX227_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX227_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EX227_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EX227_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EX227_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX227_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX227_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 4966, - "fiveG_WPA_profile": 4967, - "fiveG_WPA2-EAP_profile": 4965, - "twoFourG_WPA2_profile": 4969, - "twoFourG_WPA_profile": 4970, - "twoFourG_WPA2-EAP_profile": 4968, - "ssid_list": [ - "EX227_5G_WPA2_NAT", - "EX227_5G_WPA_NAT", - "EX227_5G_WPA2-EAP_NAT", - "EX227_2dot4G_WPA2_NAT", - "EX227_2dot4G_WPA_NAT", - "EX227_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ex447_nat": { - "profile_id": "5015", - "childProfileIds": [ - 5009, - 5010, - 5011, - 5012, - 10, - 5013, - 5014 - ], - "fiveG_WPA2_SSID": "EX447_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX447_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX447_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EX447_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EX447_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EX447_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX447_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX447_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 5010, - "fiveG_WPA_profile": 5011, - "fiveG_WPA2-EAP_profile": 5009, - "twoFourG_WPA2_profile": 5013, - "twoFourG_WPA_profile": 5014, - "twoFourG_WPA2-EAP_profile": 5012, - "ssid_list": [ - "EX447_5G_WPA2_NAT", - "EX447_5G_WPA_NAT", - "EX447_5G_WPA2-EAP_NAT", - "EX447_2dot4G_WPA2_NAT", - "EX447_2dot4G_WPA_NAT", - "EX447_2dot4G_WPA2-EAP_NAT" - ] - }, - - "eap102_nat": { - "profile_id": "5057", - "childProfileIds": [ - 5051, - 5052, - 5053, - 5054, - 10, - 5055, - 5056 - ], - "fiveG_WPA2_SSID": "EAP102_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP102_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP102_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EAP102_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EAP102_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EAP102_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP102_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP102_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 5052, - "fiveG_WPA_profile": 5053, - "fiveG_WPA2-EAP_profile": 5051, - "twoFourG_WPA2_profile": 5055, - "twoFourG_WPA_profile": 5056, - "twoFourG_WPA2-EAP_profile": 5054, - "ssid_list": [ - "EAP102_5G_WPA2_NAT", - "EAP102_5G_WPA_NAT", - "EAP102_5G_WPA2-EAP_NAT", - "EAP102_2dot4G_WPA2_NAT", - "EAP102_2dot4G_WPA_NAT", - "EAP102_2dot4G_WPA2-EAP_NAT" - ] - }, - - "eap101_nat": { - "profile_id": "5036", - "childProfileIds": [ - 5030, - 5031, - 5032, - 5033, - 10, - 5034, - 5035 - ], - "fiveG_WPA2_SSID": "EAP101_5G_WPA2_NAT", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP101_5G_WPA_NAT", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP101_5G_OPEN_NAT", - "fiveG_WPA2-EAP_SSID": "EAP101_5G_WPA2-EAP_NAT", - "twoFourG_OPEN_SSID": "EAP101_2dot4G_OPEN_NAT", - "twoFourG_WPA2_SSID": "EAP101_2dot4G_WPA2_NAT", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP101_2dot4G_WPA_NAT", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP101_2dot4G_WPA2-EAP_NAT", - "fiveG_WPA2_profile": 5031, - "fiveG_WPA_profile": 5032, - "fiveG_WPA2-EAP_profile": 5030, - "twoFourG_WPA2_profile": 5034, - "twoFourG_WPA_profile": 5035, - "twoFourG_WPA2-EAP_profile": 5033, - "ssid_list": [ - "EAP101_5G_WPA2_NAT", - "EAP101_5G_WPA_NAT", - "EAP101_5G_WPA2-EAP_NAT", - "EAP101_2dot4G_WPA2_NAT", - "EAP101_2dot4G_WPA_NAT", - "EAP101_2dot4G_WPA2-EAP_NAT" - ] - }, - - "ecw5410_vlan": { - "profile_id": "338", - "childProfileIds": [ - 336, - 320, - 337, - 10, - 333, - 334, - 335 - ], - "fiveG_WPA2_SSID": "ECW5410_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5410_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5410_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "ECW5410_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "ECW5410_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "ECW5410_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5410_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5410_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 320, - "fiveG_WPA_profile": 333, - "fiveG_WPA2-EAP_profile": 337, - "twoFourG_WPA2_profile": 334, - "twoFourG_WPA_profile": 335, - "twoFourG_WPA2-EAP_profile": 336, - "ssid_list": [ - "ECW5410_5G_WPA2_VLAN", - "ECW5410_5G_WPA_VLAN", - "ECW5410_5G_WPA2-EAP_VLAN", - "ECW5410_2dot4G_WPA2_VLAN", - "ECW5410_2dot4G_WPA_VLAN", - "ECW5410_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "ea8300_vlan": { - "profile_id": "319", - "childProfileIds": [ - 313, - 10, - 314, - 315, - 316, - 317, - 318 - ], - "fiveG_WPA2_SSID": "EA8300_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EA8300_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EA8300_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EA8300_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EA8300_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EA8300_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EA8300_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EA8300_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 313, - "fiveG_WPA_profile": 314, - "fiveG_WPA2-EAP_profile": 318, - "twoFourG_WPA2_profile": 315, - "twoFourG_WPA_profile": 316, - "twoFourG_WPA2-EAP_profile": 317, - # EA8300 has 2x 5GHz SSIDs because it is a tri-radio AP! - "ssid_list": [ - "EA8300_5G_WPA2_VLAN", - "EA8300_5G_WPA2_VLAN", - "EA8300_5G_WPA_VLAN", - "EA8300_5G_WPA_VLAN", - "EA8300_5G_WPA2-EAP_VLAN", - "EA8300_5G_WPA2-EAP_VLAN", - "EA8300_2dot4G_WPA2_VLAN", - "EA8300_2dot4G_WPA_VLAN", - "EA8300_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "ec420_vlan": { - "profile_id": "357", - "childProfileIds": [ - 352, - 353, - 354, - 355, - 356, - 10, - 351 - ], - "fiveG_WPA2_SSID": "EC420_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EC420_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EC420_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EC420_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EC420_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EC420_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EC420_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EC420_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 351, - "fiveG_WPA_profile": 352, - "fiveG_WPA2-EAP_profile": 356, - "twoFourG_WPA2_profile": 353, - "twoFourG_WPA_profile": 354, - "twoFourG_WPA2-EAP_profile": 355, - "ssid_list": [ - "EC420_5G_WPA2_VLAN", - "EC420_5G_WPA_VLAN", - "EC420_5G_WPA2-EAP_VLAN", - "EC420_2dot4G_WPA2_VLAN", - "EC420_2dot4G_WPA_VLAN", - "EC420_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "ecw5211_vlan": { - "profile_id": "364", - "childProfileIds": [ - 358, - 359, - 360, - 361, - 10, - 362, - 363 - ], - "fiveG_WPA2_SSID": "ECW5211_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "ECW5211_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "ECW5211_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "ECW5211_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "ECW5211_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "ECW5211_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "ECW5211_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "ECW5211_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 358, - "fiveG_WPA_profile": 359, - "fiveG_WPA2-EAP_profile": 363, - "twoFourG_WPA2_profile": 360, - "twoFourG_WPA_profile": 361, - "twoFourG_WPA2-EAP_profile": 362, - "ssid_list": [ - "ECW5211_5G_WPA2_VLAN", - "ECW5211_5G_WPA_VLAN", - "ECW5211_5G_WPA2-EAP_VLAN", - "ECW5211_2dot4G_WPA2_VLAN", - "ECW5211_2dot4G_WPA_VLAN", - "ECW5211_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "wf188n_vlan": { - "profile_id": "3740", - "childProfileIds": [ - 3734, - 3735, - 3736, - 3737, - 3738, - 10, - 3739 - ], - "fiveG_WPA2_SSID": "WF188N_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF188N_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF188N_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "WF188N_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "WF188N_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "WF188N_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF188N_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF188N_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 3738, - "fiveG_WPA_profile": 3739, - "fiveG_WPA2-EAP_profile": 3737, - "twoFourG_WPA2_profile": 3722, - "twoFourG_WPA_profile": 3723, - "twoFourG_WPA2-EAP_profile": 3721, - "ssid_list": [ - "WF188N_5G_WPA2_VLAN", - "WF188N_5G_WPA_VLAN", - "WF188N_5G_WPA2-EAP_VLAN", - "WF188N_2dot4G_WPA2_VLAN", - "WF188N_2dot4G_WPA_VLAN", - "WF188N_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "wf194c_vlan": { - "profile_id": "4429", - "childProfileIds": [ - 4423, - 4424, - 4425, - 4426, - 4427, - 10, - 4428 - ], - "fiveG_WPA2_SSID": "WF194C_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "WF194C_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "WF194C_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "WF194C_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "WF194C_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "WF194C_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "WF194C_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "WF194C_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 4424, - "fiveG_WPA_profile": 4425, - "fiveG_WPA2-EAP_profile": 4423, - "twoFourG_WPA2_profile": 4427, - "twoFourG_WPA_profile": 4428, - "twoFourG_WPA2-EAP_profile": 4426, - "ssid_list": [ - "WF194C_5G_WPA2_VLAN", - "WF194C_5G_WPA_VLAN", - "WF194C_5G_WPA2-EAP_VLAN", - "WF194C_2dot4G_WPA2_VLAN", - "WF194C_2dot4G_WPA_VLAN", - "WF194C_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "ex227_vlan": { - "profile_id": "4978", - "childProfileIds": [ - 4972, - 4973, - 4974, - 4975, - 4976, - 10, - 4977 - ], - "fiveG_WPA2_SSID": "EX227_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX227_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX227_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EX227_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EX227_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EX227_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX227_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX227_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 4973, - "fiveG_WPA_profile": 4974, - "fiveG_WPA2-EAP_profile": 4972, - "twoFourG_WPA2_profile": 4976, - "twoFourG_WPA_profile": 4977, - "twoFourG_WPA2-EAP_profile": 4975, - "ssid_list": [ - "EX227_5G_WPA2_VLAN", - "EX227_5G_WPA_VLAN", - "EX227_5G_WPA2-EAP_VLAN", - "EX227_2dot4G_WPA2_VLAN", - "EX227_2dot4G_WPA_VLAN", - "EX227_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "ex447_vlan": { - "profile_id": "5022", - "childProfileIds": [ - 5016, - 5017, - 5018, - 5019, - 5020, - 10, - 5021 - ], - "fiveG_WPA2_SSID": "EX447_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EX447_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EX447_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EX447_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EX447_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EX447_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EX447_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EX447_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 4973, - "fiveG_WPA_profile": 4974, - "fiveG_WPA2-EAP_profile": 4972, - "twoFourG_WPA2_profile": 4976, - "twoFourG_WPA_profile": 4977, - "twoFourG_WPA2-EAP_profile": 4975, - "ssid_list": [ - "EX447_5G_WPA2_VLAN", - "EX447_5G_WPA_VLAN", - "EX447_5G_WPA2-EAP_VLAN", - "EX447_2dot4G_WPA2_VLAN", - "EX447_2dot4G_WPA_VLAN", - "EX447_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "eap101_vlan": { - "profile_id": "5043", - "childProfileIds": [ - 5037, - 5038, - 5039, - 5040, - 5041, - 10, - 5042 - ], - "fiveG_WPA2_SSID": "EAP101_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP101_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP101_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EAP101_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EAP101_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EAP101_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP101_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP101_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 5038, - "fiveG_WPA_profile": 5039, - "fiveG_WPA2-EAP_profile": 5037, - "twoFourG_WPA2_profile": 5041, - "twoFourG_WPA_profile": 5042, - "twoFourG_WPA2-EAP_profile": 5040, - "ssid_list": [ - "EAP101_5G_WPA2_VLAN", - "EAP101_5G_WPA_VLAN", - "EAP101_5G_WPA2-EAP_VLAN", - "EAP101_2dot4G_WPA2_VLAN", - "EAP101_2dot4G_WPA_VLAN", - "EAP101_2dot4G_WPA2-EAP_VLAN" - ] - }, - - "eap102_vlan": { - "profile_id": "5064", - "childProfileIds": [ - 5058, - 5059, - 5060, - 5061, - 5062, - 10, - 5063 - ], - "fiveG_WPA2_SSID": "EAP102_5G_WPA2_VLAN", - "fiveG_WPA2_PSK": "Connectus123$", - "fiveG_WPA_SSID": "EAP102_5G_WPA_VLAN", - "fiveG_WPA_PSK": "Connectus123$", - "fiveG_OPEN_SSID": "EAP102_5G_OPEN_VLAN", - "fiveG_WPA2-EAP_SSID": "EAP102_5G_WPA2-EAP_VLAN", - "twoFourG_OPEN_SSID": "EAP102_2dot4G_OPEN_VLAN", - "twoFourG_WPA2_SSID": "EAP102_2dot4G_WPA2_VLAN", - "twoFourG_WPA2_PSK": "Connectus123$", - "twoFourG_WPA_SSID": "EAP102_2dot4G_WPA_VLAN", - "twoFourG_WPA_PSK": "Connectus123$", - "twoFourG_WPA2-EAP_SSID": "EAP102_2dot4G_WPA2-EAP_VLAN", - "fiveG_WPA2_profile": 5059, - "fiveG_WPA_profile": 5060, - "fiveG_WPA2-EAP_profile": 5058, - "twoFourG_WPA2_profile": 5060, - "twoFourG_WPA_profile": 5061, - "twoFourG_WPA2-EAP_profile": 5059, - "ssid_list": [ - "EAP102_5G_WPA2_VLAN", - "EAP102_5G_WPA_VLAN", - "EAP102_5G_WPA2-EAP_VLAN", - "EAP102_2dot4G_WPA2_VLAN", - "EAP102_2dot4G_WPA_VLAN", - "EAP102_2dot4G_WPA2-EAP_VLAN" - ] - }, -} diff --git a/libs/testrails/reporting.py b/libs/testrails/reporting.py new file mode 100644 index 000000000..849c06082 --- /dev/null +++ b/libs/testrails/reporting.py @@ -0,0 +1,7 @@ +class Reporting: + + def __init__(self): + pass + + def update_testrail(self, case_id=None, run_id=None, status_id=1, msg=None): + pass \ No newline at end of file diff --git a/libs/testrails/testrail_api.py b/libs/testrails/testrail_api.py index 541ea6551..f8a01019d 100644 --- a/libs/testrails/testrail_api.py +++ b/libs/testrails/testrail_api.py @@ -1,4 +1,5 @@ -"""TestRail API binding for Python 3.x. +""" +TestRail API binding for Python 3.x. """ @@ -15,19 +16,20 @@ import requests from pprint import pprint import os -class TestRail_Client: - def __init__(self, command_line_args): - self.user = command_line_args.testrail_user_id - self.password = command_line_args.testrail_user_password - self.command_line_args = command_line_args - base_url = command_line_args.testrail_base_url + +# tr_user=os.getenv('TR_USER') +# tr_pw=os.getenv('TR_PWD') +# project = os.getenv('PROJECT_ID') + + +class APIClient: + def __init__(self, base_url, tr_user, tr_pw, project): + self.user = tr_user + self.password = tr_pw + self.project = project if not base_url.endswith('/'): base_url += '/' self.__url = base_url + 'index.php?/api/v2/' - self.use_testrails = True - if command_line_args.testrail_user_id == "NONE": - self.use_testrails = False - def send_get(self, uri, filepath=None): """Issue a GET request (read) against the API. @@ -57,9 +59,6 @@ class TestRail_Client: return self.__send_request('POST', uri, data) def __send_request(self, method, uri, data): - if not self.use_testrails: - return {"TESTRAILS":"DISABLED"} - url = self.__url + uri auth = str( @@ -69,10 +68,10 @@ class TestRail_Client: 'ascii' ).strip() headers = {'Authorization': 'Basic ' + auth} - #print("Method =" , method) + # print("Method =" , method) if method == 'POST': - if uri[:14] == 'add_attachment': # add_attachment API method + if uri[:14] == 'add_attachment': # add_attachment API method files = {'attachment': (open(data, 'rb'))} response = requests.post(url, headers=headers, files=files) files['attachment'].close() @@ -83,25 +82,25 @@ class TestRail_Client: else: headers['Content-Type'] = 'application/json' response = requests.get(url, headers=headers) - #print("headers = ", headers) - #print("resonse=", response) - #print("response code =", response.status_code) + # print("headers = ", headers) + # print("resonse=", response) + # print("response code =", response.status_code) if response.status_code > 201: try: error = response.json() - except: # response.content not formatted as JSON + except: # response.content not formatted as JSON error = str(response.content) - #raise APIError('TestRail API returned HTTP %s (%s)' % (response.status_code, error)) + # raise APIError('TestRail API returned HTTP %s (%s)' % (response.status_code, error)) print('TestRail API returned HTTP %s (%s)' % (response.status_code, error)) return else: print(uri[:15]) - if uri[:15] == 'get_attachments': # Expecting file, not JSON + if uri[:15] == 'get_attachments': # Expecting file, not JSON try: print('opening file') - print (str(response.content)) + print(str(response.content)) open(data, 'wb').write(response.content) print('opened file') return (data) @@ -111,39 +110,31 @@ class TestRail_Client: try: return response.json() - except: # Nothing to return + except: # Nothing to return return {} def get_project_id(self, project_name): "Get the project ID using project name" - - if not self.use_testrails: - return -1 - project_id = None projects = self.send_get('get_projects') ##pprint(projects) for project in projects: - if project['name']== project_name: + if project['name'] == project_name: project_id = project['id'] # project_found_flag=True break - print("project Id =",project_id) + print("project Id =", project_id) return project_id def get_run_id(self, test_run_name): "Get the run ID using test name and project name" - - if not self.use_testrails: - return -1 - run_id = None - project_id = self.get_project_id(project_name=project) + project_id = self.get_project_id(project_name=self.project) try: test_runs = self.send_get('get_runs/%s' % (project_id)) - #print("------------TEST RUNS----------") - #pprint(test_runs) + # print("------------TEST RUNS----------") + # pprint(test_runs) except Exception: print @@ -153,23 +144,18 @@ class TestRail_Client: for test_run in test_runs: if test_run['name'] == test_run_name: run_id = test_run['id'] - #print("run Id in Test Runs=",run_id) + # print("run Id in Test Runs=",run_id) break return run_id - def update_testrail(self, case_id, run_id, status_id, msg): "Update TestRail for a given run_id and case_id" - - if not self.use_testrails: - return False - update_flag = False # Get the TestRail client account details # Update the result in TestRail using send_post function. # Parameters for add_result_for_case is the combination of runid and case id. # status_id is 1 for Passed, 2 For Blocked, 4 for Retest and 5 for Failed - #status_id = 1 if result_flag is True else 5 + # status_id = 1 if result_flag is True else 5 print("result status Pass/Fail = ", status_id) print("case id=", case_id) @@ -179,7 +165,7 @@ class TestRail_Client: result = self.send_post( 'add_result_for_case/%s/%s' % (run_id, case_id), {'status_id': status_id, 'comment': msg}) - print("result in post",result) + print("result in post", result) except Exception: print 'Exception in update_testrail() updating TestRail.' @@ -193,8 +179,16 @@ class TestRail_Client: def create_testrun(self, name, case_ids, project_id, milestone_id, description): result = self.send_post( 'add_run/%s' % (project_id), - {'name': name, 'case_ids': case_ids, 'milestone_id': milestone_id, 'description': description, 'include_all': False}) + {'name': name, 'case_ids': case_ids, 'milestone_id': milestone_id, 'description': description, + 'include_all': False}) print("result in post", result) + def update_testrun(self, runid, description): + result = self.send_post( + 'update_run/%s' % (runid), + {'description': description}) + print("result in post", result) + + class APIError(Exception): pass diff --git a/testbeds/README_OPENWRT.txt b/testbeds/README_OPENWRT.txt deleted file mode 100644 index 98443bbe6..000000000 --- a/testbeds/README_OPENWRT.txt +++ /dev/null @@ -1,23 +0,0 @@ -This automation assumes that the AP is configured as pass-through AP, not -router: - -# Until cloud-sdk is integrated, stop opensync so we can do local config -service opensync stop -service opensync disable - -# Configure /etc/config/network to bridge eth ports and wifi devices. - -# Disable DHCP -/etc/init.d/dnsmasq disable -/etc/init.d/dnsmasq stop - -# Disable DHCP v6 -/etc/init.d/odhcpd disable -/etc/init.d/odhcpd stop - -# Disable firewall ??? -/etc/init.d/firewall disable -/etc/init.d/firewall stop - -/etc/init.d/network reload - diff --git a/testbeds/ben-home-ecw5410/228_sta_scenario.txt b/testbeds/ben-home-ecw5410/228_sta_scenario.txt deleted file mode 100644 index 2414af434..000000000 --- a/testbeds/ben-home-ecw5410/228_sta_scenario.txt +++ /dev/null @@ -1,9 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 178 'DUT: ecw5410 Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 upstream-dhcp 1 'DUT: ecw5410 LAN' NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: uplink LAN 192.168.3.5/24' NA eth3,eth2 -1 -dut uplink 323 37 -dut ecw5410 459 125 -resource 1.1 244 252 - - diff --git a/testbeds/ben-home-ecw5410/AP-Auto-ap-auto-228.txt b/testbeds/ben-home-ecw5410/AP-Auto-ap-auto-228.txt deleted file mode 100644 index 16efb8c87..000000000 --- a/testbeds/ben-home-ecw5410/AP-Auto-ap-auto-228.txt +++ /dev/null @@ -1,100 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -show_events: 1 -show_log: 0 -port_sorting: 0 -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5-0: ecw5410 OpenWrt-ecw-5 -dut2-0: ecw5410 OpenWrt-ecw-2 -dut5-1: NA -dut2-1: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.1 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 100000 -reset_stall_thresh_udp_ul: 100000 -reset_stall_thresh_tcp_dl: 100000 -reset_stall_thresh_tcp_ul: 100000 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 500000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 500000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 178 -max_stations_5: 64 -max_stations_dual: 242 -lt_sta: 2 -voip_calls: 20 -lt_dur: 3600 -reset_dur: 3600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio5-0: 1.1.3 wiphy1 -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 60Mbps -pf_text1: 2.4 DL 512 90Mbps -pf_text2: 2.4 DL 1024 110Mbps -pf_text3: 2.4 DL MTU 112Mbps -pf_text4: -pf_text5: 2.4 UL 200 60Mbps -pf_text6: 2.4 UL 512 90Mbps -pf_text7: 2.4 UL 1024 110Mbps -pf_text8: 2.4 UL MTU 112Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 520Mbps -pf_text14: -pf_text15: 5 UL 200 85Mbps -pf_text16: 5 UL 512 220Mbps -pf_text17: 5 UL 1024 430Mbps -pf_text18: 5 UL MTU 600Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/ben-home-ecw5410/NOTES.txt b/testbeds/ben-home-ecw5410/NOTES.txt deleted file mode 100644 index a6630fdfb..000000000 --- a/testbeds/ben-home-ecw5410/NOTES.txt +++ /dev/null @@ -1,10 +0,0 @@ - -DUT is an ECW5410 running TIP OpenWrt. -This uses ath10k-ct firmware, and by default, the ath10k driver only supports 32 stations per -radio. To improve this, I tweaked the setup using the fwcfg files. -The radios also only work on certain frequencies, so one has to configure them -carefully. - -See the OpenWrt-overlay directory for files that should be copied onto the DUT -to work with this test. Once OpenSync cloud stuff is complete, the overlay may -not be needed. diff --git a/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/network b/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/network deleted file mode 100644 index a75f02db1..000000000 --- a/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/network +++ /dev/null @@ -1,33 +0,0 @@ -config interface 'loopback' - option ifname 'lo' - option proto 'static' - option ipaddr '127.0.0.1' - option netmask '255.0.0.0' - -config globals 'globals' - option ula_prefix 'fd05:d9f9:75c8::/48' - -config interface 'lan' - option type 'bridge' - option ifname 'eth1 eth0' - option proto 'dhcp' -# option ipaddr '192.168.1.1' -# option netmask '255.255.255.0' -# option ip6assign '60' - -config device 'lan_eth1_dev' - option name 'eth1' - option macaddr '3c:2c:99:f4:51:73' - -#config interface 'wan' -# option ifname 'eth0' -# option proto 'dhcp' - -config device 'wan_eth0_dev' - option name 'eth0' - option macaddr '3c:2c:99:f4:51:72' - -config interface 'wan6' - option ifname 'eth0' - option proto 'dhcpv6' - diff --git a/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/wireless b/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 47e16a451..000000000 --- a/testbeds/ben-home-ecw5410/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,30 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'OpenWrt-ecw-5' - option encryption 'none' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0' - option htmode 'HT20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'OpenWrt-ecw-2' - option encryption 'none' - diff --git a/testbeds/ben-home-ecw5410/dpt-pkt-sz.txt b/testbeds/ben-home-ecw5410/dpt-pkt-sz.txt deleted file mode 100644 index c77880bfc..000000000 --- a/testbeds/ben-home-ecw5410/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -show_events: 1 -show_log: 0 -port_sorting: 0 -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ecw5410 -duration: 15000 -traffic_port: 1.1.6 sta00000 -upstream_port: 1.1.1 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 0 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/ben-home-ecw5410/ecw-env.txt b/testbeds/ben-home-ecw5410/ecw-env.txt deleted file mode 100644 index 2f5b6921b..000000000 --- a/testbeds/ben-home-ecw5410/ecw-env.txt +++ /dev/null @@ -1,51 +0,0 @@ -# Seems ECW can lose its environment sometimes, here is a proper environment: -# For whatever reason, I can only paste about two lines at a time...more and sometimes -# the bootloader seems to silently crash. - -setenv active '1' -setenv altbootcmd 'if test $changed = 0; then run do_change; else run do_recovery; fi' -setenv args_common 'root=mtd:ubi_rootfs rootfstype=squashfs' -setenv boot1 'echo Booting from partition: ${partname}' -setenv boot2 'nand device 1 && set mtdids nand0=nand0' -setenv boot3 'set mtdparts mtdparts=nand0:0x4000000@0x0(fs1),0x4000000@0x4000000(fs2)' -setenv boot4 'ubi part fs${partname} && ubi read 44000000 kernel' -setenv boot5 'cfgsel 44000000 && run bootfdtcmd' -setenv bootargs 'console=ttyHSL1,115200n8' -setenv bootcmd 'run setup && run bootlinux' -setenv bootdelay '2' -setenv bootlimit '3' -setenv bootlinux 'run boot1 boot2 boot3 boot4 boot5|| reset' -setenv change1 'if test $active = 1; then setenv active 2; else setenv active 1; fi' -setenv change2 'setenv bootcount; setenv changed 1; saveenv' -setenv change3 'echo Active partition changed to [$active]' -setenv do_change 'run change1 change2 change3; reset' -setenv do_lub 'run lub1 lub2 lub3' -setenv do_recovery 'run rec1 rec2 rec3 rec4 rec5 rec6 rec7 rec8; reset' -setenv eth1addr '3c:2c:99:f4:51:63' -setenv ethact 'eth0' -setenv ethaddr '3c:2c:99:f4:51:62' -setenv lub1 'tftpboot ${tftp_loadaddr} ${ub_file}' -setenv lub2 'sf probe && sf erase 0x100000 0x70000' -setenv lub3 'sf write ${tftp_loadaddr} 0x100000 ${filesize}' -setenv machid '136b' -setenv rec1 'echo Doing firmware recovery!' -setenv rec2 'setenv active 1 && setenv changed 0 && setenv bootcount 0' -setenv rec3 'saveenv' -setenv rec4 'sleep 2 && tftpboot ${tftp_loadaddr} ${recovery_file}' -setenv rec5 'imxtract ${tftp_loadaddr} ubi' -setenv rec6 'nand device 1 && nand erase.chip' -setenv rec7 'nand write ${fileaddr} 0x0 ${filesize}' -setenv rec8 'nand write ${fileaddr} 0x4000000 ${filesize}' -setenv recovery_file 'fwupdate.bin' -setenv setup 'if test $active = 1; then run setup1; else run setup2; fi' -setenv setup1 'partname=1 && setenv bootargs ubi.mtd=rootfs${partname} ${args_common}' -setenv setup2 'partname=2 && setenv bootargs ubi.mtd=rootfs${partname} ${args_common}' -setenv stderr 'serial' -setenv stdin 'serial' -setenv stdout 'serial' -setenv tftp_loadaddr '0x42000000' -setenv ub_file 'openwrt-ipq806x-u-boot.mbn' -setenv upgrade_available '1' -setenv bootcount '0' -saveenv -setenv baudrate '115200' diff --git a/testbeds/ben-home-ecw5410/run_basic.bash b/testbeds/ben-home-ecw5410/run_basic.bash deleted file mode 100755 index 830bb01b4..000000000 --- a/testbeds/ben-home-ecw5410/run_basic.bash +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ben-basic-ecw5410-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ben-home-ecw5410/run_basic_fast.bash b/testbeds/ben-home-ecw5410/run_basic_fast.bash deleted file mode 100755 index 7d15affb3..000000000 --- a/testbeds/ben-home-ecw5410/run_basic_fast.bash +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi - -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ben-basic-ecw5410-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=0 ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ben-home-ecw5410/test_bed_cfg.bash b/testbeds/ben-home-ecw5410/test_bed_cfg.bash deleted file mode 100644 index d18799810..000000000 --- a/testbeds/ben-home-ecw5410/test_bed_cfg.bash +++ /dev/null @@ -1,55 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyUSB3} -LF_SERIAL=${LF_SERIAL:-/dev/ttyS4} -LFPASSWD=${LFPASSWD:-r} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/AP-Auto-ap-auto-228.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/WCT-228sta.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/228_sta_scenario.txt} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-192.168.3.188} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-192.168.3.188} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-Ben-Home-ECW5410-OTA} - -# DUT configuration -#DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-Stock} -DUT_HW_VER=ECW5410 -DUT_MODEL=ECW5410 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-OpenWrt-ecw-2} -DUT_SSID2=${DUT_SSID2:-OpenWrt-ecw-5} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -DUT_BSSID1=3c:2c:99:f4:51:74 -DUT_BSSID2=3c:2c:99:f4:51:75 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - diff --git a/testbeds/ben-home-ecw5410/testbed_notes.html b/testbeds/ben-home-ecw5410/testbed_notes.html deleted file mode 100644 index 08a540844..000000000 --- a/testbeds/ben-home-ecw5410/testbed_notes.html +++ /dev/null @@ -1,8 +0,0 @@ - -

-This test-bed consists of a CT522 LANforge test system, with one ath9k a/b/g/n 3x3s and one wave-2 -4x4 5Ghz radio. It is connected over-the-air in a home office to the DUT, which is placed about 3 -feet away. The DUT is a Linksys ECW5410 (dual 4x4 wave-2 9984 chipset). -Local inteferers include an a/b/g/n AP serving the home. In general, there is not much wifi -traffic. -

diff --git a/testbeds/ben-home/228_sta_scenario.txt b/testbeds/ben-home/228_sta_scenario.txt deleted file mode 100644 index b597205d8..000000000 --- a/testbeds/ben-home/228_sta_scenario.txt +++ /dev/null @@ -1,10 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: mr8300 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 100 'DUT: mr8300 Radio-1' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: mr8300 Radio-3' NA wiphy2,AUTO -1 -profile_link 1.1 upstream-dhcp 1 'DUT: mr8300 LAN' NA eth0,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: uplink LAN 192.168.3.5/24' NA eth1,eth0 -1 -dut uplink 323 37 -dut mr8300 459 125 -resource 1.1 244 252 - - diff --git a/testbeds/ben-home/AP-Auto-ap-auto-228.txt b/testbeds/ben-home/AP-Auto-ap-auto-228.txt deleted file mode 100644 index d9bdc3b57..000000000 --- a/testbeds/ben-home/AP-Auto-ap-auto-228.txt +++ /dev/null @@ -1,101 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth0 -show_events: 1 -show_log: 0 -port_sorting: 0 -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5-0: mr8300 OpenWrt-5hi -dut2-0: mr8300 OpenWrt-2 -dut5-1: NA -dut2-1: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.1 eth0 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 100000 -reset_stall_thresh_udp_ul: 100000 -reset_stall_thresh_tcp_dl: 100000 -reset_stall_thresh_tcp_ul: 100000 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 500000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 500000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 100 -max_stations_5: 128 -max_stations_dual: 228 -lt_sta: 2 -voip_calls: 20 -lt_dur: 3600 -reset_dur: 3600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy1 -radio5-0: 1.1.3 wiphy0 -radio5-1: 1.1.5 wiphy2 -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 60Mbps -pf_text1: 2.4 DL 512 90Mbps -pf_text2: 2.4 DL 1024 110Mbps -pf_text3: 2.4 DL MTU 112Mbps -pf_text4: -pf_text5: 2.4 UL 200 60Mbps -pf_text6: 2.4 UL 512 90Mbps -pf_text7: 2.4 UL 1024 110Mbps -pf_text8: 2.4 UL MTU 112Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 520Mbps -pf_text14: -pf_text15: 5 UL 200 85Mbps -pf_text16: 5 UL 512 220Mbps -pf_text17: 5 UL 1024 430Mbps -pf_text18: 5 UL MTU 600Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/ben-home/NOTES.txt b/testbeds/ben-home/NOTES.txt deleted file mode 100644 index d6bfa3a86..000000000 --- a/testbeds/ben-home/NOTES.txt +++ /dev/null @@ -1,10 +0,0 @@ - -DUT is an MR8300, running TIP OpenWrt. -This uses ath10k-ct firmware, and by default, the ath10k driver only supports 32 stations per -radio. To improve this, I tweaked the setup using the fwcfg files. -The radios also only work on certain frequencies, so one has to configure them -carefully. - -See the OpenWrt-overlay directory for files that should be copied onto the DUT -to work with this test. Once OpenSync cloud stuff is complete, the overlay may -not be needed. diff --git a/testbeds/ben-home/OpenWrt-overlay/etc/config/wireless b/testbeds/ben-home/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index b62635086..000000000 --- a/testbeds/ben-home/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,46 +0,0 @@ - -config wifi-device 'radio0' - option type 'mac80211' - option hwmode '11a' - option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0' - option htmode 'VHT80' - option disabled '0' - option channel '149' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option encryption 'none' - option ssid 'OpenWrt-MR8300' - -config wifi-device 'radio1' - option type 'mac80211' - option hwmode '11g' - option path 'platform/soc/a000000.wifi' - option htmode 'HT20' - option disabled '0' - option channel '1' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option encryption 'none' - option ssid 'OpenWrt-MR8300' - -config wifi-device 'radio2' - option type 'mac80211' - option hwmode '11a' - option path 'platform/soc/a800000.wifi' - option htmode 'VHT80' - option disabled '0' - option channel '36' - -config wifi-iface 'default_radio2' - option device 'radio2' - option network 'lan' - option mode 'ap' - option encryption 'none' - option ssid 'OpenWrt-MR8300' - diff --git a/testbeds/ben-home/WCT-228sta.txt b/testbeds/ben-home/WCT-228sta.txt deleted file mode 100644 index 761bf73e3..000000000 --- a/testbeds/ben-home/WCT-228sta.txt +++ /dev/null @@ -1,290 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth0 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta00001 -sel_port-3: 1.1.sta00002 -sel_port-4: 1.1.sta00003 -sel_port-5: 1.1.sta00004 -sel_port-6: 1.1.sta00005 -sel_port-7: 1.1.sta00006 -sel_port-8: 1.1.sta00007 -sel_port-9: 1.1.sta00008 -sel_port-10: 1.1.sta00009 -sel_port-11: 1.1.sta00010 -sel_port-12: 1.1.sta00011 -sel_port-13: 1.1.sta00012 -sel_port-14: 1.1.sta00013 -sel_port-15: 1.1.sta00014 -sel_port-16: 1.1.sta00015 -sel_port-17: 1.1.sta00016 -sel_port-18: 1.1.sta00017 -sel_port-19: 1.1.sta00018 -sel_port-20: 1.1.sta00019 -sel_port-21: 1.1.sta00020 -sel_port-22: 1.1.sta00021 -sel_port-23: 1.1.sta00022 -sel_port-24: 1.1.sta00023 -sel_port-25: 1.1.sta00024 -sel_port-26: 1.1.sta00025 -sel_port-27: 1.1.sta00026 -sel_port-28: 1.1.sta00027 -sel_port-29: 1.1.sta00028 -sel_port-30: 1.1.sta00029 -sel_port-31: 1.1.sta00030 -sel_port-32: 1.1.sta00031 -sel_port-33: 1.1.sta00032 -sel_port-34: 1.1.sta00033 -sel_port-35: 1.1.sta00034 -sel_port-36: 1.1.sta00035 -sel_port-37: 1.1.sta00036 -sel_port-38: 1.1.sta00037 -sel_port-39: 1.1.sta00038 -sel_port-40: 1.1.sta00039 -sel_port-41: 1.1.sta00040 -sel_port-42: 1.1.sta00041 -sel_port-43: 1.1.sta00042 -sel_port-44: 1.1.sta00043 -sel_port-45: 1.1.sta00044 -sel_port-46: 1.1.sta00045 -sel_port-47: 1.1.sta00046 -sel_port-48: 1.1.sta00047 -sel_port-49: 1.1.sta00048 -sel_port-50: 1.1.sta00049 -sel_port-51: 1.1.sta00050 -sel_port-52: 1.1.sta00051 -sel_port-53: 1.1.sta00052 -sel_port-54: 1.1.sta00053 -sel_port-55: 1.1.sta00054 -sel_port-56: 1.1.sta00055 -sel_port-57: 1.1.sta00056 -sel_port-58: 1.1.sta00057 -sel_port-59: 1.1.sta00058 -sel_port-60: 1.1.sta00059 -sel_port-61: 1.1.sta00060 -sel_port-62: 1.1.sta00061 -sel_port-63: 1.1.sta00062 -sel_port-64: 1.1.sta00063 -sel_port-65: 1.1.sta00500 -sel_port-66: 1.1.sta00501 -sel_port-67: 1.1.sta00502 -sel_port-68: 1.1.sta00503 -sel_port-69: 1.1.sta00504 -sel_port-70: 1.1.sta00505 -sel_port-71: 1.1.sta00506 -sel_port-72: 1.1.sta00507 -sel_port-73: 1.1.sta00508 -sel_port-74: 1.1.sta00509 -sel_port-75: 1.1.sta00510 -sel_port-76: 1.1.sta00511 -sel_port-77: 1.1.sta00512 -sel_port-78: 1.1.sta00513 -sel_port-79: 1.1.sta00514 -sel_port-80: 1.1.sta00515 -sel_port-81: 1.1.sta00516 -sel_port-82: 1.1.sta00517 -sel_port-83: 1.1.sta00518 -sel_port-84: 1.1.sta00519 -sel_port-85: 1.1.sta00520 -sel_port-86: 1.1.sta00521 -sel_port-87: 1.1.sta00522 -sel_port-88: 1.1.sta00523 -sel_port-89: 1.1.sta00524 -sel_port-90: 1.1.sta00525 -sel_port-91: 1.1.sta00526 -sel_port-92: 1.1.sta00527 -sel_port-93: 1.1.sta00528 -sel_port-94: 1.1.sta00529 -sel_port-95: 1.1.sta00530 -sel_port-96: 1.1.sta00531 -sel_port-97: 1.1.sta00532 -sel_port-98: 1.1.sta00533 -sel_port-99: 1.1.sta00534 -sel_port-100: 1.1.sta00535 -sel_port-101: 1.1.sta00536 -sel_port-102: 1.1.sta00537 -sel_port-103: 1.1.sta00538 -sel_port-104: 1.1.sta00539 -sel_port-105: 1.1.sta00540 -sel_port-106: 1.1.sta00541 -sel_port-107: 1.1.sta00542 -sel_port-108: 1.1.sta00543 -sel_port-109: 1.1.sta00544 -sel_port-110: 1.1.sta00545 -sel_port-111: 1.1.sta00546 -sel_port-112: 1.1.sta00547 -sel_port-113: 1.1.sta00548 -sel_port-114: 1.1.sta00549 -sel_port-115: 1.1.sta00550 -sel_port-116: 1.1.sta00551 -sel_port-117: 1.1.sta00552 -sel_port-118: 1.1.sta00553 -sel_port-119: 1.1.sta00554 -sel_port-120: 1.1.sta00555 -sel_port-121: 1.1.sta00556 -sel_port-122: 1.1.sta00557 -sel_port-123: 1.1.sta00558 -sel_port-124: 1.1.sta00559 -sel_port-125: 1.1.sta00560 -sel_port-126: 1.1.sta00561 -sel_port-127: 1.1.sta00562 -sel_port-128: 1.1.sta00563 -sel_port-129: 1.1.sta00564 -sel_port-130: 1.1.sta00565 -sel_port-131: 1.1.sta00566 -sel_port-132: 1.1.sta00567 -sel_port-133: 1.1.sta00568 -sel_port-134: 1.1.sta00569 -sel_port-135: 1.1.sta00570 -sel_port-136: 1.1.sta00571 -sel_port-137: 1.1.sta00572 -sel_port-138: 1.1.sta00573 -sel_port-139: 1.1.sta00574 -sel_port-140: 1.1.sta00575 -sel_port-141: 1.1.sta00576 -sel_port-142: 1.1.sta00577 -sel_port-143: 1.1.sta00578 -sel_port-144: 1.1.sta00579 -sel_port-145: 1.1.sta00580 -sel_port-146: 1.1.sta00581 -sel_port-147: 1.1.sta00582 -sel_port-148: 1.1.sta00583 -sel_port-149: 1.1.sta00584 -sel_port-150: 1.1.sta00585 -sel_port-151: 1.1.sta00586 -sel_port-152: 1.1.sta00587 -sel_port-153: 1.1.sta00588 -sel_port-154: 1.1.sta00589 -sel_port-155: 1.1.sta00590 -sel_port-156: 1.1.sta00591 -sel_port-157: 1.1.sta00592 -sel_port-158: 1.1.sta00593 -sel_port-159: 1.1.sta00594 -sel_port-160: 1.1.sta00595 -sel_port-161: 1.1.sta00596 -sel_port-162: 1.1.sta00597 -sel_port-163: 1.1.sta00598 -sel_port-164: 1.1.sta00599 -sel_port-165: 1.1.sta01000 -sel_port-166: 1.1.sta01001 -sel_port-167: 1.1.sta01002 -sel_port-168: 1.1.sta01003 -sel_port-169: 1.1.sta01004 -sel_port-170: 1.1.sta01005 -sel_port-171: 1.1.sta01006 -sel_port-172: 1.1.sta01007 -sel_port-173: 1.1.sta01008 -sel_port-174: 1.1.sta01009 -sel_port-175: 1.1.sta01010 -sel_port-176: 1.1.sta01011 -sel_port-177: 1.1.sta01012 -sel_port-178: 1.1.sta01013 -sel_port-179: 1.1.sta01014 -sel_port-180: 1.1.sta01015 -sel_port-181: 1.1.sta01016 -sel_port-182: 1.1.sta01017 -sel_port-183: 1.1.sta01018 -sel_port-184: 1.1.sta01019 -sel_port-185: 1.1.sta01020 -sel_port-186: 1.1.sta01021 -sel_port-187: 1.1.sta01022 -sel_port-188: 1.1.sta01023 -sel_port-189: 1.1.sta01024 -sel_port-190: 1.1.sta01025 -sel_port-191: 1.1.sta01026 -sel_port-192: 1.1.sta01027 -sel_port-193: 1.1.sta01028 -sel_port-194: 1.1.sta01029 -sel_port-195: 1.1.sta01030 -sel_port-196: 1.1.sta01031 -sel_port-197: 1.1.sta01032 -sel_port-198: 1.1.sta01033 -sel_port-199: 1.1.sta01034 -sel_port-200: 1.1.sta01035 -sel_port-201: 1.1.sta01036 -sel_port-202: 1.1.sta01037 -sel_port-203: 1.1.sta01038 -sel_port-204: 1.1.sta01039 -sel_port-205: 1.1.sta01040 -sel_port-206: 1.1.sta01041 -sel_port-207: 1.1.sta01042 -sel_port-208: 1.1.sta01043 -sel_port-209: 1.1.sta01044 -sel_port-210: 1.1.sta01045 -sel_port-211: 1.1.sta01046 -sel_port-212: 1.1.sta01047 -sel_port-213: 1.1.sta01048 -sel_port-214: 1.1.sta01049 -sel_port-215: 1.1.sta01050 -sel_port-216: 1.1.sta01051 -sel_port-217: 1.1.sta01052 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta01054 -sel_port-220: 1.1.sta01055 -sel_port-221: 1.1.sta01056 -sel_port-222: 1.1.sta01057 -sel_port-223: 1.1.sta01058 -sel_port-224: 1.1.sta01059 -sel_port-225: 1.1.sta01060 -sel_port-226: 1.1.sta01061 -sel_port-227: 1.1.sta01062 -sel_port-228: 1.1.sta01063 -show_events: 1 -show_log: 0 -port_sorting: 0 -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,2,5,10,20,45,60,100 -loop_iter: 1 -duration: 60000 -test_groups: 0 -test_groups_subset: 0 -protocol: UDP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 0 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/ben-home/dpt-pkt-sz.txt b/testbeds/ben-home/dpt-pkt-sz.txt deleted file mode 100644 index c28ef6766..000000000 --- a/testbeds/ben-home/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth0 -show_events: 1 -show_log: 0 -port_sorting: 0 -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: mr8300 -duration: 15000 -traffic_port: 1.1.6 sta00000 -upstream_port: 1.1.1 eth0 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 0 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/ben-home/run_basic.bash b/testbeds/ben-home/run_basic.bash deleted file mode 100755 index 66dfa2577..000000000 --- a/testbeds/ben-home/run_basic.bash +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.

" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ben-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ben-home/run_basic_fast.bash b/testbeds/ben-home/run_basic_fast.bash deleted file mode 100755 index 4cb2f9f66..000000000 --- a/testbeds/ben-home/run_basic_fast.bash +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi - -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ben-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=0 ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ben-home/test_bed_cfg.bash b/testbeds/ben-home/test_bed_cfg.bash deleted file mode 100644 index aa4c2d21d..000000000 --- a/testbeds/ben-home/test_bed_cfg.bash +++ /dev/null @@ -1,58 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyUSB1} -LF_SERIAL=${LF_SERIAL:-/dev/ttyS5} -LFPASSWD=${LFPASSWD:-r} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/AP-Auto-ap-auto-228.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/WCT-228sta.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/228_sta_scenario.txt} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-192.168.3.190} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-192.168.3.190} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-Ben-Home-OTA} - -# DUT configuration -#DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-Stock} -DUT_HW_VER=Linksys-MR8300 -DUT_MODEL=Linksys-MR8300 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-OpenWrt-2} -DUT_SSID2=${DUT_SSID2:-OpenWrt-5lo} -DUT_SSID3=${DUT_SSID3:-OpenWrt-5hi} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -DUT_PASSWD3=${DUT_PASSWD3:-12345678} -DUT_BSSID1=32:23:03:81:9c:29 -DUT_BSSID2=30:23:03:81:9c:27 -DUT_BSSID3=30:23:03:81:9c:28 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - diff --git a/testbeds/ferndale-basic-01/NOTES.txt b/testbeds/ferndale-basic-01/NOTES.txt deleted file mode 100644 index d6bfa3a86..000000000 --- a/testbeds/ferndale-basic-01/NOTES.txt +++ /dev/null @@ -1,10 +0,0 @@ - -DUT is an MR8300, running TIP OpenWrt. -This uses ath10k-ct firmware, and by default, the ath10k driver only supports 32 stations per -radio. To improve this, I tweaked the setup using the fwcfg files. -The radios also only work on certain frequencies, so one has to configure them -carefully. - -See the OpenWrt-overlay directory for files that should be copied onto the DUT -to work with this test. Once OpenSync cloud stuff is complete, the overlay may -not be needed. diff --git a/testbeds/ferndale-basic-01/OpenWrt-overlay/etc/config/wireless b/testbeds/ferndale-basic-01/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 49398647e..000000000 --- a/testbeds/ferndale-basic-01/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,57 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option hwmode '11a' - option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0' - option htmode 'VHT80' - option disabled '0' - option channel '149' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option disabled '0' - option ssid 'Default-SSID-5gu' - option hidden '0' - option key '12345678' - option encryption 'psk-mixed' - option isolate '1' - -config wifi-device 'radio1' - option type 'mac80211' - option hwmode '11g' - option path 'platform/soc/a000000.wifi' - option htmode 'HT20' - option disabled '0' - option channel '6' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option disabled '0' - option ssid 'Default-SSID-2g' - option hidden '0' - option key '12345678' - option encryption 'psk-mixed' - option isolate '1' - -config wifi-device 'radio2' - option type 'mac80211' - option hwmode '11a' - option path 'platform/soc/a800000.wifi' - option htmode 'VHT80' - option disabled '0' - option channel '36' - -config wifi-iface 'default_radio2' - option device 'radio2' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option key '12345678' - option encryption 'psk-mixed' - option isolate '1' - option hidden '0' - option disabled '0' - diff --git a/testbeds/ferndale-basic-01/ap-auto.txt b/testbeds/ferndale-basic-01/ap-auto.txt deleted file mode 100644 index f9c101e67..000000000 --- a/testbeds/ferndale-basic-01/ap-auto.txt +++ /dev/null @@ -1,110 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: ea8300 Default-SSID-5gu -dut5-0: ea8300 Default-SSID-5gl -dut2-0: ea8300 Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 128 -max_stations_5: 128 -max_stations_dual: 256 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.6 wiphy2 -radio5-0: 1.1.5 wiphy1 -radio5-1: 1.1.7 wiphy3 -radio5-2: 1.1.8 wiphy4 -radio5-3: 1.1.9 wiphy5 -radio5-4: 1.1.10 wiphy6 -radio5-5: 1.1.11 wiphy7 -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/ferndale-basic-01/dpt-pkt-sz.txt b/testbeds/ferndale-basic-01/dpt-pkt-sz.txt deleted file mode 100644 index b51685d6a..000000000 --- a/testbeds/ferndale-basic-01/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ea8300 -duration: 15000 -traffic_port: 1.1.136 sta01001 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/ferndale-basic-01/run_basic.bash b/testbeds/ferndale-basic-01/run_basic.bash deleted file mode 100755 index f95e5c7c7..000000000 --- a/testbeds/ferndale-basic-01/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ferndale-01-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ferndale-basic-01/run_basic_fast.bash b/testbeds/ferndale-basic-01/run_basic_fast.bash deleted file mode 100755 index 72b8cc7af..000000000 --- a/testbeds/ferndale-basic-01/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/ferndale-01-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/ferndale-basic-01/scenario.txt b/testbeds/ferndale-basic-01/scenario.txt deleted file mode 100644 index 78da790a3..000000000 --- a/testbeds/ferndale-basic-01/scenario.txt +++ /dev/null @@ -1,15 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ea8300 Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ea8300 Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ea8300 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ea8300 Radio-3' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 92.168.100.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-2' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-3' NA wiphy5,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-2' NA wiphy6,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-3' NA wiphy7,AUTO -1 -dut ea8300 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/ferndale-basic-01/scenario_small.txt b/testbeds/ferndale-basic-01/scenario_small.txt deleted file mode 100644 index 29e92c5ac..000000000 --- a/testbeds/ferndale-basic-01/scenario_small.txt +++ /dev/null @@ -1,15 +0,0 @@ -profile_link 1.1 STA-AC 8 'DUT: ea8300 Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 8 'DUT: ea8300 Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 8 'DUT: ea8300 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 8 'DUT: ea8300 Radio-3' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 92.168.100.1/24' NA eth3,eth2 -1 -#profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-2' NA wiphy4,AUTO -1 -#profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-3' NA wiphy5,AUTO -1 -#profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-2' NA wiphy6,AUTO -1 -#profile_link 1.1 STA-AC 1 'DUT: ea8300 Radio-3' NA wiphy7,AUTO -1 -dut ea8300 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/ferndale-basic-01/test_bed_cfg.bash b/testbeds/ferndale-basic-01/test_bed_cfg.bash deleted file mode 100644 index 4c3270d01..000000000 --- a/testbeds/ferndale-basic-01/test_bed_cfg.bash +++ /dev/null @@ -1,61 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyUSB0} -LF_SERIAL=${LF_SERIAL:-/dev/ttyUSB1} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-192.168.100.209} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-192.168.100.209} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-Ferndale-01-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-Stock} -DUT_HW_VER=Linksys-EA8300 -DUT_MODEL=Linksys-EA8300 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_SSID3=${DUT_SSID3:-Default-SSID-5gu} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -DUT_PASSWD3=${DUT_PASSWD3:-12345678} -DUT_BSSID1=24:f5:a2:08:21:6c -DUT_BSSID2=24:f5:a2:08:21:6d -DUT_BSSID3=26:f5:a2:08:21:6e - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/ferndale-basic-01/wct.txt b/testbeds/ferndale-basic-01/wct.txt deleted file mode 100644 index 3c7910719..000000000 --- a/testbeds/ferndale-basic-01/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta01000 -sel_port-3: 1.1.sta00500 -sel_port-4: 1.1.sta01500 -sel_port-5: 1.1.sta03000 -sel_port-6: 1.1.sta03500 -sel_port-7: 1.1.sta04000 -sel_port-8: 1.1.sta04500 -sel_port-9: 1.1.sta00001 -sel_port-10: 1.1.sta01001 -sel_port-11: 1.1.sta00501 -sel_port-12: 1.1.sta01501 -sel_port-13: 1.1.sta00002 -sel_port-14: 1.1.sta01002 -sel_port-15: 1.1.sta00502 -sel_port-16: 1.1.sta01502 -sel_port-17: 1.1.sta00003 -sel_port-18: 1.1.sta01003 -sel_port-19: 1.1.sta00503 -sel_port-20: 1.1.sta01503 -sel_port-21: 1.1.sta00004 -sel_port-22: 1.1.sta01004 -sel_port-23: 1.1.sta00504 -sel_port-24: 1.1.sta01504 -sel_port-25: 1.1.sta00005 -sel_port-26: 1.1.sta01005 -sel_port-27: 1.1.sta00505 -sel_port-28: 1.1.sta01505 -sel_port-29: 1.1.sta00006 -sel_port-30: 1.1.sta01006 -sel_port-31: 1.1.sta00506 -sel_port-32: 1.1.sta01506 -sel_port-33: 1.1.sta00007 -sel_port-34: 1.1.sta01007 -sel_port-35: 1.1.sta00507 -sel_port-36: 1.1.sta01507 -sel_port-37: 1.1.sta00008 -sel_port-38: 1.1.sta01008 -sel_port-39: 1.1.sta00508 -sel_port-40: 1.1.sta01508 -sel_port-41: 1.1.sta00009 -sel_port-42: 1.1.sta01009 -sel_port-43: 1.1.sta00509 -sel_port-44: 1.1.sta01509 -sel_port-45: 1.1.sta00010 -sel_port-46: 1.1.sta01010 -sel_port-47: 1.1.sta00510 -sel_port-48: 1.1.sta01510 -sel_port-49: 1.1.sta00011 -sel_port-50: 1.1.sta01011 -sel_port-51: 1.1.sta00511 -sel_port-52: 1.1.sta01511 -sel_port-53: 1.1.sta00012 -sel_port-54: 1.1.sta01012 -sel_port-55: 1.1.sta00512 -sel_port-56: 1.1.sta01512 -sel_port-57: 1.1.sta00013 -sel_port-58: 1.1.sta01013 -sel_port-59: 1.1.sta00513 -sel_port-60: 1.1.sta01513 -sel_port-61: 1.1.sta00014 -sel_port-62: 1.1.sta01014 -sel_port-63: 1.1.sta00514 -sel_port-64: 1.1.sta01514 -sel_port-65: 1.1.sta00015 -sel_port-66: 1.1.sta01015 -sel_port-67: 1.1.sta00515 -sel_port-68: 1.1.sta01515 -sel_port-69: 1.1.sta00016 -sel_port-70: 1.1.sta01016 -sel_port-71: 1.1.sta00516 -sel_port-72: 1.1.sta01516 -sel_port-73: 1.1.sta00017 -sel_port-74: 1.1.sta01017 -sel_port-75: 1.1.sta00517 -sel_port-76: 1.1.sta01517 -sel_port-77: 1.1.sta00018 -sel_port-78: 1.1.sta01018 -sel_port-79: 1.1.sta00518 -sel_port-80: 1.1.sta01518 -sel_port-81: 1.1.sta00019 -sel_port-82: 1.1.sta01019 -sel_port-83: 1.1.sta00519 -sel_port-84: 1.1.sta01519 -sel_port-85: 1.1.sta00020 -sel_port-86: 1.1.sta01020 -sel_port-87: 1.1.sta00520 -sel_port-88: 1.1.sta01520 -sel_port-89: 1.1.sta00021 -sel_port-90: 1.1.sta01021 -sel_port-91: 1.1.sta00521 -sel_port-92: 1.1.sta01521 -sel_port-93: 1.1.sta00022 -sel_port-94: 1.1.sta01022 -sel_port-95: 1.1.sta00522 -sel_port-96: 1.1.sta01522 -sel_port-97: 1.1.sta00023 -sel_port-98: 1.1.sta01023 -sel_port-99: 1.1.sta00523 -sel_port-100: 1.1.sta01523 -sel_port-101: 1.1.sta00024 -sel_port-102: 1.1.sta01024 -sel_port-103: 1.1.sta00524 -sel_port-104: 1.1.sta01524 -sel_port-105: 1.1.sta00025 -sel_port-106: 1.1.sta01025 -sel_port-107: 1.1.sta00525 -sel_port-108: 1.1.sta01525 -sel_port-109: 1.1.sta00026 -sel_port-110: 1.1.sta01026 -sel_port-111: 1.1.sta00526 -sel_port-112: 1.1.sta01526 -sel_port-113: 1.1.sta00027 -sel_port-114: 1.1.sta01027 -sel_port-115: 1.1.sta00527 -sel_port-116: 1.1.sta01527 -sel_port-117: 1.1.sta00028 -sel_port-118: 1.1.sta01028 -sel_port-119: 1.1.sta00528 -sel_port-120: 1.1.sta01528 -sel_port-121: 1.1.sta00029 -sel_port-122: 1.1.sta01029 -sel_port-123: 1.1.sta00529 -sel_port-124: 1.1.sta01529 -sel_port-125: 1.1.sta00030 -sel_port-126: 1.1.sta01030 -sel_port-127: 1.1.sta00530 -sel_port-128: 1.1.sta01530 -sel_port-129: 1.1.sta00031 -sel_port-130: 1.1.sta01031 -sel_port-131: 1.1.sta00531 -sel_port-132: 1.1.sta01531 -sel_port-133: 1.1.sta00032 -sel_port-134: 1.1.sta01032 -sel_port-135: 1.1.sta00532 -sel_port-136: 1.1.sta01532 -sel_port-137: 1.1.sta00033 -sel_port-138: 1.1.sta01033 -sel_port-139: 1.1.sta00533 -sel_port-140: 1.1.sta01533 -sel_port-141: 1.1.sta00034 -sel_port-142: 1.1.sta01034 -sel_port-143: 1.1.sta00534 -sel_port-144: 1.1.sta01534 -sel_port-145: 1.1.sta00035 -sel_port-146: 1.1.sta01035 -sel_port-147: 1.1.sta00535 -sel_port-148: 1.1.sta01535 -sel_port-149: 1.1.sta00036 -sel_port-150: 1.1.sta01036 -sel_port-151: 1.1.sta00536 -sel_port-152: 1.1.sta01536 -sel_port-153: 1.1.sta00037 -sel_port-154: 1.1.sta01037 -sel_port-155: 1.1.sta00537 -sel_port-156: 1.1.sta01537 -sel_port-157: 1.1.sta00038 -sel_port-158: 1.1.sta01038 -sel_port-159: 1.1.sta00538 -sel_port-160: 1.1.sta01538 -sel_port-161: 1.1.sta00039 -sel_port-162: 1.1.sta01039 -sel_port-163: 1.1.sta00539 -sel_port-164: 1.1.sta01539 -sel_port-165: 1.1.sta00040 -sel_port-166: 1.1.sta01040 -sel_port-167: 1.1.sta00540 -sel_port-168: 1.1.sta01540 -sel_port-169: 1.1.sta00041 -sel_port-170: 1.1.sta01041 -sel_port-171: 1.1.sta00541 -sel_port-172: 1.1.sta01541 -sel_port-173: 1.1.sta00042 -sel_port-174: 1.1.sta01042 -sel_port-175: 1.1.sta00542 -sel_port-176: 1.1.sta01542 -sel_port-177: 1.1.sta00043 -sel_port-178: 1.1.sta01043 -sel_port-179: 1.1.sta00543 -sel_port-180: 1.1.sta01543 -sel_port-181: 1.1.sta00044 -sel_port-182: 1.1.sta01044 -sel_port-183: 1.1.sta00544 -sel_port-184: 1.1.sta01544 -sel_port-185: 1.1.sta00045 -sel_port-186: 1.1.sta01045 -sel_port-187: 1.1.sta00545 -sel_port-188: 1.1.sta01545 -sel_port-189: 1.1.sta00046 -sel_port-190: 1.1.sta01046 -sel_port-191: 1.1.sta00546 -sel_port-192: 1.1.sta01546 -sel_port-193: 1.1.sta00047 -sel_port-194: 1.1.sta01047 -sel_port-195: 1.1.sta00547 -sel_port-196: 1.1.sta01547 -sel_port-197: 1.1.sta00048 -sel_port-198: 1.1.sta01048 -sel_port-199: 1.1.sta00548 -sel_port-200: 1.1.sta01548 -sel_port-201: 1.1.sta00049 -sel_port-202: 1.1.sta01049 -sel_port-203: 1.1.sta00549 -sel_port-204: 1.1.sta01549 -sel_port-205: 1.1.sta00050 -sel_port-206: 1.1.sta01050 -sel_port-207: 1.1.sta00550 -sel_port-208: 1.1.sta01550 -sel_port-209: 1.1.sta00051 -sel_port-210: 1.1.sta01051 -sel_port-211: 1.1.sta00551 -sel_port-212: 1.1.sta01551 -sel_port-213: 1.1.sta00052 -sel_port-214: 1.1.sta01052 -sel_port-215: 1.1.sta00552 -sel_port-216: 1.1.sta01552 -sel_port-217: 1.1.sta00053 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta00553 -sel_port-220: 1.1.sta01553 -sel_port-221: 1.1.sta00054 -sel_port-222: 1.1.sta01054 -sel_port-223: 1.1.sta00554 -sel_port-224: 1.1.sta01554 -sel_port-225: 1.1.sta00055 -sel_port-226: 1.1.sta01055 -sel_port-227: 1.1.sta00555 -sel_port-228: 1.1.sta01555 -sel_port-229: 1.1.sta00056 -sel_port-230: 1.1.sta01056 -sel_port-231: 1.1.sta00556 -sel_port-232: 1.1.sta01556 -sel_port-233: 1.1.sta00057 -sel_port-234: 1.1.sta01057 -sel_port-235: 1.1.sta00557 -sel_port-236: 1.1.sta01557 -sel_port-237: 1.1.sta00058 -sel_port-238: 1.1.sta01058 -sel_port-239: 1.1.sta00558 -sel_port-240: 1.1.sta01558 -sel_port-241: 1.1.sta00059 -sel_port-242: 1.1.sta01059 -sel_port-243: 1.1.sta00559 -sel_port-244: 1.1.sta01559 -sel_port-245: 1.1.sta00060 -sel_port-246: 1.1.sta01060 -sel_port-247: 1.1.sta00560 -sel_port-248: 1.1.sta01560 -sel_port-249: 1.1.sta00061 -sel_port-250: 1.1.sta01061 -sel_port-251: 1.1.sta00561 -sel_port-252: 1.1.sta01561 -sel_port-253: 1.1.sta00062 -sel_port-254: 1.1.sta01062 -sel_port-255: 1.1.sta00562 -sel_port-256: 1.1.sta01562 -sel_port-257: 1.1.sta00063 -sel_port-258: 1.1.sta01063 -sel_port-259: 1.1.sta00563 -sel_port-260: 1.1.sta01563 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-01/NOTES.txt b/testbeds/nola-basic-01/NOTES.txt deleted file mode 100644 index 9dabae284..000000000 --- a/testbeds/nola-basic-01/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an Edge-Core 5410, running TIP OpenWrt. diff --git a/testbeds/nola-basic-01/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-01/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 20cf5293b..000000000 --- a/testbeds/nola-basic-01/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,32 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0' - option htmode 'HT20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - diff --git a/testbeds/nola-basic-01/ap-auto.txt b/testbeds/nola-basic-01/ap-auto.txt deleted file mode 100644 index 8ca4b220c..000000000 --- a/testbeds/nola-basic-01/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: ecw5410 Default-SSID-5gl -dut2-0: ecw5410 Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 66 -max_stations_5: 66 -max_stations_dual: 132 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.6 wiphy2 -radio2-2: 1.1.8 wiphy4 -radio5-0: 1.1.5 wiphy1 -radio5-1: 1.1.7 wiphy3 -radio5-2: 1.1.9 wiphy5 -radio5-3: -radio5-4: -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-01/dpt-pkt-sz.txt b/testbeds/nola-basic-01/dpt-pkt-sz.txt deleted file mode 100644 index 5044ebd36..000000000 --- a/testbeds/nola-basic-01/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ecw5410 -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-01/run_basic.bash b/testbeds/nola-basic-01/run_basic.bash deleted file mode 100755 index 6e2cec8b5..000000000 --- a/testbeds/nola-basic-01/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-01-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-01/run_basic_fast.bash b/testbeds/nola-basic-01/run_basic_fast.bash deleted file mode 100755 index 1031f296a..000000000 --- a/testbeds/nola-basic-01/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-01-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-01/scenario.txt b/testbeds/nola-basic-01/scenario.txt deleted file mode 100644 index 48d2275de..000000000 --- a/testbeds/nola-basic-01/scenario.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-01/scenario_small.txt b/testbeds/nola-basic-01/scenario_small.txt deleted file mode 100644 index 3fe509994..000000000 --- a/testbeds/nola-basic-01/scenario_small.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-01/test_bed_cfg.bash b/testbeds/nola-basic-01/test_bed_cfg.bash deleted file mode 100644 index 06870290d..000000000 --- a/testbeds/nola-basic-01/test_bed_cfg.bash +++ /dev/null @@ -1,60 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP1} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF1} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf1} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf1} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-01-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=Edgecore-ECW5410 -DUT_MODEL=Edgecore-ECW5410 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=3C:2C:99:F4:4E:78 -# 5Ghz radio -DUT_BSSID2=3C:2C:99:F4:4E:79 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-01/wct.txt b/testbeds/nola-basic-01/wct.txt deleted file mode 100644 index 3c7910719..000000000 --- a/testbeds/nola-basic-01/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta01000 -sel_port-3: 1.1.sta00500 -sel_port-4: 1.1.sta01500 -sel_port-5: 1.1.sta03000 -sel_port-6: 1.1.sta03500 -sel_port-7: 1.1.sta04000 -sel_port-8: 1.1.sta04500 -sel_port-9: 1.1.sta00001 -sel_port-10: 1.1.sta01001 -sel_port-11: 1.1.sta00501 -sel_port-12: 1.1.sta01501 -sel_port-13: 1.1.sta00002 -sel_port-14: 1.1.sta01002 -sel_port-15: 1.1.sta00502 -sel_port-16: 1.1.sta01502 -sel_port-17: 1.1.sta00003 -sel_port-18: 1.1.sta01003 -sel_port-19: 1.1.sta00503 -sel_port-20: 1.1.sta01503 -sel_port-21: 1.1.sta00004 -sel_port-22: 1.1.sta01004 -sel_port-23: 1.1.sta00504 -sel_port-24: 1.1.sta01504 -sel_port-25: 1.1.sta00005 -sel_port-26: 1.1.sta01005 -sel_port-27: 1.1.sta00505 -sel_port-28: 1.1.sta01505 -sel_port-29: 1.1.sta00006 -sel_port-30: 1.1.sta01006 -sel_port-31: 1.1.sta00506 -sel_port-32: 1.1.sta01506 -sel_port-33: 1.1.sta00007 -sel_port-34: 1.1.sta01007 -sel_port-35: 1.1.sta00507 -sel_port-36: 1.1.sta01507 -sel_port-37: 1.1.sta00008 -sel_port-38: 1.1.sta01008 -sel_port-39: 1.1.sta00508 -sel_port-40: 1.1.sta01508 -sel_port-41: 1.1.sta00009 -sel_port-42: 1.1.sta01009 -sel_port-43: 1.1.sta00509 -sel_port-44: 1.1.sta01509 -sel_port-45: 1.1.sta00010 -sel_port-46: 1.1.sta01010 -sel_port-47: 1.1.sta00510 -sel_port-48: 1.1.sta01510 -sel_port-49: 1.1.sta00011 -sel_port-50: 1.1.sta01011 -sel_port-51: 1.1.sta00511 -sel_port-52: 1.1.sta01511 -sel_port-53: 1.1.sta00012 -sel_port-54: 1.1.sta01012 -sel_port-55: 1.1.sta00512 -sel_port-56: 1.1.sta01512 -sel_port-57: 1.1.sta00013 -sel_port-58: 1.1.sta01013 -sel_port-59: 1.1.sta00513 -sel_port-60: 1.1.sta01513 -sel_port-61: 1.1.sta00014 -sel_port-62: 1.1.sta01014 -sel_port-63: 1.1.sta00514 -sel_port-64: 1.1.sta01514 -sel_port-65: 1.1.sta00015 -sel_port-66: 1.1.sta01015 -sel_port-67: 1.1.sta00515 -sel_port-68: 1.1.sta01515 -sel_port-69: 1.1.sta00016 -sel_port-70: 1.1.sta01016 -sel_port-71: 1.1.sta00516 -sel_port-72: 1.1.sta01516 -sel_port-73: 1.1.sta00017 -sel_port-74: 1.1.sta01017 -sel_port-75: 1.1.sta00517 -sel_port-76: 1.1.sta01517 -sel_port-77: 1.1.sta00018 -sel_port-78: 1.1.sta01018 -sel_port-79: 1.1.sta00518 -sel_port-80: 1.1.sta01518 -sel_port-81: 1.1.sta00019 -sel_port-82: 1.1.sta01019 -sel_port-83: 1.1.sta00519 -sel_port-84: 1.1.sta01519 -sel_port-85: 1.1.sta00020 -sel_port-86: 1.1.sta01020 -sel_port-87: 1.1.sta00520 -sel_port-88: 1.1.sta01520 -sel_port-89: 1.1.sta00021 -sel_port-90: 1.1.sta01021 -sel_port-91: 1.1.sta00521 -sel_port-92: 1.1.sta01521 -sel_port-93: 1.1.sta00022 -sel_port-94: 1.1.sta01022 -sel_port-95: 1.1.sta00522 -sel_port-96: 1.1.sta01522 -sel_port-97: 1.1.sta00023 -sel_port-98: 1.1.sta01023 -sel_port-99: 1.1.sta00523 -sel_port-100: 1.1.sta01523 -sel_port-101: 1.1.sta00024 -sel_port-102: 1.1.sta01024 -sel_port-103: 1.1.sta00524 -sel_port-104: 1.1.sta01524 -sel_port-105: 1.1.sta00025 -sel_port-106: 1.1.sta01025 -sel_port-107: 1.1.sta00525 -sel_port-108: 1.1.sta01525 -sel_port-109: 1.1.sta00026 -sel_port-110: 1.1.sta01026 -sel_port-111: 1.1.sta00526 -sel_port-112: 1.1.sta01526 -sel_port-113: 1.1.sta00027 -sel_port-114: 1.1.sta01027 -sel_port-115: 1.1.sta00527 -sel_port-116: 1.1.sta01527 -sel_port-117: 1.1.sta00028 -sel_port-118: 1.1.sta01028 -sel_port-119: 1.1.sta00528 -sel_port-120: 1.1.sta01528 -sel_port-121: 1.1.sta00029 -sel_port-122: 1.1.sta01029 -sel_port-123: 1.1.sta00529 -sel_port-124: 1.1.sta01529 -sel_port-125: 1.1.sta00030 -sel_port-126: 1.1.sta01030 -sel_port-127: 1.1.sta00530 -sel_port-128: 1.1.sta01530 -sel_port-129: 1.1.sta00031 -sel_port-130: 1.1.sta01031 -sel_port-131: 1.1.sta00531 -sel_port-132: 1.1.sta01531 -sel_port-133: 1.1.sta00032 -sel_port-134: 1.1.sta01032 -sel_port-135: 1.1.sta00532 -sel_port-136: 1.1.sta01532 -sel_port-137: 1.1.sta00033 -sel_port-138: 1.1.sta01033 -sel_port-139: 1.1.sta00533 -sel_port-140: 1.1.sta01533 -sel_port-141: 1.1.sta00034 -sel_port-142: 1.1.sta01034 -sel_port-143: 1.1.sta00534 -sel_port-144: 1.1.sta01534 -sel_port-145: 1.1.sta00035 -sel_port-146: 1.1.sta01035 -sel_port-147: 1.1.sta00535 -sel_port-148: 1.1.sta01535 -sel_port-149: 1.1.sta00036 -sel_port-150: 1.1.sta01036 -sel_port-151: 1.1.sta00536 -sel_port-152: 1.1.sta01536 -sel_port-153: 1.1.sta00037 -sel_port-154: 1.1.sta01037 -sel_port-155: 1.1.sta00537 -sel_port-156: 1.1.sta01537 -sel_port-157: 1.1.sta00038 -sel_port-158: 1.1.sta01038 -sel_port-159: 1.1.sta00538 -sel_port-160: 1.1.sta01538 -sel_port-161: 1.1.sta00039 -sel_port-162: 1.1.sta01039 -sel_port-163: 1.1.sta00539 -sel_port-164: 1.1.sta01539 -sel_port-165: 1.1.sta00040 -sel_port-166: 1.1.sta01040 -sel_port-167: 1.1.sta00540 -sel_port-168: 1.1.sta01540 -sel_port-169: 1.1.sta00041 -sel_port-170: 1.1.sta01041 -sel_port-171: 1.1.sta00541 -sel_port-172: 1.1.sta01541 -sel_port-173: 1.1.sta00042 -sel_port-174: 1.1.sta01042 -sel_port-175: 1.1.sta00542 -sel_port-176: 1.1.sta01542 -sel_port-177: 1.1.sta00043 -sel_port-178: 1.1.sta01043 -sel_port-179: 1.1.sta00543 -sel_port-180: 1.1.sta01543 -sel_port-181: 1.1.sta00044 -sel_port-182: 1.1.sta01044 -sel_port-183: 1.1.sta00544 -sel_port-184: 1.1.sta01544 -sel_port-185: 1.1.sta00045 -sel_port-186: 1.1.sta01045 -sel_port-187: 1.1.sta00545 -sel_port-188: 1.1.sta01545 -sel_port-189: 1.1.sta00046 -sel_port-190: 1.1.sta01046 -sel_port-191: 1.1.sta00546 -sel_port-192: 1.1.sta01546 -sel_port-193: 1.1.sta00047 -sel_port-194: 1.1.sta01047 -sel_port-195: 1.1.sta00547 -sel_port-196: 1.1.sta01547 -sel_port-197: 1.1.sta00048 -sel_port-198: 1.1.sta01048 -sel_port-199: 1.1.sta00548 -sel_port-200: 1.1.sta01548 -sel_port-201: 1.1.sta00049 -sel_port-202: 1.1.sta01049 -sel_port-203: 1.1.sta00549 -sel_port-204: 1.1.sta01549 -sel_port-205: 1.1.sta00050 -sel_port-206: 1.1.sta01050 -sel_port-207: 1.1.sta00550 -sel_port-208: 1.1.sta01550 -sel_port-209: 1.1.sta00051 -sel_port-210: 1.1.sta01051 -sel_port-211: 1.1.sta00551 -sel_port-212: 1.1.sta01551 -sel_port-213: 1.1.sta00052 -sel_port-214: 1.1.sta01052 -sel_port-215: 1.1.sta00552 -sel_port-216: 1.1.sta01552 -sel_port-217: 1.1.sta00053 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta00553 -sel_port-220: 1.1.sta01553 -sel_port-221: 1.1.sta00054 -sel_port-222: 1.1.sta01054 -sel_port-223: 1.1.sta00554 -sel_port-224: 1.1.sta01554 -sel_port-225: 1.1.sta00055 -sel_port-226: 1.1.sta01055 -sel_port-227: 1.1.sta00555 -sel_port-228: 1.1.sta01555 -sel_port-229: 1.1.sta00056 -sel_port-230: 1.1.sta01056 -sel_port-231: 1.1.sta00556 -sel_port-232: 1.1.sta01556 -sel_port-233: 1.1.sta00057 -sel_port-234: 1.1.sta01057 -sel_port-235: 1.1.sta00557 -sel_port-236: 1.1.sta01557 -sel_port-237: 1.1.sta00058 -sel_port-238: 1.1.sta01058 -sel_port-239: 1.1.sta00558 -sel_port-240: 1.1.sta01558 -sel_port-241: 1.1.sta00059 -sel_port-242: 1.1.sta01059 -sel_port-243: 1.1.sta00559 -sel_port-244: 1.1.sta01559 -sel_port-245: 1.1.sta00060 -sel_port-246: 1.1.sta01060 -sel_port-247: 1.1.sta00560 -sel_port-248: 1.1.sta01560 -sel_port-249: 1.1.sta00061 -sel_port-250: 1.1.sta01061 -sel_port-251: 1.1.sta00561 -sel_port-252: 1.1.sta01561 -sel_port-253: 1.1.sta00062 -sel_port-254: 1.1.sta01062 -sel_port-255: 1.1.sta00562 -sel_port-256: 1.1.sta01562 -sel_port-257: 1.1.sta00063 -sel_port-258: 1.1.sta01063 -sel_port-259: 1.1.sta00563 -sel_port-260: 1.1.sta01563 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-02/NOTES.txt b/testbeds/nola-basic-02/NOTES.txt deleted file mode 100644 index 9dabae284..000000000 --- a/testbeds/nola-basic-02/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an Edge-Core 5410, running TIP OpenWrt. diff --git a/testbeds/nola-basic-02/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-02/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 20cf5293b..000000000 --- a/testbeds/nola-basic-02/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,32 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0' - option htmode 'HT20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - diff --git a/testbeds/nola-basic-02/ap-auto.txt b/testbeds/nola-basic-02/ap-auto.txt deleted file mode 100644 index 8ca4b220c..000000000 --- a/testbeds/nola-basic-02/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: ecw5410 Default-SSID-5gl -dut2-0: ecw5410 Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 66 -max_stations_5: 66 -max_stations_dual: 132 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.6 wiphy2 -radio2-2: 1.1.8 wiphy4 -radio5-0: 1.1.5 wiphy1 -radio5-1: 1.1.7 wiphy3 -radio5-2: 1.1.9 wiphy5 -radio5-3: -radio5-4: -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-02/dpt-pkt-sz.txt b/testbeds/nola-basic-02/dpt-pkt-sz.txt deleted file mode 100644 index aa10d1107..000000000 --- a/testbeds/nola-basic-02/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ea8300 -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-02/run_basic.bash b/testbeds/nola-basic-02/run_basic.bash deleted file mode 100755 index 12579b356..000000000 --- a/testbeds/nola-basic-02/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-02-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-02/run_basic_fast.bash b/testbeds/nola-basic-02/run_basic_fast.bash deleted file mode 100755 index ebd4542c8..000000000 --- a/testbeds/nola-basic-02/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-02-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-02/scenario.txt b/testbeds/nola-basic-02/scenario.txt deleted file mode 100644 index 48d2275de..000000000 --- a/testbeds/nola-basic-02/scenario.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-02/scenario_small.txt b/testbeds/nola-basic-02/scenario_small.txt deleted file mode 100644 index 3fe509994..000000000 --- a/testbeds/nola-basic-02/scenario_small.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-02/test_bed_cfg.bash b/testbeds/nola-basic-02/test_bed_cfg.bash deleted file mode 100644 index 9b7f4ed07..000000000 --- a/testbeds/nola-basic-02/test_bed_cfg.bash +++ /dev/null @@ -1,60 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP2} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF2} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf2} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf2} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-02-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=Edgecore-ECW5410 -DUT_MODEL=Edgecore-ECW5410 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=68:21:5F:9D:0A:8B -# 5Ghz radio -DUT_BSSID2=68:21:5F:9D:0A:8C - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-02/wct.txt b/testbeds/nola-basic-02/wct.txt deleted file mode 100644 index 3c7910719..000000000 --- a/testbeds/nola-basic-02/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta01000 -sel_port-3: 1.1.sta00500 -sel_port-4: 1.1.sta01500 -sel_port-5: 1.1.sta03000 -sel_port-6: 1.1.sta03500 -sel_port-7: 1.1.sta04000 -sel_port-8: 1.1.sta04500 -sel_port-9: 1.1.sta00001 -sel_port-10: 1.1.sta01001 -sel_port-11: 1.1.sta00501 -sel_port-12: 1.1.sta01501 -sel_port-13: 1.1.sta00002 -sel_port-14: 1.1.sta01002 -sel_port-15: 1.1.sta00502 -sel_port-16: 1.1.sta01502 -sel_port-17: 1.1.sta00003 -sel_port-18: 1.1.sta01003 -sel_port-19: 1.1.sta00503 -sel_port-20: 1.1.sta01503 -sel_port-21: 1.1.sta00004 -sel_port-22: 1.1.sta01004 -sel_port-23: 1.1.sta00504 -sel_port-24: 1.1.sta01504 -sel_port-25: 1.1.sta00005 -sel_port-26: 1.1.sta01005 -sel_port-27: 1.1.sta00505 -sel_port-28: 1.1.sta01505 -sel_port-29: 1.1.sta00006 -sel_port-30: 1.1.sta01006 -sel_port-31: 1.1.sta00506 -sel_port-32: 1.1.sta01506 -sel_port-33: 1.1.sta00007 -sel_port-34: 1.1.sta01007 -sel_port-35: 1.1.sta00507 -sel_port-36: 1.1.sta01507 -sel_port-37: 1.1.sta00008 -sel_port-38: 1.1.sta01008 -sel_port-39: 1.1.sta00508 -sel_port-40: 1.1.sta01508 -sel_port-41: 1.1.sta00009 -sel_port-42: 1.1.sta01009 -sel_port-43: 1.1.sta00509 -sel_port-44: 1.1.sta01509 -sel_port-45: 1.1.sta00010 -sel_port-46: 1.1.sta01010 -sel_port-47: 1.1.sta00510 -sel_port-48: 1.1.sta01510 -sel_port-49: 1.1.sta00011 -sel_port-50: 1.1.sta01011 -sel_port-51: 1.1.sta00511 -sel_port-52: 1.1.sta01511 -sel_port-53: 1.1.sta00012 -sel_port-54: 1.1.sta01012 -sel_port-55: 1.1.sta00512 -sel_port-56: 1.1.sta01512 -sel_port-57: 1.1.sta00013 -sel_port-58: 1.1.sta01013 -sel_port-59: 1.1.sta00513 -sel_port-60: 1.1.sta01513 -sel_port-61: 1.1.sta00014 -sel_port-62: 1.1.sta01014 -sel_port-63: 1.1.sta00514 -sel_port-64: 1.1.sta01514 -sel_port-65: 1.1.sta00015 -sel_port-66: 1.1.sta01015 -sel_port-67: 1.1.sta00515 -sel_port-68: 1.1.sta01515 -sel_port-69: 1.1.sta00016 -sel_port-70: 1.1.sta01016 -sel_port-71: 1.1.sta00516 -sel_port-72: 1.1.sta01516 -sel_port-73: 1.1.sta00017 -sel_port-74: 1.1.sta01017 -sel_port-75: 1.1.sta00517 -sel_port-76: 1.1.sta01517 -sel_port-77: 1.1.sta00018 -sel_port-78: 1.1.sta01018 -sel_port-79: 1.1.sta00518 -sel_port-80: 1.1.sta01518 -sel_port-81: 1.1.sta00019 -sel_port-82: 1.1.sta01019 -sel_port-83: 1.1.sta00519 -sel_port-84: 1.1.sta01519 -sel_port-85: 1.1.sta00020 -sel_port-86: 1.1.sta01020 -sel_port-87: 1.1.sta00520 -sel_port-88: 1.1.sta01520 -sel_port-89: 1.1.sta00021 -sel_port-90: 1.1.sta01021 -sel_port-91: 1.1.sta00521 -sel_port-92: 1.1.sta01521 -sel_port-93: 1.1.sta00022 -sel_port-94: 1.1.sta01022 -sel_port-95: 1.1.sta00522 -sel_port-96: 1.1.sta01522 -sel_port-97: 1.1.sta00023 -sel_port-98: 1.1.sta01023 -sel_port-99: 1.1.sta00523 -sel_port-100: 1.1.sta01523 -sel_port-101: 1.1.sta00024 -sel_port-102: 1.1.sta01024 -sel_port-103: 1.1.sta00524 -sel_port-104: 1.1.sta01524 -sel_port-105: 1.1.sta00025 -sel_port-106: 1.1.sta01025 -sel_port-107: 1.1.sta00525 -sel_port-108: 1.1.sta01525 -sel_port-109: 1.1.sta00026 -sel_port-110: 1.1.sta01026 -sel_port-111: 1.1.sta00526 -sel_port-112: 1.1.sta01526 -sel_port-113: 1.1.sta00027 -sel_port-114: 1.1.sta01027 -sel_port-115: 1.1.sta00527 -sel_port-116: 1.1.sta01527 -sel_port-117: 1.1.sta00028 -sel_port-118: 1.1.sta01028 -sel_port-119: 1.1.sta00528 -sel_port-120: 1.1.sta01528 -sel_port-121: 1.1.sta00029 -sel_port-122: 1.1.sta01029 -sel_port-123: 1.1.sta00529 -sel_port-124: 1.1.sta01529 -sel_port-125: 1.1.sta00030 -sel_port-126: 1.1.sta01030 -sel_port-127: 1.1.sta00530 -sel_port-128: 1.1.sta01530 -sel_port-129: 1.1.sta00031 -sel_port-130: 1.1.sta01031 -sel_port-131: 1.1.sta00531 -sel_port-132: 1.1.sta01531 -sel_port-133: 1.1.sta00032 -sel_port-134: 1.1.sta01032 -sel_port-135: 1.1.sta00532 -sel_port-136: 1.1.sta01532 -sel_port-137: 1.1.sta00033 -sel_port-138: 1.1.sta01033 -sel_port-139: 1.1.sta00533 -sel_port-140: 1.1.sta01533 -sel_port-141: 1.1.sta00034 -sel_port-142: 1.1.sta01034 -sel_port-143: 1.1.sta00534 -sel_port-144: 1.1.sta01534 -sel_port-145: 1.1.sta00035 -sel_port-146: 1.1.sta01035 -sel_port-147: 1.1.sta00535 -sel_port-148: 1.1.sta01535 -sel_port-149: 1.1.sta00036 -sel_port-150: 1.1.sta01036 -sel_port-151: 1.1.sta00536 -sel_port-152: 1.1.sta01536 -sel_port-153: 1.1.sta00037 -sel_port-154: 1.1.sta01037 -sel_port-155: 1.1.sta00537 -sel_port-156: 1.1.sta01537 -sel_port-157: 1.1.sta00038 -sel_port-158: 1.1.sta01038 -sel_port-159: 1.1.sta00538 -sel_port-160: 1.1.sta01538 -sel_port-161: 1.1.sta00039 -sel_port-162: 1.1.sta01039 -sel_port-163: 1.1.sta00539 -sel_port-164: 1.1.sta01539 -sel_port-165: 1.1.sta00040 -sel_port-166: 1.1.sta01040 -sel_port-167: 1.1.sta00540 -sel_port-168: 1.1.sta01540 -sel_port-169: 1.1.sta00041 -sel_port-170: 1.1.sta01041 -sel_port-171: 1.1.sta00541 -sel_port-172: 1.1.sta01541 -sel_port-173: 1.1.sta00042 -sel_port-174: 1.1.sta01042 -sel_port-175: 1.1.sta00542 -sel_port-176: 1.1.sta01542 -sel_port-177: 1.1.sta00043 -sel_port-178: 1.1.sta01043 -sel_port-179: 1.1.sta00543 -sel_port-180: 1.1.sta01543 -sel_port-181: 1.1.sta00044 -sel_port-182: 1.1.sta01044 -sel_port-183: 1.1.sta00544 -sel_port-184: 1.1.sta01544 -sel_port-185: 1.1.sta00045 -sel_port-186: 1.1.sta01045 -sel_port-187: 1.1.sta00545 -sel_port-188: 1.1.sta01545 -sel_port-189: 1.1.sta00046 -sel_port-190: 1.1.sta01046 -sel_port-191: 1.1.sta00546 -sel_port-192: 1.1.sta01546 -sel_port-193: 1.1.sta00047 -sel_port-194: 1.1.sta01047 -sel_port-195: 1.1.sta00547 -sel_port-196: 1.1.sta01547 -sel_port-197: 1.1.sta00048 -sel_port-198: 1.1.sta01048 -sel_port-199: 1.1.sta00548 -sel_port-200: 1.1.sta01548 -sel_port-201: 1.1.sta00049 -sel_port-202: 1.1.sta01049 -sel_port-203: 1.1.sta00549 -sel_port-204: 1.1.sta01549 -sel_port-205: 1.1.sta00050 -sel_port-206: 1.1.sta01050 -sel_port-207: 1.1.sta00550 -sel_port-208: 1.1.sta01550 -sel_port-209: 1.1.sta00051 -sel_port-210: 1.1.sta01051 -sel_port-211: 1.1.sta00551 -sel_port-212: 1.1.sta01551 -sel_port-213: 1.1.sta00052 -sel_port-214: 1.1.sta01052 -sel_port-215: 1.1.sta00552 -sel_port-216: 1.1.sta01552 -sel_port-217: 1.1.sta00053 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta00553 -sel_port-220: 1.1.sta01553 -sel_port-221: 1.1.sta00054 -sel_port-222: 1.1.sta01054 -sel_port-223: 1.1.sta00554 -sel_port-224: 1.1.sta01554 -sel_port-225: 1.1.sta00055 -sel_port-226: 1.1.sta01055 -sel_port-227: 1.1.sta00555 -sel_port-228: 1.1.sta01555 -sel_port-229: 1.1.sta00056 -sel_port-230: 1.1.sta01056 -sel_port-231: 1.1.sta00556 -sel_port-232: 1.1.sta01556 -sel_port-233: 1.1.sta00057 -sel_port-234: 1.1.sta01057 -sel_port-235: 1.1.sta00557 -sel_port-236: 1.1.sta01557 -sel_port-237: 1.1.sta00058 -sel_port-238: 1.1.sta01058 -sel_port-239: 1.1.sta00558 -sel_port-240: 1.1.sta01558 -sel_port-241: 1.1.sta00059 -sel_port-242: 1.1.sta01059 -sel_port-243: 1.1.sta00559 -sel_port-244: 1.1.sta01559 -sel_port-245: 1.1.sta00060 -sel_port-246: 1.1.sta01060 -sel_port-247: 1.1.sta00560 -sel_port-248: 1.1.sta01560 -sel_port-249: 1.1.sta00061 -sel_port-250: 1.1.sta01061 -sel_port-251: 1.1.sta00561 -sel_port-252: 1.1.sta01561 -sel_port-253: 1.1.sta00062 -sel_port-254: 1.1.sta01062 -sel_port-255: 1.1.sta00562 -sel_port-256: 1.1.sta01562 -sel_port-257: 1.1.sta00063 -sel_port-258: 1.1.sta01063 -sel_port-259: 1.1.sta00563 -sel_port-260: 1.1.sta01563 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-03/NOTES.txt b/testbeds/nola-basic-03/NOTES.txt deleted file mode 100644 index 2ddf29991..000000000 --- a/testbeds/nola-basic-03/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an TP-Link EC420, running TIP OpenWrt. diff --git a/testbeds/nola-basic-03/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-03/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 082f24dd1..000000000 --- a/testbeds/nola-basic-03/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,34 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/40000000.pci/pci0000:00/0000:00:00.0/0000:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ec:42:00:02' - -config wifi-device 'radio1' - option type 'mac80211' - option hwmode '11g' - option path 'platform/soc/a000000.wifi' - option htmode 'HT40' - option channel 'auto' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ec:42:00:01' - diff --git a/testbeds/nola-basic-03/ap-auto.txt b/testbeds/nola-basic-03/ap-auto.txt deleted file mode 100644 index b4c174313..000000000 --- a/testbeds/nola-basic-03/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: ec420 Default-SSID-5gl -dut2-0: ec420 Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 66 -max_stations_5: 66 -max_stations_dual: 132 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.6 wiphy2 -radio2-2: 1.1.8 wiphy4 -radio5-0: 1.1.5 wiphy1 -radio5-1: 1.1.7 wiphy3 -radio5-2: 1.1.9 wiphy5 -radio5-3: -radio5-4: -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-03/dpt-pkt-sz.txt b/testbeds/nola-basic-03/dpt-pkt-sz.txt deleted file mode 100644 index f69d14477..000000000 --- a/testbeds/nola-basic-03/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ec420 -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-03/run_basic.bash b/testbeds/nola-basic-03/run_basic.bash deleted file mode 100755 index 2a6473747..000000000 --- a/testbeds/nola-basic-03/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-03-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-03/run_basic_fast.bash b/testbeds/nola-basic-03/run_basic_fast.bash deleted file mode 100755 index 6e41c95de..000000000 --- a/testbeds/nola-basic-03/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-03-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-03/scenario.txt b/testbeds/nola-basic-03/scenario.txt deleted file mode 100644 index 25a9cce15..000000000 --- a/testbeds/nola-basic-03/scenario.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ec420 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ec420 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy3,AUTO -1 -dut ec420 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-03/scenario_small.txt b/testbeds/nola-basic-03/scenario_small.txt deleted file mode 100644 index 4796c03ab..000000000 --- a/testbeds/nola-basic-03/scenario_small.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: ec420 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: ec420 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ec420 Radio-2' NA wiphy3,AUTO -1 -dut ec420 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-03/test_bed_cfg.bash b/testbeds/nola-basic-03/test_bed_cfg.bash deleted file mode 100644 index 2432edc31..000000000 --- a/testbeds/nola-basic-03/test_bed_cfg.bash +++ /dev/null @@ -1,60 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP3} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF3} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf3} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf3} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-03-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER="TP-Link EC420" -DUT_MODEL="TP-Link EC420" -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=00:00:ec:42:00:01 -# 5Ghz radio -DUT_BSSID2=00:00:ec:42:00:02 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-03/wct.txt b/testbeds/nola-basic-03/wct.txt deleted file mode 100644 index 3c7910719..000000000 --- a/testbeds/nola-basic-03/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta01000 -sel_port-3: 1.1.sta00500 -sel_port-4: 1.1.sta01500 -sel_port-5: 1.1.sta03000 -sel_port-6: 1.1.sta03500 -sel_port-7: 1.1.sta04000 -sel_port-8: 1.1.sta04500 -sel_port-9: 1.1.sta00001 -sel_port-10: 1.1.sta01001 -sel_port-11: 1.1.sta00501 -sel_port-12: 1.1.sta01501 -sel_port-13: 1.1.sta00002 -sel_port-14: 1.1.sta01002 -sel_port-15: 1.1.sta00502 -sel_port-16: 1.1.sta01502 -sel_port-17: 1.1.sta00003 -sel_port-18: 1.1.sta01003 -sel_port-19: 1.1.sta00503 -sel_port-20: 1.1.sta01503 -sel_port-21: 1.1.sta00004 -sel_port-22: 1.1.sta01004 -sel_port-23: 1.1.sta00504 -sel_port-24: 1.1.sta01504 -sel_port-25: 1.1.sta00005 -sel_port-26: 1.1.sta01005 -sel_port-27: 1.1.sta00505 -sel_port-28: 1.1.sta01505 -sel_port-29: 1.1.sta00006 -sel_port-30: 1.1.sta01006 -sel_port-31: 1.1.sta00506 -sel_port-32: 1.1.sta01506 -sel_port-33: 1.1.sta00007 -sel_port-34: 1.1.sta01007 -sel_port-35: 1.1.sta00507 -sel_port-36: 1.1.sta01507 -sel_port-37: 1.1.sta00008 -sel_port-38: 1.1.sta01008 -sel_port-39: 1.1.sta00508 -sel_port-40: 1.1.sta01508 -sel_port-41: 1.1.sta00009 -sel_port-42: 1.1.sta01009 -sel_port-43: 1.1.sta00509 -sel_port-44: 1.1.sta01509 -sel_port-45: 1.1.sta00010 -sel_port-46: 1.1.sta01010 -sel_port-47: 1.1.sta00510 -sel_port-48: 1.1.sta01510 -sel_port-49: 1.1.sta00011 -sel_port-50: 1.1.sta01011 -sel_port-51: 1.1.sta00511 -sel_port-52: 1.1.sta01511 -sel_port-53: 1.1.sta00012 -sel_port-54: 1.1.sta01012 -sel_port-55: 1.1.sta00512 -sel_port-56: 1.1.sta01512 -sel_port-57: 1.1.sta00013 -sel_port-58: 1.1.sta01013 -sel_port-59: 1.1.sta00513 -sel_port-60: 1.1.sta01513 -sel_port-61: 1.1.sta00014 -sel_port-62: 1.1.sta01014 -sel_port-63: 1.1.sta00514 -sel_port-64: 1.1.sta01514 -sel_port-65: 1.1.sta00015 -sel_port-66: 1.1.sta01015 -sel_port-67: 1.1.sta00515 -sel_port-68: 1.1.sta01515 -sel_port-69: 1.1.sta00016 -sel_port-70: 1.1.sta01016 -sel_port-71: 1.1.sta00516 -sel_port-72: 1.1.sta01516 -sel_port-73: 1.1.sta00017 -sel_port-74: 1.1.sta01017 -sel_port-75: 1.1.sta00517 -sel_port-76: 1.1.sta01517 -sel_port-77: 1.1.sta00018 -sel_port-78: 1.1.sta01018 -sel_port-79: 1.1.sta00518 -sel_port-80: 1.1.sta01518 -sel_port-81: 1.1.sta00019 -sel_port-82: 1.1.sta01019 -sel_port-83: 1.1.sta00519 -sel_port-84: 1.1.sta01519 -sel_port-85: 1.1.sta00020 -sel_port-86: 1.1.sta01020 -sel_port-87: 1.1.sta00520 -sel_port-88: 1.1.sta01520 -sel_port-89: 1.1.sta00021 -sel_port-90: 1.1.sta01021 -sel_port-91: 1.1.sta00521 -sel_port-92: 1.1.sta01521 -sel_port-93: 1.1.sta00022 -sel_port-94: 1.1.sta01022 -sel_port-95: 1.1.sta00522 -sel_port-96: 1.1.sta01522 -sel_port-97: 1.1.sta00023 -sel_port-98: 1.1.sta01023 -sel_port-99: 1.1.sta00523 -sel_port-100: 1.1.sta01523 -sel_port-101: 1.1.sta00024 -sel_port-102: 1.1.sta01024 -sel_port-103: 1.1.sta00524 -sel_port-104: 1.1.sta01524 -sel_port-105: 1.1.sta00025 -sel_port-106: 1.1.sta01025 -sel_port-107: 1.1.sta00525 -sel_port-108: 1.1.sta01525 -sel_port-109: 1.1.sta00026 -sel_port-110: 1.1.sta01026 -sel_port-111: 1.1.sta00526 -sel_port-112: 1.1.sta01526 -sel_port-113: 1.1.sta00027 -sel_port-114: 1.1.sta01027 -sel_port-115: 1.1.sta00527 -sel_port-116: 1.1.sta01527 -sel_port-117: 1.1.sta00028 -sel_port-118: 1.1.sta01028 -sel_port-119: 1.1.sta00528 -sel_port-120: 1.1.sta01528 -sel_port-121: 1.1.sta00029 -sel_port-122: 1.1.sta01029 -sel_port-123: 1.1.sta00529 -sel_port-124: 1.1.sta01529 -sel_port-125: 1.1.sta00030 -sel_port-126: 1.1.sta01030 -sel_port-127: 1.1.sta00530 -sel_port-128: 1.1.sta01530 -sel_port-129: 1.1.sta00031 -sel_port-130: 1.1.sta01031 -sel_port-131: 1.1.sta00531 -sel_port-132: 1.1.sta01531 -sel_port-133: 1.1.sta00032 -sel_port-134: 1.1.sta01032 -sel_port-135: 1.1.sta00532 -sel_port-136: 1.1.sta01532 -sel_port-137: 1.1.sta00033 -sel_port-138: 1.1.sta01033 -sel_port-139: 1.1.sta00533 -sel_port-140: 1.1.sta01533 -sel_port-141: 1.1.sta00034 -sel_port-142: 1.1.sta01034 -sel_port-143: 1.1.sta00534 -sel_port-144: 1.1.sta01534 -sel_port-145: 1.1.sta00035 -sel_port-146: 1.1.sta01035 -sel_port-147: 1.1.sta00535 -sel_port-148: 1.1.sta01535 -sel_port-149: 1.1.sta00036 -sel_port-150: 1.1.sta01036 -sel_port-151: 1.1.sta00536 -sel_port-152: 1.1.sta01536 -sel_port-153: 1.1.sta00037 -sel_port-154: 1.1.sta01037 -sel_port-155: 1.1.sta00537 -sel_port-156: 1.1.sta01537 -sel_port-157: 1.1.sta00038 -sel_port-158: 1.1.sta01038 -sel_port-159: 1.1.sta00538 -sel_port-160: 1.1.sta01538 -sel_port-161: 1.1.sta00039 -sel_port-162: 1.1.sta01039 -sel_port-163: 1.1.sta00539 -sel_port-164: 1.1.sta01539 -sel_port-165: 1.1.sta00040 -sel_port-166: 1.1.sta01040 -sel_port-167: 1.1.sta00540 -sel_port-168: 1.1.sta01540 -sel_port-169: 1.1.sta00041 -sel_port-170: 1.1.sta01041 -sel_port-171: 1.1.sta00541 -sel_port-172: 1.1.sta01541 -sel_port-173: 1.1.sta00042 -sel_port-174: 1.1.sta01042 -sel_port-175: 1.1.sta00542 -sel_port-176: 1.1.sta01542 -sel_port-177: 1.1.sta00043 -sel_port-178: 1.1.sta01043 -sel_port-179: 1.1.sta00543 -sel_port-180: 1.1.sta01543 -sel_port-181: 1.1.sta00044 -sel_port-182: 1.1.sta01044 -sel_port-183: 1.1.sta00544 -sel_port-184: 1.1.sta01544 -sel_port-185: 1.1.sta00045 -sel_port-186: 1.1.sta01045 -sel_port-187: 1.1.sta00545 -sel_port-188: 1.1.sta01545 -sel_port-189: 1.1.sta00046 -sel_port-190: 1.1.sta01046 -sel_port-191: 1.1.sta00546 -sel_port-192: 1.1.sta01546 -sel_port-193: 1.1.sta00047 -sel_port-194: 1.1.sta01047 -sel_port-195: 1.1.sta00547 -sel_port-196: 1.1.sta01547 -sel_port-197: 1.1.sta00048 -sel_port-198: 1.1.sta01048 -sel_port-199: 1.1.sta00548 -sel_port-200: 1.1.sta01548 -sel_port-201: 1.1.sta00049 -sel_port-202: 1.1.sta01049 -sel_port-203: 1.1.sta00549 -sel_port-204: 1.1.sta01549 -sel_port-205: 1.1.sta00050 -sel_port-206: 1.1.sta01050 -sel_port-207: 1.1.sta00550 -sel_port-208: 1.1.sta01550 -sel_port-209: 1.1.sta00051 -sel_port-210: 1.1.sta01051 -sel_port-211: 1.1.sta00551 -sel_port-212: 1.1.sta01551 -sel_port-213: 1.1.sta00052 -sel_port-214: 1.1.sta01052 -sel_port-215: 1.1.sta00552 -sel_port-216: 1.1.sta01552 -sel_port-217: 1.1.sta00053 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta00553 -sel_port-220: 1.1.sta01553 -sel_port-221: 1.1.sta00054 -sel_port-222: 1.1.sta01054 -sel_port-223: 1.1.sta00554 -sel_port-224: 1.1.sta01554 -sel_port-225: 1.1.sta00055 -sel_port-226: 1.1.sta01055 -sel_port-227: 1.1.sta00555 -sel_port-228: 1.1.sta01555 -sel_port-229: 1.1.sta00056 -sel_port-230: 1.1.sta01056 -sel_port-231: 1.1.sta00556 -sel_port-232: 1.1.sta01556 -sel_port-233: 1.1.sta00057 -sel_port-234: 1.1.sta01057 -sel_port-235: 1.1.sta00557 -sel_port-236: 1.1.sta01557 -sel_port-237: 1.1.sta00058 -sel_port-238: 1.1.sta01058 -sel_port-239: 1.1.sta00558 -sel_port-240: 1.1.sta01558 -sel_port-241: 1.1.sta00059 -sel_port-242: 1.1.sta01059 -sel_port-243: 1.1.sta00559 -sel_port-244: 1.1.sta01559 -sel_port-245: 1.1.sta00060 -sel_port-246: 1.1.sta01060 -sel_port-247: 1.1.sta00560 -sel_port-248: 1.1.sta01560 -sel_port-249: 1.1.sta00061 -sel_port-250: 1.1.sta01061 -sel_port-251: 1.1.sta00561 -sel_port-252: 1.1.sta01561 -sel_port-253: 1.1.sta00062 -sel_port-254: 1.1.sta01062 -sel_port-255: 1.1.sta00562 -sel_port-256: 1.1.sta01562 -sel_port-257: 1.1.sta00063 -sel_port-258: 1.1.sta01063 -sel_port-259: 1.1.sta00563 -sel_port-260: 1.1.sta01563 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-04/NOTES.txt b/testbeds/nola-basic-04/NOTES.txt deleted file mode 100644 index 9dabae284..000000000 --- a/testbeds/nola-basic-04/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an Edge-Core 5410, running TIP OpenWrt. diff --git a/testbeds/nola-basic-04/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-04/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 20cf5293b..000000000 --- a/testbeds/nola-basic-04/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,32 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0' - option htmode 'HT20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - diff --git a/testbeds/nola-basic-04/ap-auto.txt b/testbeds/nola-basic-04/ap-auto.txt deleted file mode 100644 index 8ca4b220c..000000000 --- a/testbeds/nola-basic-04/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: ecw5410 Default-SSID-5gl -dut2-0: ecw5410 Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 66 -max_stations_5: 66 -max_stations_dual: 132 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.6 wiphy2 -radio2-2: 1.1.8 wiphy4 -radio5-0: 1.1.5 wiphy1 -radio5-1: 1.1.7 wiphy3 -radio5-2: 1.1.9 wiphy5 -radio5-3: -radio5-4: -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-04/dpt-pkt-sz.txt b/testbeds/nola-basic-04/dpt-pkt-sz.txt deleted file mode 100644 index aa10d1107..000000000 --- a/testbeds/nola-basic-04/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: ea8300 -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-04/run_basic.bash b/testbeds/nola-basic-04/run_basic.bash deleted file mode 100755 index 89f8db436..000000000 --- a/testbeds/nola-basic-04/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-04-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-04/run_basic_fast.bash b/testbeds/nola-basic-04/run_basic_fast.bash deleted file mode 100755 index ce203df65..000000000 --- a/testbeds/nola-basic-04/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-04-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-04/scenario.txt b/testbeds/nola-basic-04/scenario.txt deleted file mode 100644 index 48d2275de..000000000 --- a/testbeds/nola-basic-04/scenario.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-04/scenario_small.txt b/testbeds/nola-basic-04/scenario_small.txt deleted file mode 100644 index 3fe509994..000000000 --- a/testbeds/nola-basic-04/scenario_small.txt +++ /dev/null @@ -1,13 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-1' NA wiphy4,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: ecw5410 Radio-2' NA wiphy5,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 100.97.39.129/25' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 1 'DUT: ecw5410 Radio-2' NA wiphy3,AUTO -1 -dut ecw5410 393 148 -dut upstream 306 62 -resource 1.1 132 218 - - diff --git a/testbeds/nola-basic-04/test_bed_cfg.bash b/testbeds/nola-basic-04/test_bed_cfg.bash deleted file mode 100644 index b73434570..000000000 --- a/testbeds/nola-basic-04/test_bed_cfg.bash +++ /dev/null @@ -1,60 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP4} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF4} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf4} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf4} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-04-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=Edgecore-ECW5410 -DUT_MODEL=Edgecore-ECW5410 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=68:21:5F:9D:0C:1B -# 5Ghz radio -DUT_BSSID2=68:21:5F:9D:0C:1C - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-04/wct.txt b/testbeds/nola-basic-04/wct.txt deleted file mode 100644 index 3c7910719..000000000 --- a/testbeds/nola-basic-04/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta01000 -sel_port-3: 1.1.sta00500 -sel_port-4: 1.1.sta01500 -sel_port-5: 1.1.sta03000 -sel_port-6: 1.1.sta03500 -sel_port-7: 1.1.sta04000 -sel_port-8: 1.1.sta04500 -sel_port-9: 1.1.sta00001 -sel_port-10: 1.1.sta01001 -sel_port-11: 1.1.sta00501 -sel_port-12: 1.1.sta01501 -sel_port-13: 1.1.sta00002 -sel_port-14: 1.1.sta01002 -sel_port-15: 1.1.sta00502 -sel_port-16: 1.1.sta01502 -sel_port-17: 1.1.sta00003 -sel_port-18: 1.1.sta01003 -sel_port-19: 1.1.sta00503 -sel_port-20: 1.1.sta01503 -sel_port-21: 1.1.sta00004 -sel_port-22: 1.1.sta01004 -sel_port-23: 1.1.sta00504 -sel_port-24: 1.1.sta01504 -sel_port-25: 1.1.sta00005 -sel_port-26: 1.1.sta01005 -sel_port-27: 1.1.sta00505 -sel_port-28: 1.1.sta01505 -sel_port-29: 1.1.sta00006 -sel_port-30: 1.1.sta01006 -sel_port-31: 1.1.sta00506 -sel_port-32: 1.1.sta01506 -sel_port-33: 1.1.sta00007 -sel_port-34: 1.1.sta01007 -sel_port-35: 1.1.sta00507 -sel_port-36: 1.1.sta01507 -sel_port-37: 1.1.sta00008 -sel_port-38: 1.1.sta01008 -sel_port-39: 1.1.sta00508 -sel_port-40: 1.1.sta01508 -sel_port-41: 1.1.sta00009 -sel_port-42: 1.1.sta01009 -sel_port-43: 1.1.sta00509 -sel_port-44: 1.1.sta01509 -sel_port-45: 1.1.sta00010 -sel_port-46: 1.1.sta01010 -sel_port-47: 1.1.sta00510 -sel_port-48: 1.1.sta01510 -sel_port-49: 1.1.sta00011 -sel_port-50: 1.1.sta01011 -sel_port-51: 1.1.sta00511 -sel_port-52: 1.1.sta01511 -sel_port-53: 1.1.sta00012 -sel_port-54: 1.1.sta01012 -sel_port-55: 1.1.sta00512 -sel_port-56: 1.1.sta01512 -sel_port-57: 1.1.sta00013 -sel_port-58: 1.1.sta01013 -sel_port-59: 1.1.sta00513 -sel_port-60: 1.1.sta01513 -sel_port-61: 1.1.sta00014 -sel_port-62: 1.1.sta01014 -sel_port-63: 1.1.sta00514 -sel_port-64: 1.1.sta01514 -sel_port-65: 1.1.sta00015 -sel_port-66: 1.1.sta01015 -sel_port-67: 1.1.sta00515 -sel_port-68: 1.1.sta01515 -sel_port-69: 1.1.sta00016 -sel_port-70: 1.1.sta01016 -sel_port-71: 1.1.sta00516 -sel_port-72: 1.1.sta01516 -sel_port-73: 1.1.sta00017 -sel_port-74: 1.1.sta01017 -sel_port-75: 1.1.sta00517 -sel_port-76: 1.1.sta01517 -sel_port-77: 1.1.sta00018 -sel_port-78: 1.1.sta01018 -sel_port-79: 1.1.sta00518 -sel_port-80: 1.1.sta01518 -sel_port-81: 1.1.sta00019 -sel_port-82: 1.1.sta01019 -sel_port-83: 1.1.sta00519 -sel_port-84: 1.1.sta01519 -sel_port-85: 1.1.sta00020 -sel_port-86: 1.1.sta01020 -sel_port-87: 1.1.sta00520 -sel_port-88: 1.1.sta01520 -sel_port-89: 1.1.sta00021 -sel_port-90: 1.1.sta01021 -sel_port-91: 1.1.sta00521 -sel_port-92: 1.1.sta01521 -sel_port-93: 1.1.sta00022 -sel_port-94: 1.1.sta01022 -sel_port-95: 1.1.sta00522 -sel_port-96: 1.1.sta01522 -sel_port-97: 1.1.sta00023 -sel_port-98: 1.1.sta01023 -sel_port-99: 1.1.sta00523 -sel_port-100: 1.1.sta01523 -sel_port-101: 1.1.sta00024 -sel_port-102: 1.1.sta01024 -sel_port-103: 1.1.sta00524 -sel_port-104: 1.1.sta01524 -sel_port-105: 1.1.sta00025 -sel_port-106: 1.1.sta01025 -sel_port-107: 1.1.sta00525 -sel_port-108: 1.1.sta01525 -sel_port-109: 1.1.sta00026 -sel_port-110: 1.1.sta01026 -sel_port-111: 1.1.sta00526 -sel_port-112: 1.1.sta01526 -sel_port-113: 1.1.sta00027 -sel_port-114: 1.1.sta01027 -sel_port-115: 1.1.sta00527 -sel_port-116: 1.1.sta01527 -sel_port-117: 1.1.sta00028 -sel_port-118: 1.1.sta01028 -sel_port-119: 1.1.sta00528 -sel_port-120: 1.1.sta01528 -sel_port-121: 1.1.sta00029 -sel_port-122: 1.1.sta01029 -sel_port-123: 1.1.sta00529 -sel_port-124: 1.1.sta01529 -sel_port-125: 1.1.sta00030 -sel_port-126: 1.1.sta01030 -sel_port-127: 1.1.sta00530 -sel_port-128: 1.1.sta01530 -sel_port-129: 1.1.sta00031 -sel_port-130: 1.1.sta01031 -sel_port-131: 1.1.sta00531 -sel_port-132: 1.1.sta01531 -sel_port-133: 1.1.sta00032 -sel_port-134: 1.1.sta01032 -sel_port-135: 1.1.sta00532 -sel_port-136: 1.1.sta01532 -sel_port-137: 1.1.sta00033 -sel_port-138: 1.1.sta01033 -sel_port-139: 1.1.sta00533 -sel_port-140: 1.1.sta01533 -sel_port-141: 1.1.sta00034 -sel_port-142: 1.1.sta01034 -sel_port-143: 1.1.sta00534 -sel_port-144: 1.1.sta01534 -sel_port-145: 1.1.sta00035 -sel_port-146: 1.1.sta01035 -sel_port-147: 1.1.sta00535 -sel_port-148: 1.1.sta01535 -sel_port-149: 1.1.sta00036 -sel_port-150: 1.1.sta01036 -sel_port-151: 1.1.sta00536 -sel_port-152: 1.1.sta01536 -sel_port-153: 1.1.sta00037 -sel_port-154: 1.1.sta01037 -sel_port-155: 1.1.sta00537 -sel_port-156: 1.1.sta01537 -sel_port-157: 1.1.sta00038 -sel_port-158: 1.1.sta01038 -sel_port-159: 1.1.sta00538 -sel_port-160: 1.1.sta01538 -sel_port-161: 1.1.sta00039 -sel_port-162: 1.1.sta01039 -sel_port-163: 1.1.sta00539 -sel_port-164: 1.1.sta01539 -sel_port-165: 1.1.sta00040 -sel_port-166: 1.1.sta01040 -sel_port-167: 1.1.sta00540 -sel_port-168: 1.1.sta01540 -sel_port-169: 1.1.sta00041 -sel_port-170: 1.1.sta01041 -sel_port-171: 1.1.sta00541 -sel_port-172: 1.1.sta01541 -sel_port-173: 1.1.sta00042 -sel_port-174: 1.1.sta01042 -sel_port-175: 1.1.sta00542 -sel_port-176: 1.1.sta01542 -sel_port-177: 1.1.sta00043 -sel_port-178: 1.1.sta01043 -sel_port-179: 1.1.sta00543 -sel_port-180: 1.1.sta01543 -sel_port-181: 1.1.sta00044 -sel_port-182: 1.1.sta01044 -sel_port-183: 1.1.sta00544 -sel_port-184: 1.1.sta01544 -sel_port-185: 1.1.sta00045 -sel_port-186: 1.1.sta01045 -sel_port-187: 1.1.sta00545 -sel_port-188: 1.1.sta01545 -sel_port-189: 1.1.sta00046 -sel_port-190: 1.1.sta01046 -sel_port-191: 1.1.sta00546 -sel_port-192: 1.1.sta01546 -sel_port-193: 1.1.sta00047 -sel_port-194: 1.1.sta01047 -sel_port-195: 1.1.sta00547 -sel_port-196: 1.1.sta01547 -sel_port-197: 1.1.sta00048 -sel_port-198: 1.1.sta01048 -sel_port-199: 1.1.sta00548 -sel_port-200: 1.1.sta01548 -sel_port-201: 1.1.sta00049 -sel_port-202: 1.1.sta01049 -sel_port-203: 1.1.sta00549 -sel_port-204: 1.1.sta01549 -sel_port-205: 1.1.sta00050 -sel_port-206: 1.1.sta01050 -sel_port-207: 1.1.sta00550 -sel_port-208: 1.1.sta01550 -sel_port-209: 1.1.sta00051 -sel_port-210: 1.1.sta01051 -sel_port-211: 1.1.sta00551 -sel_port-212: 1.1.sta01551 -sel_port-213: 1.1.sta00052 -sel_port-214: 1.1.sta01052 -sel_port-215: 1.1.sta00552 -sel_port-216: 1.1.sta01552 -sel_port-217: 1.1.sta00053 -sel_port-218: 1.1.sta01053 -sel_port-219: 1.1.sta00553 -sel_port-220: 1.1.sta01553 -sel_port-221: 1.1.sta00054 -sel_port-222: 1.1.sta01054 -sel_port-223: 1.1.sta00554 -sel_port-224: 1.1.sta01554 -sel_port-225: 1.1.sta00055 -sel_port-226: 1.1.sta01055 -sel_port-227: 1.1.sta00555 -sel_port-228: 1.1.sta01555 -sel_port-229: 1.1.sta00056 -sel_port-230: 1.1.sta01056 -sel_port-231: 1.1.sta00556 -sel_port-232: 1.1.sta01556 -sel_port-233: 1.1.sta00057 -sel_port-234: 1.1.sta01057 -sel_port-235: 1.1.sta00557 -sel_port-236: 1.1.sta01557 -sel_port-237: 1.1.sta00058 -sel_port-238: 1.1.sta01058 -sel_port-239: 1.1.sta00558 -sel_port-240: 1.1.sta01558 -sel_port-241: 1.1.sta00059 -sel_port-242: 1.1.sta01059 -sel_port-243: 1.1.sta00559 -sel_port-244: 1.1.sta01559 -sel_port-245: 1.1.sta00060 -sel_port-246: 1.1.sta01060 -sel_port-247: 1.1.sta00560 -sel_port-248: 1.1.sta01560 -sel_port-249: 1.1.sta00061 -sel_port-250: 1.1.sta01061 -sel_port-251: 1.1.sta00561 -sel_port-252: 1.1.sta01561 -sel_port-253: 1.1.sta00062 -sel_port-254: 1.1.sta01062 -sel_port-255: 1.1.sta00562 -sel_port-256: 1.1.sta01562 -sel_port-257: 1.1.sta00063 -sel_port-258: 1.1.sta01063 -sel_port-259: 1.1.sta00563 -sel_port-260: 1.1.sta01563 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-12/NOTES.txt b/testbeds/nola-basic-12/NOTES.txt deleted file mode 100644 index 6cad5cf80..000000000 --- a/testbeds/nola-basic-12/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an cig 188n wifi-6, running TIP OpenWrt. diff --git a/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/bugcheck b/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/bugcheck deleted file mode 100644 index b138a6fad..000000000 --- a/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/bugcheck +++ /dev/null @@ -1,2 +0,0 @@ -DO_BUGCHECK=1 -export DO_BUGCHECK diff --git a/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index a2c72dbb2..000000000 --- a/testbeds/nola-basic-12/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,33 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'platform/soc/c000000.wifi' - option htmode 'HE80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:c1:01:88:12:00' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'platform/soc/c000000.wifi+1' - option htmode 'HE20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:c1:01:88:12:01' diff --git a/testbeds/nola-basic-12/ap-auto.txt b/testbeds/nola-basic-12/ap-auto.txt deleted file mode 100644 index 0d3b14a58..000000000 --- a/testbeds/nola-basic-12/ap-auto.txt +++ /dev/null @@ -1,120 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: NOLA-12-Basic -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -skip_5b: 1 -skip_dual: 0 -skip_tri: 1 -dut5b-0: NA -dut5-0: TIP Default-SSID-5gl -dut2-0: TIP Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_mcast_dl_min: 100000 -stab_mcast_dl_max: 0 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 65 -max_stations_5: 67 -max_stations_5b: 64 -max_stations_dual: 132 -max_stations_tri: 64 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -hunt_iter: 100 -bind_bssid: 1 -set_txpower_default: 0 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -stability_use_pkt_sizes: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps -radio2-0: 1.1.4 wiphy2 -radio2-1: 1.1.6 wiphy4 -radio5-0: 1.1.5 wiphy3 -radio5-1: 1.1.7 wiphy5 -radio5-2: 1.1.9 wiphy6 -radio5-3: 1.1.9 wiphy7 -basic_cx: 1 -tput: 0 -tput_multi: 0 -tput_multi_tcp: 1 -tput_multi_udp: 1 -tput_multi_dl: 1 -tput_multi_ul: 1 -dual_band_tput: 0 -capacity: 0 -band_steering: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 -bandsteer_always_5g: 0 - diff --git a/testbeds/nola-basic-12/dpt-pkt-sz.txt b/testbeds/nola-basic-12/dpt-pkt-sz.txt deleted file mode 100644 index 670fb0c2b..000000000 --- a/testbeds/nola-basic-12/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: TIP -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-12/run_basic.bash b/testbeds/nola-basic-12/run_basic.bash deleted file mode 100755 index 7d88ff44d..000000000 --- a/testbeds/nola-basic-12/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-12/run_basic_fast.bash b/testbeds/nola-basic-12/run_basic_fast.bash deleted file mode 100755 index 1d85a73cd..000000000 --- a/testbeds/nola-basic-12/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-12/scenario.txt b/testbeds/nola-basic-12/scenario.txt deleted file mode 100644 index f2ab6bd99..000000000 --- a/testbeds/nola-basic-12/scenario.txt +++ /dev/null @@ -1,9 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth1,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-12/scenario_small.txt b/testbeds/nola-basic-12/scenario_small.txt deleted file mode 100644 index 072c13b13..000000000 --- a/testbeds/nola-basic-12/scenario_small.txt +++ /dev/null @@ -1,9 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth1,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-12/test_bed_cfg.bash b/testbeds/nola-basic-12/test_bed_cfg.bash deleted file mode 100644 index 53c1a3ca4..000000000 --- a/testbeds/nola-basic-12/test_bed_cfg.bash +++ /dev/null @@ -1,62 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -NOLA_NUM=12 - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP1} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF1} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf12} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf12} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-${NOLA_NUM}-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=CIG-188n -DUT_MODEL=CIG-188n -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=00:c1:01:88:12:01 -# 5Ghz radio -DUT_BSSID2=00:c1:01:88:12:00 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-12/wct.txt b/testbeds/nola-basic-12/wct.txt deleted file mode 100644 index b4eeaa756..000000000 --- a/testbeds/nola-basic-12/wct.txt +++ /dev/null @@ -1,197 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta00001 -sel_port-3: 1.1.sta00002 -sel_port-4: 1.1.sta00003 -sel_port-5: 1.1.sta00004 -sel_port-6: 1.1.sta00005 -sel_port-7: 1.1.sta00006 -sel_port-8: 1.1.sta00007 -sel_port-9: 1.1.sta00008 -sel_port-10: 1.1.sta00009 -sel_port-11: 1.1.sta00010 -sel_port-12: 1.1.sta00011 -sel_port-13: 1.1.sta00012 -sel_port-14: 1.1.sta00013 -sel_port-15: 1.1.sta00014 -sel_port-16: 1.1.sta00015 -sel_port-17: 1.1.sta00016 -sel_port-18: 1.1.sta00017 -sel_port-19: 1.1.sta00018 -sel_port-20: 1.1.sta00019 -sel_port-21: 1.1.sta00020 -sel_port-22: 1.1.sta00021 -sel_port-23: 1.1.sta00022 -sel_port-24: 1.1.sta00023 -sel_port-25: 1.1.sta00024 -sel_port-26: 1.1.sta00025 -sel_port-27: 1.1.sta00026 -sel_port-28: 1.1.sta00027 -sel_port-29: 1.1.sta00028 -sel_port-30: 1.1.sta00029 -sel_port-31: 1.1.sta00030 -sel_port-32: 1.1.sta00031 -sel_port-33: 1.1.sta00032 -sel_port-34: 1.1.sta00033 -sel_port-35: 1.1.sta00034 -sel_port-36: 1.1.sta00035 -sel_port-37: 1.1.sta00036 -sel_port-38: 1.1.sta00037 -sel_port-39: 1.1.sta00038 -sel_port-40: 1.1.sta00039 -sel_port-41: 1.1.sta00040 -sel_port-42: 1.1.sta00041 -sel_port-43: 1.1.sta00042 -sel_port-44: 1.1.sta00043 -sel_port-45: 1.1.sta00044 -sel_port-46: 1.1.sta00045 -sel_port-47: 1.1.sta00046 -sel_port-48: 1.1.sta00047 -sel_port-49: 1.1.sta00048 -sel_port-50: 1.1.sta00049 -sel_port-51: 1.1.sta00050 -sel_port-52: 1.1.sta00051 -sel_port-53: 1.1.sta00052 -sel_port-54: 1.1.sta00053 -sel_port-55: 1.1.sta00054 -sel_port-56: 1.1.sta00055 -sel_port-57: 1.1.sta00056 -sel_port-58: 1.1.sta00057 -sel_port-59: 1.1.sta00058 -sel_port-60: 1.1.sta00059 -sel_port-61: 1.1.sta00060 -sel_port-62: 1.1.sta00061 -sel_port-63: 1.1.sta00062 -sel_port-64: 1.1.sta00063 -sel_port-65: 1.1.sta00500 -sel_port-66: 1.1.sta00501 -sel_port-67: 1.1.sta00502 -sel_port-68: 1.1.sta00503 -sel_port-69: 1.1.sta00504 -sel_port-70: 1.1.sta00505 -sel_port-71: 1.1.sta00506 -sel_port-72: 1.1.sta00507 -sel_port-73: 1.1.sta00508 -sel_port-74: 1.1.sta00509 -sel_port-75: 1.1.sta00510 -sel_port-76: 1.1.sta00511 -sel_port-77: 1.1.sta00512 -sel_port-78: 1.1.sta00513 -sel_port-79: 1.1.sta00514 -sel_port-80: 1.1.sta00515 -sel_port-81: 1.1.sta00516 -sel_port-82: 1.1.sta00517 -sel_port-83: 1.1.sta00518 -sel_port-84: 1.1.sta00519 -sel_port-85: 1.1.sta00520 -sel_port-86: 1.1.sta00521 -sel_port-87: 1.1.sta00522 -sel_port-88: 1.1.sta00523 -sel_port-89: 1.1.sta00524 -sel_port-90: 1.1.sta00525 -sel_port-91: 1.1.sta00526 -sel_port-92: 1.1.sta00527 -sel_port-93: 1.1.sta00528 -sel_port-94: 1.1.sta00529 -sel_port-95: 1.1.sta00530 -sel_port-96: 1.1.sta00531 -sel_port-97: 1.1.sta00532 -sel_port-98: 1.1.sta00533 -sel_port-99: 1.1.sta00534 -sel_port-100: 1.1.sta00535 -sel_port-101: 1.1.sta00536 -sel_port-102: 1.1.sta00537 -sel_port-103: 1.1.sta00538 -sel_port-104: 1.1.sta00539 -sel_port-105: 1.1.sta00540 -sel_port-106: 1.1.sta00541 -sel_port-107: 1.1.sta00542 -sel_port-108: 1.1.sta00543 -sel_port-109: 1.1.sta00544 -sel_port-110: 1.1.sta00545 -sel_port-111: 1.1.sta00546 -sel_port-112: 1.1.sta00547 -sel_port-113: 1.1.sta00548 -sel_port-114: 1.1.sta00549 -sel_port-115: 1.1.sta00550 -sel_port-116: 1.1.sta00551 -sel_port-117: 1.1.sta00552 -sel_port-118: 1.1.sta00553 -sel_port-119: 1.1.sta00554 -sel_port-120: 1.1.sta00555 -sel_port-121: 1.1.sta00556 -sel_port-122: 1.1.sta00557 -sel_port-123: 1.1.sta00558 -sel_port-124: 1.1.sta00559 -sel_port-125: 1.1.sta00560 -sel_port-126: 1.1.sta00561 -sel_port-127: 1.1.sta00562 -sel_port-128: 1.1.sta00563 -sel_port-129: 1.1.wlan4 -sel_port-130: 1.1.wlan5 -sel_port-131: 1.1.wlan6 -sel_port-132: 1.1.wlan7 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: Capacity-TCP-UL+DL -bg: 0xE0ECF8 -test_rig: NOLA-12-Basic -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -skip_5b: 1 -skip_dual: 0 -skip_tri: 1 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 60000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - diff --git a/testbeds/nola-basic-13/NOTES.txt b/testbeds/nola-basic-13/NOTES.txt deleted file mode 100644 index 9fec63916..000000000 --- a/testbeds/nola-basic-13/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ - -DUT is an EAP-102 wifi-6, running TIP OpenWrt. diff --git a/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/bugcheck b/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/bugcheck deleted file mode 100644 index b138a6fad..000000000 --- a/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/bugcheck +++ /dev/null @@ -1,2 +0,0 @@ -DO_BUGCHECK=1 -export DO_BUGCHECK diff --git a/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 0c973bd5b..000000000 --- a/testbeds/nola-basic-13/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,34 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'platform/soc/c000000.wifi1' - option htmode 'HE80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ea:D2:01:02' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'platform/soc/c000000.wifi1+1' - option htmode 'HE20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ea:92:01:02' - diff --git a/testbeds/nola-basic-13/ap-auto.txt b/testbeds/nola-basic-13/ap-auto.txt deleted file mode 100644 index 0727523bb..000000000 --- a/testbeds/nola-basic-13/ap-auto.txt +++ /dev/null @@ -1,114 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: TIP Default-SSID-5gl -dut2-0: TIP Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -#max_stations_2: 129 -#max_stations_5: 131 -#max_stations_dual: 260 -max_stations_2: 64 -max_stations_5: 64 -max_stations_dual: 128 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.0 wiphy2 -radio2-2: 1.1.0 wiphy4 -radio5-0: 1.1.5 wiphy3 -radio5-1: 1.1.7 wiphy5 -radio5-2: 1.1.9 wiphy6 -radio5-3: 1.1.9 wiphy7 -radio5-4: 1.1.0 wiphy1 -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-13/dpt-pkt-sz.txt b/testbeds/nola-basic-13/dpt-pkt-sz.txt deleted file mode 100644 index 670fb0c2b..000000000 --- a/testbeds/nola-basic-13/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: TIP -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-13/run_basic.bash b/testbeds/nola-basic-13/run_basic.bash deleted file mode 100755 index 7d88ff44d..000000000 --- a/testbeds/nola-basic-13/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-13/run_basic_fast.bash b/testbeds/nola-basic-13/run_basic_fast.bash deleted file mode 100755 index 1d85a73cd..000000000 --- a/testbeds/nola-basic-13/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-13/scenario.txt b/testbeds/nola-basic-13/scenario.txt deleted file mode 100644 index d66adf262..000000000 --- a/testbeds/nola-basic-13/scenario.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 32 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 32 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 32 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 28 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-13/scenario_small.txt b/testbeds/nola-basic-13/scenario_small.txt deleted file mode 100644 index d70e64875..000000000 --- a/testbeds/nola-basic-13/scenario_small.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-13/test_bed_cfg.bash b/testbeds/nola-basic-13/test_bed_cfg.bash deleted file mode 100644 index a402bb941..000000000 --- a/testbeds/nola-basic-13/test_bed_cfg.bash +++ /dev/null @@ -1,62 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -NOLA_NUM=13 - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP2} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF2} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf13} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf13} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-${NOLA_NUM}-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=EAP-102 -DUT_MODEL=EAP-102 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=00:00:ea:92:01:02 -# 5Ghz radio -DUT_BSSID2=00:00:ea:D2:01:02 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-13/wct.txt b/testbeds/nola-basic-13/wct.txt deleted file mode 100644 index c673f3abb..000000000 --- a/testbeds/nola-basic-13/wct.txt +++ /dev/null @@ -1,191 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta00001 -sel_port-3: 1.1.sta00002 -sel_port-4: 1.1.sta00003 -sel_port-5: 1.1.sta00004 -sel_port-6: 1.1.sta00005 -sel_port-7: 1.1.sta00006 -sel_port-8: 1.1.sta00007 -sel_port-9: 1.1.sta00008 -sel_port-10: 1.1.sta00009 -sel_port-11: 1.1.sta00010 -sel_port-12: 1.1.sta00011 -sel_port-13: 1.1.sta00012 -sel_port-14: 1.1.sta00013 -sel_port-15: 1.1.sta00014 -sel_port-16: 1.1.sta00015 -sel_port-17: 1.1.sta00016 -sel_port-18: 1.1.sta00017 -sel_port-19: 1.1.sta00018 -sel_port-20: 1.1.sta00019 -sel_port-21: 1.1.sta00020 -sel_port-22: 1.1.sta00021 -sel_port-23: 1.1.sta00022 -sel_port-24: 1.1.sta00023 -sel_port-25: 1.1.sta00024 -sel_port-26: 1.1.sta00025 -sel_port-27: 1.1.sta00026 -sel_port-28: 1.1.sta00027 -sel_port-29: 1.1.sta00028 -sel_port-30: 1.1.sta00029 -sel_port-31: 1.1.sta00030 -sel_port-32: 1.1.sta00031 -sel_port-33: 1.1.sta00500 -sel_port-34: 1.1.sta00501 -sel_port-35: 1.1.sta00502 -sel_port-36: 1.1.sta00503 -sel_port-37: 1.1.sta00504 -sel_port-38: 1.1.sta00505 -sel_port-39: 1.1.sta00506 -sel_port-40: 1.1.sta00507 -sel_port-41: 1.1.sta00508 -sel_port-42: 1.1.sta00509 -sel_port-43: 1.1.sta00510 -sel_port-44: 1.1.sta00511 -sel_port-45: 1.1.sta00512 -sel_port-46: 1.1.sta00513 -sel_port-47: 1.1.sta00514 -sel_port-48: 1.1.sta00515 -sel_port-49: 1.1.sta00516 -sel_port-50: 1.1.sta00517 -sel_port-51: 1.1.sta00518 -sel_port-52: 1.1.sta00519 -sel_port-53: 1.1.sta00520 -sel_port-54: 1.1.sta00521 -sel_port-55: 1.1.sta00522 -sel_port-56: 1.1.sta00523 -sel_port-57: 1.1.sta00524 -sel_port-58: 1.1.sta00525 -sel_port-59: 1.1.sta00526 -sel_port-60: 1.1.sta00527 -sel_port-61: 1.1.sta00528 -sel_port-62: 1.1.sta00529 -sel_port-63: 1.1.sta00530 -sel_port-64: 1.1.sta00531 -sel_port-65: 1.1.sta01000 -sel_port-66: 1.1.sta01001 -sel_port-67: 1.1.sta01002 -sel_port-68: 1.1.sta01003 -sel_port-69: 1.1.sta01004 -sel_port-70: 1.1.sta01005 -sel_port-71: 1.1.sta01006 -sel_port-72: 1.1.sta01007 -sel_port-73: 1.1.sta01008 -sel_port-74: 1.1.sta01009 -sel_port-75: 1.1.sta01010 -sel_port-76: 1.1.sta01011 -sel_port-77: 1.1.sta01012 -sel_port-78: 1.1.sta01013 -sel_port-79: 1.1.sta01014 -sel_port-80: 1.1.sta01015 -sel_port-81: 1.1.sta01016 -sel_port-82: 1.1.sta01017 -sel_port-83: 1.1.sta01018 -sel_port-84: 1.1.sta01019 -sel_port-85: 1.1.sta01020 -sel_port-86: 1.1.sta01021 -sel_port-87: 1.1.sta01022 -sel_port-88: 1.1.sta01023 -sel_port-89: 1.1.sta01024 -sel_port-90: 1.1.sta01025 -sel_port-91: 1.1.sta01026 -sel_port-92: 1.1.sta01027 -sel_port-93: 1.1.sta01028 -sel_port-94: 1.1.sta01029 -sel_port-95: 1.1.sta01030 -sel_port-96: 1.1.sta01031 -sel_port-97: 1.1.sta01500 -sel_port-98: 1.1.sta01501 -sel_port-99: 1.1.sta01502 -sel_port-100: 1.1.sta01503 -sel_port-101: 1.1.sta01504 -sel_port-102: 1.1.sta01505 -sel_port-103: 1.1.sta01506 -sel_port-104: 1.1.sta01507 -sel_port-105: 1.1.sta01508 -sel_port-106: 1.1.sta01509 -sel_port-107: 1.1.sta01510 -sel_port-108: 1.1.sta01511 -sel_port-109: 1.1.sta01512 -sel_port-110: 1.1.sta01513 -sel_port-111: 1.1.sta01514 -sel_port-112: 1.1.sta01515 -sel_port-113: 1.1.sta01516 -sel_port-114: 1.1.sta01517 -sel_port-115: 1.1.sta01518 -sel_port-116: 1.1.sta01519 -sel_port-117: 1.1.sta01520 -sel_port-118: 1.1.sta01521 -sel_port-119: 1.1.sta01522 -sel_port-120: 1.1.sta01523 -sel_port-121: 1.1.sta01524 -sel_port-122: 1.1.sta01525 -sel_port-123: 1.1.sta01526 -sel_port-124: 1.1.sta01527 -sel_port-125: 1.1.wlan4 -sel_port-126: 1.1.wlan5 -sel_port-127: 1.1.wlan6 -sel_port-128: 1.1.wlan7 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-14/NOTES.txt b/testbeds/nola-basic-14/NOTES.txt deleted file mode 100644 index e708146af..000000000 --- a/testbeds/nola-basic-14/NOTES.txt +++ /dev/null @@ -1,2 +0,0 @@ -DUT is an EAP-102 wifi-6, running TIP OpenWrt. -Configured for <= 128 stations total. diff --git a/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/bugcheck b/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/bugcheck deleted file mode 100644 index b138a6fad..000000000 --- a/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/bugcheck +++ /dev/null @@ -1,2 +0,0 @@ -DO_BUGCHECK=1 -export DO_BUGCHECK diff --git a/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index f58ce0822..000000000 --- a/testbeds/nola-basic-14/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,34 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'platform/soc/c000000.wifi1' - option htmode 'HE80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ea:D2:01:03' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'platform/soc/c000000.wifi1+1' - option htmode 'HE20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - option macaddr '00:00:ea:92:01:03' - diff --git a/testbeds/nola-basic-14/ap-auto.txt b/testbeds/nola-basic-14/ap-auto.txt deleted file mode 100644 index df17fd21f..000000000 --- a/testbeds/nola-basic-14/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: TIP Default-SSID-5gl -dut2-0: TIP Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 60 -max_stations_5: 60 -max_stations_dual: 120 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.0 wiphy2 -radio2-2: 1.1.0 wiphy4 -radio5-0: 1.1.5 wiphy3 -radio5-1: 1.1.7 wiphy5 -radio5-2: 1.1.9 wiphy6 -radio5-3: 1.1.9 wiphy7 -radio5-4: 1.1.0 wiphy1 -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-14/dpt-pkt-sz.txt b/testbeds/nola-basic-14/dpt-pkt-sz.txt deleted file mode 100644 index 670fb0c2b..000000000 --- a/testbeds/nola-basic-14/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: TIP -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-14/run_basic.bash b/testbeds/nola-basic-14/run_basic.bash deleted file mode 100755 index 7d88ff44d..000000000 --- a/testbeds/nola-basic-14/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-14/run_basic_fast.bash b/testbeds/nola-basic-14/run_basic_fast.bash deleted file mode 100755 index 1d85a73cd..000000000 --- a/testbeds/nola-basic-14/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-14/scenario.txt b/testbeds/nola-basic-14/scenario.txt deleted file mode 100644 index d70e64875..000000000 --- a/testbeds/nola-basic-14/scenario.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-14/scenario_small.txt b/testbeds/nola-basic-14/scenario_small.txt deleted file mode 100644 index d70e64875..000000000 --- a/testbeds/nola-basic-14/scenario_small.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-14/test_bed_cfg.bash b/testbeds/nola-basic-14/test_bed_cfg.bash deleted file mode 100644 index 8b489978b..000000000 --- a/testbeds/nola-basic-14/test_bed_cfg.bash +++ /dev/null @@ -1,62 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -NOLA_NUM=14 - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP3} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF3} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf14} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf14} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-${NOLA_NUM}-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=EAP-102 -DUT_MODEL=EAP-102 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=00:00:ea:92:01:03 -# 5Ghz radio -DUT_BSSID2=00:00:ea:D2:01:03 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-14/wct.txt b/testbeds/nola-basic-14/wct.txt deleted file mode 100644 index 321ac7c13..000000000 --- a/testbeds/nola-basic-14/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta00001 -sel_port-3: 1.1.sta00002 -sel_port-4: 1.1.sta00003 -sel_port-5: 1.1.sta00004 -sel_port-6: 1.1.sta00005 -sel_port-7: 1.1.sta00006 -sel_port-8: 1.1.sta00007 -sel_port-9: 1.1.sta00008 -sel_port-10: 1.1.sta00009 -sel_port-11: 1.1.sta00010 -sel_port-12: 1.1.sta00011 -sel_port-13: 1.1.sta00012 -sel_port-14: 1.1.sta00013 -sel_port-15: 1.1.sta00014 -sel_port-16: 1.1.sta00015 -sel_port-17: 1.1.sta00016 -sel_port-18: 1.1.sta00017 -sel_port-19: 1.1.sta00018 -sel_port-20: 1.1.sta00019 -sel_port-21: 1.1.sta00020 -sel_port-22: 1.1.sta00021 -sel_port-23: 1.1.sta00022 -sel_port-24: 1.1.sta00023 -sel_port-25: 1.1.sta00024 -sel_port-26: 1.1.sta00025 -sel_port-27: 1.1.sta00026 -sel_port-28: 1.1.sta00027 -sel_port-29: 1.1.sta00028 -sel_port-30: 1.1.sta00029 -sel_port-31: 1.1.sta00030 -sel_port-32: 1.1.sta00031 -sel_port-33: 1.1.sta00032 -sel_port-34: 1.1.sta00033 -sel_port-35: 1.1.sta00034 -sel_port-36: 1.1.sta00035 -sel_port-37: 1.1.sta00036 -sel_port-38: 1.1.sta00037 -sel_port-39: 1.1.sta00038 -sel_port-40: 1.1.sta00039 -sel_port-41: 1.1.sta00040 -sel_port-42: 1.1.sta00041 -sel_port-43: 1.1.sta00042 -sel_port-44: 1.1.sta00043 -sel_port-45: 1.1.sta00044 -sel_port-46: 1.1.sta00045 -sel_port-47: 1.1.sta00046 -sel_port-48: 1.1.sta00047 -sel_port-49: 1.1.sta00048 -sel_port-50: 1.1.sta00049 -sel_port-51: 1.1.sta00050 -sel_port-52: 1.1.sta00051 -sel_port-53: 1.1.sta00052 -sel_port-54: 1.1.sta00053 -sel_port-55: 1.1.sta00054 -sel_port-56: 1.1.sta00055 -sel_port-57: 1.1.sta00056 -sel_port-58: 1.1.sta00057 -sel_port-59: 1.1.sta00058 -sel_port-60: 1.1.sta00059 -sel_port-61: 1.1.sta00060 -sel_port-62: 1.1.sta00061 -sel_port-63: 1.1.sta00062 -sel_port-64: 1.1.sta00063 -sel_port-65: 1.1.sta00500 -sel_port-66: 1.1.sta00501 -sel_port-67: 1.1.sta00502 -sel_port-68: 1.1.sta00503 -sel_port-69: 1.1.sta00504 -sel_port-70: 1.1.sta00505 -sel_port-71: 1.1.sta00506 -sel_port-72: 1.1.sta00507 -sel_port-73: 1.1.sta00508 -sel_port-74: 1.1.sta00509 -sel_port-75: 1.1.sta00510 -sel_port-76: 1.1.sta00511 -sel_port-77: 1.1.sta00512 -sel_port-78: 1.1.sta00513 -sel_port-79: 1.1.sta00514 -sel_port-80: 1.1.sta00515 -sel_port-81: 1.1.sta00516 -sel_port-82: 1.1.sta00517 -sel_port-83: 1.1.sta00518 -sel_port-84: 1.1.sta00519 -sel_port-85: 1.1.sta00520 -sel_port-86: 1.1.sta00521 -sel_port-87: 1.1.sta00522 -sel_port-88: 1.1.sta00523 -sel_port-89: 1.1.sta00524 -sel_port-90: 1.1.sta00525 -sel_port-91: 1.1.sta00526 -sel_port-92: 1.1.sta00527 -sel_port-93: 1.1.sta00528 -sel_port-94: 1.1.sta00529 -sel_port-95: 1.1.sta00530 -sel_port-96: 1.1.sta00531 -sel_port-97: 1.1.sta00532 -sel_port-98: 1.1.sta00533 -sel_port-99: 1.1.sta00534 -sel_port-100: 1.1.sta00535 -sel_port-101: 1.1.sta00536 -sel_port-102: 1.1.sta00537 -sel_port-103: 1.1.sta00538 -sel_port-104: 1.1.sta00539 -sel_port-105: 1.1.sta00540 -sel_port-106: 1.1.sta00541 -sel_port-107: 1.1.sta00542 -sel_port-108: 1.1.sta00543 -sel_port-109: 1.1.sta00544 -sel_port-110: 1.1.sta00545 -sel_port-111: 1.1.sta00546 -sel_port-112: 1.1.sta00547 -sel_port-113: 1.1.sta00548 -sel_port-114: 1.1.sta00549 -sel_port-115: 1.1.sta00550 -sel_port-116: 1.1.sta00551 -sel_port-117: 1.1.sta00552 -sel_port-118: 1.1.sta00553 -sel_port-119: 1.1.sta00554 -sel_port-120: 1.1.sta00555 -sel_port-121: 1.1.sta00556 -sel_port-122: 1.1.sta00557 -sel_port-123: 1.1.sta00558 -sel_port-124: 1.1.sta00559 -sel_port-125: 1.1.sta00560 -sel_port-126: 1.1.sta00561 -sel_port-127: 1.1.sta00562 -sel_port-128: 1.1.sta00563 -sel_port-129: 1.1.sta04000 -sel_port-130: 1.1.sta04001 -sel_port-131: 1.1.sta04002 -sel_port-132: 1.1.sta04003 -sel_port-133: 1.1.sta04004 -sel_port-134: 1.1.sta04005 -sel_port-135: 1.1.sta04006 -sel_port-136: 1.1.sta04007 -sel_port-137: 1.1.sta04008 -sel_port-138: 1.1.sta04009 -sel_port-139: 1.1.sta04010 -sel_port-140: 1.1.sta04011 -sel_port-141: 1.1.sta04012 -sel_port-142: 1.1.sta04013 -sel_port-143: 1.1.sta04014 -sel_port-144: 1.1.sta04015 -sel_port-145: 1.1.sta04016 -sel_port-146: 1.1.sta04017 -sel_port-147: 1.1.sta04018 -sel_port-148: 1.1.sta04019 -sel_port-149: 1.1.sta04020 -sel_port-150: 1.1.sta04021 -sel_port-151: 1.1.sta04022 -sel_port-152: 1.1.sta04023 -sel_port-153: 1.1.sta04024 -sel_port-154: 1.1.sta04025 -sel_port-155: 1.1.sta04026 -sel_port-156: 1.1.sta04027 -sel_port-157: 1.1.sta04028 -sel_port-158: 1.1.sta04029 -sel_port-159: 1.1.sta04030 -sel_port-160: 1.1.sta04031 -sel_port-161: 1.1.sta04032 -sel_port-162: 1.1.sta04033 -sel_port-163: 1.1.sta04034 -sel_port-164: 1.1.sta04035 -sel_port-165: 1.1.sta04036 -sel_port-166: 1.1.sta04037 -sel_port-167: 1.1.sta04038 -sel_port-168: 1.1.sta04039 -sel_port-169: 1.1.sta04040 -sel_port-170: 1.1.sta04041 -sel_port-171: 1.1.sta04042 -sel_port-172: 1.1.sta04043 -sel_port-173: 1.1.sta04044 -sel_port-174: 1.1.sta04045 -sel_port-175: 1.1.sta04046 -sel_port-176: 1.1.sta04047 -sel_port-177: 1.1.sta04048 -sel_port-178: 1.1.sta04049 -sel_port-179: 1.1.sta04050 -sel_port-180: 1.1.sta04051 -sel_port-181: 1.1.sta04052 -sel_port-182: 1.1.sta04053 -sel_port-183: 1.1.sta04054 -sel_port-184: 1.1.sta04055 -sel_port-185: 1.1.sta04056 -sel_port-186: 1.1.sta04057 -sel_port-187: 1.1.sta04058 -sel_port-188: 1.1.sta04059 -sel_port-189: 1.1.sta04060 -sel_port-190: 1.1.sta04061 -sel_port-191: 1.1.sta04062 -sel_port-192: 1.1.sta04063 -sel_port-193: 1.1.sta04500 -sel_port-194: 1.1.sta04501 -sel_port-195: 1.1.sta04502 -sel_port-196: 1.1.sta04503 -sel_port-197: 1.1.sta04504 -sel_port-198: 1.1.sta04505 -sel_port-199: 1.1.sta04506 -sel_port-200: 1.1.sta04507 -sel_port-201: 1.1.sta04508 -sel_port-202: 1.1.sta04509 -sel_port-203: 1.1.sta04510 -sel_port-204: 1.1.sta04511 -sel_port-205: 1.1.sta04512 -sel_port-206: 1.1.sta04513 -sel_port-207: 1.1.sta04514 -sel_port-208: 1.1.sta04515 -sel_port-209: 1.1.sta04516 -sel_port-210: 1.1.sta04517 -sel_port-211: 1.1.sta04518 -sel_port-212: 1.1.sta04519 -sel_port-213: 1.1.sta04520 -sel_port-214: 1.1.sta04521 -sel_port-215: 1.1.sta04522 -sel_port-216: 1.1.sta04523 -sel_port-217: 1.1.sta04524 -sel_port-218: 1.1.sta04525 -sel_port-219: 1.1.sta04526 -sel_port-220: 1.1.sta04527 -sel_port-221: 1.1.sta04528 -sel_port-222: 1.1.sta04529 -sel_port-223: 1.1.sta04530 -sel_port-224: 1.1.sta04531 -sel_port-225: 1.1.sta04532 -sel_port-226: 1.1.sta04533 -sel_port-227: 1.1.sta04534 -sel_port-228: 1.1.sta04535 -sel_port-229: 1.1.sta04536 -sel_port-230: 1.1.sta04537 -sel_port-231: 1.1.sta04538 -sel_port-232: 1.1.sta04539 -sel_port-233: 1.1.sta04540 -sel_port-234: 1.1.sta04541 -sel_port-235: 1.1.sta04542 -sel_port-236: 1.1.sta04543 -sel_port-237: 1.1.sta04544 -sel_port-238: 1.1.sta04545 -sel_port-239: 1.1.sta04546 -sel_port-240: 1.1.sta04547 -sel_port-241: 1.1.sta04548 -sel_port-242: 1.1.sta04549 -sel_port-243: 1.1.sta04550 -sel_port-244: 1.1.sta04551 -sel_port-245: 1.1.sta04552 -sel_port-246: 1.1.sta04553 -sel_port-247: 1.1.sta04554 -sel_port-248: 1.1.sta04555 -sel_port-249: 1.1.sta04556 -sel_port-250: 1.1.sta04557 -sel_port-251: 1.1.sta04558 -sel_port-252: 1.1.sta04559 -sel_port-253: 1.1.sta04560 -sel_port-254: 1.1.sta04561 -sel_port-255: 1.1.sta04562 -sel_port-256: 1.1.sta04563 -sel_port-257: 1.1.wlan4 -sel_port-258: 1.1.wlan5 -sel_port-259: 1.1.wlan6 -sel_port-260: 1.1.wlan7 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/testbeds/nola-basic-15/NOTES.txt b/testbeds/nola-basic-15/NOTES.txt deleted file mode 100644 index 7a1412587..000000000 --- a/testbeds/nola-basic-15/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ -DUT is an Edge-Core 5410 wifi-5, running TIP OpenWrt. diff --git a/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/bugcheck b/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/bugcheck deleted file mode 100644 index b138a6fad..000000000 --- a/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/bugcheck +++ /dev/null @@ -1,2 +0,0 @@ -DO_BUGCHECK=1 -export DO_BUGCHECK diff --git a/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/wireless b/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/wireless deleted file mode 100644 index 20cf5293b..000000000 --- a/testbeds/nola-basic-15/OpenWrt-overlay/etc/config/wireless +++ /dev/null @@ -1,32 +0,0 @@ -config wifi-device 'radio0' - option type 'mac80211' - option channel '36' - option hwmode '11a' - option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0' - option htmode 'VHT80' - option disabled '0' - -config wifi-iface 'default_radio0' - option device 'radio0' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-5gl' - option encryption 'psk-mixed' - option key '12345678' - -config wifi-device 'radio1' - option type 'mac80211' - option channel '11' - option hwmode '11g' - option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0' - option htmode 'HT20' - option disabled '0' - -config wifi-iface 'default_radio1' - option device 'radio1' - option network 'lan' - option mode 'ap' - option ssid 'Default-SSID-2g' - option encryption 'psk-mixed' - option key '12345678' - diff --git a/testbeds/nola-basic-15/ap-auto.txt b/testbeds/nola-basic-15/ap-auto.txt deleted file mode 100644 index 71769a40e..000000000 --- a/testbeds/nola-basic-15/ap-auto.txt +++ /dev/null @@ -1,111 +0,0 @@ -[BLANK] -sel_port-0: 1.1.sta00500 -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: AP Auto -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 1 -skip_5: 1 -dut5b-0: NA -dut5-0: TIP Default-SSID-5gl -dut2-0: TIP Default-SSID-2g -dut5b-1: NA -dut5-1: NA -dut2-1: NA -dut5b-2: NA -dut5-2: NA -dut2-2: NA -spatial_streams: AUTO -bandw_options: AUTO -modes: Auto -upstream_port: 1.1.2 eth2 -operator: -mconn: 1 -tos: 0 -vid_buf: 1000000 -vid_speed: 700000 -reset_stall_thresh_udp_dl: 9600 -reset_stall_thresh_udp_ul: 9600 -reset_stall_thresh_tcp_dl: 9600 -reset_stall_thresh_tcp_ul: 9600 -reset_stall_thresh_l4: 100000 -reset_stall_thresh_voip: 20000 -stab_udp_dl_min: 56000 -stab_udp_dl_max: 0 -stab_udp_ul_min: 56000 -stab_udp_ul_max: 0 -stab_tcp_dl_min: 500000 -stab_tcp_dl_max: 0 -stab_tcp_ul_min: 500000 -stab_tcp_ul_max: 0 -dl_speed: 85% -ul_speed: 85% -max_stations_2: 129 -max_stations_5: 131 -max_stations_dual: 260 -lt_sta: 2 -voip_calls: 0 -lt_dur: 3600 -reset_dur: 600 -lt_gi: 30 -dur20: 20 -hunt_retries: 1 -cap_dl: 1 -cap_ul: 0 -cap_use_pkt_sizes: 0 -stability_reset_radios: 0 -pkt_loss_thresh: 10000 -frame_sizes: 200, 512, 1024, MTU -capacities: 1, 2, 5, 10, 20, 40, 64, 128, 256, 512, 1024, MAX -radio2-0: 1.1.4 wiphy0 -radio2-1: 1.1.0 wiphy2 -radio2-2: 1.1.0 wiphy4 -radio5-0: 1.1.5 wiphy3 -radio5-1: 1.1.7 wiphy5 -radio5-2: 1.1.9 wiphy6 -radio5-3: 1.1.9 wiphy7 -radio5-4: 1.1.0 wiphy1 -radio5-5: -basic_cx: 1 -tput: 0 -dual_band_tput: 0 -capacity: 0 -longterm: 0 -mix_stability: 0 -loop_iter: 1 -reset_batch_size: 1 -reset_duration_min: 10000 -reset_duration_max: 60000 - -# Configure pass/fail metrics for this testbed. -pf_text0: 2.4 DL 200 70Mbps -pf_text1: 2.4 DL 512 110Mbps -pf_text2: 2.4 DL 1024 115Mbps -pf_text3: 2.4 DL MTU 120Mbps -pf_text4: -pf_text5: 2.4 UL 200 88Mbps -pf_text6: 2.4 UL 512 106Mbps -pf_text7: 2.4 UL 1024 115Mbps -pf_text8: 2.4 UL MTU 120Mbps -pf_text9: -pf_text10: 5 DL 200 72Mbps -pf_text11: 5 DL 512 185Mbps -pf_text12: 5 DL 1024 370Mbps -pf_text13: 5 DL MTU 525Mbps -pf_text14: -pf_text15: 5 UL 200 90Mbps -pf_text16: 5 UL 512 230Mbps -pf_text17: 5 UL 1024 450Mbps -pf_text18: 5 UL MTU 630Mbps - -# Tune connect-time thresholds. -cx_prcnt: 950000 -cx_open_thresh: 35 -cx_psk_thresh: 75 -cx_1x_thresh: 130 - - diff --git a/testbeds/nola-basic-15/dpt-pkt-sz.txt b/testbeds/nola-basic-15/dpt-pkt-sz.txt deleted file mode 100644 index 670fb0c2b..000000000 --- a/testbeds/nola-basic-15/dpt-pkt-sz.txt +++ /dev/null @@ -1,55 +0,0 @@ -[BLANK] -show_events: 1 -show_log: 0 -port_sorting: 0 -kpi_id: Dataplane -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 0 -skip_2: 0 -skip_5: 0 -selected_dut: TIP -duration: 15000 -traffic_port: 1.1.136 sta00500 -upstream_port: 1.1.2 eth2 -path_loss: 10 -speed: 85% -speed2: 0Kbps -min_rssi_bound: -150 -max_rssi_bound: 0 -channels: AUTO -modes: Auto -pkts: 60;142;256;512;1024;MTU;4000 -spatial_streams: AUTO -security_options: AUTO -bandw_options: AUTO -traffic_types: UDP -directions: DUT Transmit;DUT Receive -txo_preamble: OFDM -txo_mcs: 0 CCK, OFDM, HT, VHT -txo_retries: No Retry -txo_sgi: OFF -txo_txpower: 15 -attenuator: 0 -attenuator2: 0 -attenuator_mod: 255 -attenuator_mod2: 255 -attenuations: 0..+50..950 -attenuations2: 0..+50..950 -chamber: 0 -tt_deg: 0..+45..359 -cust_pkt_sz: -show_3s: 0 -show_ll_graphs: 1 -show_gp_graphs: 1 -show_1m: 1 -pause_iter: 0 -show_realtime: 1 -operator: -mconn: 1 -mpkt: 1000 -tos: 0 -loop_iterations: 1 - - diff --git a/testbeds/nola-basic-15/run_basic.bash b/testbeds/nola-basic-15/run_basic.bash deleted file mode 100755 index 7d88ff44d..000000000 --- a/testbeds/nola-basic-15/run_basic.bash +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Run one test -# DEFAULT_ENABLE=0 DO_SHORT_AP_STABILITY_RESET=1 ./basic_regression.bash - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run all tests -./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-15/run_basic_fast.bash b/testbeds/nola-basic-15/run_basic_fast.bash deleted file mode 100755 index 1d85a73cd..000000000 --- a/testbeds/nola-basic-15/run_basic_fast.bash +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -# Example usage of this script -# DUT_SW_VER=my-build-id ./run_basic.bash -# -# Other DUT variables in test_bed_cfg.bash may also be over-ridden, -# including those below. See LANforge 'add_dut' CLI command for -# details on what these variables are for. - -# DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -# DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -# DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -# DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 - -#set -x - -DO_SHORT_AP_BASIC_CX=${DO_SHORT_AP_BASIC_CX:-1} -DO_WCT_BI=${DO_WCT_BI:-1} - -export DO_SHORT_AP_BASI_CX DO_WCT_BI - -# Source config file -. test_bed_cfg.bash - -echo "Top wlan-testing git commits.
" > ./tmp_gitlog.html
-git log -n 8 --oneline >> ./tmp_gitlog.html
-echo "
" >> ./tmp_gitlog.html - -NOTES_HTML=`pwd`/testbed_notes.html -GITLOG=`pwd`/tmp_gitlog.html - -if [ -d "../../../wlan-ap" ] -then - DUTGITLOG=/tmp/${DUT_SW_VER}_dut_gitlog.html - echo "Top wlan-ap git commits.
" > $DUTGITLOG
-    (cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
-    echo "
" >> $DUTGITLOG - export DUTGITLOG -fi -export NOTES_HTML GITLOG - -# TODO: Copy config file to cloud controller and restart it -# and/or do other config to make it work. - -# Change to scripts dir -cd ../../lanforge/lanforge-scripts/gui - -# Where to place results. basic_regression.bash will use this variable. -RSLTS_DIR=/tmp/nola-${NOLA_NUM}-basic-regression-fast -export RSLTS_DIR - -# Clean any existing data from the results dir -rm -fr $RSLTS_DIR - -# Clean up old DHCP leases -../lf_gui_cmd.pl --manager $GMANAGER --port $GMPORT --cmd "cli clear_port_counters ALL ALL ALL dhcp_leases" - -# Run a subset of available tests -# See 'Tests to run' comment in basic_regression.bash for available options. - -#DEFAULT_ENABLE=0 WCT_DURATION=20s DO_SHORT_AP_BASIC_CX=1 DO_WCT_BI=1 ./basic_regression.bash - -DEFAULT_ENABLE=0 WCT_DURATION=20s ./basic_regression.bash - - -# Run all tests -#./basic_regression.bash - -cd - - -if [ ! -d $RSLTS_DIR ] -then - echo "Test did not run as expected, $RSLTS_DIR not found." - mkdir -p $RSLTS_DIR -fi - -if [ -f ${MY_TMPDIR}/basic_regression_log.txt ] -then - echo "Found ${MY_TMPDIR}/basic_regression_log.txt, moving into $RSLTS_DIR" - mv ${MY_TMPDIR}/basic_regression_log.txt $RSLTS_DIR/ -fi - -echo "See results in $RSLTS_DIR" diff --git a/testbeds/nola-basic-15/scenario.txt b/testbeds/nola-basic-15/scenario.txt deleted file mode 100644 index bde6a131d..000000000 --- a/testbeds/nola-basic-15/scenario.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 64 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-15/scenario_small.txt b/testbeds/nola-basic-15/scenario_small.txt deleted file mode 100644 index d70e64875..000000000 --- a/testbeds/nola-basic-15/scenario_small.txt +++ /dev/null @@ -1,11 +0,0 @@ -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy0,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy1,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-1' NA wiphy2,AUTO -1 -profile_link 1.1 STA-AC 24 'DUT: TIP Radio-2' NA wiphy3,AUTO -1 -profile_link 1.1 upstream-dhcp 1 NA NA eth2,AUTO -1 -profile_link 1.1 uplink-nat 1 'DUT: upstream LAN 10.28.2.1/24' NA eth3,eth2 -1 -profile_link 1.1 STA-AC 1 'DUT: TIP Radio-2' NA ALL-AX,AUTO -1 -dut ecw5410 393 148 -dut TIP 395 295 -dut upstream 306 62 -resource 1.1 132 218 diff --git a/testbeds/nola-basic-15/test_bed_cfg.bash b/testbeds/nola-basic-15/test_bed_cfg.bash deleted file mode 100644 index 0f1d4c61e..000000000 --- a/testbeds/nola-basic-15/test_bed_cfg.bash +++ /dev/null @@ -1,62 +0,0 @@ -# Example test-bed configuration - -# Scripts should source this file to set the default environment variables -# and then override the variables specific to their test case (and it can be done -# in opposite order for same results -# -# After the env variables are set, -# call the 'lanforge/lanforge-scripts/gui/basic_regression.bash' -# from the directory in which it resides. - -NOLA_NUM=15 - -PWD=`pwd` -AP_SERIAL=${AP_SERIAL:-/dev/ttyAP4} -LF_SERIAL=${LF_SERIAL:-/dev/ttyLF4} -LFPASSWD=${LFPASSWD:-lanforge} # Root password on LANforge machine -AP_AUTO_CFG_FILE=${AP_AUTO_CFG_FILE:-$PWD/ap-auto.txt} -WCT_CFG_FILE=${WCT_CFG_FILE:-$PWD/wct.txt} -DPT_CFG_FILE=${DPT_CFG_FILE:-$PWD/dpt-pkt-sz.txt} -SCENARIO_CFG_FILE=${SCENARIO_CFG_FILE:-$PWD/scenario.txt} - -# Default to enable cloud-sdk for this testbed, cloud-sdk is at IP addr below -#USE_CLOUD_SDK=${USE_CLOUD_SDK:-192.168.100.164} - -# LANforge target machine -LFMANAGER=${LFMANAGER:-lf15} - -# LANforge GUI machine (may often be same as target) -GMANAGER=${GMANAGER:-lf15} -GMPORT=${GMPORT:-3990} -MY_TMPDIR=${MY_TMPDIR:-/tmp} - -# Test configuration (10 minutes by default, in interest of time) -STABILITY_DURATION=${STABILITY_DURATION:-600} -TEST_RIG_ID=${TEST_RIG_ID:-NOLA-${NOLA_NUM}-Basic} - -# DUT configuration -DUT_FLAGS=${DUT_FLAGS:-0x22} # AP, WPA-PSK -#DUT_FLAGS=${DUT_FLAGS:-0x2} # AP, Open -DUT_FLAGS_MASK=${DUT_FLAGS_MASK:-0xFFFF} -DUT_SW_VER=${DUT_SW_VER:-OpenWrt-TIP} -DUT_HW_VER=ECW5410 -DUT_MODEL=ECW5410 -DUT_SERIAL=${DUT_SERIAL:-NA} -DUT_SSID1=${DUT_SSID1:-Default-SSID-2g} -DUT_SSID2=${DUT_SSID2:-Default-SSID-5gl} -DUT_PASSWD1=${DUT_PASSWD1:-12345678} -DUT_PASSWD2=${DUT_PASSWD2:-12345678} -# 2.4 radio -DUT_BSSID1=68:21:5F:D2:F7:25 -# 5Ghz radio -DUT_BSSID2=68:21:5F:D2:F7:26 - -export LF_SERIAL AP_SERIAL LFPASSWD -export AP_AUTO_CFG_FILE WCT_CFG_FILE DPT_CFG_FILE SCENARIO_CFG_FILE -export LFMANAGER GMANAGER GMPORT MY_TMPDIR -export STABILITY_DURATION TEST_RIG_ID -export DUT_FLAGS DUT_FLAGS_MASK DUT_SW_VER DUT_HW_VER DUT_MODEL -export DUT_SERIAL DUT_SSID1 DUT_SSID2 DUT_SSID3 -export DUT_PASSWD1 DUT_PASSWD2 DUT_PASSWD3 -export DUT_BSSID1 DUT_BSSID2 DUT_BSSID3 -export USE_CLOUD_SDK diff --git a/testbeds/nola-basic-15/wct.txt b/testbeds/nola-basic-15/wct.txt deleted file mode 100644 index 321ac7c13..000000000 --- a/testbeds/nola-basic-15/wct.txt +++ /dev/null @@ -1,323 +0,0 @@ -[BLANK] -sel_port-0: 1.1.eth2 -sel_port-1: 1.1.sta00000 -sel_port-2: 1.1.sta00001 -sel_port-3: 1.1.sta00002 -sel_port-4: 1.1.sta00003 -sel_port-5: 1.1.sta00004 -sel_port-6: 1.1.sta00005 -sel_port-7: 1.1.sta00006 -sel_port-8: 1.1.sta00007 -sel_port-9: 1.1.sta00008 -sel_port-10: 1.1.sta00009 -sel_port-11: 1.1.sta00010 -sel_port-12: 1.1.sta00011 -sel_port-13: 1.1.sta00012 -sel_port-14: 1.1.sta00013 -sel_port-15: 1.1.sta00014 -sel_port-16: 1.1.sta00015 -sel_port-17: 1.1.sta00016 -sel_port-18: 1.1.sta00017 -sel_port-19: 1.1.sta00018 -sel_port-20: 1.1.sta00019 -sel_port-21: 1.1.sta00020 -sel_port-22: 1.1.sta00021 -sel_port-23: 1.1.sta00022 -sel_port-24: 1.1.sta00023 -sel_port-25: 1.1.sta00024 -sel_port-26: 1.1.sta00025 -sel_port-27: 1.1.sta00026 -sel_port-28: 1.1.sta00027 -sel_port-29: 1.1.sta00028 -sel_port-30: 1.1.sta00029 -sel_port-31: 1.1.sta00030 -sel_port-32: 1.1.sta00031 -sel_port-33: 1.1.sta00032 -sel_port-34: 1.1.sta00033 -sel_port-35: 1.1.sta00034 -sel_port-36: 1.1.sta00035 -sel_port-37: 1.1.sta00036 -sel_port-38: 1.1.sta00037 -sel_port-39: 1.1.sta00038 -sel_port-40: 1.1.sta00039 -sel_port-41: 1.1.sta00040 -sel_port-42: 1.1.sta00041 -sel_port-43: 1.1.sta00042 -sel_port-44: 1.1.sta00043 -sel_port-45: 1.1.sta00044 -sel_port-46: 1.1.sta00045 -sel_port-47: 1.1.sta00046 -sel_port-48: 1.1.sta00047 -sel_port-49: 1.1.sta00048 -sel_port-50: 1.1.sta00049 -sel_port-51: 1.1.sta00050 -sel_port-52: 1.1.sta00051 -sel_port-53: 1.1.sta00052 -sel_port-54: 1.1.sta00053 -sel_port-55: 1.1.sta00054 -sel_port-56: 1.1.sta00055 -sel_port-57: 1.1.sta00056 -sel_port-58: 1.1.sta00057 -sel_port-59: 1.1.sta00058 -sel_port-60: 1.1.sta00059 -sel_port-61: 1.1.sta00060 -sel_port-62: 1.1.sta00061 -sel_port-63: 1.1.sta00062 -sel_port-64: 1.1.sta00063 -sel_port-65: 1.1.sta00500 -sel_port-66: 1.1.sta00501 -sel_port-67: 1.1.sta00502 -sel_port-68: 1.1.sta00503 -sel_port-69: 1.1.sta00504 -sel_port-70: 1.1.sta00505 -sel_port-71: 1.1.sta00506 -sel_port-72: 1.1.sta00507 -sel_port-73: 1.1.sta00508 -sel_port-74: 1.1.sta00509 -sel_port-75: 1.1.sta00510 -sel_port-76: 1.1.sta00511 -sel_port-77: 1.1.sta00512 -sel_port-78: 1.1.sta00513 -sel_port-79: 1.1.sta00514 -sel_port-80: 1.1.sta00515 -sel_port-81: 1.1.sta00516 -sel_port-82: 1.1.sta00517 -sel_port-83: 1.1.sta00518 -sel_port-84: 1.1.sta00519 -sel_port-85: 1.1.sta00520 -sel_port-86: 1.1.sta00521 -sel_port-87: 1.1.sta00522 -sel_port-88: 1.1.sta00523 -sel_port-89: 1.1.sta00524 -sel_port-90: 1.1.sta00525 -sel_port-91: 1.1.sta00526 -sel_port-92: 1.1.sta00527 -sel_port-93: 1.1.sta00528 -sel_port-94: 1.1.sta00529 -sel_port-95: 1.1.sta00530 -sel_port-96: 1.1.sta00531 -sel_port-97: 1.1.sta00532 -sel_port-98: 1.1.sta00533 -sel_port-99: 1.1.sta00534 -sel_port-100: 1.1.sta00535 -sel_port-101: 1.1.sta00536 -sel_port-102: 1.1.sta00537 -sel_port-103: 1.1.sta00538 -sel_port-104: 1.1.sta00539 -sel_port-105: 1.1.sta00540 -sel_port-106: 1.1.sta00541 -sel_port-107: 1.1.sta00542 -sel_port-108: 1.1.sta00543 -sel_port-109: 1.1.sta00544 -sel_port-110: 1.1.sta00545 -sel_port-111: 1.1.sta00546 -sel_port-112: 1.1.sta00547 -sel_port-113: 1.1.sta00548 -sel_port-114: 1.1.sta00549 -sel_port-115: 1.1.sta00550 -sel_port-116: 1.1.sta00551 -sel_port-117: 1.1.sta00552 -sel_port-118: 1.1.sta00553 -sel_port-119: 1.1.sta00554 -sel_port-120: 1.1.sta00555 -sel_port-121: 1.1.sta00556 -sel_port-122: 1.1.sta00557 -sel_port-123: 1.1.sta00558 -sel_port-124: 1.1.sta00559 -sel_port-125: 1.1.sta00560 -sel_port-126: 1.1.sta00561 -sel_port-127: 1.1.sta00562 -sel_port-128: 1.1.sta00563 -sel_port-129: 1.1.sta04000 -sel_port-130: 1.1.sta04001 -sel_port-131: 1.1.sta04002 -sel_port-132: 1.1.sta04003 -sel_port-133: 1.1.sta04004 -sel_port-134: 1.1.sta04005 -sel_port-135: 1.1.sta04006 -sel_port-136: 1.1.sta04007 -sel_port-137: 1.1.sta04008 -sel_port-138: 1.1.sta04009 -sel_port-139: 1.1.sta04010 -sel_port-140: 1.1.sta04011 -sel_port-141: 1.1.sta04012 -sel_port-142: 1.1.sta04013 -sel_port-143: 1.1.sta04014 -sel_port-144: 1.1.sta04015 -sel_port-145: 1.1.sta04016 -sel_port-146: 1.1.sta04017 -sel_port-147: 1.1.sta04018 -sel_port-148: 1.1.sta04019 -sel_port-149: 1.1.sta04020 -sel_port-150: 1.1.sta04021 -sel_port-151: 1.1.sta04022 -sel_port-152: 1.1.sta04023 -sel_port-153: 1.1.sta04024 -sel_port-154: 1.1.sta04025 -sel_port-155: 1.1.sta04026 -sel_port-156: 1.1.sta04027 -sel_port-157: 1.1.sta04028 -sel_port-158: 1.1.sta04029 -sel_port-159: 1.1.sta04030 -sel_port-160: 1.1.sta04031 -sel_port-161: 1.1.sta04032 -sel_port-162: 1.1.sta04033 -sel_port-163: 1.1.sta04034 -sel_port-164: 1.1.sta04035 -sel_port-165: 1.1.sta04036 -sel_port-166: 1.1.sta04037 -sel_port-167: 1.1.sta04038 -sel_port-168: 1.1.sta04039 -sel_port-169: 1.1.sta04040 -sel_port-170: 1.1.sta04041 -sel_port-171: 1.1.sta04042 -sel_port-172: 1.1.sta04043 -sel_port-173: 1.1.sta04044 -sel_port-174: 1.1.sta04045 -sel_port-175: 1.1.sta04046 -sel_port-176: 1.1.sta04047 -sel_port-177: 1.1.sta04048 -sel_port-178: 1.1.sta04049 -sel_port-179: 1.1.sta04050 -sel_port-180: 1.1.sta04051 -sel_port-181: 1.1.sta04052 -sel_port-182: 1.1.sta04053 -sel_port-183: 1.1.sta04054 -sel_port-184: 1.1.sta04055 -sel_port-185: 1.1.sta04056 -sel_port-186: 1.1.sta04057 -sel_port-187: 1.1.sta04058 -sel_port-188: 1.1.sta04059 -sel_port-189: 1.1.sta04060 -sel_port-190: 1.1.sta04061 -sel_port-191: 1.1.sta04062 -sel_port-192: 1.1.sta04063 -sel_port-193: 1.1.sta04500 -sel_port-194: 1.1.sta04501 -sel_port-195: 1.1.sta04502 -sel_port-196: 1.1.sta04503 -sel_port-197: 1.1.sta04504 -sel_port-198: 1.1.sta04505 -sel_port-199: 1.1.sta04506 -sel_port-200: 1.1.sta04507 -sel_port-201: 1.1.sta04508 -sel_port-202: 1.1.sta04509 -sel_port-203: 1.1.sta04510 -sel_port-204: 1.1.sta04511 -sel_port-205: 1.1.sta04512 -sel_port-206: 1.1.sta04513 -sel_port-207: 1.1.sta04514 -sel_port-208: 1.1.sta04515 -sel_port-209: 1.1.sta04516 -sel_port-210: 1.1.sta04517 -sel_port-211: 1.1.sta04518 -sel_port-212: 1.1.sta04519 -sel_port-213: 1.1.sta04520 -sel_port-214: 1.1.sta04521 -sel_port-215: 1.1.sta04522 -sel_port-216: 1.1.sta04523 -sel_port-217: 1.1.sta04524 -sel_port-218: 1.1.sta04525 -sel_port-219: 1.1.sta04526 -sel_port-220: 1.1.sta04527 -sel_port-221: 1.1.sta04528 -sel_port-222: 1.1.sta04529 -sel_port-223: 1.1.sta04530 -sel_port-224: 1.1.sta04531 -sel_port-225: 1.1.sta04532 -sel_port-226: 1.1.sta04533 -sel_port-227: 1.1.sta04534 -sel_port-228: 1.1.sta04535 -sel_port-229: 1.1.sta04536 -sel_port-230: 1.1.sta04537 -sel_port-231: 1.1.sta04538 -sel_port-232: 1.1.sta04539 -sel_port-233: 1.1.sta04540 -sel_port-234: 1.1.sta04541 -sel_port-235: 1.1.sta04542 -sel_port-236: 1.1.sta04543 -sel_port-237: 1.1.sta04544 -sel_port-238: 1.1.sta04545 -sel_port-239: 1.1.sta04546 -sel_port-240: 1.1.sta04547 -sel_port-241: 1.1.sta04548 -sel_port-242: 1.1.sta04549 -sel_port-243: 1.1.sta04550 -sel_port-244: 1.1.sta04551 -sel_port-245: 1.1.sta04552 -sel_port-246: 1.1.sta04553 -sel_port-247: 1.1.sta04554 -sel_port-248: 1.1.sta04555 -sel_port-249: 1.1.sta04556 -sel_port-250: 1.1.sta04557 -sel_port-251: 1.1.sta04558 -sel_port-252: 1.1.sta04559 -sel_port-253: 1.1.sta04560 -sel_port-254: 1.1.sta04561 -sel_port-255: 1.1.sta04562 -sel_port-256: 1.1.sta04563 -sel_port-257: 1.1.wlan4 -sel_port-258: 1.1.wlan5 -sel_port-259: 1.1.wlan6 -sel_port-260: 1.1.wlan7 -show_events: 1 -show_log: 0 -port_sorting: 2 -kpi_id: WiFi Capacity -bg: 0xE0ECF8 -test_rig: -show_scan: 1 -auto_helper: 1 -skip_2: 0 -skip_5: 0 -batch_size: 1,5,10,20,40,80 -loop_iter: 1 -duration: 30000 -test_groups: 0 -test_groups_subset: 0 -protocol: TCP-IPv4 -dl_rate_sel: Total Download Rate: -dl_rate: 1000000000 -ul_rate_sel: Total Upload Rate: -ul_rate: 1000000000 -prcnt_tcp: 100000 -l4_endp: -pdu_sz: -1 -mss_sel: 1 -sock_buffer: 0 -ip_tos: 0 -multi_conn: -1 -min_speed: -1 -ps_interval: 60-second Running Average -fairness: 0 -naptime: 0 -before_clear: 5000 -rpt_timer: 1000 -try_lower: 0 -rnd_rate: 1 -leave_ports_up: 0 -down_quiesce: 0 -udp_nat: 1 -record_other_ssids: 0 -clear_reset_counters: 0 -do_pf: 0 -pf_min_period_dl: 128000 -pf_min_period_ul: 0 -pf_max_reconnects: 0 -use_mix_pdu: 0 -pdu_prcnt_pps: 1 -pdu_prcnt_bps: 0 -pdu_mix_ln-0: -show_scan: 1 -show_golden_3p: 0 -save_csv: 0 -show_realtime: 1 -show_pie: 1 -show_per_loop_totals: 1 -show_cx_time: 1 -show_dhcp: 1 -show_anqp: 1 -show_4way: 1 -show_latency: 1 - - diff --git a/tests/.pylintrc b/tests/.pylintrc new file mode 100644 index 000000000..9cae686a5 --- /dev/null +++ b/tests/.pylintrc @@ -0,0 +1,593 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code. +extension-pkg-whitelist= + +# Specify a score threshold to be exceeded before program exits with error. +fail-under=10.0 + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the +# number of processors available to use. +jobs=1 + +# Control the amount of potential inferred values when inferring a single +# object. This can help the performance when dealing with large functions or +# complex, nested conditions. +limit-inference-results=100 + +# List of plugins (as comma separated values of python module names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# When enabled, pylint would attempt to guess common misconfiguration and emit +# user-friendly hints instead of false-positive error messages. +suggestion-mode=yes + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED. +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once). You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use "--disable=all --enable=classes +# --disable=W". +disable=print-statement, + parameter-unpacking, + unpacking-in-except, + old-raise-syntax, + backtick, + long-suffix, + old-ne-operator, + old-octal-literal, + import-star-module-level, + non-ascii-bytes-literal, + raw-checker-failed, + bad-inline-option, + locally-disabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + use-symbolic-message-instead, + apply-builtin, + basestring-builtin, + buffer-builtin, + cmp-builtin, + coerce-builtin, + execfile-builtin, + file-builtin, + long-builtin, + raw_input-builtin, + reduce-builtin, + standarderror-builtin, + unicode-builtin, + xrange-builtin, + coerce-method, + delslice-method, + getslice-method, + setslice-method, + no-absolute-import, + old-division, + dict-iter-method, + dict-view-method, + next-method-called, + metaclass-assignment, + indexing-exception, + raising-string, + reload-builtin, + oct-method, + hex-method, + nonzero-method, + cmp-method, + input-builtin, + round-builtin, + intern-builtin, + unichr-builtin, + map-builtin-not-iterating, + zip-builtin-not-iterating, + range-builtin-not-iterating, + filter-builtin-not-iterating, + using-cmp-argument, + eq-without-hash, + div-method, + idiv-method, + rdiv-method, + exception-message-attribute, + invalid-str-codec, + sys-max-int, + bad-python3-import, + deprecated-string-function, + deprecated-str-translate-call, + deprecated-itertools-function, + deprecated-types-field, + next-method-defined, + dict-items-not-iterating, + dict-keys-not-iterating, + dict-values-not-iterating, + deprecated-operator-function, + deprecated-urllib-function, + xreadlines-attribute, + deprecated-sys-function, + exception-escape, + comprehension-escape, + missing-final-newline, + trailing-newlines + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable=c-extension-no-member + + +[REPORTS] + +# Python expression which should return a score less than or equal to 10. You +# have access to the variables 'error', 'warning', 'refactor', and 'convention' +# which contain the number of messages in each category, as well as 'statement' +# which is the total number of statements analyzed. This score is used by the +# global evaluation report (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details. +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio). You can also give a reporter class, e.g. +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages. +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + +# Complete name of functions that never returns. When checking for +# inconsistent-return-statements if a never returning function is called then +# it will be considered as an explicit return statement and no message will be +# printed. +never-returning-functions=sys.exit + + +[STRING] + +# This flag controls whether inconsistent-quotes generates a warning when the +# character used as a quote delimiter is used inconsistently within a module. +check-quote-consistency=no + +# This flag controls whether the implicit-str-concat should generate a warning +# on implicit string concatenation in sequences defined over several lines. +check-str-concat-over-line-jumps=no + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME, + XXX, + TODO + +# Regular expression of note tags to take in consideration. +#notes-rgx= + + +[SPELLING] + +# Limits count of emitted suggestions for spelling mistakes. +max-spelling-suggestions=4 + +# Spelling dictionary name. Available dictionaries: none. To make it work, +# install the python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains the private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to the private dictionary (see the +# --spelling-private-dict-file option) instead of raising a message. +spelling-store-unknown-words=no + + +[BASIC] + +# Naming style matching correct argument names. +argument-naming-style=snake_case + +# Regular expression matching correct argument names. Overrides argument- +# naming-style. +#argument-rgx= + +# Naming style matching correct attribute names. +attr-naming-style=snake_case + +# Regular expression matching correct attribute names. Overrides attr-naming- +# style. +#attr-rgx= + +# Bad variable names which should always be refused, separated by a comma. +bad-names=foo, + bar, + baz, + toto, + tutu, + tata + +# Bad variable names regexes, separated by a comma. If names match any regex, +# they will always be refused +bad-names-rgxs= + +# Naming style matching correct class attribute names. +class-attribute-naming-style=any + +# Regular expression matching correct class attribute names. Overrides class- +# attribute-naming-style. +#class-attribute-rgx= + +# Naming style matching correct class names. +class-naming-style=PascalCase + +# Regular expression matching correct class names. Overrides class-naming- +# style. +#class-rgx= + +# Naming style matching correct constant names. +const-naming-style=UPPER_CASE + +# Regular expression matching correct constant names. Overrides const-naming- +# style. +#const-rgx= + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming style matching correct function names. +function-naming-style=snake_case + +# Regular expression matching correct function names. Overrides function- +# naming-style. +#function-rgx= + +# Good variable names which should always be accepted, separated by a comma. +good-names=i, + j, + k, + ex, + Run, + _ + +# Good variable names regexes, separated by a comma. If names match any regex, +# they will always be accepted +good-names-rgxs= + +# Include a hint for the correct naming format with invalid-name. +include-naming-hint=no + +# Naming style matching correct inline iteration names. +inlinevar-naming-style=any + +# Regular expression matching correct inline iteration names. Overrides +# inlinevar-naming-style. +#inlinevar-rgx= + +# Naming style matching correct method names. +method-naming-style=snake_case + +# Regular expression matching correct method names. Overrides method-naming- +# style. +#method-rgx= + +# Naming style matching correct module names. +module-naming-style=snake_case + +# Regular expression matching correct module names. Overrides module-naming- +# style. +#module-rgx= + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +# These decorators are taken in consideration only for invalid-name. +property-classes=abc.abstractproperty + +# Naming style matching correct variable names. +variable-naming-style=snake_case + +# Regular expression matching correct variable names. Overrides variable- +# naming-style. +#variable-rgx= + + +[LOGGING] + +# The type of string formatting that logging methods do. `old` means using % +# formatting, `new` is for `{}` formatting. +logging-format-style=old + +# Logging modules to check that the string format arguments are in logging +# function parameter format. +logging-modules=logging + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid defining new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_, + _cb + +# A regular expression matching the name of dummy variables (i.e. expected to +# not be used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore. +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# Tells whether to warn about missing members when the owner of the attribute +# is inferred to be None. +ignore-none=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis). It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + +# List of decorators that change the signature of a decorated function. +signature-mutators= + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=120 + +# Maximum number of lines in a module. +max-module-lines=1000 + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[DESIGN] + +# Maximum number of arguments for function / method. +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in an if statement (see R0916). +max-bool-expr=5 + +# Maximum number of branch for function / method body. +max-branches=12 + +# Maximum number of locals for function / method body. +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body. +max-returns=6 + +# Maximum number of statements in function / method body. +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[IMPORTS] + +# List of modules that can be imported at any level, not just the top level +# one. +allow-any-import-level= + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma. +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled). +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled). +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled). +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + +# Couples of modules and preferred modules, separated by a comma. +preferred-modules= + + +[CLASSES] + +# Warn about protected attribute access inside special methods +check-protected-access-in-special-methods=no + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__, + __new__, + setUp, + __post_init__ + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict, + _fields, + _replace, + _source, + _make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=cls + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "BaseException, Exception". +overgeneral-exceptions=BaseException, + Exception diff --git a/tests/Dockerfile b/tests/Dockerfile index 328c4c69c..782cd092e 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,16 +1,11 @@ -FROM python:3.8 -WORKDIR /ci +FROM python:alpine3.12 +WORKDIR /tests +COPY . /tests -RUN apt update && apt install vim -y && rm -rf /var/lib/apt/lists/* -RUN pip3 install requests xlsxwriter pandas pytest +RUN mkdir ~/.pip \ + && echo "[global]" > ~/.pip/pip.conf \ + && echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf \ + && echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf +RUN pip3 install -r requirements.txt -COPY wlan-lanforge-scripts/py-json/LANforge /ci/LANforge/ -COPY wlan-lanforge-scripts/py-json/realm.py /ci/ -COPY wlan-lanforge-scripts/py-json/generic_cx.py /ci/ -COPY wlan-lanforge-scripts/py-scripts/sta_connect2.py /ci/ -COPY wlan-testing/pytest/conftest.py /ci/ -COPY wlan-testing/pytest/test* /ci/ -COPY wlan-testing/pytest/pytest.ini /ci/ -COPY wlan-testing/pytest/helpers /ci/helpers/ - -ENTRYPOINT [ "pytest" ] +ENTRYPOINT [ "/bin/sh" ] diff --git a/tests/Dockerfile-lint b/tests/Dockerfile-lint new file mode 100644 index 000000000..bcab34e7f --- /dev/null +++ b/tests/Dockerfile-lint @@ -0,0 +1,3 @@ +FROM wlan-tip-tests +RUN pip3 install pylint +ENTRYPOINT [ "pylint" ] diff --git a/tests/EXAMPLE-USAGE.txt b/tests/EXAMPLE-USAGE.txt deleted file mode 100644 index 6a9cf30cd..000000000 --- a/tests/EXAMPLE-USAGE.txt +++ /dev/null @@ -1,35 +0,0 @@ -# This assumes you have ssh tunnels set up as suggested in ../tools/USAGE_EXAMPLES.txt - -# Attempt to run pytest against nola-12. Doesn't work, cloud is down, but of course maybe more problems too. - -pytest test_24ghz.py --testrail-user-id NONE --ap-jumphost-address localhost --ap-jumphost-port 8823 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8822 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-12c" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge --access-points wf188n - - -# Run nightly against NOLA-01 - -./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --skip-upgrade True --testbed "NOLA-01h" \ - --lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios \ - --skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \ - --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build - - -# Run nightly against NOLA-04 from lab-ctlr itself. - -./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 22 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --skip-upgrade True --testbed "NOLA-04ben" \ - --lanforge-ip-address lf4 --lanforge-port-number 8080 --default_ap_profile TipWlan-2-Radios \ - --skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \ - --sdk-base-url https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build - -# Run nightly against NOLA-04 from dev machine with ssh tunnel. - -./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8813 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --skip-upgrade True --testbed "NOLA-04ben" \ - --lanforge-ip-address localhost --lanforge-port-number 8812 --default_ap_profile TipWlan-2-Radios \ - --skip_radius --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 \ - --sdk-base-url https://wlan-portal-svc-nola-04.cicd.lab.wlan.tip.build diff --git a/tests/Nightly_Sanity.py b/tests/Nightly_Sanity.py deleted file mode 100755 index d8a96489e..000000000 --- a/tests/Nightly_Sanity.py +++ /dev/null @@ -1,487 +0,0 @@ -#!/usr/bin/python3 - -import sys - -if "libs" not in sys.path: - sys.path.append("../libs") - -from UnitTestBase import * - - -class NightlySanity: - - def __init__(self, args=None, base=None, lanforge_data=None, test=None, reporting=None, build=None): - - self.args = args - self.model = self.args.model - self.client: TestRail_Client = TestRail_Client(args) - self.logger = base.logger - self.rid = None - # Get Cloud Bearer Token - self.cloud: CloudSDK = CloudSDK(args) - cloud_type = "v1" - self.bearer = self.cloud.get_bearer(args.sdk_base_url, cloud_type) - self.customer_id = "2" - self.test = test - self.reporting = reporting - self.lanforge_data = lanforge_data - if lanforge_data is None: - exit() - self.cloud_sdk_models = { - "ec420": "EC420-G1", - "ea8300": "EA8300-CA", - "ecw5211": "ECW5211", - "ecw5410": "ECW5410", - "wf188n": "WF188N" - } - self.jfrog_build = build - self.ap_object = None - self.equipment_id = self.args.equipment_id - - self.report_data = dict() - self.ap_cli_info = get_ap_info(self.args) - self.ap_current_fw = self.ap_cli_info['active_fw'] - self.report_data = dict() - self.firmware = {} - - if self.equipment_id == "-1": - eq_id = ap_ssh_ovsh_nodec(args, 'id') - print("EQ Id: %s" % (eq_id)) - - # Now, query equipment to find something that matches. - eq = self.cloud.get_customer_equipment(self.customer_id) - for item in eq: - for e in item['items']: - print(e['id'], " ", e['inventoryId']) - if e['inventoryId'].endswith("_%s" % (eq_id)): - print("Found equipment ID: %s inventoryId: %s", - e['id'], e['inventoryId']) - self.equipment_id = str(e['id']) - if self.equipment_id == "-1": - print("ERROR: Could not find equipment-id.") - exit() - - def configure_dut(self): - - # Check for latest Firmware - latest_fw = self.jfrog_build.check_latest_fw(self.model) - if latest_fw is None: - print("AP Model doesn't match the available Models") - exit() - self.firmware = { - "latest": latest_fw, - "current": self.ap_current_fw - } - - # Create Test session - self.create_test_run_session() - key = self.args.model; # TODO: Not sure about this. - - # Check if AP needs Upgrade - if (self.firmware["current"] is not None) and self.firmware["latest"] != self.firmware["current"]: - do_upgrade = self.cloud.should_upgrade_ap_fw(self.args.force_upgrade, self.args.skip_upgrade, self.report_data, - self.firmware["latest"], - self.args.model, - self.firmware["current"], self.logger, key) - - elif (self.firmware["current"] is not None) and self.firmware["latest"] == self.firmware["current"]: - do_upgrade = False - print("AP ia already having Latest Firmware...") - - else: - print("Skipping this Profile") - exit() - - # Upgrade the Firmware on AP - if do_upgrade: - - cloud_model = self.cloud_sdk_models[self.args.model] - pf = self.cloud.do_upgrade_ap_fw(self.args, self.report_data, test_cases, self.client, - self.firmware["latest"], cloud_model, self.args.model, - self.args.jfrog_user_id, self.args.jfrog_user_password, self.rid, - self.customer_id, self.equipment_id, self.logger) - print(self.report_data) - if not pf: - exit() - - return self.firmware - - def create_test_run_session(self): - today = str(date.today()) - case_ids = list(test_cases.values()) - proj_id = self.client.get_project_id(project_name=self.args.testrail_project) - test_run_name = self.args.testrail_run_prefix + self.model + "_" + today + "_" + self.firmware["latest"] - self.client.create_testrun(name=test_run_name, case_ids=case_ids, project_id=proj_id, - milestone_id=self.args.milestone, - description="Automated Nightly Sanity test run for new firmware build") - self.rid = self.client.get_run_id(test_run_name=self.args.testrail_run_prefix + self.model + "_" + today + "_" + self.firmware["latest"]) - print("TIP run ID is:", self.rid) - - def start_test(self): - if True: - # Check AP Manager Status - manager_status = self.ap_cli_info['state'] - print(manager_status) - """ - if manager_status != "active": - print("Manager status is " + manager_status + "! Not connected to the cloud.") - print("Waiting 30 seconds and re-checking status") - time.sleep(30) - ap_cli_info = ssh_cli_active_fw(self.args) - manager_status = ap_cli_info['state'] - if manager_status != "active": - print("Manager status is", manager_status, "! Not connected to the cloud.") - print("Manager status fails multiple checks - failing test case.") - # fail cloud connectivity testcase - self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid, - status_id=5, - msg='CloudSDK connectivity failed') - self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "failed" - print(self.report_data['tests'][self.model]) - - else: - print("Manager status is Active. Proceeding to connectivity testing!") - # TC522 pass in Testrail - self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid, status_id=1, - msg='Manager status is Active') - self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "passed" - print(self.report_data['tests'][self.model]) - else: - print("Manager status is Active. Proceeding to connectivity testing!") - # TC5222 pass in testrail - self.client.update_testrail(case_id=test_cases["cloud_connection"], run_id=self.rid, status_id=1, - msg='Manager status is Active') - self.report_data['tests'][self.model][test_cases["cloud_connection"]] = "passed" - print(self.report_data['tests'][self.model]) - # Pass cloud connectivity test case - """ - # Update in reporting - self.reporting.update_json_report(self.report_data) - - self.ap_object = CreateAPProfiles(self.args, cloud=self.cloud, client=self.client, fw_model=self.model) - # - # # Logic to create AP Profiles (Bridge Mode) - nprefix = "%s-Nightly"%(self.args.testbed) - self.ap_object.set_ssid_psk_data(ssid_2g_wpa="%s-SSID-2G-WPA"%(nprefix), - ssid_5g_wpa="%s-SSID-5G-WPA"%(nprefix), - psk_2g_wpa="%s_2g_wpa"%(nprefix), - psk_5g_wpa="%s_5g_wpa"%(nprefix), - ssid_2g_wpa2="%s-SSID-2G-WPA2"%(nprefix), - ssid_5g_wpa2="%s-SSID-5G-WPA2"%(nprefix), - psk_2g_wpa2="%s_2g_wpa2"%(nprefix), - psk_5g_wpa2="%s_5g_wpa2"%(nprefix)) - - print("creating Profiles") - ssid_template = "TipWlan-Cloud-Wifi" - - if not self.args.skip_profiles: - if not self.args.skip_radius: - radius_name = "Automation_Radius_Nightly-01" - radius_template = "templates/radius_profile_template.json" - self.ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=self.rid, - key=self.model) - self.ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=True, mode="bridge") - - print("Create AP with equipment-id: ", self.equipment_id) - self.ap_object.create_ap_profile(eq_id=self.equipment_id, fw_model=self.model, mode="bridge") - self.ap_object.validate_changes(mode="bridge") - - print("Profiles Created") - - self.test_2g(mode="bridge") - self.test_5g(mode="bridge") - - time.sleep(10) - self.reporting.update_json_report(report_data=self.ap_object.report_data) - - self.ap_object = CreateAPProfiles(self.args, cloud=self.cloud, client=self.client, fw_model=self.model) - - # Logic to create AP Profiles (NAT Mode) - self.ap_object.set_ssid_psk_data(ssid_2g_wpa="%s-SSID-NAT-2G-WPA"%(nprefix), - ssid_5g_wpa="%s-SSID-NAT-5G-WPA"%(nprefix), - psk_2g_wpa="%s_2g_nat_wpa"%(nprefix), - psk_5g_wpa="%s_5g_nat_wpa"%(nprefix), - ssid_2g_wpa2="%s-SSID-NAT-2G-WPA2"%(nprefix), - ssid_5g_wpa2="%s-SSID-NAT-5G-WPA2"%(nprefix), - psk_2g_wpa2="%s_2g_nat_wpa2"%(nprefix), - psk_5g_wpa2="%s_5g_nat_wpa2"%(nprefix)) - - print("creating Profiles") - ssid_template = "TipWlan-Cloud-Wifi" - - if not self.args.skip_profiles: - if not self.args.skip_radius: - # Radius Profile needs to be set here - # obj.create_radius_profile(radius_name, rid, key) - pass - self.ap_object.create_ssid_profiles(ssid_template=ssid_template, mode="nat") - - print("Create AP with equipment-id: ", self.equipment_id) - self.ap_object.create_ap_profile(eq_id=self.equipment_id, fw_model=self.model, mode="nat") - self.ap_object.validate_changes(mode="nat") - - self.test_2g(mode="nat") - self.test_5g(mode="nat") - time.sleep(10) - self.reporting.update_json_report(report_data=self.ap_object.report_data) - - def setup_report(self): - - self.report_data["cloud_sdk"] = dict.fromkeys(ap_models, "") - for key in self.report_data["cloud_sdk"]: - self.report_data["cloud_sdk"][key] = { - "date": "N/A", - "commitId": "N/A", - "projectVersion": "N/A" - } - self.report_data["fw_available"] = dict.fromkeys(ap_models, "Unknown") - self.report_data["fw_under_test"] = dict.fromkeys(ap_models, "N/A") - self.report_data['pass_percent'] = dict.fromkeys(ap_models, "") - - self.report_data['tests'] = dict.fromkeys(ap_models, "") - for key in ap_models: - self.report_data['tests'][key] = dict.fromkeys(test_cases.values(), "not run") - - print(self.report_data) - - self.reporting.update_json_report(report_data=self.report_data) - - def test_2g(self, mode="bridge"): - - if not self.args.skip_radius: - # Run Client Single Connectivity Test Cases for Bridge SSIDs - # TC5214 - 2.4 GHz WPA2-Enterprise - test_case = test_cases["2g_eap_" + mode] - radio = command_line_args.lanforge_2g_radio - sta_list = [lanforge_prefix + "5214"] - ssid_name = ssid_2g_eap; - security = "wpa2" - eap_type = "TTLS" - try: - test_result = self.test.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, - identity, ttls_password, test_case, rid, client, logger) - except: - test_result = "error" - self.test.testrail_retest(test_case, rid, ssid_name, client, logger) - pass - report_data['tests'][key][int(test_case)] = test_result - print(report_data['tests'][key]) - - time.sleep(10) - - # Run Client Single Connectivity Test Cases for Bridge SSIDs - # TC - 2.4 GHz WPA2 - test_case = test_cases["2g_wpa2_" + mode] - station = [self.lanforge_data['prefix'] + "2237"] - ssid_name = self.ap_object.ssid_data['2g']['wpa2'][mode] - ssid_psk = self.ap_object.psk_data['2g']['wpa2'][mode] - security = "wpa2" - upstream_port = "eth2" - print(self.lanforge_data['port']) - - try: - test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port, - radio=self.lanforge_data['2g_radio'], - ssid=ssid_name, - passkey=ssid_psk, - security=security, - station_name=station, test_case=test_case, rid=self.rid, - client=self.client, logger=self.logger) - except: - test_result = "error" - self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger) - pass - self.report_data['tests'][self.model][int(test_case)] = test_result - print(self.report_data['tests'][self.model]) - - time.sleep(10) - - # TC - 2.4 GHz WPA - test_case = test_cases["2g_wpa_" + mode] - station = [self.lanforge_data['prefix'] + "2420"] - ssid_name = self.ap_object.ssid_data['2g']['wpa'][mode] - ssid_psk = self.ap_object.psk_data['2g']['wpa'][mode] - security = "wpa" - upstream_port = "eth2" - print(self.lanforge_data['port']) - try: - test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port, - radio=self.lanforge_data['2g_radio'], - ssid=ssid_name, - passkey=ssid_psk, - security=security, - station_name=station, test_case=test_case, rid=self.rid, - client=self.client, logger=self.logger) - except: - test_result = "error" - self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger) - pass - self.report_data['tests'][self.model][int(test_case)] = test_result - print(self.report_data['tests'][self.model]) - - time.sleep(10) - - def test_5g(self, mode="bridge"): - if not self.args.skip_radius: - # TC - 5 GHz WPA2-Enterprise - test_case = self.test_cases["5g_eap_" + mode] - radio = lanforge_5g_radio - sta_list = [lanforge_prefix + "5215"] - ssid_name = ssid_5g_eap - security = "wpa2" - eap_type = "TTLS" - try: - test_result = Test.Single_Client_EAP(port, sta_list, ssid_name, radio, security, eap_type, - identity, ttls_password, test_case, rid, client, logger) - except: - test_result = "error" - Test.testrail_retest(test_case, rid, ssid_name, client, logger) - pass - report_data['tests'][key][int(test_case)] = test_result - print(report_data['tests'][key]) - - time.sleep(10) - - # TC 5 GHz WPA2 - test_case = test_cases["5g_wpa2_" + mode] - station = [self.lanforge_data['prefix'] + "2236"] - ssid_name = self.ap_object.ssid_data['5g']['wpa2'][mode] - ssid_psk = self.ap_object.psk_data['5g']['wpa2'][mode] - security = "wpa2" - upstream_port = "eth2" - try: - test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port, - radio=self.lanforge_data['5g_radio'], - ssid=ssid_name, - passkey=ssid_psk, - security=security, - station_name=station, test_case=test_case, rid=self.rid, - client=self.client, logger=self.logger) - except: - test_result = "error" - self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger) - pass - self.report_data['tests'][self.model][int(test_case)] = test_result - print(self.report_data['tests'][self.model]) - - time.sleep(10) - - # # TC - 5 GHz WPA - test_case = test_cases["5g_wpa_" + mode] - station = [self.lanforge_data['prefix'] + "2419"] - ssid_name = self.ap_object.ssid_data['5g']['wpa'][mode] - ssid_psk = self.ap_object.psk_data['5g']['wpa'][mode] - security = "wpa" - upstream_port = "eth2" - try: - test_result = self.test.Single_Client_Connectivity(upstream_port=upstream_port, - radio=self.lanforge_data['5g_radio'], - ssid=ssid_name, - passkey=ssid_psk, - security=security, - station_name=station, test_case=test_case, rid=self.rid, - client=self.client, logger=self.logger) - except: - test_result = "error" - self.test.testrail_retest(test_case, self.rid, ssid_name, self.client, self.logger) - pass - self.report_data['tests'][self.model][int(test_case)] = test_result - print(self.report_data['tests'][self.model]) - - time.sleep(10) - - -def main(): - parser = argparse.ArgumentParser(description="Nightly Combined Tests", add_help=False) - parser.add_argument("--default_ap_profile", type=str, - help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios", - required=True) - parser.add_argument("--skip_radius", dest="skip_radius", action='store_true', - help="Should we skip the RADIUS configs or not") - parser.add_argument("--skip_profiles", dest="skip_profiles", action='store_true', - help="Should we skip applying profiles?") - parser.add_argument("--skip_wpa", dest="skip_wpa", action='store_false', - help="Should we skip applying profiles?") - parser.add_argument("--skip_wpa2", dest="skip_wpa2", action='store_false', - help="Should we skip applying profiles?") - parser.add_argument("--skip_eap", dest="skip_eap", action='store_false', - help="Should we skip applying profiles?") - - reporting = Reporting(reports_root=os.getcwd() + "/reports/") - base = UnitTestBase("query-sdk", parser, reporting) - command_line_args = base.command_line_args - - # cmd line takes precedence over env-vars. - cloudsdk_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL') - - local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR') - report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR') - report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE') - - # TestRail Information - tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER') - tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD') - milestone_id = command_line_args.milestone # was os.getenv('MILESTONE') - project_id = command_line_args.testrail_project # was os.getenv('PROJECT_ID') - test_run_prefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX') - - # Jfrog credentials - jfrog = { - "user": command_line_args.jfrog_user_id, # was os.getenv('JFROG_USER') - "pass": command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD') - } - - # EAP Credentials - eap_cred = { - "identity": command_line_args.eap_id, - "ttls_password": command_line_args.ttls_password - } - - # AP Credentials - ap_cred = { - "username": command_line_args.ap_username - } - - # LANForge Information - lanforge = { - "ip": command_line_args.lanforge_ip_address, - "port": command_line_args.lanforge_port_number, - "prefix": command_line_args.lanforge_prefix, - "2g_radio": command_line_args.lanforge_2g_radio, - "5g_radio": command_line_args.lanforge_5g_radio - } - - build = command_line_args.build_id - - logger = base.logger - hdlr = base.hdlr - - if command_line_args.testbed is None: - print("ERROR: Must specify --testbed argument for this test.") - sys.exit(1) - - print("Start of Sanity Testing...") - print("Testing Latest Build with Tag: " + build) - if command_line_args.skip_upgrade: - print("Will skip upgrading AP firmware...") - - # Testrail Project and Run ID Information - - test = RunTest(lanforge_ip=lanforge["ip"], lanforge_port=lanforge["port"], lanforge_prefix=lanforge["prefix"]) - - build_obj = GetBuild(jfrog['user'], jfrog['pass'], build) - - # sanity_status = json.load(open("sanity_status.json")) - obj = NightlySanity(args=command_line_args, base=base, lanforge_data=lanforge, test=test, reporting=reporting, - build=build_obj) - obj.configure_dut() - - proj_id = obj.client.get_project_id(project_name=project_id) - print("TIP WLAN Project ID is:", proj_id) - logger.info('Start of Nightly Sanity') - obj.setup_report() - obj.start_test() - - -if __name__ == "__main__": - main() diff --git a/tests/README.md b/tests/README.md index 515f4c7e3..9c6b30de2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,2 +1,106 @@ -## Testcases -This directory contains the automated test cases for the TIP Open Wi-Fi Solution +# Pytest Framework +## Perform Unit Tests in TIP Community Testbeds + +### Fixtures : +#### conftest.py +### Unit Tests : +#### Structured around multiple Directories +### Markers : +#### Categorized the Test across different Markers + + +### Note: Run all the tests from "tests" directory + +Modify pytest.ini based on the config for your setup +You can modify the ini options by using switch -o + +## Examples: +Following are the examples for Running Client Connectivity Test with different Combinations: + + # Run the sanity test in all modes across wpa, wpa2 and eap) + pytest -m run -s + + # Run the sanity test in all modes except wpa2_enterprise) + pytest -m "run and not wpa2_enterprise" -s + + # Run the bridge test in all modes across wpa, wpa2 and eap) + pytest -m "run and bridge" -s + + # Run the bridge test in all modes except wpa2_enterprise) + pytest -m "run and bridge and not wpa2_enterprise" -s + + # Run the nat test in all modes across wpa, wpa2 and eap) + pytest -m "run and nat" -s + + # Run the nat test in all modes except wpa2_enterprise) + pytest -m "run and nat and not wpa2_enterprise" -s + + # Run the vlan test in all modes across wpa, wpa2 and eap) + pytest -m "run and vlan" -s + + # Run the vlan test in all modes except wpa2_enterprise) + pytest -m "run and vlan and not wpa2_enterprise" -s + + +Following are the examples for cloudSDK standalone tests + + # Run cloud test to check sdk version + pytest -m sdk_version_check -s + + # Run cloud test to create firmware on cloudsdk instance (currently using pending) + pytest -m firmware_create -s + + # Run cloud test to upgrade the latest firmware on AP (currently using pending) + pytest -m firmware_upgrade -s + + All test cases can be executed individually as well as part of sanity work flow also + +Following are the examples for apnos standalone tests + + # Run ap test to see the manager state on AP using SSH + pytest -m ap_manager_state -s + + # Run ap test to see if the AP is in latest firmware + pytest -m check_active_firmware_ap -s + +Following are the examples for apnos+cloudsdk mixed tests + + # Run apnos and cloudsdk test to verify if profiles that are pushed from cloud are same on vif_config + pytest -m vif_config_test -s + + # Run apnos and cloudsdk test to verify if profiles that are pushed from cloud are same on vif_config + pytest -m vif_state_test -s + + +##General Notes: + +Please enter your testrail userid and password inside pytest.ini to run the sanity with testrails + + # Modify the below fields in tests/pytest.ini + tr_user=shivam.thakur@candelatech.com + tr_pass=Something + +you can always skip the use of testrails by adding an option "--skip-testrail" + + # Run test cases without testrails + pytest -m ap_manager_state -s --skip-testrail + + +you can always control the number of clients for test cases by just adding a command line option + + # Run test cases with multiclient + pytest -m "run and bridge" -s --skip-testrail -o num_stations=5 + + +Modify the tests/configuration_data.py, according to the requirement +#### AP SSH info is wrapped up in APNOS Library in libs/apnos/apnos.py +the configuration_data.py has the data structure in the below format, + + APNOS_CREDENTIAL_DATA = { + 'ip': "192.168.200.80", + 'username': "lanforge", + 'password': "lanforge", + 'port': 22, + 'mode': 1 + } + # There are two modes, (mode:0, AP direct ssh mode, mode:1, Jumphost mode) \ No newline at end of file diff --git a/tests/Throughput_Test.py b/tests/Throughput_Test.py deleted file mode 100755 index cffcf93f0..000000000 --- a/tests/Throughput_Test.py +++ /dev/null @@ -1,530 +0,0 @@ -import csv -import sys -import time -import datetime -from datetime import date -import json -import os -import logging - -import single_client_throughput -import cloudsdk -from cloudsdk import CloudSDK -import lab_ap_info - -cloudSDK_url=os.getenv('CLOUD_SDK_URL') -station = ["tput5000"] -runtime = 10 -csv_path=os.getenv('CSV_PATH') -bridge_upstream_port = "eth2" -nat_upstream_port = "eth2" -vlan_upstream_port = "vlan100" - -#EAP Credentials -identity=os.getenv('EAP_IDENTITY') -ttls_password=os.getenv('EAP_PWD') - -local_dir=os.getenv('TPUT_LOG_DIR') -logger = logging.getLogger('Throughput_Test') -hdlr = logging.FileHandler(local_dir+"/Throughput_Testing.log") -formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') -hdlr.setFormatter(formatter) -logger.addHandler(hdlr) -logger.setLevel(logging.INFO) - - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - -if 'py-json' not in sys.path: - sys.path.append('../../py-json') - -def throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput): - #parse client_tput list returned from single_client_throughput - udp_ds = client_tput[0].partition(": ")[2] - udp_us = client_tput[1].partition(": ")[2] - tcp_ds = client_tput[2].partition(": ")[2] - tcp_us = client_tput[3].partition(": ")[2] - # Find band for CSV ---> This code is not great, it SHOULD get that info from LANForge! - if "5G" in ssid_name: - frequency = "5 GHz" - elif "2dot4G" in ssid_name: - frequency = "2.4 GHz" - else: - frequency = "Unknown" - # Append row to top of CSV file - row = [ap_model, firmware, frequency, mimo, security, mode, udp_ds, udp_us, tcp_ds, tcp_us] - with open(csv_file, 'r') as readFile: - reader = csv.reader(readFile) - lines = list(reader) - lines.insert(1, row) - with open(csv_file, 'w') as writeFile: - writer = csv.writer(writeFile) - writer.writerows(lines) - readFile.close() - writeFile.close() - -#Import dictionaries for AP Info -from lab_ap_info import equipment_id_dict -from lab_ap_info import profile_info_dict -from lab_ap_info import ap_models -from lab_ap_info import mimo_2dot4g -from lab_ap_info import mimo_5g -from lab_ap_info import customer_id -from lab_ap_info import cloud_type -#import json file to determine if throughput should be run for specific AP model -sanity_status = json.load(open("sanity_status.json")) - -#create CSV file for test run -today = str(date.today()) -csv_file = csv_path+"throughput_test_"+today+".csv" -headers = ['AP Type', 'Firmware','Radio', 'MIMO', 'Security', 'Mode', 'UDP Downstream (Mbps)', 'UDP Upstream (Mbps)', 'TCP Downstream (Mbps)', 'TCP Upstream (Mbps)'] -with open(csv_file, "w") as file: - create = csv.writer(file) - create.writerow(headers) - file.close() - -ap_firmware_dict = { - "ea8300": '', - "ecw5211": '', - "ecw5410": '', - "ec420": '' -} - -logger.info('Start of Throughput Test') - -for key in equipment_id_dict: - if sanity_status['sanity_status'][key] == "passed": - logger.info("Running throughput test on " + key) - ##Get Bearer Token to make sure its valid (long tests can require re-auth) - bearer = CloudSDK.get_bearer(cloudSDK_url, cloud_type) - ###Get Current AP Firmware - equipment_id = equipment_id_dict[key] - ap_fw = CloudSDK.ap_firmware(customer_id, equipment_id, cloudSDK_url, bearer) - fw_model = ap_fw.partition("-")[0] - print("AP MODEL UNDER TEST IS", fw_model) - print('Current AP Firmware:', ap_fw) - ##add current FW to dictionary - ap_firmware_dict[fw_model] = ap_fw - - ########################################################################### - ############## Bridge Throughput Testing ################################# - ########################################################################### - print("Testing for Bridge SSIDs") - logger.info("Starting Brdige SSID tput tests on " + key) - ###Set Proper AP Profile for Bridge SSID Tests - test_profile_id = profile_info_dict[fw_model]["profile_id"] - #print(test_profile_id) - ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) - ### Wait for Profile Push - print('-----------------PROFILE PUSH -------------------') - time.sleep(180) - - ##Set port for LANForge - port = bridge_upstream_port - - # 5G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model]["fiveG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "Bridge" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port) - print(fw_model, "5 GHz WPA2-EAP throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - #5G WPA2 UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model]["fiveG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model]["fiveG_WPA2_PSK"] - security = "wpa2" - mode = "Bridge" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA2 throughput:\n",client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model]["fiveG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model]["fiveG_WPA_PSK"] - security = "wpa" - mode = "Bridge" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA throughput:\n",client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G Open UDP DS/US and TCP DS/US - # ap_model = fw_model - # firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model]["fiveG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - #mode = "Bridge" - #mimo = mimo_5g[fw_model] - # client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - #print(fw_model, "5 GHz Open throughput:\n",client_tput) - #throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model]["twoFourG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "Bridge" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, - ttls_password, port) - print(fw_model, "2.4 GHz WPA2-EAP throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model]["twoFourG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA2_PSK"] - security = "wpa2" - mode = "Bridge" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA2 throughput:\n",client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model]["twoFourG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model]["twoFourG_WPA_PSK"] - security = "wpa" - mode = "Bridge" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA throughput:\n",client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G Open UDP DS/US and TCP DS/US - #ap_model = fw_model - #firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model]["twoFourG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - #mode = "Bridge" - #mimo = mimo_2dot4g[fw_model] - #client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - #print(fw_model, "2.4 GHz Open throughput:\n",client_tput) - #throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - ########################################################################### - ################# NAT Mode Throughput Testing ############################ - ########################################################################### - print('Testing for NAT SSIDs') - logger.info("Starting NAT SSID tput tests on " + key) - ###Set Proper AP Profile for NAT SSID Tests - test_profile_id = profile_info_dict[fw_model + '_nat']["profile_id"] - print(test_profile_id) - ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) - - ### Wait for Profile Push - print('-----------------PROFILE PUSH -------------------') - time.sleep(180) - - ##Set port for LANForge - port = nat_upstream_port - - # 5G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "NAT" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, - ttls_password, port) - print(fw_model, "5 GHz WPA2-EAP NAT throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G WPA2 NAT UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model+'_nat']["fiveG_WPA2_PSK"] - security = "wpa2" - mode = "NAT" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA2 NAT throughput:\n", client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model+'_nat']["fiveG_WPA_PSK"] - security = "wpa" - mode = "NAT" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA NAT throughput:\n", client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G Open UDP DS/US and TCP DS/US - # ap_model = fw_model - # firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model+'_nat']["fiveG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - # mode = "NAT" - #mimo = mimo_5g[fw_model] - # client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - # print(fw_model, "5 GHz Open NAT throughput:\n",client_tput) - # throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "NAT" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port) - print(fw_model, "2.4 GHz WPA2-EAP NAT throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model+'_nat']["twoFourG_WPA2_PSK"] - security = "wpa2" - mode = "NAT" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA2 NAT throughput:\n", client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model+'_nat']["twoFourG_WPA_PSK"] - security = "wpa" - mode = "NAT" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA NAT throughput:\n", client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G Open NAT UDP DS/US and TCP DS/US - # ap_model = fw_model - # firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model+'_nat']["twoFourG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - # mode = "NAT" - #mimo = mimo_2dot4g[fw_model] - # client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - # print(fw_model, "2.4 GHz Open NAT throughput:\n",client_tput) - # throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - ########################################################################### - ################# Custom VLAN Mode Throughput Testing ##################### - ########################################################################### - print('Testing for Custom VLAN SSIDs') - logger.info("Starting Custom VLAN SSID tput tests on " + key) - ###Set Proper AP Profile for NAT SSID Tests - test_profile_id = profile_info_dict[fw_model + '_vlan']["profile_id"] - print(test_profile_id) - ap_profile = CloudSDK.set_ap_profile(equipment_id, test_profile_id, cloudSDK_url, bearer) - - ### Wait for Profile Push - print('-----------------PROFILE PUSH -------------------') - time.sleep(180) - - ##Set port for LANForge - port = vlan_upstream_port - - # 5G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "VLAN" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port) - print(fw_model, "5 GHz WPA2-EAP VLAN throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G WPA2 VLAN UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model + '_vlan']["fiveG_WPA2_PSK"] - security = "wpa2" - mode = "VLAN" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA2 VLAN throughput:\n", client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_5g - ssid_name = profile_info_dict[fw_model + '_vlan']["fiveG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model + '_vlan']["fiveG_WPA_PSK"] - security = "wpa" - mode = "VLAN" - mimo = mimo_5g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "5 GHz WPA VLAN throughput:\n", client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 5G Open UDP DS/US and TCP DS/US - # ap_model = fw_model - # firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model+'_vlan']["fiveG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - # mode = "VLAN" - # mimo = mimo_5g[fw_model] - # client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - # print(fw_model, "5 GHz Open VLAN throughput:\n",client_tput) - # throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 Enterprise UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - sta_list = station - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2-EAP_SSID"] - security = "wpa2" - eap_type = "TTLS" - mode = "VLAN" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, port) - print(fw_model, "2.4 GHz WPA2-EAP VLAN throughput:\n", client_tput) - security = "wpa2-eap" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA2 UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_SSID"] - ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA2_PSK"] - security = "wpa2" - mode = "VLAN" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA2 VLAN throughput:\n", client_tput) - security = "wpa2-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G WPA UDP DS/US and TCP DS/US - ap_model = fw_model - firmware = ap_fw - radio = lab_ap_info.lanforge_2dot4g - ssid_name = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_SSID"] - ssid_psk = profile_info_dict[fw_model + '_vlan']["twoFourG_WPA_PSK"] - security = "wpa" - mode = "VLAN" - mimo = mimo_2dot4g[fw_model] - client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - print(fw_model, "2.4 GHz WPA VLAN throughput:\n", client_tput) - security = "wpa-psk" - throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - # 2.4G Open VLAN UDP DS/US and TCP DS/US - # ap_model = fw_model - # firmware = ap_fw - # radio = lab_ap_info.lanforge_5g - # ssid_name = profile_info_dict[fw_model+'_vlan']["twoFourG_OPEN_SSID"] - # ssid_psk = "BLANK" - # security = "open" - # mode = "VLAN" - # mimo = mimo_2dot4g[fw_model] - # client_tput = single_client_throughput.main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, port) - # print(fw_model, "2.4 GHz Open VLAN throughput:\n",client_tput) - # throughput_csv(csv_file, ssid_name, ap_model, mimo, firmware, security, mode, client_tput) - - - #Indicates throughput has been run for AP model - sanity_status['sanity_status'][key] = "tput run" - logger.info("Trhoughput tests complete on " + key) - - elif sanity_status['sanity_status'][key] == "tput run": - print("Throughput test already run on", key) - logger.info("Throughput test already run on "+ key +" for latest AP FW") - - else: - print(key,"did not pass Nightly Sanity. Skipping throughput test on this AP Model") - logger.info(key+" did not pass Nightly Sanity. Skipping throughput test.") - -#Indicate which AP model has had tput test to external json file -with open('sanity_status.json', 'w') as json_file: - json.dump(sanity_status, json_file) - -with open(csv_file, 'r') as readFile: - reader = csv.reader(readFile) - lines = list(reader) - row_count = len(lines) - #print(row_count) - -if row_count <= 1: - os.remove(csv_file) - file.close() - -else: - print("Saving File") - file.close() - -print(" -- Throughput Testing Complete -- ") diff --git a/tests/UnitTestBase.py b/tests/UnitTestBase.py deleted file mode 100644 index 7f2d76c34..000000000 --- a/tests/UnitTestBase.py +++ /dev/null @@ -1,406 +0,0 @@ -#!/usr/bin/python3 - -import sys - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - -for folder in 'py-json', 'py-scripts': - if folder not in sys.path: - sys.path.append(f'../lanforge/lanforge-scripts/{folder}') - -sys.path.append(f'../libs/lanforge') -sys.path.append(f'../libs/testrails') -sys.path.append(f'../libs/apnos') -sys.path.append(f'../libs/cloudsdk') -sys.path.append(f'../libs') -sys.path.append(f'../tests/test_utility/') - -import base64 -import urllib.request -from bs4 import BeautifulSoup -import ssl -import subprocess, os -from artifactory import ArtifactoryPath -import tarfile -import paramiko -from paramiko import SSHClient -from scp import SCPClient -import os -import pexpect -from pexpect import pxssh - -import paramiko -from scp import SCPClient -import pprint -from pprint import pprint -from os import listdir -import re -import requests -import json -import logging -import datetime -import time -from datetime import date -from shutil import copyfile -import argparse -from unittest.mock import Mock -from lf_tests import * -from ap_plus_sdk import * -from lab_ap_info import * -from JfrogHelper import * -from reporting import Reporting - -# For finding files -# https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory -import glob - -# external_results_dir=/var/tmp/lanforge - -# To run this from your home system to NOLA-01 testbed, use this command. This assumes you have set up an ssh tunnel -# logged to the cicd jumphost that can reach the lab. In separate console to set up the ssh tunnel: ssh -C -L -# 7220:lab-ctlr:22 ubuntu@3.130.51.163 On local machine: -# ./query_ssids.py --testrail-user-id NONE --model ecw5410 -# --ap-jumphost-address localhost --ap-jumphost-port 7220 --ap-jumphost-password secret --ap-jumphost-tty /dev/ttyAP1 - - -import testrail_api - -from LANforge.LFUtils import * - -# if you lack __init__.py in this directory you will not find sta_connect module# - -import sta_connect2 -from sta_connect2 import StaConnect2 -import testrail_api -from testrail_api import TestRail_Client -import eap_connect -from eap_connect import EAPConnect -import cloudsdk -from cloudsdk import CloudSDK -from cloudsdk import CreateAPProfiles -import ap_ssh -from ap_ssh import * - -# Import info for lab setup and APs under test -import lab_ap_info -from lab_ap_info import cloud_sdk_models -from lab_ap_info import ap_models -from lab_ap_info import customer_id -from lab_ap_info import cloud_type -from lab_ap_info import test_cases -from lab_ap_info import radius_info - -# keep in sync with that below. -def add_base_parse_args(parser): - parser.add_argument("-b", "--build-id", type=str, - help="FW commit ID (latest pending build on dev is default)", - default="pending") - parser.add_argument("--skip-upgrade", type=bool, help="Skip upgrading firmware", - default=False) - parser.add_argument("--force-upgrade", type=bool, - help="Force upgrading firmware even if it is already current version", - default=False) - parser.add_argument("-m", "--model", type=str, - choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'eap102', 'None'], - help="AP model to be run", required=True) - parser.add_argument("--equipment-id", type=str, - help="AP model ID, as exists in the cloud-sdk. -1 to auto-detect.", - default="-1") - parser.add_argument("--object-id", type=str, - help="Used when querying and deleting individual objects.", - default=None) - parser.add_argument("--customer-id", type=str, - help="Specify cloud customer-id, default is 2", - default="2") - parser.add_argument("--testbed", type=str, - help="Testbed name, will be prefixed to profile names and similar", - default=None) - - parser.add_argument("--sdk-base-url", type=str, - help="cloudsdk base url, default: https://wlan-portal-svc.cicd.lab.wlan.tip.build", - default="https://wlan-portal-svc.cicd.lab.wlan.tip.build") - parser.add_argument("--sdk-user-id", type=str, help="cloudsdk user id, default: support@example.conf", - default="support@example.com") - parser.add_argument("--sdk-user-password", type=str, help="cloudsdk user password, default: support", - default="support") - - parser.add_argument("--jfrog-base-url", type=str, help="jfrog base url", - default="tip.jFrog.io/artifactory/tip-wlan-ap-firmware") - parser.add_argument("--jfrog-user-id", type=str, help="jfrog user id", - default="tip-read") - parser.add_argument("--jfrog-user-password", type=str, help="jfrog user password", - default="tip-read") - - parser.add_argument("--testrail-base-url", type=str, help="testrail base url", - # was os.getenv('TESTRAIL_URL') - default="https://telecominfraproject.testrail.com") - parser.add_argument("--testrail-project", type=str, help="testrail project name", - default="opsfleet-wlan") - parser.add_argument("--testrail-user-id", type=str, - help="testrail user id. Use 'NONE' to disable use of testrails.", - default="NONE") - parser.add_argument("--testrail-user-password", type=str, help="testrail user password", - default="password") - parser.add_argument("--testrail-run-prefix", type=str, help="testrail run prefix", - default="prefix-1") - parser.add_argument("--testrail-milestone", dest="milestone", type=str, help="testrail milestone ID", - default="milestone-1") - - parser.add_argument("--lanforge-ip-address", type=str, help="ip address of the lanforge gui", - default="127.0.0.1") - parser.add_argument("--lanforge-port-number", type=str, help="port of the lanforge gui", - default="8080") - parser.add_argument("--lanforge-prefix", type=str, help="LANforge api prefix string", - default="sdk") - parser.add_argument("--lanforge-2g-radio", type=str, help="LANforge 2Ghz radio to use for testing", - default="1.1.wiphy0") - parser.add_argument("--lanforge-5g-radio", type=str, help="LANforge 5Ghz radio to use for testing", - default="1.1.wiphy1") - - parser.add_argument("--local_dir", type=str, help="Sanity logging directory", - default="logs") - parser.add_argument("--report-path", type=str, help="Sanity report directory", - default="reports") - parser.add_argument("--report-template", type=str, help="Sanity report template", - default="reports/report_template.php") - - parser.add_argument("--eap-id", type=str, help="EAP indentity", - default="lanforge") - parser.add_argument("--ttls-password", type=str, help="TTLS password", - default="lanforge") - - parser.add_argument("--ap-ip", type=str, help="AP IP Address, for direct ssh access if not using jumphost", - default="127.0.0.1") - parser.add_argument("--ap-username", type=str, help="AP username", - default="root") - parser.add_argument("--ap-password", type=str, help="AP password", - default="root") - parser.add_argument("--ap-jumphost-address", type=str, - help="IP of system that we can ssh in to get serial console access to AP", - default=None) - parser.add_argument("--ap-jumphost-port", type=str, - help="SSH port to use in case we are using ssh tunneling or other non-standard ports", - default="22") - parser.add_argument("--ap-jumphost-username", type=str, - help="User-ID for system that we can ssh in to get serial console access to AP", - default="lanforge") - parser.add_argument("--ap-jumphost-password", type=str, - help="Passwort for system that we can ssh in to get serial console access to AP", - default="lanforge") - parser.add_argument("--ap-jumphost-wlan-testing", type=str, help="wlan-testing repo dir on the jumphost", - default="git/wlan-testing") - parser.add_argument("--ap-jumphost-tty", type=str, help="Serial port for the AP we wish to talk to", - default="UNCONFIGURED-JUMPHOST-TTY") - - parser.add_argument('--skip-update-firmware', dest='update_firmware', action='store_false') - parser.set_defaults(update_firmware=True) - - parser.add_argument('--verbose', dest='verbose', action='store_true') - parser.set_defaults(verbose=False) - - -# Keep in sync with that above -def add_base_parse_args_pytest(parser): - parser.addoption("--default-ap-profile", type=str, - help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios", - default="TipWlan-2-Radios") - parser.addoption("--skip-radius", dest="skip_radius", action='store_true', - help="Should we skip the RADIUS configs or not") - parser.addoption("--skip-profiles", dest="skip_profiles", action='store_true', - help="Should we skip applying profiles?") - parser.addoption("--skip-wpa", dest="skip_wpa", action='store_false', - help="Should we skip applying profiles?") - parser.addoption("--skip-wpa2", dest="skip_wpa2", action='store_false', - help="Should we skip applying profiles?") - - parser.addoption("--psk-5g-wpa2", dest="psk_5g_wpa2", type=str, - help="Allow over-riding the 5g-wpa2 PSK value.") - parser.addoption("--psk-5g-wpa", dest="psk_5g_wpa", type=str, - help="Allow over-riding the 5g-wpa PSK value.") - parser.addoption("--psk-2g-wpa2", dest="psk_2g_wpa2", type=str, - help="Allow over-riding the 2g-wpa2 PSK value.") - parser.addoption("--psk-2g-wpa", dest="psk_2g_wpa", type=str, - help="Allow over-riding the 2g-wpa PSK value.") - - parser.addoption("--ssid-5g-wpa2", dest="ssid_5g_wpa2", type=str, - help="Allow over-riding the 5g-wpa2 SSID value.") - parser.addoption("--ssid-5g-wpa", dest="ssid_5g_wpa", type=str, - help="Allow over-riding the 5g-wpa SSID value.") - parser.addoption("--ssid-2g-wpa2", dest="ssid_2g_wpa2", type=str, - help="Allow over-riding the 2g-wpa2 SSID value.") - parser.addoption("--ssid-2g-wpa", dest="ssid_2g_wpa", type=str, - help="Allow over-riding the 2g-wpa SSID value.") - - parser.addoption("--mode", dest="mode", choices=['bridge', 'nat', 'vlan'], type=str, - help="Mode of AP Profile [bridge/nat/vlan]", default="bridge") - - parser.addoption("--build-id", type=str, - help="FW commit ID (latest pending build on dev is default)", - default="pending") - parser.addoption("--skip-upgrade", type=bool, help="Skip upgrading firmware", - default=False) - parser.addoption("--force-upgrade", type=bool, - help="Force upgrading firmware even if it is already current version", - default=False) - # --access-points instead - # parser.addoption("--model", type=str, - # choices=['ea8300', 'ecw5410', 'ecw5211', 'ec420', 'wf188n', 'eap102', 'None'], - # help="AP model to be run", required=True) - parser.addoption("--equipment-id", type=str, - help="AP model ID, as exists in the cloud-sdk. -1 to auto-detect.", - default="-1") - parser.addoption("--object-id", type=str, - help="Used when querying and deleting individual objects.", - default=None) - parser.addoption("--customer-id", type=str, - help="Specify cloud customer-id, default is 2", - default="2") - parser.addoption("--testbed", type=str, - help="Testbed name, will be prefixed to profile names and similar", - default=None) - - parser.addoption("--sdk-base-url", type=str, - help="cloudsdk base url, default: https://wlan-portal-svc.cicd.lab.wlan.tip.build", - default="https://wlan-portal-svc.cicd.lab.wlan.tip.build") - parser.addoption("--sdk-user-id", type=str, help="cloudsdk user id, default: support@example.conf", - default="support@example.com") - parser.addoption("--sdk-user-password", type=str, help="cloudsdk user password, default: support", - default="support") - - parser.addoption("--jfrog-base-url", type=str, help="jfrog base url", - default="tip.jFrog.io/artifactory/tip-wlan-ap-firmware") - parser.addoption("--jfrog-user-id", type=str, help="jfrog user id", - default="tip-read") - parser.addoption("--jfrog-user-password", type=str, help="jfrog user password", - default="tip-read") - - parser.addoption("--testrail-base-url", type=str, help="testrail base url", - # was os.getenv('TESTRAIL_URL') - default="https://telecominfraproject.testrail.com") - parser.addoption("--testrail-project", type=str, help="testrail project name", - default="opsfleet-wlan") - parser.addoption("--testrail-user-id", type=str, - help="testrail user id. Use 'NONE' to disable use of testrails.", - default="NONE") - parser.addoption("--testrail-user-password", type=str, help="testrail user password", - default="password") - parser.addoption("--testrail-run-prefix", type=str, help="testrail run prefix", - default="prefix-1") - parser.addoption("--testrail-milestone", dest="milestone", type=str, help="testrail milestone ID", - default="milestone-1") - - parser.addoption("--lanforge-ip-address", type=str, help="ip address of the lanforge gui", - default="127.0.0.1") - parser.addoption("--lanforge-port-number", type=str, help="port of the lanforge gui", - default="8080") - parser.addoption("--lanforge-prefix", type=str, help="LANforge api prefix string", - default="sdk") - parser.addoption("--lanforge-2g-radio", type=str, help="LANforge 2Ghz radio to use for testing", - default="1.1.wiphy0") - parser.addoption("--lanforge-5g-radio", type=str, help="LANforge 5Ghz radio to use for testing", - default="1.1.wiphy1") - - parser.addoption("--local_dir", type=str, help="Sanity logging directory", - default="logs") - parser.addoption("--report-path", type=str, help="Sanity report directory", - default="reports") - parser.addoption("--report-template", type=str, help="Sanity report template", - default="reports/report_template.php") - - parser.addoption("--eap-id", type=str, help="EAP indentity", - default="lanforge") - parser.addoption("--ttls-password", type=str, help="TTLS password", - default="lanforge") - - parser.addoption("--ap-ip", type=str, help="AP IP Address, for direct ssh access if not using jumphost", - default="127.0.0.1") - parser.addoption("--ap-username", type=str, help="AP username", - default="root") - parser.addoption("--ap-password", type=str, help="AP password", - default="root") - parser.addoption("--ap-jumphost-address", type=str, - help="IP of system that we can ssh in to get serial console access to AP", - default=None) - parser.addoption("--ap-jumphost-port", type=str, - help="SSH port to use in case we are using ssh tunneling or other non-standard ports", - default="22") - parser.addoption("--ap-jumphost-username", type=str, - help="User-ID for system that we can ssh in to get serial console access to AP", - default="lanforge") - parser.addoption("--ap-jumphost-password", type=str, - help="Passwort for system that we can ssh in to get serial console access to AP", - default="lanforge") - parser.addoption("--ap-jumphost-wlan-testing", type=str, help="wlan-testing repo dir on the jumphost", - default="git/wlan-testing") - parser.addoption("--ap-jumphost-tty", type=str, help="Serial port for the AP we wish to talk to", - default="UNCONFIGURED-JUMPHOST-TTY") - - parser.addoption('--skip-update-firmware', dest='update_firmware', action='store_false', default=True) - - parser.addoption('--tip-verbose', dest='verbose', action='store_true', default=False) - - -class UnitTestBase: - - def __init__(self, log_name, args, reporting=None): - self.parser = argparse.ArgumentParser(description="Sanity Testing on Firmware Build", parents=[args]) - - add_base_parse_args(self.parser) - - self.command_line_args = self.parser.parse_args() - - # cmd line takes precedence over env-vars. - self.cloudSDK_url = self.command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL') - self.local_dir = self.command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR') - self.report_path = self.command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR') - self.report_template = self.command_line_args.report_template # was os.getenv('REPORT_TEMPLATE') - - ## TestRail Information - self.tr_user = self.command_line_args.testrail_user_id # was os.getenv('TR_USER') - self.tr_pw = self.command_line_args.testrail_user_password # was os.getenv('TR_PWD') - self.milestoneId = self.command_line_args.milestone # was os.getenv('MILESTONE') - self.projectId = self.command_line_args.testrail_project # was os.getenv('PROJECT_ID') - self.testRunPrefix = self.command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX') - - ##Jfrog credentials - self.jfrog_user = self.command_line_args.jfrog_user_id # was os.getenv('JFROG_USER') - self.jfrog_pwd = self.command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD') - - ##EAP Credentials - self.identity = self.command_line_args.eap_id # was os.getenv('EAP_IDENTITY') - self.ttls_password = self.command_line_args.ttls_password # was os.getenv('EAP_PWD') - - ## AP Credentials - self.ap_username = self.command_line_args.ap_username # was os.getenv('AP_USER') - - ##LANForge Information - self.lanforge_ip = self.command_line_args.lanforge_ip_address - self.lanforge_port = self.command_line_args.lanforge_port_number - self.lanforge_prefix = self.command_line_args.lanforge_prefix - - self.build = self.command_line_args.build_id - - - self.logger = logging.getLogger(log_name) - - if not reporting: - self.hdlr = logging.FileHandler("./logs/test_run.log") - else: - self.hdlr = logging.FileHandler(reporting.report_path + "/test_run.log") - self.formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') - self.hdlr.setFormatter(self.formatter) - self.logger.addHandler(self.hdlr) - self.logger.setLevel(logging.INFO) - - ####Use variables other than defaults for running tests on custom FW etc - - self.model_id = self.command_line_args.model - self.equipment_id = self.command_line_args.equipment_id - - ###Get Cloud Bearer Token - self.cloud: CloudSDK = CloudSDK(self.command_line_args) - self.bearer = self.cloud.get_bearer(self.cloudSDK_url, cloud_type) - self.customer_id = self.command_line_args.customer_id - diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/ap_tests/README.md b/tests/ap_tests/README.md new file mode 100644 index 000000000..bff12e0ee --- /dev/null +++ b/tests/ap_tests/README.md @@ -0,0 +1,2 @@ +## APNOS Test Cases +his directory contains all the test cases related to the APNOS \ No newline at end of file diff --git a/tests/ap_tests/test_apnos.py b/tests/ap_tests/test_apnos.py new file mode 100644 index 000000000..cd5bcb07e --- /dev/null +++ b/tests/ap_tests/test_apnos.py @@ -0,0 +1,49 @@ +import pytest + +from configuration_data import TEST_CASES + + +@pytest.mark.run(order=3) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.ap_connection +class TestConnection(object): + + @pytest.mark.ap_manager_state + def test_ap_manager_state(self, get_ap_manager_status, instantiate_testrail, instantiate_project): + if "ACTIVE" not in get_ap_manager_status: + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_connection"], run_id=instantiate_project, + status_id=5, + msg='CloudSDK connectivity failed') + status = False + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_connection"], run_id=instantiate_project, + status_id=1, + msg='Manager status is Active') + status = True + assert status + # break test session if test case is false + + +@pytest.mark.run(order=4) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.ap_firmware +class TestFirmwareAPNOS(object): + + @pytest.mark.check_active_firmware_ap + def test_ap_firmware(self, check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project): + if check_ap_firmware_ssh == get_latest_firmware: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_upgrade"], run_id=instantiate_project, + status_id=1, + msg='Upgrade to ' + get_latest_firmware + ' successful') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_upgrade"], run_id=instantiate_project, + status_id=4, + msg='Cannot reach AP after upgrade to check CLI - re-test required') + + assert check_ap_firmware_ssh == get_latest_firmware + + diff --git a/tests/client_connectivity/test_bridge_mode.py b/tests/client_connectivity/test_bridge_mode.py new file mode 100644 index 000000000..0b93d8a4f --- /dev/null +++ b/tests/client_connectivity/test_bridge_mode.py @@ -0,0 +1,352 @@ +import pytest +import sys + +for folder in 'py-json', 'py-scripts': + if folder not in sys.path: + sys.path.append(f'../lanforge/lanforge-scripts/{folder}') + +sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity") + +sys.path.append(f'../libs') +sys.path.append(f'../libs/lanforge/') + +from LANforge.LFUtils import * +from configuration_data import TEST_CASES +if 'py-json' not in sys.path: + sys.path.append('../py-scripts') + +import sta_connect2 +from sta_connect2 import StaConnect2 +import eap_connect +from eap_connect import EAPConnect +import time + + +@pytest.mark.run(order=13) +@pytest.mark.bridge +class TestBridgeModeClientConnectivity(object): + + @pytest.mark.wpa + @pytest.mark.twog + def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail, instantiate_project): + profile_data = setup_profile_data["BRIDGE"]["WPA"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + print(profile_data, get_lanforge_data) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_bridge"], run_id=instantiate_project, + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_bridge"], run_id=instantiate_project, + status_id=5, + msg='2G WPA Client Connectivity Failed - bridge mode') + assert staConnect.passes() + # C2420 + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - bridge mode') + assert staConnect.passes() + # C2419 + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_bridge"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Client Connectivity Passed successfully - bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_bridge"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Client Connectivity Failed - bridge mode') + assert staConnect.passes() + # C2237 + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Client Connectivity Passed successfully - bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Client Connectivity Failed - bridge mode') + assert staConnect.passes() + # C2236 + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_2dot4g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode') + assert eap_connect.passes() + # C5214 + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_5g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'bridge mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode') + assert eap_connect.passes() + + @pytest.mark.modify_ssid + @pytest.mark.parametrize( + 'update_ssid', + (["BRIDGE, WPA, 5G, Sanity-updated-5G-WPA-BRIDGE"]), + indirect=True + ) + def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail, instantiate_project): + profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_ssid_update"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - bridge mode ' + 'updated ssid') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_ssid_update"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - bridge mode updated ssid') + assert staConnect.passes() + + diff --git a/tests/client_connectivity/test_nat_mode.py b/tests/client_connectivity/test_nat_mode.py new file mode 100644 index 000000000..d0f007b44 --- /dev/null +++ b/tests/client_connectivity/test_nat_mode.py @@ -0,0 +1,358 @@ +import pytest +import sys + +for folder in 'py-json', 'py-scripts': + if folder not in sys.path: + sys.path.append(f'../lanforge/lanforge-scripts/{folder}') + +sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-something") + +sys.path.append(f'../libs') +sys.path.append(f'../libs/lanforge/') + +from LANforge.LFUtils import * +from configuration_data import TEST_CASES + +if 'py-json' not in sys.path: + sys.path.append('../py-scripts') + +import sta_connect2 +from sta_connect2 import StaConnect2 +import eap_connect +from eap_connect import EAPConnect +import time + + +@pytest.mark.run(order=19) +@pytest.mark.nat +class TestNatModeClientConnectivity(object): + + @pytest.mark.wpa + @pytest.mark.twog + def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail, + instantiate_project): + profile_data = setup_profile_data["NAT"]["WPA"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + print(profile_data, get_lanforge_data) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_nat"], run_id=instantiate_project, + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_nat"], run_id=instantiate_project, + status_id=5, + msg='2G WPA Client Connectivity Failed - nat mode') + assert staConnect.passes() + # C2420 + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, + instantiate_testrail): + profile_data = setup_profile_data["NAT"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - nat mode') + assert staConnect.passes() + # C2419 + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, + instantiate_testrail): + profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_nat"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Client Connectivity Passed successfully - nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_nat"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Client Connectivity Failed - nat mode') + assert staConnect.passes() + # C2237 + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, + instantiate_testrail): + profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Client Connectivity Passed successfully - nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Client Connectivity Failed - nat mode') + assert staConnect.passes() + # C2236 + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, + instantiate_testrail): + profile_data = setup_profile_data["NAT"]["WPA2_E"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_2dot4g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode') + assert eap_connect.passes() + # C5214 + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, + instantiate_testrail): + profile_data = setup_profile_data["NAT"]["WPA2_E"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_5g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'nat mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode') + assert eap_connect.passes() + + @pytest.mark.modify_ssid + @pytest.mark.parametrize( + 'update_ssid', + (["NAT, WPA, 5G, Sanity-updated-5G-WPA-NAT"]), + indirect=True + ) + def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail, + instantiate_project): + profile_data = setup_profile_data["NAT"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_ssid_update"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - nat mode ' + 'updated ssid') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_ssid_update"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - nat mode updated ssid') + assert staConnect.passes() diff --git a/tests/client_connectivity/test_vlan_mode.py b/tests/client_connectivity/test_vlan_mode.py new file mode 100644 index 000000000..bbdaeeafd --- /dev/null +++ b/tests/client_connectivity/test_vlan_mode.py @@ -0,0 +1,351 @@ +import pytest +import sys + +for folder in 'py-json', 'py-scripts': + if folder not in sys.path: + sys.path.append(f'../lanforge/lanforge-scripts/{folder}') + +sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-something") + +sys.path.append(f'../libs') +sys.path.append(f'../libs/lanforge/') + +from LANforge.LFUtils import * +from configuration_data import TEST_CASES +if 'py-json' not in sys.path: + sys.path.append('../py-scripts') + +import sta_connect2 +from sta_connect2 import StaConnect2 +import eap_connect +from eap_connect import EAPConnect +import time + + +@pytest.mark.run(order=25) +@pytest.mark.vlan +class TestVlanModeClientConnectivity(object): + + @pytest.mark.wpa + @pytest.mark.twog + def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail, instantiate_project): + profile_data = setup_profile_data["VLAN"]["WPA"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + print(profile_data, get_lanforge_data) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_vlan"], run_id=instantiate_project, + status_id=1, + msg='2G WPA Client Connectivity Passed successfully - vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa_vlan"], run_id=instantiate_project, + status_id=5, + msg='2G WPA Client Connectivity Failed - vlan mode') + assert staConnect.passes() + # C2420 + + @pytest.mark.wpa + @pytest.mark.fiveg + def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["VLAN"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - vlan mode') + assert staConnect.passes() + # C2419 + + @pytest.mark.wpa2_personal + @pytest.mark.twog + def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["VLAN"]["WPA2_P"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + staConnect.radio = get_lanforge_data["lanforge_2dot4g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_vlan"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Client Connectivity Passed successfully - vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_wpa2_vlan"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Client Connectivity Failed - vlan mode') + assert staConnect.passes() + # C2237 + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["VLAN"]["WPA2_P"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa2" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Client Connectivity Passed successfully - vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_wpa2_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Client Connectivity Failed - vlan mode') + assert staConnect.passes() + # C2236 + + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["VLAN"]["WPA2_E"]["2G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_2dot4g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["2g_eap_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode') + assert eap_connect.passes() + # C5214 + + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project, instantiate_testrail): + profile_data = setup_profile_data["VLAN"]["WPA2_E"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"]) + eap_connect.upstream_resource = 1 + eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"] + eap_connect.security = "wpa2" + eap_connect.sta_list = station_names + eap_connect.station_names = station_names + eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + eap_connect.ssid = profile_data["ssid_name"] + eap_connect.radio = get_lanforge_data["lanforge_5g"] + eap_connect.eap = "TTLS" + eap_connect.identity = "nolaradius" + eap_connect.ttls_passwd = "nolastart" + eap_connect.runtime_secs = 10 + eap_connect.setup() + eap_connect.start() + print("napping %f sec" % eap_connect.runtime_secs) + time.sleep(eap_connect.runtime_secs) + eap_connect.stop() + try: + eap_connect.cleanup() + eap_connect.cleanup() + except: + pass + run_results = eap_connect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", eap_connect.passes) + if eap_connect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - ' + 'vlan mode') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["5g_eap_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode') + assert eap_connect.passes() + + @pytest.mark.modify_ssid + @pytest.mark.parametrize( + 'update_ssid', + (["VLAN, WPA, 5G, Sanity-updated-5G-WPA-VLAN"]), + indirect=True + ) + def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail, + instantiate_project): + profile_data = setup_profile_data["VLAN"]["WPA"]["5G"] + station_names = [] + for i in range(0, int(request.config.getini("num_stations"))): + station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i)) + staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]), + debug_=False) + staConnect.sta_mode = 0 + staConnect.upstream_resource = 1 + staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"] + staConnect.radio = get_lanforge_data["lanforge_5g"] + staConnect.resource = 1 + staConnect.dut_ssid = profile_data["ssid_name"] + staConnect.dut_passwd = profile_data["security_key"] + staConnect.dut_security = "wpa" + staConnect.station_names = station_names + staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"] + staConnect.runtime_secs = 10 + staConnect.bringup_time_sec = 60 + staConnect.cleanup_on_exit = True + # staConnect.cleanup() + staConnect.setup() + staConnect.start() + print("napping %f sec" % staConnect.runtime_secs) + time.sleep(staConnect.runtime_secs) + staConnect.stop() + staConnect.cleanup() + run_results = staConnect.get_result_list() + for result in run_results: + print("test result: " + result) + # result = 'pass' + print("Single Client Connectivity :", staConnect.passes) + if staConnect.passes(): + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_ssid_update"], run_id=instantiate_project, + status_id=1, + msg='5G WPA Client Connectivity Passed successfully - vlan mode ' + 'updated ssid') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_ssid_update"], run_id=instantiate_project, + status_id=5, + msg='5G WPA Client Connectivity Failed - vlan mode updated ssid') + assert staConnect.passes() diff --git a/tests/cloudsdk_apnos/test_cloudsdk_apnos.py b/tests/cloudsdk_apnos/test_cloudsdk_apnos.py new file mode 100644 index 000000000..d4c8891b5 --- /dev/null +++ b/tests/cloudsdk_apnos/test_cloudsdk_apnos.py @@ -0,0 +1,224 @@ +import time + +import pytest +import sys + +if 'apnos' not in sys.path: + sys.path.append(f'../libs/apnos') + +if 'cloudsdk_tests' not in sys.path: + sys.path.append(f'../../libs/cloudsdk') +from cloudsdk import CloudSDK +from configuration_data import TEST_CASES +from apnos import APNOS +from configuration_data import APNOS_CREDENTIAL_DATA + + +@pytest.mark.profile_push +class TestCloudPush(object): + + @pytest.mark.run(order=10) + @pytest.mark.bridge + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_apnos_profile_push_bridge(self, push_profile): + assert push_profile + + @pytest.mark.run(order=16) + @pytest.mark.nat + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_apnos_profile_push_nat(self, push_profile): + assert push_profile + + @pytest.mark.run(order=22) + @pytest.mark.vlan + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_apnos_profile_push_vlan(self, push_profile): + assert push_profile + + +@pytest.mark.vif_config_test +class TestCloudVifConfig(object): + + @pytest.mark.run(order=11) + @pytest.mark.bridge + def test_vif_config_cloud_bridge(self, get_current_profile_cloud, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + get_current_profile_cloud.sort() + PASS = False + for i in range(0, 18): + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(get_current_profile_cloud) + if get_current_profile_cloud == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_vifc"], run_id=instantiate_project, + status_id=1, + msg='Profiles Matched with vif config bridge mode- passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_vifc"], run_id=instantiate_project, + status_id=5, + msg='Profiles does not with vif config bridge mode- failed') + assert PASS + + @pytest.mark.run(order=17) + @pytest.mark.nat + def test_vif_config_cloud_nat(self, get_current_profile_cloud, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + get_current_profile_cloud.sort() + PASS = False + for i in range(0, 18): + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(get_current_profile_cloud) + if get_current_profile_cloud == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_vifc"], run_id=instantiate_project, + status_id=1, + msg='Profiles Matched with vif config nat mode- passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_vifc"], run_id=instantiate_project, + status_id=5, + msg='Profiles does not with vif config nat mode - failed') + assert PASS + + @pytest.mark.run(order=23) + @pytest.mark.vlan + def test_vif_config_cloud_vlan(self, get_current_profile_cloud, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + get_current_profile_cloud.sort() + PASS = False + for i in range(0, 18): + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(get_current_profile_cloud) + if get_current_profile_cloud == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_vifc"], run_id=instantiate_project, + status_id=1, + msg='Profiles Matched with vif config vlan mode- passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_vifc"], run_id=instantiate_project, + status_id=5, + msg='Profiles Matched with vif config vlan mode - failed') + assert PASS + + +@pytest.mark.vif_state_test +class TestCloudVifState(object): + + @pytest.mark.run(order=12) + @pytest.mark.bridge + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_vif_state_cloud_bridge(self, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + PASS = False + for i in range(0, 18): + vif_state = list(ap_ssh.get_vif_state_ssids()) + vif_state.sort() + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(vif_state) + if vif_state == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_vifs"], run_id=instantiate_project, + status_id=1, + msg='vif config mateches with vif state bridge mode - passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["bridge_vifs"], run_id=instantiate_project, + status_id=5, + msg='vif config mateches with vif state bridge mode - failed') + assert PASS + + @pytest.mark.run(order=18) + @pytest.mark.nat + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_vif_state_cloud_nat(self, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + PASS = False + for i in range(0, 18): + vif_state = list(ap_ssh.get_vif_state_ssids()) + vif_state.sort() + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(vif_state) + if vif_state == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_vifs"], run_id=instantiate_project, + status_id=1, + msg='vif config mateches with vif state nat mode - passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["nat_vifs"], run_id=instantiate_project, + status_id=5, + msg='vif config mateches with vif state nat mode - failed') + assert PASS + + @pytest.mark.run(order=24) + @pytest.mark.vlan + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_vif_state_cloud_vlan(self, instantiate_testrail, instantiate_project): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + PASS = False + for i in range(0, 18): + vif_state = list(ap_ssh.get_vif_state_ssids()) + vif_state.sort() + vif_config = list(ap_ssh.get_vif_config_ssids()) + vif_config.sort() + print(vif_config) + print(vif_state) + if vif_state == vif_config: + PASS = True + break + time.sleep(10) + if PASS: + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_vifs"], run_id=instantiate_project, + status_id=1, + msg='vif config mateches with vif state vlan mode - passed') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["vlan_vifs"], run_id=instantiate_project, + status_id=5, + msg='vif config mateches with vif state vlan mode - failed') + assert PASS diff --git a/tests/cloudsdk_tests/__init__.py b/tests/cloudsdk_tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cloudsdk_tests/test_cloud.py b/tests/cloudsdk_tests/test_cloud.py new file mode 100644 index 000000000..0190eecf7 --- /dev/null +++ b/tests/cloudsdk_tests/test_cloud.py @@ -0,0 +1,89 @@ +""" +About: It contains some Functional Unit Tests for CloudSDK and to run and test them on per unit level +""" + +import pytest +import sys + +if 'cloudsdk_tests' not in sys.path: + sys.path.append(f'../../libs/cloudsdk') +from cloudsdk import CloudSDK +from configuration_data import TEST_CASES + + +@pytest.mark.run(order=1) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.cloud_connect +class TestCloudSDK(object): + + @pytest.mark.sdk_version_check + def test_cloud_sdk_version(self, instantiate_cloudsdk, instantiate_testrail, instantiate_project): + cloudsdk_cluster_info = {} # Needed in Test Result + try: + response = instantiate_cloudsdk.portal_ping() + + cloudsdk_cluster_info['date'] = response._commit_date + cloudsdk_cluster_info['commitId'] = response._commit_id + cloudsdk_cluster_info['projectVersion'] = response._project_version + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_ver"], run_id=instantiate_project, + status_id=1, msg='Read CloudSDK version from API successfully') + PASS = True + except: + cloudsdk_cluster_info = {'date': "unknown", 'commitId': "unknown", 'projectVersion': "unknown"} + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_ver"], run_id=instantiate_project, + status_id=0, msg='Could not read CloudSDK version from API') + PASS = False + + assert PASS, cloudsdk_cluster_info + + +@pytest.mark.run(order=2) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.firmware +class TestFirmware(object): + + @pytest.mark.firmware_create + def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project): + if upload_firmware != 0: + instantiate_testrail.update_testrail(case_id=TEST_CASES["create_fw"], run_id=instantiate_project, + status_id=1, + msg='Create new FW version by API successful') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["create_fw"], run_id=instantiate_project, + status_id=5, + msg='Error creating new FW version by API') + PASS = False + assert PASS + + @pytest.mark.firmware_upgrade + def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project): + if not upgrade_firmware: + instantiate_testrail.update_testrail(case_id=TEST_CASES["upgrade_api"], run_id=instantiate_project, + status_id=0, + msg='Error requesting upgrade via API') + PASS = False + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["upgrade_api"], run_id=instantiate_project, + status_id=1, + msg='Upgrade request using API successful') + PASS = True + assert PASS + + @pytest.mark.check_active_firmware_cloud + def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail, instantiate_project): + if get_latest_firmware != check_ap_firmware_cloud: + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_fw"], run_id=instantiate_project, + status_id=5, + msg='CLOUDSDK reporting incorrect firmware version.') + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["cloud_fw"], run_id=instantiate_project, + status_id=1, + msg='CLOUDSDK reporting correct firmware version.') + + assert get_latest_firmware == check_ap_firmware_cloud + diff --git a/tests/cloudsdk_tests/test_profile.py b/tests/cloudsdk_tests/test_profile.py new file mode 100644 index 000000000..19114d252 --- /dev/null +++ b/tests/cloudsdk_tests/test_profile.py @@ -0,0 +1,487 @@ +import pytest +import sys +import os + +sys.path.append( + os.path.dirname( + os.path.realpath(__file__) + ) +) + +if 'cloudsdk' not in sys.path: + sys.path.append(f'../libs/cloudsdk') +if 'apnos' not in sys.path: + sys.path.append(f'../libs/apnos') +if 'testrails' not in sys.path: + sys.path.append(f'../libs/testrails') + +from cloudsdk import ProfileUtility +from configuration_data import TEST_CASES + + +class TestProfileCleanup(object): + + @pytest.mark.hard_cleanup + def test_profile_hard_cleanup(self, cleanup_cloud_profiles): + # (cleanup_cloud_profiles) + assert True + + @pytest.mark.sanity_cleanup + @pytest.mark.run(order=5) + @pytest.mark.bridge + @pytest.mark.nat + @pytest.mark.vlan + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_profile_cleanup(self, setup_profile_data, instantiate_profile, testrun_session): + print("6") + try: + instantiate_profile.delete_profile_by_name(profile_name="Sanity-ecw5410-BRIDGE") + instantiate_profile.delete_profile_by_name(profile_name="Sanity-" + testrun_session + "-NAT") + instantiate_profile.delete_profile_by_name(profile_name="Sanity-" + testrun_session + "-VLAN") + for i in setup_profile_data: + for j in setup_profile_data[i]: + for k in setup_profile_data[i][j]: + instantiate_profile.delete_profile_by_name( + profile_name=setup_profile_data[i][j][k]['profile_name']) + instantiate_profile.delete_profile_by_name(profile_name=testrun_session + "-RADIUS-Sanity") + + status = True + except Exception as e: + print(e) + status = False + assert status + + +@pytest.mark.run(order=6) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.fiveg +@pytest.mark.wpa +@pytest.mark.twog +@pytest.mark.wpa2_personal +@pytest.mark.wpa2_enterprise +class TestRfProfile(object): + + @pytest.mark.rf + def test_radius_profile_creation(self, set_rf_profile): + print("7") + profile_data = set_rf_profile + if profile_data: + PASS = True + else: + PASS = False + assert PASS + + +@pytest.mark.run(order=7) +@pytest.mark.bridge +@pytest.mark.nat +@pytest.mark.vlan +@pytest.mark.wpa2_enterprise +@pytest.mark.twog +@pytest.mark.fiveg +class TestRadiusProfile(object): + + @pytest.mark.radius + def test_radius_profile_creation(self, instantiate_profile, create_radius_profile, testrun_session, instantiate_testrail, instantiate_project): + print("8") + profile_data = create_radius_profile + if profile_data._name == testrun_session + "-RADIUS-Sanity": + instantiate_testrail.update_testrail(case_id=TEST_CASES["radius_profile"], run_id=instantiate_project, + status_id=1, + msg='RADIUS profile created successfully') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["radius_profile"], run_id=instantiate_project, + status_id=5, + msg='Failed to create RADIUS profile') + PASS = False + assert PASS + + +@pytest.mark.run(order=8) +@pytest.mark.ssid +@pytest.mark.bridge +class TestProfilesBridge(object): + + def test_reset_profile(self, reset_profile): + assert reset_profile + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ssid_wpa_5g(self, instantiate_profile, create_wpa_ssid_5g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_5g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA SSID create failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa + def test_ssid_wpa_2g(self, instantiate_profile, create_wpa_ssid_2g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_2g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_bridge"], run_id=instantiate_project, + status_id=1, + msg='2G WPA SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_bridge"], run_id=instantiate_project, + status_id=5, + msg='2G WPA SSID create failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_2g(self, instantiate_profile, create_wpa2_p_ssid_2g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_2g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_bridge"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 PERSONAL SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_bridge"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 PERSONAL SSID create failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_5g(self, instantiate_profile, create_wpa2_p_ssid_5g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_5g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 PERSONAL SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 PERSONAL SSID create failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_2g(self, instantiate_profile, create_wpa2_e_ssid_2g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_2g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_bridge"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Enterprise SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_bridge"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Enterprise SSID create failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_5g(self, instantiate_profile, create_wpa2_e_ssid_5g_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_5g_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_bridge"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Enterprise SSID created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_bridge"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Enterprise SSID create failed - bridge mode') + PASS = False + assert PASS + + +@pytest.mark.equipment_ap +class TestEquipmentAPProfile(object): + + @pytest.mark.run(order=9) + @pytest.mark.bridge + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_equipment_ap_profile_bridge_mode(self, instantiate_profile, create_ap_profile_bridge, instantiate_testrail, instantiate_project): + profile_data = create_ap_profile_bridge + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_bridge"], run_id=instantiate_project, + status_id=1, + msg='EQUIPMENT AP PROFILE created successfully - bridge mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_bridge"], run_id=instantiate_project, + status_id=5, + msg='EQUIPMENT AP PROFILE CREATION Failed - bridge mode') + PASS = False + assert PASS + + @pytest.mark.run(order=15) + @pytest.mark.nat + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_equipment_ap_profile_nat_mode(self, create_ap_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_ap_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_nat"], run_id=instantiate_project, + status_id=1, + msg='EQUIPMENT AP PROFILE CREATION successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_nat"], run_id=instantiate_project, + status_id=5, + msg='EQUIPMENT AP PROFILE CREATION Failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.run(order=21) + @pytest.mark.vlan + @pytest.mark.fiveg + @pytest.mark.wpa + @pytest.mark.twog + @pytest.mark.wpa2_personal + @pytest.mark.wpa2_enterprise + def test_equipment_ap_profile_vlan_mode(self, create_ap_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_ap_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_vlan"], run_id=instantiate_project, + status_id=1, + msg='EQUIPMENT AP PROFILE CREATION successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ap_vlan"], run_id=instantiate_project, + status_id=5, + msg='EQUIPMENT AP PROFILE CREATION failed - vlan mode') + PASS = False + assert PASS + + +@pytest.mark.run(order=14) +@pytest.mark.ssid +@pytest.mark.nat +class TestProfilesNAT(object): + + def test_reset_profile(self, reset_profile): + assert reset_profile + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ssid_wpa_5g(self, instantiate_profile, create_wpa_ssid_5g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_5g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA SSID create failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa + def test_ssid_wpa_2g(self, instantiate_profile, create_wpa_ssid_2g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_2g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_nat"], run_id=instantiate_project, + status_id=1, + msg='2G WPA SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_nat"], run_id=instantiate_project, + status_id=5, + msg='2G WPA SSID create failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_2g(self, instantiate_profile, create_wpa2_p_ssid_2g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_2g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_nat"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 PERSONAL SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_nat"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 PERSONAL SSID create failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_5g(self, instantiate_profile, create_wpa2_p_ssid_5g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_5g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 PERSONAL SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 PERSONAL SSID create failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_2g(self, instantiate_profile, create_wpa2_e_ssid_2g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_2g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_nat"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Enterprise SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_nat"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Enterprise SSID create failed - nat mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_5g(self, instantiate_profile, create_wpa2_e_ssid_5g_profile_nat, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_5g_profile_nat + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_nat"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Enterprise SSID created successfully - nat mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_nat"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Enterprise SSID create failed - nat mode') + PASS = False + assert PASS + + +@pytest.mark.run(order=20) +@pytest.mark.ssid +@pytest.mark.vlan +class TestProfilesVLAN(object): + + def test_reset_profile(self, reset_profile): + assert reset_profile + + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ssid_wpa_5g(self, instantiate_profile, create_wpa_ssid_5g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_5g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA SSID create failed - vlan mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa + def test_ssid_wpa_2g(self, instantiate_profile, create_wpa_ssid_2g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa_ssid_2g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_vlan"], run_id=instantiate_project, + status_id=1, + msg='2G WPA SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa_vlan"], run_id=instantiate_project, + status_id=5, + msg='2G WPA SSID create failed - vlan mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_2g(self, instantiate_profile, create_wpa2_p_ssid_2g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_2g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_vlan"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 PERSONAL SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_wpa2_vlan"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 PERSONAL SSID create failed - vlan mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ssid_wpa2_personal_5g(self, instantiate_profile, create_wpa2_p_ssid_5g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_p_ssid_5g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 PERSONAL SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_wpa2_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 PERSONAL SSID create failed - vlan mode') + PASS = False + assert PASS + + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_2g(self, instantiate_profile, create_wpa2_e_ssid_2g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_2g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_vlan"], run_id=instantiate_project, + status_id=1, + msg='2G WPA2 Enterprise SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_2g_eap_vlan"], run_id=instantiate_project, + status_id=5, + msg='2G WPA2 Enterprise SSID create failed - vlan mode') + PASS = False + assert PASS + + @pytest.mark.fiveg + @pytest.mark.wpa2_enterprise + def test_ssid_wpa2_enterprise_5g(self, instantiate_profile, create_wpa2_e_ssid_5g_profile_vlan, instantiate_testrail, instantiate_project): + profile_data = create_wpa2_e_ssid_5g_profile_vlan + if profile_data: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_vlan"], run_id=instantiate_project, + status_id=1, + msg='5G WPA2 Enterprise SSID created successfully - vlan mode') + PASS = True + else: + instantiate_testrail.update_testrail(case_id=TEST_CASES["ssid_5g_eap_vlan"], run_id=instantiate_project, + status_id=5, + msg='5G WPA2 Enterprise SSID create failed - vlan mode') + PASS = False + assert PASS + diff --git a/tests/configuration_data.py b/tests/configuration_data.py new file mode 100644 index 000000000..8e622115f --- /dev/null +++ b/tests/configuration_data.py @@ -0,0 +1,136 @@ +""" + A set of constants describing AP profiles +""" + +APNOS_CREDENTIAL_DATA = { + 'ip': "192.168.200.80", + 'username': "lanforge", + 'password': "lanforge", + 'port': 22, + 'mode': 1, + 'jumphost_tty': '/dev/ttyAP1' +} + +""" +AP --- ssh + +ssh tunnel --- localhost:8800 + +""" + + +NOLA = { + # It is in NOLA-01 equipment 4 lab-ctlr minicom ap1 + "ecw5410": { + "cloudsdk_url": "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", + "customer_id": 2, + "equipment_id": 24 + }, + "ecw5211": { + "cloudsdk_url": "", + "customer_id": 2, + "equipment_id": "" + }, + # WORKS # NOLA -03 lab-ctlr minicom ap3, lf4 + "ec420": { + "cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build", + "customer_id": 2, + "equipment_id": 7 + }, + "wf194c": { + "cloudsdk_url": "", + "customer_id": 2, + "equipment_id": "" + }, + # NOLA -01 lab-ctlr3 minicom ap3 + "eap102": { + "cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build", + "customer_id": 2, + "equipment_id": "" + }, + # WORKS # NOLA -02 lab-ctlr minicom ap2, lf2 + "eap101": { + "cloudsdk_url": "http://wlan-ui.nola-qa.lab.wlan.tip.build", + "customer_id": 2, + "equipment_id": 8 + }, + "wf188n": { + "cloudsdk_url": "", + "customer_id": 2, + "equipment_id": "" + } +} + +TEST_CASES = { + "ap_upgrade": 2233, + "5g_wpa2_bridge": 2236, + "2g_wpa2_bridge": 2237, + "5g_wpa_bridge": 2419, + "2g_wpa_bridge": 2420, + "2g_wpa_nat": 4323, + "5g_wpa_nat": 4324, + "2g_wpa2_nat": 4325, + "5g_wpa2_nat": 4326, + "2g_eap_bridge": 5214, + "5g_eap_bridge": 5215, + "2g_eap_nat": 5216, + "5g_eap_nat": 5217, + "cloud_connection": 5222, + "cloud_fw": 5247, + "5g_wpa2_vlan": 5248, + "5g_wpa_vlan": 5249, + "5g_eap_vlan": 5250, + "2g_wpa2_vlan": 5251, + "2g_wpa_vlan": 5252, + "2g_eap_vlan": 5253, + "cloud_ver": 5540, + "bridge_vifc": 5541, + "nat_vifc": 5542, + "vlan_vifc": 5543, + "bridge_vifs": 5544, + "nat_vifs": 5545, + "vlan_vifs": 5546, + "upgrade_api": 5547, + "create_fw": 5548, + "ap_bridge": 5641, + "ap_nat": 5642, + "ap_vlan": 5643, + "ssid_2g_eap_bridge": 5644, + "ssid_2g_wpa2_bridge": 5645, + "ssid_2g_wpa_bridge": 5646, + "ssid_5g_eap_bridge": 5647, + "ssid_5g_wpa2_bridge": 5648, + "ssid_5g_wpa_bridge": 5649, + "ssid_2g_eap_nat": 5650, + "ssid_2g_wpa2_nat": 5651, + "ssid_2g_wpa_nat": 5652, + "ssid_5g_eap_nat": 5653, + "ssid_5g_wpa2_nat": 5654, + "ssid_5g_wpa_nat": 5655, + "ssid_2g_eap_vlan": 5656, + "ssid_2g_wpa2_vlan": 5657, + "ssid_2g_wpa_vlan": 5658, + "ssid_5g_eap_vlan": 5659, + "ssid_5g_wpa2_vlan": 5660, + "ssid_5g_wpa_vlan": 5661, + "radius_profile": 5808, + "bridge_ssid_update": 8742, + "nat_ssid_update": 8743, + "vlan_ssid_update": 8744 +} + +RADIUS_SERVER_DATA = { + "ip": "192.168.200.75", + "port": 1812, + "secret": "testing123" +} +RADIUS_CLIENT_CRED = { + "" +} +""" +orch + lab-ctlr + lab-ctlr2 + lab-ctlr3 + lab-ctlr4 +""" diff --git a/tests/conftest.py b/tests/conftest.py index 5b556ddde..602de8755 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,287 +1,651 @@ -import pytest -from time import sleep, gmtime, strftime - +# import files in the current directory +import datetime import sys import os -sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers')) +import time -sys.path.append(f'..') +sys.path.append( + os.path.dirname( + os.path.realpath(__file__) + ) +) -for folder in 'py-json', 'py-scripts': - if folder not in sys.path: - sys.path.append(f'../../lanforge/lanforge-scripts/{folder}') +if 'cloudsdk' not in sys.path: + sys.path.append(f'../libs/cloudsdk') +if 'apnos' not in sys.path: + sys.path.append(f'../libs/apnos') +if 'testrails' not in sys.path: + sys.path.append(f'../libs/testrails') -sys.path.append(f'../../libs/lanforge/') -sys.path.append(f'../../libs/cloudsdk/') -sys.path.append(f'../../libs/apnos/') -sys.path.append(f'../../libs/testrails/') -sys.path.append(f'../../libs/') - -sys.path.append(f'../test_utility/') - -from utils import * -from UnitTestBase import * -from JfrogHelper import * -from cloudsdk import * -from testrail_api import TestRail_Client +from apnos import APNOS +from cloudsdk import CloudSDK +from cloudsdk import ProfileUtility +from cloudsdk import FirmwareUtility +import pytest +import logging +from configuration_data import APNOS_CREDENTIAL_DATA +from configuration_data import RADIUS_SERVER_DATA +from configuration_data import TEST_CASES +from configuration_data import NOLA +from testrail_api import APIClient +from reporting import Reporting def pytest_addoption(parser): + parser.addini("force-upload", "firmware-upload option") + parser.addini("jfrog-base-url", "jfrog base url") parser.addini("jfrog-user-id", "jfrog username") parser.addini("jfrog-user-password", "jfrog password") - parser.addini("sdk-base-url", "cloud sdk base url") + parser.addini("testbed-name", "cloud sdk base url") + parser.addini("equipment-model", "Equipment Model") + parser.addini("sdk-user-id", "cloud sdk username") parser.addini("sdk-user-password", "cloud sdk user password") - parser.addini("customer-id", "cloud sdk customer id for the access points") - parser.addini("equipment-id", "cloud sdk equipment id for the access point") - parser.addini("default-ap-profile", "cloud sdk default AP profile name") - parser.addini("verbose", "Enable verbose logs?") - - parser.addini("ap-ip", "AP IP address (or can use serial)") - parser.addini("ap-username", "AP username") - parser.addini("ap-password", "AP password") - parser.addini("ap-jumphost-address", "AP jumphost IP address") - parser.addini("ap-jumphost-username", "AP jumphost username") - parser.addini("ap-jumphost-password", "AP jumphost password") - parser.addini("ap-jumphost-port", "AP jumphost port") - parser.addini("ap-jumphost-wlan-testing", "AP jumphost wlan-testing code directory") - parser.addini("ap-jumphost-tty", "AP jumphost TTY") - - parser.addini("build-id", "What build flavor to use, ie 'pending'") - parser.addini("testbed", "Testbed name") - parser.addini("mode", "AP Mode, bridge/vlan/nat") - parser.addini("skip-wpa", "Should we skip setting up WPA?", default=False) - parser.addini("skip-wpa2", "Should we skip setting up WPA2?", default=False) - parser.addini("skip-radius", "Should we skip setting up EAP/Radius?", default=False) - parser.addini("skip-profiles", "Should we skip setting up profiles") - - parser.addini("ssid-2g-wpa", "Configure ssid-2g-wpa") - parser.addini("psk-2g-wpa", "Configure psk-2g-wpa") - parser.addini("ssid-5g-wpa", "Configure ssid-5g-wpa") - parser.addini("psk-5g-wpa", "Configure psk-5g-wpa") - parser.addini("ssid-2g-wpa2", "Configure ssid-2g-wpa2") - parser.addini("psk-2g-wpa2", "Configure psk-2g-wpa2") - parser.addini("ssid-5g-wpa2", "Configure ssid-5g-wpa2") - parser.addini("psk-5g-wpa2", "Configure psk-5g-wpa2") + parser.addini("sdk-customer-id", "cloud sdk customer id for the access points") + parser.addini("sdk-equipment-id", "cloud sdk customer id for the access points") parser.addini("testrail-base-url", "testrail base url") parser.addini("testrail-project", "testrail project name to use to generate test reports") parser.addini("testrail-user-id", "testrail username") parser.addini("testrail-user-password", "testrail user password") + parser.addini("lanforge-ip-address", "LANforge ip address to connect to") parser.addini("lanforge-port-number", "LANforge port number to connect to") - parser.addini("lanforge-2g-radio", "LANforge radio to use") - parser.addini("lanforge-5g-radio", "LANforge radio to use") - parser.addini("lanforge-ethernet-port", "LANforge ethernet adapter to use") + parser.addini("lanforge-bridge-port", "LANforge port for bridge mode testing") + parser.addini("lanforge-2dot4g-prefix", "LANforge 2.4g prefix") + parser.addini("lanforge-5g-prefix", "LANforge 5g prefix") + parser.addini("lanforge-2dot4g-station", "LANforge station name for 2.4g") + parser.addini("lanforge-5g-station", "LANforge station name for 5g") + parser.addini("lanforge-2dot4g-radio", "LANforge radio for 2.4g") + parser.addini("lanforge-5g-radio", "LANforge radio for 5g") - add_base_parse_args_pytest(parser) + parser.addini("jumphost_ip", "APNOS Jumphost IP Address") + parser.addini("jumphost_username", "APNOS Jumphost Username") + parser.addini("jumphost_password", "APNOS Jumphost password") + parser.addini("jumphost_port", "APNOS Jumphost ssh Port") + parser.addini("skip-open", "skip open ssid mode") + parser.addini("skip-wpa", "skip wpa ssid mode") + parser.addini("skip-wpa2", "skip wpa2 ssid mode") + parser.addini("skip-eap", "skip eap ssid mode") + + parser.addini("radius_server_ip", "Radius server IP") + parser.addini("radius_port", "Radius Port") + parser.addini("radius_secret", "Radius shared Secret") + + parser.addini("tr_url", "Test Rail URL") + parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)") + parser.addini("tr_user", "Testrail Username") + parser.addini("tr_pass", "Testrail Password") + parser.addini("tr_project_id", "Testrail Project ID") + parser.addini("milestone", "milestone Id") + + parser.addini("num_stations", "Number of Stations/Clients for testing") + + # change behaviour + parser.addoption( + "--skip-upgrade", + action="store_true", + default=False, + help="skip updating firmware on the AP (useful for local testing)" + ) + # change behaviour + parser.addoption( + "--force-upgrade", + action="store_true", + default=False, + help="force Upgrading Firmware even if it is already latest version" + ) + parser.addoption( + "--force-upload", + action="store_true", + default=False, + help="force Uploading Firmware even if it is already latest version" + ) # this has to be the last argument # example: --access-points ECW5410 EA8300-EU parser.addoption( - "--access-points", - nargs="+", - default=[ "ECW5410" ], - help="list of access points to test" + "--model", + # nargs="+", + default="ecw5410", + help="AP Model which is needed to test" + ) + parser.addoption( + "--skip-testrail", + action="store_true", + default=False, + help="Stop using Testrails" ) -def pytest_generate_tests(metafunc): - metafunc.parametrize("access_points", metafunc.config.getoption('--access-points'), scope="session") -# run something after all tests are done regardless of the outcome -def pytest_unconfigure(config): - print("Tests cleanup done") +""" +Test session base fixture +""" + @pytest.fixture(scope="session") -def setup_testrails(request, instantiate_testrail, access_points): - if request.config.getoption("--testrail-user-id") == "NONE": - yield -1 - return # needed to stop fixture execution +def testrun_session(request): + var = request.config.getoption("model") + yield var + + +""" +Instantiate Objects for Test session +""" - if request.config.getoption("--skip-update-firmware"): - firmware_update_case = [] - else: - firmware_update_case = [ 2831 ] - seen = {None} - test_data = [] - session = request.node - for item in session.items: - cls = item.getparent(pytest.Class) - if cls not in seen: - if hasattr(cls.obj, "get_test_data"): - test_data.append(cls.obj.get_test_data()) - seen.add(cls) - testrail_project_id = instantiate_testrail.get_project_id(request.config.getini("testrail-project")) - runId = instantiate_testrail.create_testrun( - name=f'Nightly_model_{access_points}_{strftime("%Y-%m-%d", gmtime())}', - case_ids=( [*test_data] + firmware_update_case ), - project_id=testrail_project_id - ) - yield runId -# TODO: Should not be session wide I think, you will want to run different -# configurations (bridge, nat, vlan, wpa/wpa2/eap, etc @pytest.fixture(scope="session") -def setup_cloudsdk(request, instantiate_cloudsdk, instantiate_testrail): - # snippet to do cleanup after all the tests are done - def fin(): - print("Cloud SDK cleanup done") - request.addfinalizer(fin) - - # Set up bridged setup by default. - - command_line_args = create_command_line_args(request) - - cloud = instantiate_cloudsdk - - cloud.assert_bad_response = True - - equipment_id = instantiate_cloudsdk.equipment_id - - print("equipment-id: %s" % (equipment_id)) - if equipment_id == "-1": - print("ERROR: Could not find equipment-id.") - sys.exit(1) - - ###Get Current AP info +def instantiate_cloudsdk(testrun_session): try: - ap_cli_info = ssh_cli_active_fw(command_line_args) - ap_cli_fw = ap_cli_info['active_fw'] - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ap_cli_info = "ERROR" - print("FAILED: Cannot Reach AP CLI."); - sys.exit(1) + sdk_client = CloudSDK(testbed=NOLA[testrun_session]["cloudsdk_url"], + customer_id=NOLA[testrun_session]["customer_id"]) + except: + sdk_client = False + yield sdk_client - # LANForge Information - lanforge = { - "ip": "localhost", - "port": 8806, - # "prefix": command_line_args.lanforge_prefix, - "2g_radio": "wiphy4", - "5g_radio": "wiphy5", - "eth_port": "eth2" - } - - - - - fw_model = ap_cli_fw.partition("-")[0] - - print('Current Active AP FW from CLI:', ap_cli_fw) - - radius_name = "%s-%s-%s" % (command_line_args.testbed, fw_model, "Radius") - - print("Create profiles") - ap_object = CreateAPProfiles(command_line_args, cloud=cloud, client=instantiate_testrail, fw_model=fw_model) - - # Logic to create AP Profiles (Bridge Mode) - - # ap_object.set_ssid_psk_data(ssid_2g_wpa="Pytest-run-2g-wpa", - # ssid_5g_wpa="Pytest-run-2g-wpa", - # psk_2g_wpa="Pytest-run-2g-wpa", - # psk_5g_wpa="Pytest-run-2g-wpa", - # ssid_2g_wpa2="Pytest-run-2g-wpa", - # ssid_5g_wpa2="Pytest-run-2g-wpa", - # psk_2g_wpa2="Pytest-run-2g-wpa", - # psk_5g_wpa2="Pytest-run-2g-wpa") - - print(ap_object) - today = str(date.today()) - rid = instantiate_testrail.get_run_id( - test_run_name=command_line_args.testrail_run_prefix + fw_model + "_" + today + "_" + "ecw5410-2021-02-12-pending-e8bb466") - print("creating Profiles") - ssid_template = "TipWlan-Cloud-Wifi" - - if not command_line_args.skip_profiles: - if not command_line_args.skip_radius: - # Radius Profile needs to be set here - radius_name = "Test-Radius-" + str(time.time()).split(".")[0] - radius_template = "templates/radius_profile_template.json" - ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=rid, - key=fw_model) - ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=True, skip_wpa=True, - skip_wpa2=False, mode="bridge") - - print("Create AP with equipment-id: ", equipment_id) - ap_object.create_ap_profile(eq_id=equipment_id, fw_model=fw_model, mode=command_line_args.mode) - ap_object.validate_changes(mode=command_line_args.mode) - - print("Profiles Created") - data = {"lanforge": lanforge, "ap_object": ap_object} - - yield data - -@pytest.fixture(scope="session") -def update_firmware(request, setup_testrails, instantiate_jFrog, instantiate_cloudsdk, access_points): - if request.config.getoption("--skip-update-firmware"): - return True - - #access_points is really a single AP. - ap = access_points - - if True: - latest_image = instantiate_jFrog.get_latest_image(ap) - if latest_image is None: - print("AP Model: %s doesn't match the available Models"%(ap)) - sys.exit(1) # TODO: How to return error properly here? - - cloudModel = cloud_sdk_models[ap] - logger = None - report_data = None - test_cases = None - testrail_client = None - jfrog_user = instantiate_jFrog.get_user() - jfrog_pwd = instantiate_jFrog.get_passwd() - testrail_rid = 0 - customer_id = request.config.getoption("--customer-id") - equipment_id = instantiate_cloudsdk.equipment_id - pf = instantiate_cloudsdk.do_upgrade_ap_fw(request.config, report_data, test_cases, testrail_client, - latest_image, cloudModel, ap, jfrog_user, jfrog_pwd, testrail_rid, - customer_id, equipment_id, logger) - - return pf - -@pytest.fixture(scope="session") -def instantiate_cloudsdk(request): - command_line_args = create_command_line_args(request) - rv = CloudSDK(command_line_args) - - equipment_id = request.config.getoption("--equipment-id") - if equipment_id == "-1": - eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id') - print("EQ Id: %s" % (eq_id)) - - # Now, query equipment to find something that matches. - eq = rv.get_customer_equipment(customer_id) - for item in eq: - for e in item['items']: - print(e['id'], " ", e['inventoryId']) - if e['inventoryId'].endswith("_%s" % (eq_id)): - print("Found equipment ID: %s inventoryId: %s" % (e['id'], e['inventoryId'])) - equipment_id = str(e['id']) - - rv.equipment_id = equipment_id - - if equipment_id == "-1": - print("EQ ID invalid: ", equipment_id) - sys.exit(1) - - yield rv - -@pytest.fixture(scope="session") -def instantiate_testrail(request): - yield TestRail_Client(create_command_line_args(request)) @pytest.fixture(scope="session") def instantiate_jFrog(request): - yield GetBuild( - request.config.getini("jfrog-user-id"), - request.config.getini("jfrog-user-password"), - "pending", # TODO make this optional - url=request.config.getini("jfrog-base-url") - ) + jfrog_cred = { + "user": request.config.getini("jfrog-user-id"), + "password": request.config.getini("jfrog-user-password") + } + yield jfrog_cred + + +@pytest.fixture(scope="session") +def instantiate_firmware(instantiate_cloudsdk, instantiate_jFrog): + try: + firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=instantiate_cloudsdk) + except: + firmware_client = False + yield firmware_client + + +@pytest.fixture(scope="session") +def instantiate_profile(instantiate_cloudsdk): + try: + profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk) + except: + profile_object = False + yield profile_object + + +@pytest.fixture(scope="session") +def instantiate_testrail(request): + if request.config.getoption("--skip-testrail"): + tr_client = Reporting() + else: + tr_client = APIClient(request.config.getini("tr_url"), request.config.getini("tr_user"), + request.config.getini("tr_pass"), request.config.getini("tr_project_id")) + yield tr_client + + +@pytest.fixture(scope="session") +def instantiate_project(request, instantiate_testrail, testrun_session, get_latest_firmware): + if request.config.getoption("--skip-testrail"): + rid = "skip testrails" + else: + projId = instantiate_testrail.get_project_id(project_name=request.config.getini("tr_project_id")) + test_run_name = request.config.getini("tr_prefix") + testrun_session + "_" + str( + datetime.date.today()) + "_" + get_latest_firmware + instantiate_testrail.create_testrun(name=test_run_name, case_ids=list(TEST_CASES.values()), project_id=projId, + milestone_id=request.config.getini("milestone"), + description="Automated Nightly Sanity test run for new firmware build") + rid = instantiate_testrail.get_run_id( + test_run_name=request.config.getini("tr_prefix") + testrun_session + "_" + str( + datetime.date.today()) + "_" + get_latest_firmware) + yield rid + + +""" +Utility Fixtures +""" + + +@pytest.fixture(scope="session") +def get_equipment_id(testrun_session): + yield NOLA[testrun_session]["equipment_id"] + + +@pytest.fixture(scope="session") +def get_latest_firmware(testrun_session, instantiate_firmware): + try: + latest_firmware = instantiate_firmware.get_latest_fw_version(testrun_session) + except: + latest_firmware = False + yield latest_firmware + + +@pytest.fixture(scope="session") +def check_ap_firmware_ssh(request, testrun_session): + try: + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + active_fw = ap_ssh.get_active_firmware() + except Exception as e: + active_fw = False + yield active_fw + + +@pytest.fixture(scope="session") +def check_ap_firmware_cloud(instantiate_cloudsdk, get_equipment_id): + yield instantiate_cloudsdk.get_ap_firmware_old_method(equipment_id=get_equipment_id) + + +@pytest.fixture(scope="function") +def get_ap_manager_status(): + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + status = ap_ssh.get_manager_state() + if "ACTIVE" not in status: + time.sleep(30) + ap_ssh = APNOS(APNOS_CREDENTIAL_DATA) + status = ap_ssh.get_manager_state() + yield status + + +@pytest.fixture(scope="session") +def should_upload_firmware(request): + yield request.config.getoption("--force-upload") + + +@pytest.fixture(scope="session") +def should_upgrade_firmware(request): + yield request.config.getoption("--force-upgrade") + + +@pytest.fixture(scope="session") +def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware): + firmware_id = instantiate_firmware.upload_fw_on_cloud(fw_version=get_latest_firmware, + force_upload=should_upload_firmware) + yield firmware_id + + +@pytest.fixture(scope="session") +def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware, + should_upgrade_firmware): + if get_latest_firmware != check_ap_firmware_cloud: + if request.config.getoption("--skip-upgrade"): + status = "skip-upgrade" + else: + status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False, + force_upgrade=should_upgrade_firmware) + else: + if should_upgrade_firmware: + status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False, + force_upgrade=should_upgrade_firmware) + else: + status = "skip-upgrade" + yield status + + +@pytest.fixture(scope="session") +def setup_profile_data(testrun_session): + profile_data = {} + for mode in "BRIDGE", "NAT", "VLAN": + profile_data[mode] = {} + for security in "OPEN", "WPA", "WPA2_P", "WPA2_E": + profile_data[mode][security] = {} + for radio in "2G", "5G": + profile_data[mode][security][radio] = {} + name_string = f"{'Sanity'}-{testrun_session}-{radio}_{security}_{mode}" + passkey_string = f"{radio}-{security}_{mode}" + profile_data[mode][security][radio]["profile_name"] = name_string + profile_data[mode][security][radio]["ssid_name"] = name_string + if mode == "VLAN": + profile_data[mode][security][radio]["vlan"] = 100 + else: + profile_data[mode][security][radio]["vlan"] = 1 + if mode != "NAT": + profile_data[mode][security][radio]["mode"] = "BRIDGE" + else: + profile_data[mode][security][radio]["mode"] = "NAT" + if security != "OPEN": + profile_data[mode][security][radio]["security_key"] = passkey_string + else: + profile_data[mode][security][radio]["security_key"] = "[BLANK]" + yield profile_data + + +""" +Profile Utility +""" + + +@pytest.fixture(scope="class") +def reset_profile(instantiate_profile): + instantiate_profile.profile_creation_ids["ssid"] = [] + yield True + + +@pytest.fixture(scope="function") +def cleanup_cloud_profiles(instantiate_cloudsdk): + profile_object = ProfileUtility(sdk_client=instantiate_cloudsdk) + yield profile_object.cleanup_profiles() + + +@pytest.fixture(scope="session") +def create_radius_profile(instantiate_profile, testrun_session): + radius_info = { + "name": testrun_session + "-RADIUS-Sanity", + "ip": RADIUS_SERVER_DATA["ip"], + "port": RADIUS_SERVER_DATA["port"], + "secret": RADIUS_SERVER_DATA["secret"] + } + instantiate_profile.delete_profile_by_name(radius_info["name"]) + instantiate_profile.get_default_profiles() + profile_info = instantiate_profile.create_radius_profile(radius_info=radius_info) + yield profile_info + + +@pytest.fixture(scope="session") +def set_rf_profile(instantiate_profile): + try: + instantiate_profile.get_default_profiles() + profile = instantiate_profile.set_rf_profile() + except: + profile = False + yield profile + + +""" +BRIDGE MOde +""" + + +@pytest.fixture(scope="session") +def create_wpa_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA2_P']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_2g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False) + except Exception as e: + # (e) + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_5g_profile_bridge(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["BRIDGE"]['WPA2_E']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False) + except Exception as e: + # (e) + profile = False + yield profile + + +""" +NAT MOde +""" + + +@pytest.fixture(scope="session") +def create_wpa_ssid_2g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa_ssid_5g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_2g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA2_P']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_5g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA2_P']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_2g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA2_E']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_5g_profile_nat(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["NAT"]['WPA2_E']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +""" +VLAN MOde +""" + + +@pytest.fixture(scope="session") +def create_wpa_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA2_P']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_p_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA2_P']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_2g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA2_E']['2G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, fiveg=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_wpa2_e_ssid_5g_profile_vlan(instantiate_profile, setup_profile_data): + try: + profile_data = setup_profile_data["VLAN"]['WPA2_E']['5G'] + instantiate_profile.get_default_profiles() + profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=profile_data, two4g=False) + except: + profile = False + yield profile + + +@pytest.fixture(scope="session") +def create_ap_profile_bridge(instantiate_profile, testrun_session): + try: + profile_data = { + "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'BRIDGE'), + } + profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data) + except Exception as e: + profile_obj = e + print(profile_obj) + yield profile_obj + + +@pytest.fixture(scope="session") +def create_ap_profile_nat(instantiate_profile, testrun_session): + profile_data = { + "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'NAT'), + } + profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data) + yield profile_obj + + +@pytest.fixture(scope="session") +def create_ap_profile_vlan(instantiate_profile, testrun_session): + profile_data = { + "profile_name": "%s-%s-%s" % ("Sanity", testrun_session, 'VLAN'), + } + profile_obj = instantiate_profile.set_ap_profile(profile_data=profile_data) + yield profile_obj + + +@pytest.fixture(scope="function") +def get_current_profile_cloud(instantiate_profile): + ssid_names = [] + print(instantiate_profile.profile_creation_ids["ssid"]) + for i in instantiate_profile.profile_creation_ids["ssid"]: + ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i)) + + yield ssid_names + + +""" +Profile Push Fixtures +""" + + +@pytest.fixture(scope="function") +def push_profile(instantiate_profile, get_equipment_id, setup_profile_data): + try: + instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id) + status = True + except Exception as e: + status = False + + yield status + + +@pytest.fixture(scope="function") +def get_lanforge_data(request): + lanforge_data = { + "lanforge_ip": request.config.getini("lanforge-ip-address"), + "lanforge-port-number": request.config.getini("lanforge-port-number"), + "lanforge_2dot4g": request.config.getini("lanforge-2dot4g-radio"), + "lanforge_5g": request.config.getini("lanforge-5g-radio"), + "lanforge_2dot4g_prefix": request.config.getini("lanforge-2dot4g-prefix"), + "lanforge_5g_prefix": request.config.getini("lanforge-5g-prefix"), + "lanforge_2dot4g_station": request.config.getini("lanforge-2dot4g-station"), + "lanforge_5g_station": request.config.getini("lanforge-5g-station"), + "lanforge_bridge_port": request.config.getini("lanforge-bridge-port"), + "lanforge_vlan_port": "eth1.100", + "vlan": 100 + } + yield lanforge_data + + +@pytest.fixture(scope="function") +def update_ssid(request, instantiate_profile, setup_profile_data): + requested_profile = str(request.param).replace(" ","").split(",") + profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]] + status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"], new_profile_name=requested_profile[3]) + setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = requested_profile[3] + setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = requested_profile[3] + time.sleep(90) + yield status diff --git a/tests/dockerfile b/tests/dockerfile new file mode 100644 index 000000000..782cd092e --- /dev/null +++ b/tests/dockerfile @@ -0,0 +1,11 @@ +FROM python:alpine3.12 +WORKDIR /tests +COPY . /tests + +RUN mkdir ~/.pip \ + && echo "[global]" > ~/.pip/pip.conf \ + && echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf \ + && echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf +RUN pip3 install -r requirements.txt + +ENTRYPOINT [ "/bin/sh" ] diff --git a/tests/dockerfile-lint b/tests/dockerfile-lint new file mode 100644 index 000000000..bcab34e7f --- /dev/null +++ b/tests/dockerfile-lint @@ -0,0 +1,3 @@ +FROM wlan-tip-tests +RUN pip3 install pylint +ENTRYPOINT [ "pylint" ] diff --git a/tests/eap_connect.py b/tests/eap_connect.py deleted file mode 100755 index d5055150b..000000000 --- a/tests/eap_connect.py +++ /dev/null @@ -1,354 +0,0 @@ -#!/usr/bin/env python3 - -######################################################################################################### -# Built to allow connection and test of clients using EAP-TTLS. -# Functions can be called to create a station, create TCP and UDP traffic, run it a short amount of time. -# -# Used by Nightly_Sanity and Throughput_Test ############################################################ -######################################################################################################### - -# This will create a station, create TCP and UDP traffic, run it a short amount of time, -# and verify whether traffic was sent and received. It also verifies the station connected -# to the requested BSSID if bssid is specified as an argument. -# The script will clean up the station and connections at the end of the test. - -import sys - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - -if 'py-json' not in sys.path: - sys.path.append('../../py-json') - -import argparse -import LANforge -from LANforge import LFUtils -# from LANforge import LFCliBase -from LANforge import lfcli_base -from LANforge.lfcli_base import LFCliBase -from LANforge.LFUtils import * -import realm -from realm import Realm -from lf_lib import * -import pprint - -OPEN="open" -WEP="wep" -WPA="wpa" -WPA2="wpa2" -MODE_AUTO=0 - -class EAPConnect(LFCliBase): - def __init__(self, host, port, security=None, ssid=None, sta_list=None, number_template="00000", _debug_on=False, _dut_bssid="", - _exit_on_error=False, _sta_name=None, _resource=1, radio="wiphy0", key_mgmt="WPA-EAP", eap="", identity="", - ttls_passwd="", hessid=None, ttls_realm="", domain="", _sta_prefix='eap', _exit_on_fail=False, _cleanup_on_exit=True): - super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail) - self.host = host - self.port = port - self.ssid = ssid - self.radio = radio - self.security = security - #self.password = password - self.sta_list = sta_list - self.key_mgmt = key_mgmt - self.eap = eap - self.sta_prefix = _sta_prefix - self.identity = identity - self.ttls_passwd = ttls_passwd - self.ttls_realm = ttls_realm - self.domain = domain - self.hessid = hessid - self.dut_bssid = _dut_bssid - self.timeout = 120 - self.number_template = number_template - self.debug = _debug_on - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.station_profile = self.local_realm.new_station_profile() - self.station_profile.lfclient_url = self.lfclient_url - self.station_profile.ssid = self.ssid - self.station_profile.security = self.security - self.station_profile.number_template_ = self.number_template - self.station_profile.mode = 0 - #Added to test_ipv4_ttls code - self.upstream_url = None # defer construction - self.sta_url_map = None - self.upstream_resource = None - self.upstream_port = "eth2" - self.station_names = [] - if _sta_name is not None: - self.station_names = [_sta_name] - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) - self.resource = _resource - self.cleanup_on_exit = _cleanup_on_exit - self.resulting_stations = {} - self.resulting_endpoints = {} - self.station_profile = None - self.l3_udp_profile = None - self.l3_tcp_profile = None - - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm - - def get_station_url(self, sta_name_=None): - if sta_name_ is None: - raise ValueError("get_station_url wants a station name") - if self.sta_url_map is None: - self.sta_url_map = {} - for sta_name in self.station_names: - self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name) - return self.sta_url_map[sta_name_] - - def get_upstream_url(self): - if self.upstream_url is None: - self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port) - return self.upstream_url - - # Compare pre-test values to post-test values - def compare_vals(self, name, postVal, print_pass=False, print_fail=True): - # print(f"Comparing {name}") - if postVal > 0: - self._pass("%s %s" % (name, postVal), print_pass) - else: - self._fail("%s did not report traffic: %s" % (name, postVal), print_fail) - - def remove_stations(self): - for name in self.station_names: - LFUtils.removePort(self.resource, name, self.lfclient_url) - - def num_associated(self, bssid): - counter = 0 - # print("there are %d results" % len(self.station_results)) - fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("%s*"%self.sta_prefix, fields, debug_=False) - if (self.station_results is None) or (len(self.station_results) < 1): - self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) - if record["ap"] == bssid: - counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - return counter - - def clear_test_results(self): - self.resulting_stations = {} - self.resulting_endpoints = {} - super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() - - def setup(self): - self.clear_test_results() - self.check_connect() - upstream_json = self.json_get("%s?fields=alias,phantom,down,port,ip" % self.get_upstream_url(), debug_=False) - - if upstream_json is None: - self._fail(message="Unable to query %s, bye" % self.upstream_port, print_=True) - return False - - if upstream_json['interface']['ip'] == "0.0.0.0": - if self.debug: - pprint.pprint(upstream_json) - self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True) - return False - - # remove old stations - print("Removing old stations") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - response = self.json_get(sta_url) - if (response is not None) and (response["interface"] is not None): - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) - - # Create stations and turn dhcp on - self.station_profile = self.localrealm.new_station_profile() - - # Build stations - self.station_profile.use_security(self.security, self.ssid, passwd="[BLANK]") - self.station_profile.set_number_template(self.number_template) - print("Creating stations") - self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) - self.station_profile.set_command_param("set_port", "report_timer", 1500) - self.station_profile.set_command_flag("set_port", "rpt_timer", 1) - self.station_profile.set_wifi_extra(key_mgmt=self.key_mgmt, eap=self.eap, identity=self.identity, - passwd=self.ttls_passwd, - realm=self.ttls_realm, domain=self.domain, - hessid=self.hessid) - self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug, use_radius=True, hs20_enable=False) - self._pass("PASS: Station build finished") - - self.create_traffic = createTraffic(self.localrealm, self.sta_prefix, self.resource, self.upstream_port) - self.create_traffic.lf_l3_udp_profile() - self.create_traffic.lf_l3_tcp_profile() - - def start(self): - if self.station_profile is None: - self._fail("Incorrect setup") - pprint.pprint(self.station_profile) - if self.station_profile.up is None: - self._fail("Incorrect station profile, missing profile.up") - if self.station_profile.up == False: - print("\nBringing ports up...") - data = {"shelf": 1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1} - self.json_post("/cli-json/nc_show_ports", data) - self.station_profile.admin_up() - LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) - - # station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl())) - duration = 0 - maxTime = 60 - ip = "0.0.0.0" - ap = "" - print("Waiting for %s stations to associate to AP: " % len(self.station_names), end="") - connected_stations = {} - while (len(connected_stations.keys()) < len(self.station_names)) and (duration < maxTime): - duration += 3 - time.sleep(3) - print(".", end="") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url + "?fields=port,ip,ap") - - # LFUtils.debug_printer.pprint(station_info) - if (station_info is not None) and ("interface" in station_info): - if "ip" in station_info["interface"]: - ip = station_info["interface"]["ip"] - if "ap" in station_info["interface"]: - ap = station_info["interface"]["ap"] - - if (ap == "Not-Associated") or (ap == ""): - if self.debug: - print(" -%s," % sta_name, end="") - else: - if ip == "0.0.0.0": - if self.debug: - print(" %s (0.0.0.0)" % sta_name, end="") - else: - connected_stations[sta_name] = sta_url - data = { - "shelf":1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1 - } - self.json_post("/cli-json/nc_show_ports", data) - - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") - if station_info is None: - print("unable to query %s" % sta_url) - self.resulting_stations[sta_url] = station_info - ap = station_info["interface"]["ap"] - ip = station_info["interface"]["ip"] - if (ap != "") and (ap != "Not-Associated"): - print(" %s +AP %s, " % (sta_name, ap), end="") - if self.dut_bssid != "": - if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) - # self.test_results.append("PASSED: ) - # print("PASSED: Connected to BSSID: "+ap) - else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) - else: - self._fail(sta_name+" did not connect to AP") - return False - - if ip == "0.0.0.0": - self._fail("%s did not get an ip. Ending test" % sta_name) - else: - self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip)) - - if self.passes() == False: - if self.cleanup_on_exit: - print("Cleaning up...") - self.remove_stations() - return False - - # start cx traffic - print("\nStarting CX Traffic") - - self.create_traffic.l3_udp_profile.start_cx() - self.create_traffic.l3_tcp_profile.start_cx() - time.sleep(1) - self.create_traffic.l3_tcp_profile.refresh_cx() - self.create_traffic.l3_udp_profile.refresh_cx() - - def collect_endp_stats(self, endp_map): - print("Collecting Data") - fields="?fields=name,tx+bytes,rx+bytes" - for (cx_name, endps) in endp_map.items(): - try: - endp_url = "/endp/%s%s" % (endps[0], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - ptest_a_tx = endp_json['endpoint']['tx bytes'] - ptest_a_rx = endp_json['endpoint']['rx bytes'] - - #ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"]) - endp_url = "/endp/%s%s" % (endps[1], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - - ptest_b_tx = endp_json['endpoint']['tx bytes'] - ptest_b_rx = endp_json['endpoint']['rx bytes'] - - self.compare_vals("testTCP-A TX", ptest_a_tx) - self.compare_vals("testTCP-A RX", ptest_a_rx) - - self.compare_vals("testTCP-B TX", ptest_b_tx) - self.compare_vals("testTCP-B RX", ptest_b_rx) - - except Exception as e: - print("Is this the function having the error?") - self.error(e) - - - def stop(self): - # stop cx traffic - print("Stopping CX Traffic") - self.create_traffic.l3_udp_profile.stop_cx() - self.create_traffic.l3_tcp_profile.stop_cx() - - # Refresh stats - print("\nRefresh CX stats") - self.create_traffic.l3_udp_profile.refresh_cx() - self.create_traffic.l3_tcp_profile.refresh_cx() - - print("Sleeping for 5 seconds") - time.sleep(5) - - # get data for endpoints JSON - self.collect_endp_stats(self.create_traffic.l3_udp_profile.created_cx) - self.collect_endp_stats(self.create_traffic.l3_tcp_profile.created_cx) - # print("\n") - - def cleanup(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.create_traffic.l3_udp_profile.get_cx_names()) - removeCX(self.lfclient_url, self.create_traffic.l3_tcp_profile.get_cx_names()) - for (cx_name, endp_names) in self.create_traffic.l3_udp_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - for (cx_name, endp_names) in self.create_traffic.l3_tcp_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) - -# ~class - - - -if __name__ == "__main__": - main() diff --git a/tests/helpers/utils.py b/tests/helpers/utils.py deleted file mode 100644 index 16451d23f..000000000 --- a/tests/helpers/utils.py +++ /dev/null @@ -1,64 +0,0 @@ -import re -import requests -import json -import argparse - -# Map firmware directory name to cloud's model name. -cloud_sdk_models = { - "ec420": "EC420-G1", - "ea8300": "EA8300-CA", - "ecw5211": "ECW5211", - "ecw5410": "ECW5410", - "wf188n": "WF188N" - } - -# To better interoperate with libs that want to take a cmd-line-args thing vs -# the pytest request config. -def create_command_line_args(request): - parser = argparse.ArgumentParser(description="Fake") - command_line_args, unknown = parser.parse_known_args() - - # And then overwrite it with whatever pytest is using (which is likely same in many cases) - command_line_args.equipment_id = request.config.getoption("--equipment-id") - command_line_args.customer_id = request.config.getoption("--customer-id") - command_line_args.sdk_base_url = request.config.getoption("--sdk-base-url") - command_line_args.sdk_user_id = request.config.getoption("--sdk-user-id") - command_line_args.sdk_user_password = request.config.getoption("--sdk-user-password") - command_line_args.default_ap_profile = request.config.getoption("--default-ap-profile") - - command_line_args.verbose = request.config.getoption("--verbose") - - command_line_args.ap_ip = request.config.getoption("--ap-ip") - command_line_args.ap_username = request.config.getoption("--ap-username") - command_line_args.ap_password = request.config.getoption("--ap-password") - command_line_args.ap_jumphost_address = request.config.getoption("--ap-jumphost-address") - command_line_args.ap_jumphost_username = request.config.getoption("--ap-jumphost-username") - command_line_args.ap_jumphost_password = request.config.getoption("--ap-jumphost-password") - command_line_args.ap_jumphost_port = request.config.getoption("--ap-jumphost-port") - command_line_args.ap_jumphost_wlan_testing = request.config.getoption("--ap-jumphost-wlan-testing") # directory - command_line_args.ap_jumphost_tty = request.config.getoption("--ap-jumphost-tty") - - command_line_args.build_id = request.config.getoption("--build-id") - command_line_args.testbed = request.config.getoption("--testbed") - command_line_args.mode = request.config.getoption("--mode") - command_line_args.skip_wpa = request.config.getoption("--skip-wpa") - command_line_args.skip_wpa2 = request.config.getoption("--skip-wpa2") - command_line_args.skip_radius = request.config.getoption("--skip-radius") - command_line_args.skip_profiles = request.config.getoption("--skip-profiles") - command_line_args.ssid_2g_wpa = request.config.getoption("--ssid-2g-wpa") - command_line_args.ssid_5g_wpa = request.config.getoption("--ssid-5g-wpa") - command_line_args.psk_2g_wpa = request.config.getoption("--psk-2g-wpa") - command_line_args.psk_5g_wpa = request.config.getoption("--psk-5g-wpa") - command_line_args.ssid_2g_wpa2 = request.config.getoption("--ssid-2g-wpa2") - command_line_args.ssid_5g_wpa2 = request.config.getoption("--ssid-5g-wpa2") - command_line_args.psk_2g_wpa2 = request.config.getoption("--psk-2g-wpa2") - command_line_args.psk_5g_wpa2 = request.config.getoption("--psk-5g-wpa2") - - command_line_args.testrail_base_url = request.config.getoption("--testrail-base-url") - command_line_args.testrail_project = request.config.getoption("--testrail-project") - command_line_args.testrail_user_id = request.config.getoption("--testrail-user-id") - command_line_args.testrail_user_password = request.config.getoption("--testrail-user-password") - command_line_args.testrail_run_prefix = request.config.getoption("--testrail-run-prefix") - command_line_args.testrail_milestone = request.config.getoption("--testrail-milestone") - - return command_line_args diff --git a/tests/pytest.ini b/tests/pytest.ini index acea6fe28..b85406ab0 100644 --- a/tests/pytest.ini +++ b/tests/pytest.ini @@ -1,32 +1,61 @@ [pytest] addopts= --junitxml=test_everything.xml + # jFrog parameters -jfrog-base-url=https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ +jfrog-base-url=tip.jFrog.io/artifactory/tip-wlan-ap-firmware jfrog-user-id=tip-read jfrog-user-password=tip-read + # Cloud SDK parameters -sdk-base-url=https://wlan-portal-svc.cicd.lab.wlan.tip.build +equipment-model=ecw5410 sdk-user-id=support@example.com sdk-user-password=support -# Testrails parameters -testrail-base-url=https://telecominfraproject.testrail.com -testrail-project=opsfleet-wlan -testrail-user-id=gleb@opsfleet.com -testrail-user-password=use_command_line_to_pass_this + +# Jumphost +jumphost_ip=192.168.200.80 +jumphost_port=22 +jumphost_username=lanforge +jumphost_password=lanforge + # LANforge lanforge-ip-address=localhost lanforge-port-number=8080 -lanforge-radio=wiphy4 -lanforge-ethernet-port=eth2 + +lanforge-bridge-port=eth1 + + +lanforge-2dot4g-prefix=wlan +lanforge-5g-prefix=wlan + + +lanforge-2dot4g-radio=wiphy1 +lanforge-5g-radio=wiphy1 + +num_stations=1 # Cloud SDK settings -customer-id=2 -# equipment ID is unique for each AP, have to be told what to use or query it based on other info. -equipment-id=-1 +sdk-customer-id=2 +sdk-equipment-id=23 + + +# Radius Settings +radius_server_ip=192.168.200.75 +radius_port=1812 +radius_secret=testing123 + + +# Testrail Info +tr_url=https://telecominfraproject.testrail.com +tr_prefix=Nola_ext_03_ +tr_user=shivam.thakur@candelatech.com +tr_pass=Something +tr_project_id=WLAN +milestone=29 + + +filterwarnings = + ignore::UserWarning markers = - featureA: marks tests as slow (deselect with '-m "not slow"') - featureB - featureC - featureD - featureE + sanity: Run the sanity for Client Connectivity test + diff --git a/tests/requirements.txt b/tests/requirements.txt new file mode 100644 index 000000000..b20693cf9 --- /dev/null +++ b/tests/requirements.txt @@ -0,0 +1,12 @@ +# actual code package dependencies +tip_wlan_cloud >= 0.0.3 +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 +pytest + +# style\reporting package dependencies +pylint +allure-pytest \ No newline at end of file diff --git a/tests/sanity_status.json b/tests/sanity_status.json deleted file mode 100755 index a0d9d4c0e..000000000 --- a/tests/sanity_status.json +++ /dev/null @@ -1 +0,0 @@ -{"sanity_status": {"ea8300": "failed", "ecw5211": "failed", "ecw5410": "failed", "ec420": "failed"}, "sanity_run": {"new_data": "yes"}} \ No newline at end of file diff --git a/tests/single_client_throughput.py b/tests/single_client_throughput.py deleted file mode 100755 index 51ab2c9b5..000000000 --- a/tests/single_client_throughput.py +++ /dev/null @@ -1,1064 +0,0 @@ -#!/usr/bin/env python3 - -#################################################################################### -# Script is based off of LANForge sta_connect2.py -# Script built for max throughput testing on a single client -# The main function of the script creates a station, then tests: -# 1. UDP Downstream (AP to STA) -# 2. UDP Upstream (STA to AP) -# 3. TCP Downstream (AP to STA) -# 4. TCP Upstream (STA to AP) -# The script will clean up the station and connections at the end of the test. -# -# Used by Throughput_Test ########################################################### -#################################################################################### - -# Script is based off of sta_connect2.py -# Script built for max throughput testing on a single client -# The main function of the script creates a station, then tests: -# 1. UDP Downstream (AP to STA) -# 2. UDP Upstream (STA to AP) -# 3. TCP Downstream (AP to STA) -# 4. TCP Upstream (STA to AP) -# The script will clean up the station and connections at the end of the test. - -import sys -import csv - -if sys.version_info[0] != 3: - print("This script requires Python 3") - exit(1) - -if 'py-json' not in sys.path: - sys.path.append('../../py-json') - -import argparse -from LANforge import LFUtils -# from LANforge import LFCliBase -from LANforge import lfcli_base -from LANforge.lfcli_base import LFCliBase -from LANforge.LFUtils import * -import realm -from realm import Realm -import pprint - -OPEN="open" -WEP="wep" -WPA="wpa" -WPA2="wpa2" -MODE_AUTO=0 - -class SingleClient(LFCliBase): - def __init__(self, host, port, _dut_ssid="jedway-open-1", _dut_passwd="NA", _dut_bssid="", - _user="", _passwd="", _sta_mode="0", _radio="wiphy0", - _resource=1, _upstream_resource=1, _upstream_port="eth1", - _sta_name=None, debug_=False, _dut_security=OPEN, _exit_on_error=False, - _cleanup_on_exit=True, _runtime_sec=60, _exit_on_fail=False): - # do not use `super(LFCLiBase,self).__init__(self, host, port, _debugOn) - # that is py2 era syntax and will force self into the host variable, making you - # very confused. - super().__init__(host, port, _debug=debug_, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail) - self.debug = debug_ - self.dut_security = _dut_security - self.dut_ssid = _dut_ssid - self.dut_passwd = _dut_passwd - self.dut_bssid = _dut_bssid - self.user = _user - self.passwd = _passwd - self.sta_mode = _sta_mode # See add_sta LANforge CLI users guide entry - self.radio = _radio - self.resource = _resource - self.upstream_resource = _upstream_resource - self.upstream_port = _upstream_port - self.runtime_secs = _runtime_sec - self.cleanup_on_exit = _cleanup_on_exit - self.sta_url_map = None # defer construction - self.upstream_url = None # defer construction - self.station_names = [] - if _sta_name is not None: - self.station_names = [ _sta_name ] - # self.localrealm :Realm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) # py > 3.6 - self.resulting_stations = {} - self.resulting_endpoints = {} - self.station_profile = None - self.l3_udp_profile = None - self.l3_tcp_profile = None - - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm - - def get_station_url(self, sta_name_=None): - if sta_name_ is None: - raise ValueError("get_station_url wants a station name") - if self.sta_url_map is None: - self.sta_url_map = {} - for sta_name in self.station_names: - self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name) - return self.sta_url_map[sta_name_] - - def get_upstream_url(self): - if self.upstream_url is None: - self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port) - return self.upstream_url - - # Compare pre-test values to post-test values - def compare_vals(self, name, postVal, print_pass=False, print_fail=True): - # print(f"Comparing {name}") - if postVal > 0: - self._pass("%s %s" % (name, postVal), print_pass) - else: - self._fail("%s did not report traffic: %s" % (name, postVal), print_fail) - - def remove_stations(self): - for name in self.station_names: - LFUtils.removePort(self.resource, name, self.lfclient_url) - - def num_associated(self, bssid): - counter = 0 - # print("there are %d results" % len(self.station_results)) - fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("sta*", fields, debug_=False) - if (self.station_results is None) or (len(self.station_results) < 1): - self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) - if record["ap"] == bssid: - counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - return counter - - def clear_test_results(self): - self.resulting_stations = {} - self.resulting_endpoints = {} - super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() - - def setup(self): - self.clear_test_results() - self.check_connect() - upstream_json = self.json_get("%s?fields=alias,phantom,down,port,ip" % self.get_upstream_url(), debug_=False) - - if upstream_json is None: - self._fail(message="Unable to query %s, bye" % self.upstream_port, print_=True) - return False - - if upstream_json['interface']['ip'] == "0.0.0.0": - if self.debug: - pprint.pprint(upstream_json) - self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True) - return False - - # remove old stations - print("Removing old stations") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - response = self.json_get(sta_url) - if (response is not None) and (response["interface"] is not None): - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) - - # Create stations and turn dhcp on - self.station_profile = self.localrealm.new_station_profile() - - if self.dut_security == WPA2: - self.station_profile.use_security(security_type="wpa2", ssid=self.dut_ssid, passwd=self.dut_passwd) - elif self.dut_security == WPA: - self.station_profile.use_security(security_type="wpa", ssid=self.dut_ssid, passwd=self.dut_passwd) - elif self.dut_security == OPEN: - self.station_profile.use_security(security_type="open", ssid=self.dut_ssid, passwd="[BLANK]") - elif self.dut_security == WPA: - self.station_profile.use_security(security_type="wpa", ssid=self.dut_ssid, passwd=self.dut_passwd) - elif self.dut_security == WEP: - self.station_profile.use_security(security_type="wep", ssid=self.dut_ssid, passwd=self.dut_passwd) - self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) - - print("Adding new stations ", end="") - self.station_profile.create(radio=self.radio, sta_names_=self.station_names, up_=False, debug=self.debug, suppress_related_commands_=True) - LFUtils.wait_until_ports_appear(self.lfclient_url, self.station_names, debug=self.debug) - - def start(self): - if self.station_profile is None: - self._fail("Incorrect setup") - pprint.pprint(self.station_profile) - if self.station_profile.up is None: - self._fail("Incorrect station profile, missing profile.up") - if self.station_profile.up == False: - print("\nBringing ports up...") - data = {"shelf": 1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1} - self.json_post("/cli-json/nc_show_ports", data) - self.station_profile.admin_up() - LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) - - # station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl())) - duration = 0 - maxTime = 100 - ip = "0.0.0.0" - ap = "" - print("Waiting for %s stations to associate to AP: " % len(self.station_names), end="") - connected_stations = {} - while (len(connected_stations.keys()) < len(self.station_names)) and (duration < maxTime): - duration += 3 - time.sleep(10) - print(".", end="") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url + "?fields=port,ip,ap") - - # LFUtils.debug_printer.pprint(station_info) - if (station_info is not None) and ("interface" in station_info): - if "ip" in station_info["interface"]: - ip = station_info["interface"]["ip"] - if "ap" in station_info["interface"]: - ap = station_info["interface"]["ap"] - - if (ap == "Not-Associated") or (ap == ""): - if self.debug: - print(" -%s," % sta_name, end="") - else: - if ip == "0.0.0.0": - if self.debug: - print(" %s (0.0.0.0)" % sta_name, end="") - else: - connected_stations[sta_name] = sta_url - data = { - "shelf":1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1 - } - self.json_post("/cli-json/nc_show_ports", data) - - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") - if station_info is None: - print("unable to query %s" % sta_url) - self.resulting_stations[sta_url] = station_info - ap = station_info["interface"]["ap"] - ip = station_info["interface"]["ip"] - if (ap != "") and (ap != "Not-Associated"): - print(" %s +AP %s, " % (sta_name, ap), end="") - if self.dut_bssid != "": - if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) - # self.test_results.append("PASSED: ) - # print("PASSED: Connected to BSSID: "+ap) - else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) - else: - self._fail(sta_name+" did not connect to AP") - return False - - if ip == "0.0.0.0": - self._fail("%s did not get an ip. Ending test" % sta_name) - else: - self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip)) - - if self.passes() == False: - if self.cleanup_on_exit: - print("Cleaning up...") - self.remove_stations() - return False - - def udp_profile(self, side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu): - # Create UDP endpoint - Alex's code! - self.l3_udp_tput_profile = self.localrealm.new_l3_cx_profile() - self.l3_udp_tput_profile.side_a_min_bps = side_a_min_bps - self.l3_udp_tput_profile.side_b_min_bps = side_b_min_bps - self.l3_udp_tput_profile.side_a_min_pdu = side_a_min_pdu - self.l3_udp_tput_profile.side_b_min_pdu = side_b_min_pdu - self.l3_udp_tput_profile.report_timer = 1000 - self.l3_udp_tput_profile.name_prefix = "udp" - self.l3_udp_tput_profile.create(endp_type="lf_udp", - side_a=list(self.localrealm.find_ports_like("tput+")), - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) - - def tcp_profile(self, side_a_min_bps, side_b_min_bps): - # Create TCP endpoints - original code! - self.l3_tcp_tput_profile = self.localrealm.new_l3_cx_profile() - self.l3_tcp_tput_profile.side_a_min_bps = side_a_min_bps - self.l3_tcp_tput_profile.side_b_min_bps = side_b_min_bps - self.l3_tcp_tput_profile.name_prefix = "tcp" - self.l3_tcp_tput_profile.report_timer = 1000 - self.l3_tcp_tput_profile.create(endp_type="lf_tcp", - side_a=list(self.localrealm.find_ports_like("tput+")), - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) - - # Start UDP Downstream Traffic - def udp_throughput(self): - print("\nStarting UDP Traffic") - self.l3_udp_tput_profile.start_cx() - time.sleep(1) - self.l3_udp_tput_profile.refresh_cx() - - def tcp_throughput(self): - print("\nStarting TCP Traffic") - self.l3_tcp_tput_profile.start_cx() - time.sleep(1) - self.l3_tcp_tput_profile.refresh_cx() - - def udp_stop(self): - # stop cx traffic - print("Stopping CX Traffic") - self.l3_udp_tput_profile.stop_cx() - - # Refresh stats - print("\nRefresh CX stats") - self.l3_udp_tput_profile.refresh_cx() - - print("Sleeping for 5 seconds") - time.sleep(5) - - # get data for endpoints JSON - return self.collect_client_stats(self.l3_udp_tput_profile.created_cx) - # print("\n") - - def tcp_stop(self): - # stop cx traffic - print("Stopping CX Traffic") - self.l3_tcp_tput_profile.stop_cx() - - # Refresh stats - print("\nRefresh CX stats") - self.l3_tcp_tput_profile.refresh_cx() - - print("Sleeping for 5 seconds") - time.sleep(5) - - # get data for endpoints JSON - return self.collect_client_stats(self.l3_tcp_tput_profile.created_cx) - # print("\n") - - # New Endpoint code to print TX and RX numbers - def collect_client_stats(self, endp_map): - print("Collecting Data") - fields="?fields=name,tx+bytes,rx+bytes" - for (cx_name, endps) in endp_map.items(): - try: - endp_url = "/endp/%s%s" % (endps[0], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - ptest_a_tx = endp_json['endpoint']['tx bytes'] - ptest_a_rx = endp_json['endpoint']['rx bytes'] - - # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"]) - endp_url = "/endp/%s%s" % (endps[1], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - ptest_b_tx = endp_json['endpoint']['tx bytes'] - ptest_b_rx = endp_json['endpoint']['rx bytes'] - - byte_values = [] - byte_values.append("Station TX: " + str(ptest_a_tx)) - byte_values.append("Station RX: " + str(ptest_a_rx)) - byte_values.append("AP TX: " + str(ptest_b_tx)) - byte_values.append("AP RX: " + str(ptest_b_rx)) - - return byte_values - - except Exception as e: - self.error(e) - - def cleanup_udp(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_udp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_udp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) - - def cleanup_tcp(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_tcp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_tcp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) - - def cleanup(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_tcp_tput_profile.get_cx_names()) - removeCX(self.lfclient_url, self.l3_udp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_tcp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - for (cx_name, endp_names) in self.l3_udp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug=self.debug) - - def udp_unidirectional(self, side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line): - self.udp_profile(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu) - self.start() - print("Running", direction, "Traffic for %s seconds" % self.runtime_secs) - self.udp_throughput() - print("napping %f sec" % self.runtime_secs) - time.sleep(self.runtime_secs) - values = self.udp_stop() - print(values) - # Get value required for measurement - bytes = values[values_line] - # Get value in Bits and convert to Mbps - bits = (int(bytes.split(": ", 1)[1])) * 8 - mpbs = round((bits / 1000000) / self.runtime_secs, 2) - return mpbs - - def tcp_unidirectional(self, side_a_min_bps, side_b_min_bps, direction, values_line): - self.tcp_profile(side_a_min_bps, side_b_min_bps) - self.start() - print("Running", direction, "Traffic for %s seconds" % self.runtime_secs) - self.tcp_throughput() - print("napping %f sec" % self.runtime_secs) - time.sleep(self.runtime_secs) - values = self.tcp_stop() - print(values) - # Get value required for measurement - bytes = values[values_line] - # Get value in Bits and convert to Mbps - bits = (int(bytes.split(": ", 1)[1])) * 8 - mpbs = round((bits / 1000000) / self.runtime_secs, 2) - return mpbs - - def throughput_csv(csv_file, ssid_name, ap_model, firmware, security, udp_ds, udp_us, tcp_ds, tcp_us): - # Find band for CSV ---> This code is not great, it SHOULD get that info from LANForge! - if "5G" in ssid_name: - frequency = "5 GHz" - - elif "2dot4G" in ssid_name: - frequency = "2.4 GHz" - - else: - frequency = "Unknown" - - # Append row to top of CSV file - row = [ap_model, firmware, frequency, security, udp_ds, udp_us, tcp_ds, tcp_us] - - with open(csv_file, 'r') as readFile: - reader = csv.reader(readFile) - lines = list(reader) - lines.insert(1, row) - - with open(csv_file, 'w') as writeFile: - writer = csv.writer(writeFile) - writer.writerows(lines) - - readFile.close() - writeFile.close() - - -class SingleClientEAP(LFCliBase): - def __init__(self, host, port, security=None, ssid=None, sta_list=None, number_template="00000", _debug_on=False, _dut_bssid="", - _exit_on_error=False, _sta_name=None, _resource=1, radio="wiphy0", key_mgmt="WPA-EAP", eap="", identity="", - ttls_passwd="", hessid=None, ttls_realm="", domain="", _exit_on_fail=False, _cleanup_on_exit=True): - super().__init__(host, port, _debug=_debug_on, _halt_on_error=_exit_on_error, _exit_on_fail=_exit_on_fail) - self.host = host - self.port = port - self.ssid = ssid - self.radio = radio - self.security = security - #self.password = password - self.sta_list = sta_list - self.key_mgmt = key_mgmt - self.eap = eap - self.identity = identity - self.ttls_passwd = ttls_passwd - self.ttls_realm = ttls_realm - self.domain = domain - self.hessid = hessid - self.dut_bssid = _dut_bssid - self.timeout = 120 - self.number_template = number_template - self.debug = _debug_on - self.local_realm = realm.Realm(lfclient_host=self.host, lfclient_port=self.port) - self.station_profile = self.local_realm.new_station_profile() - self.station_profile.lfclient_url = self.lfclient_url - self.station_profile.ssid = self.ssid - self.station_profile.security = self.security - self.station_profile.number_template_ = self.number_template - self.station_profile.mode = 0 - #Added to test_ipv4_ttls code - self.upstream_url = None # defer construction - self.sta_url_map = None - self.upstream_resource = None - self.upstream_port = None - self.station_names = [] - if _sta_name is not None: - self.station_names = [_sta_name] - self.localrealm = Realm(lfclient_host=host, lfclient_port=port) - self.resource = _resource - self.cleanup_on_exit = _cleanup_on_exit - self.resulting_stations = {} - self.resulting_endpoints = {} - self.station_profile = None - self.l3_udp_profile = None - self.l3_tcp_profile = None - - # def get_realm(self) -> Realm: # py > 3.6 - def get_realm(self): - return self.localrealm - - def get_station_url(self, sta_name_=None): - if sta_name_ is None: - raise ValueError("get_station_url wants a station name") - if self.sta_url_map is None: - self.sta_url_map = {} - for sta_name in self.station_names: - self.sta_url_map[sta_name] = "port/1/%s/%s" % (self.resource, sta_name) - return self.sta_url_map[sta_name_] - - def get_upstream_url(self): - if self.upstream_url is None: - self.upstream_url = "port/1/%s/%s" % (self.upstream_resource, self.upstream_port) - return self.upstream_url - - # Compare pre-test values to post-test values - def compare_vals(self, name, postVal, print_pass=False, print_fail=True): - # print(f"Comparing {name}") - if postVal > 0: - self._pass("%s %s" % (name, postVal), print_pass) - else: - self._fail("%s did not report traffic: %s" % (name, postVal), print_fail) - - def remove_stations(self): - for name in self.station_names: - LFUtils.removePort(self.resource, name, self.lfclient_url) - - def num_associated(self, bssid): - counter = 0 - # print("there are %d results" % len(self.station_results)) - fields = "_links,port,alias,ip,ap,port+type" - self.station_results = self.localrealm.find_ports_like("eap*", fields, debug_=False) - if (self.station_results is None) or (len(self.station_results) < 1): - self.get_failed_result_list() - for eid,record in self.station_results.items(): - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - #pprint(eid) - #pprint(record) - if record["ap"] == bssid: - counter += 1 - #print("-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ") - return counter - - def clear_test_results(self): - self.resulting_stations = {} - self.resulting_endpoints = {} - super().clear_test_results() - #super(StaConnect, self).clear_test_results().test_results.clear() - - def setup(self): - self.clear_test_results() - self.check_connect() - upstream_json = self.json_get("%s?fields=alias,phantom,down,port,ip" % self.get_upstream_url(), debug_=False) - - if upstream_json is None: - self._fail(message="Unable to query %s, bye" % self.upstream_port, print_=True) - return False - - if upstream_json['interface']['ip'] == "0.0.0.0": - if self.debug: - pprint.pprint(upstream_json) - self._fail("Warning: %s lacks ip address" % self.get_upstream_url(), print_=True) - return False - - # remove old stations - print("Removing old stations") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - response = self.json_get(sta_url) - if (response is not None) and (response["interface"] is not None): - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - LFUtils.wait_until_ports_disappear(self.lfclient_url, self.station_names) - - # Create stations and turn dhcp on - self.station_profile = self.localrealm.new_station_profile() - - # Build stations - self.station_profile.use_security(self.security, self.ssid, passwd="[BLANK]") - self.station_profile.set_number_template(self.number_template) - print("Creating stations") - self.station_profile.set_command_flag("add_sta", "create_admin_down", 1) - self.station_profile.set_command_param("set_port", "report_timer", 1500) - self.station_profile.set_command_flag("set_port", "rpt_timer", 1) - self.station_profile.set_wifi_extra(key_mgmt=self.key_mgmt, eap=self.eap, identity=self.identity, - passwd=self.ttls_passwd, - realm=self.ttls_realm, domain=self.domain, - hessid=self.hessid) - self.station_profile.create(radio=self.radio, sta_names_=self.sta_list, debug=self.debug, use_radius=True, hs20_enable=False) - self._pass("PASS: Station build finished") - - def start(self): - if self.station_profile is None: - self._fail("Incorrect setup") - pprint.pprint(self.station_profile) - if self.station_profile.up is None: - self._fail("Incorrect station profile, missing profile.up") - if self.station_profile.up == False: - print("\nBringing ports up...") - data = {"shelf": 1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1} - self.json_post("/cli-json/nc_show_ports", data) - self.station_profile.admin_up() - LFUtils.waitUntilPortsAdminUp(self.resource, self.lfclient_url, self.station_names) - - # station_info = self.jsonGet(self.mgr_url, "%s?fields=port,ip,ap" % (self.getStaUrl())) - duration = 0 - maxTime = 30 - ip = "0.0.0.0" - ap = "" - print("Waiting for %s stations to associate to AP: " % len(self.station_names), end="") - connected_stations = {} - while (len(connected_stations.keys()) < len(self.station_names)) and (duration < maxTime): - duration += 3 - time.sleep(10) - print(".", end="") - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url + "?fields=port,ip,ap") - - # LFUtils.debug_printer.pprint(station_info) - if (station_info is not None) and ("interface" in station_info): - if "ip" in station_info["interface"]: - ip = station_info["interface"]["ip"] - if "ap" in station_info["interface"]: - ap = station_info["interface"]["ap"] - - if (ap == "Not-Associated") or (ap == ""): - if self.debug: - print(" -%s," % sta_name, end="") - else: - if ip == "0.0.0.0": - if self.debug: - print(" %s (0.0.0.0)" % sta_name, end="") - else: - connected_stations[sta_name] = sta_url - data = { - "shelf":1, - "resource": self.resource, - "port": "ALL", - "probe_flags": 1 - } - self.json_post("/cli-json/nc_show_ports", data) - - for sta_name in self.station_names: - sta_url = self.get_station_url(sta_name) - station_info = self.json_get(sta_url) # + "?fields=port,ip,ap") - if station_info is None: - print("unable to query %s" % sta_url) - self.resulting_stations[sta_url] = station_info - ap = station_info["interface"]["ap"] - ip = station_info["interface"]["ip"] - if (ap != "") and (ap != "Not-Associated"): - print(" %s +AP %s, " % (sta_name, ap), end="") - if self.dut_bssid != "": - if self.dut_bssid.lower() == ap.lower(): - self._pass(sta_name+" connected to BSSID: " + ap) - # self.test_results.append("PASSED: ) - # print("PASSED: Connected to BSSID: "+ap) - else: - self._fail("%s connected to wrong BSSID, requested: %s Actual: %s" % (sta_name, self.dut_bssid, ap)) - else: - self._fail(sta_name+" did not connect to AP") - return False - - if ip == "0.0.0.0": - self._fail("%s did not get an ip. Ending test" % sta_name) - else: - self._pass("%s connected to AP: %s With IP: %s" % (sta_name, ap, ip)) - - if self.passes() == False: - if self.cleanup_on_exit: - print("Cleaning up...") - self.remove_stations() - return False - - def udp_profile(self, side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu): - # Create UDP endpoint - Alex's code! - self.l3_udp_tput_profile = self.localrealm.new_l3_cx_profile() - self.l3_udp_tput_profile.side_a_min_bps = side_a_min_bps - self.l3_udp_tput_profile.side_b_min_bps = side_b_min_bps - self.l3_udp_tput_profile.side_a_min_pdu = side_a_min_pdu - self.l3_udp_tput_profile.side_b_min_pdu = side_b_min_pdu - self.l3_udp_tput_profile.report_timer = 1000 - self.l3_udp_tput_profile.name_prefix = "udp" - self.l3_udp_tput_profile.create(endp_type="lf_udp", - side_a=list(self.localrealm.find_ports_like("tput+")), - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) - - def tcp_profile(self, side_a_min_bps, side_b_min_bps): - # Create TCP endpoints - original code! - self.l3_tcp_tput_profile = self.localrealm.new_l3_cx_profile() - self.l3_tcp_tput_profile.side_a_min_bps = side_a_min_bps - self.l3_tcp_tput_profile.side_b_min_bps = side_b_min_bps - self.l3_tcp_tput_profile.name_prefix = "tcp" - self.l3_tcp_tput_profile.report_timer = 1000 - self.l3_tcp_tput_profile.create(endp_type="lf_tcp", - side_a=list(self.localrealm.find_ports_like("tput+")), - side_b="%d.%s" % (self.resource, self.upstream_port), - suppress_related_commands=True) - - # Start UDP Downstream Traffic - def udp_throughput(self): - print("\nStarting UDP Traffic") - self.l3_udp_tput_profile.start_cx() - time.sleep(1) - self.l3_udp_tput_profile.refresh_cx() - - def tcp_throughput(self): - print("\nStarting TCP Traffic") - self.l3_tcp_tput_profile.start_cx() - time.sleep(1) - self.l3_tcp_tput_profile.refresh_cx() - - def udp_stop(self): - # stop cx traffic - print("Stopping CX Traffic") - self.l3_udp_tput_profile.stop_cx() - - # Refresh stats - print("\nRefresh CX stats") - self.l3_udp_tput_profile.refresh_cx() - - print("Sleeping for 5 seconds") - time.sleep(5) - - # get data for endpoints JSON - return self.collect_client_stats(self.l3_udp_tput_profile.created_cx) - # print("\n") - - def tcp_stop(self): - # stop cx traffic - print("Stopping CX Traffic") - self.l3_tcp_tput_profile.stop_cx() - - # Refresh stats - print("\nRefresh CX stats") - self.l3_tcp_tput_profile.refresh_cx() - - print("Sleeping for 5 seconds") - time.sleep(5) - - # get data for endpoints JSON - return self.collect_client_stats(self.l3_tcp_tput_profile.created_cx) - # print("\n") - - # New Endpoint code to print TX and RX numbers - def collect_client_stats(self, endp_map): - print("Collecting Data") - fields="?fields=name,tx+bytes,rx+bytes" - for (cx_name, endps) in endp_map.items(): - try: - endp_url = "/endp/%s%s" % (endps[0], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - ptest_a_tx = endp_json['endpoint']['tx bytes'] - ptest_a_rx = endp_json['endpoint']['rx bytes'] - - # ptest = self.json_get("/endp/%s?fields=tx+bytes,rx+bytes" % cx_names[cx_name]["b"]) - endp_url = "/endp/%s%s" % (endps[1], fields) - endp_json = self.json_get(endp_url) - self.resulting_endpoints[endp_url] = endp_json - ptest_b_tx = endp_json['endpoint']['tx bytes'] - ptest_b_rx = endp_json['endpoint']['rx bytes'] - - byte_values = [] - byte_values.append("Station TX: " + str(ptest_a_tx)) - byte_values.append("Station RX: " + str(ptest_a_rx)) - byte_values.append("AP TX: " + str(ptest_b_tx)) - byte_values.append("AP RX: " + str(ptest_b_rx)) - - return byte_values - - except Exception as e: - self.error(e) - - def cleanup_udp(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_udp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_udp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) - - def cleanup_tcp(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_tcp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_tcp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug= self.debug) - - def cleanup(self): - # remove all endpoints and cxs - if self.cleanup_on_exit: - for sta_name in self.station_names: - LFUtils.removePort(self.resource, sta_name, self.lfclient_url) - curr_endp_names = [] - removeCX(self.lfclient_url, self.l3_tcp_tput_profile.get_cx_names()) - removeCX(self.lfclient_url, self.l3_udp_tput_profile.get_cx_names()) - for (cx_name, endp_names) in self.l3_tcp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - for (cx_name, endp_names) in self.l3_udp_tput_profile.created_cx.items(): - curr_endp_names.append(endp_names[0]) - curr_endp_names.append(endp_names[1]) - removeEndps(self.lfclient_url, curr_endp_names, debug=self.debug) - - def udp_unidirectional(self, side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line): - self.udp_profile(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu) - self.start() - print("Running", direction, "Traffic for %s seconds" % self.runtime_secs) - self.udp_throughput() - print("napping %f sec" % self.runtime_secs) - time.sleep(self.runtime_secs) - values = self.udp_stop() - print(values) - # Get value required for measurement - bytes = values[values_line] - # Get value in Bits and convert to Mbps - bits = (int(bytes.split(": ", 1)[1])) * 8 - mpbs = round((bits / 1000000) / self.runtime_secs, 2) - return mpbs - - def tcp_unidirectional(self, side_a_min_bps, side_b_min_bps, direction, values_line): - self.tcp_profile(side_a_min_bps, side_b_min_bps) - self.start() - print("Running", direction, "Traffic for %s seconds" % self.runtime_secs) - self.tcp_throughput() - print("napping %f sec" % self.runtime_secs) - time.sleep(self.runtime_secs) - values = self.tcp_stop() - print(values) - # Get value required for measurement - bytes = values[values_line] - # Get value in Bits and convert to Mbps - bits = (int(bytes.split(": ", 1)[1])) * 8 - mpbs = round((bits / 1000000) / self.runtime_secs, 2) - return mpbs -# ~class - - -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -########################## Test Code ################################ - -##Main will perform 4 throughput tests on SSID provided by input and return a list with the values - -def main(ap_model, firmware, radio, ssid_name, ssid_psk, security, station, runtime, upstream_port): - ######## Establish Client Connection ######################### - singleClient = SingleClient("10.10.10.201", 8080, debug_=False) - singleClient.sta_mode = 0 - singleClient.upstream_resource = 1 - singleClient.upstream_port = upstream_port - singleClient.radio = radio - singleClient.resource = 1 - singleClient.dut_ssid = ssid_name - singleClient.dut_passwd = ssid_psk - singleClient.dut_security = security - singleClient.station_names = station - singleClient.runtime_secs = runtime - singleClient.cleanup_on_exit = True - - #Create List for Throughput Data - tput_data = [] - - ####### Setup UDP Profile and Run Traffic Downstream (AP to STA) ####################### - singleClient.setup() - side_a_min_bps = 56000 - side_b_min_bps = 500000000 - side_a_min_pdu = 1200 - side_b_min_pdu = 1500 - direction = "Downstream" - values_line = 1 # 1 = Station Rx - try: - udp_ds = singleClient.udp_unidirectional(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line) - print("UDP Downstream:", udp_ds, "Mbps") - tput_data.append("UDP Downstream: " + str(udp_ds)) - except: - udp_ds = "error" - print("UDP Downstream Test Error") - tput_data.append("UDP Downstream: Error") - - - ####### Setup UDP Profile and Run Traffic Upstream (STA to AP) ####################### - #singleClient.setup() - side_a_min_bps = 500000000 - side_b_min_bps = 0 - side_a_min_pdu = 1200 - side_b_min_pdu = 1500 - direction = "Upstream" - values_line = 3 # 3 = AP Rx - try: - udp_us = singleClient.udp_unidirectional(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line) - print("UDP Upstream:",udp_us,"Mbps") - tput_data.append("UDP Upstream: " + str(udp_us)) - except: - udp_us = "error" - print("UDP Upstream Test Error") - tput_data.append("UDP Upstream: Error") - #Cleanup UDP Endpoints - #singleClient.cleanup_udp() - - - ####### Setup TCP Profile and Run Traffic Downstream (AP to STA) ####################### - #singleClient.setup() - side_a_min_bps = 0 - side_b_min_bps = 500000000 - direction = "Downstream" - values_line = 1 # 1 = Station Rx - try: - tcp_ds = singleClient.tcp_unidirectional(side_a_min_bps, side_b_min_bps, direction, values_line) - print("TCP Downstream:",tcp_ds,"Mbps") - tput_data.append("TCP Downstream: " + str(tcp_ds)) - except: - tcp_ds = "error" - print("TCP Downstream Test Error") - tput_data.append("TCP Downstream: Error") - - ####### Setup TCP Profile and Run Traffic Upstream (STA to AP) ####################### - #singleClient.setup() - side_a_min_bps = 500000000 - side_b_min_bps = 0 - direction = "Upstream" - values_line = 3 # 3 = AP Rx - try: - tcp_us = singleClient.tcp_unidirectional(side_a_min_bps, side_b_min_bps, direction, values_line) - print("TCP Upstream:",tcp_us,"Mbps") - tput_data.append("TCP Upstream: " + str(tcp_us)) - except: - tcp_us = "error" - print("TCP Upstream Test Error") - tput_data.append("TCP Uptream: Error") - - #Cleanup TCP Endpoints - #singleClient.cleanup_tcp() - - #Cleanup Endpoints - singleClient.cleanup() - - return(tput_data) - -def eap_tput(sta_list, ssid_name, radio, security, eap_type, identity, ttls_password, upstream_port): - eap_connect = SingleClientEAP("10.10.10.201", 8080, _debug_on=False) - eap_connect.upstream_resource = 1 - eap_connect.upstream_port = upstream_port - eap_connect.security = security - eap_connect.sta_list = sta_list - eap_connect.station_names = sta_list - eap_connect.ssid = ssid_name - eap_connect.radio = radio - eap_connect.eap = eap_type - eap_connect.identity = identity - eap_connect.ttls_passwd = ttls_password - eap_connect.runtime_secs = 10 - - #Create List for Throughput Data - tput_data = [] - - ####### Setup UDP Profile and Run Traffic Downstream (AP to STA) ####################### - eap_connect.setup() - side_a_min_bps = 56000 - side_b_min_bps = 500000000 - side_a_min_pdu = 1200 - side_b_min_pdu = 1500 - direction = "Downstream" - values_line = 1 # 1 = Station Rx - try: - udp_ds = eap_connect.udp_unidirectional(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line) - print("UDP Downstream:", udp_ds, "Mbps") - tput_data.append("UDP Downstream: " + str(udp_ds)) - except: - udp_ds = "error" - print("UDP Downstream Test Error") - tput_data.append("UDP Downstream: Error") - - - ####### Setup UDP Profile and Run Traffic Upstream (STA to AP) ####################### - #singleClient.setup() - side_a_min_bps = 500000000 - side_b_min_bps = 0 - side_a_min_pdu = 1200 - side_b_min_pdu = 1500 - direction = "Upstream" - values_line = 3 # 3 = AP Rx - try: - udp_us = eap_connect.udp_unidirectional(side_a_min_bps, side_b_min_bps, side_a_min_pdu, side_b_min_pdu, direction, values_line) - print("UDP Upstream:",udp_us,"Mbps") - tput_data.append("UDP Upstream: " + str(udp_us)) - except: - udp_us = "error" - print("UDP Upstream Test Error") - tput_data.append("UDP Upstream: Error") - #Cleanup UDP Endpoints - #singleClient.cleanup_udp() - - - ####### Setup TCP Profile and Run Traffic Downstream (AP to STA) ####################### - #singleClient.setup() - side_a_min_bps = 0 - side_b_min_bps = 500000000 - direction = "Downstream" - values_line = 1 # 1 = Station Rx - try: - tcp_ds = eap_connect.tcp_unidirectional(side_a_min_bps, side_b_min_bps, direction, values_line) - print("TCP Downstream:",tcp_ds,"Mbps") - tput_data.append("TCP Downstream: " + str(tcp_ds)) - except: - tcp_ds = "error" - print("TCP Downstream Test Error") - tput_data.append("TCP Downstream: Error") - - ####### Setup TCP Profile and Run Traffic Upstream (STA to AP) ####################### - #singleClient.setup() - side_a_min_bps = 500000000 - side_b_min_bps = 0 - direction = "Upstream" - values_line = 3 # 3 = AP Rx - try: - tcp_us = eap_connect.tcp_unidirectional(side_a_min_bps, side_b_min_bps, direction, values_line) - print("TCP Upstream:",tcp_us,"Mbps") - tput_data.append("TCP Upstream: " + str(tcp_us)) - except: - tcp_us = "error" - print("TCP Upstream Test Error") - tput_data.append("TCP Uptream: Error") - - #Cleanup TCP Endpoints - #singleClient.cleanup_tcp() - - #Cleanup Endpoints - eap_connect.cleanup() - - return(tput_data) diff --git a/tests/templates/radius_profile_template.json b/tests/templates/radius_profile_template.json deleted file mode 100644 index 2af9ee0f8..000000000 --- a/tests/templates/radius_profile_template.json +++ /dev/null @@ -1 +0,0 @@ -{"model_type": "Profile", "id": 129, "customerId": "2", "profileType": "radius", "name": "Automation_Radius_Nightly-01", "details": {"model_type": "RadiusProfile", "primaryRadiusAuthServer": {"model_type": "RadiusServer", "ipAddress": "18.189.25.141", "secret": "testing123", "port": 1812, "timeout": 5}, "secondaryRadiusAuthServer": null, "primaryRadiusAccountingServer": null, "secondaryRadiusAccountingServer": null, "profileType": "radius"}, "createdTimestamp": 1602263176599, "lastModifiedTimestamp": 1611708334061, "childProfileIds": []} \ No newline at end of file diff --git a/tests/templates/report_template.php b/tests/templates/report_template.php deleted file mode 100755 index f25fcda54..000000000 --- a/tests/templates/report_template.php +++ /dev/null @@ -1,622 +0,0 @@ - - - - -Testing Report - - - - - - - - -
-

CICD Nightly Sanity Report -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Test Results

-
EA8300 ResultECW5211 ResultECW5410 ResultEC420 Result
New FW Available
FW Under Test
CloudSDK Commit Date
CloudSDK Commit ID
CloudSDK Project Version
Test Pass Rate
Test CaseCategoryDescription
5540CloudSDKGet CloudSDK Version with API
5548CloudSDKCreate FW version on CloudSDK using API
5547CloudSDKRequest AP Upgrade using API
2233APAP Upgrade Successful
5247CloudSDKCloudSDK Reports Correct FW
5222CloudSDKAP-CloudSDK Connection Active
5808CloudSDKCreate RADIUS Profile
5644CloudSDKCreate SSID Profile 2.4 GHz WPA2-EAP - Bridge Mode
5645CloudSDKCreate SSID Profile 2.4 GHz WPA2 - Bridge Mode
5646CloudSDKCreate SSID Profile 2.4 GHz WPA - Bridge Mode
5647CloudSDKCreate SSID Profile 5 GHz WPA2-EAP - Bridge Mode
5647CloudSDKCreate SSID Profile 5 GHz WPA2 - Bridge Mode
5648CloudSDKCreate SSID Profile 5 GHz WPA - Bridge Mode
5641CloudSDKCreate AP Profile - Bridge Mode
5541CloudSDKCloudSDK Pushes Correct AP Profile - Bridge Mode
5544APAP Applies Correct AP Profile - Bridge Mode
5214APClient connects to 2.4 GHz WPA2-EAP - Bridge Mode
2237APClient connects to 2.4 GHz WPA2 - Bridge Mode
2420APClient connects to 2.4 GHz WPA - Bridge Mode
5215APClient connects to 5 GHz WPA2-EAP - Bridge Mode
2236APClient connects to 5 GHz WPA2 - Bridge Mode
2419APClient connects to 5 GHz WPA - Bridge Mode
5650CloudSDKCreate SSID Profile 2.4 GHz WPA2-EAP - NAT Mode
5651CloudSDKCreate SSID Profile 2.4 GHz WPA2 - NAT Mode
5652CloudSDKCreate SSID Profile 2.4 GHz WPA - NAT Mode
5653CloudSDKCreate SSID Profile 5 GHz WPA2-EAP - NAT Mode
5654CloudSDKCreate SSID Profile 5 GHz WPA2 - NAT Mode
5655CloudSDKCreate SSID Profile 5 GHz WPA - NAT Mode
5642CloudSDKCreate AP Profile - NAT Mode
5542CloudSDKCloudSDK Pushes Correct AP Profile - NAT Mode
5545APAP Applies Correct AP Profile - NAT Mode
5216APClient connects to 2.4 GHz WPA2-EAP - NAT Mode
4325APClient connects to 2.4 GHz WPA2 - NAT Mode
4323APClient connects to 2.4 GHz WPA - NAT Mode
5217APClient connects to 5 GHz WPA2-EAP - NAT Mode
4326APClient connects to 5 GHz WPA2 - NAT Mode
4324APClient connects to 5 GHz WPA - NAT Mode
5656CloudSDKCreate SSID Profile 2.4 GHz WPA2-EAP - Custom VLAN
5657CloudSDKCreate SSID Profile 2.4 GHz WPA2 - Custom VLAN
5658CloudSDKCreate SSID Profile 2.4 GHz WPA - Custom VLAN
5659CloudSDKCreate SSID Profile 5 GHz WPA2-EAP - Custom VLAN
5660CloudSDKCreate SSID Profile 5 GHz WPA2 - Custom VLAN
5661CloudSDKCreate SSID Profile 5 GHz WPA - Custom VLAN
5643CloudSDKCreate AP Profile - Custom VLAN
5543CloudSDKCloudSDK Pushes Correct AP Profile - Custom VLAN
5546APAP Applies Correct AP Profile - Custom VLAN
5253APClient connects to 2.4 GHz WPA2-EAP - Custom VLAN
5251APClient connects to 2.4 GHz WPA2 - Custom VLAN
5252APClient connects to 2.4 GHz WPA - Custom VLAN
5250APClient connects to 5 GHz WPA2-EAP - Custom VLAN
5248APClient connects to 5 GHz WPA2 - Custom VLAN
5249APClient connects to 5 GHz WPA - Custom VLAN
- - \ No newline at end of file diff --git a/tests/templates/ssid_profile_template.json b/tests/templates/ssid_profile_template.json deleted file mode 100644 index 6dae58662..000000000 --- a/tests/templates/ssid_profile_template.json +++ /dev/null @@ -1 +0,0 @@ -{"model_type": "Profile", "id": 28, "customerId": 2, "profileType": "ssid", "name": "NOLA-01-ecw5410-2G_WPA", "details": {"model_type": "SsidConfiguration", "ssid": "ECW5410_2dot4G_WPA", "appliedRadios": ["is2dot4GHz"], "ssidAdminState": "enabled", "secureMode": "wpaPSK", "vlanId": 1, "keyStr": "Connectus123$", "broadcastSsid": "enabled", "keyRefresh": 0, "noLocalSubnets": false, "radiusServiceName": "Radius-Accounting-Profile", "radiusAccountingServiceName": null, "radiusAcountingServiceInterval": null, "captivePortalId": null, "bandwidthLimitDown": 0, "bandwidthLimitUp": 0, "clientBandwidthLimitDown": 0, "clientBandwidthLimitUp": 0, "videoTrafficOnly": false, "radioBasedConfigs": {"is2dot4GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHz": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzU": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}, "is5GHzL": {"model_type": "RadioBasedSsidConfiguration", "enable80211r": null, "enable80211k": null, "enable80211v": null}}, "bonjourGatewayProfileId": null, "enable80211w": null, "wepConfig": null, "forwardMode": "BRIDGE", "profileType": "ssid"}, "createdTimestamp": 1598557809816, "lastModifiedTimestamp": 1598557809816, "childProfileIds": []} \ No newline at end of file diff --git a/tests/test_24ghz.py b/tests/test_24ghz.py deleted file mode 100644 index fbe6e8686..000000000 --- a/tests/test_24ghz.py +++ /dev/null @@ -1,66 +0,0 @@ -# https://docs.pytest.org/en/latest/example/markers.html -# https://docs.pytest.org/en/latest/usage.html -# http://pythontesting.net/framework/pytest/pytest-introduction/ - -import sys - -import pytest -from time import sleep, gmtime, strftime -from sta_connect2 import StaConnect2 - -@pytest.mark.usefixtures('setup_testrails') -@pytest.mark.usefixtures('setup_cloudsdk') -@pytest.mark.usefixtures('update_firmware') -@pytest.mark.usefixtures('instantiate_testrail') -class Test24ghz(object): - @pytest.mark.client_connectivity - def test_single_client_wpa2(self, setup_testrails, setup_cloudsdk, update_firmware, instantiate_testrail): - lf_config = setup_cloudsdk["lanforge"] - # ap_profile = setup_cloudsdk["ap_object"] - staConnect = StaConnect2(lf_config["ip"], lf_config["port"], debug_=False) - staConnect.sta_mode = 0 - staConnect.upstream_resource = 1 - staConnect.upstream_port = lf_config["eth_port"] - staConnect.radio = lf_config["2g_radio"] - # staConnect.runtime_secs = lf_config["runtime_duration"] - staConnect.resource = 1 - staConnect.dut_ssid = "NOLA-01g-ecw5410-2G_WPA2" - staConnect.dut_passwd = "ecw5410-2G_WPA2" - staConnect.dut_security = "wpa2" - staConnect.station_names = ['sta0000'] - staConnect.bringup_time_sec = 60 - staConnect.cleanup_on_exit = True - staConnect.setup() - staConnect.start() - sleep(staConnect.runtime_secs) - staConnect.stop() - staConnect.cleanup() - - assert staConnect.passes() - if setup_testrails > 0: - instantiate_testrail.update_testrail(case_id=2835, run_id=setup_testrails, status_id=1, msg="testing") - - # @pytest.mark.client_connectivity - # def test_single_client_wpa(self): - # pass - # - # @pytest.mark.client_connectivity - # def test_single_client_eap(self): - # pass - - #@pytest.mark.featureB - #def test_feature_b(self): - # pass - - #@pytest.mark.featureC - #def test_feature_c(self): - # assert 1 == 0 - - #@pytest.mark.featureD - #def test_feature_d(self): - # pytest.skip("speedup") - - #@pytest.mark.xfail - #@pytest.mark.featureE - #def test_feature_e(self): - # assert 1 == 0 diff --git a/tests/test_utility/reporting.py b/tests/test_utility/reporting.py deleted file mode 100644 index 0517fb001..000000000 --- a/tests/test_utility/reporting.py +++ /dev/null @@ -1,46 +0,0 @@ -import os -from datetime import date, datetime -from shutil import copyfile -import json - - -class Reporting: - - def __init__(self, reports_root="../reports/"): - - self.reports_root = reports_root - self.report_id = self.create_report_id() - self.report_path = self.reports_root + self.report_id - self.templates_root = os.path.abspath(self.reports_root + "../templates") - try: - os.mkdir(self.report_path) - print("Successfully created the directory %s " % self.report_path) - except OSError: - print("Creation of the directory %s failed" % self.report_path) - - try: - copyfile(self.templates_root + "/report_template.php", self.report_path + '/report.php') - except: - print("No report template created. Report data will still be saved. Continuing with tests...") - - def create_report_id(self): - today = str(date.today()) - now = str(datetime.now()).split(" ")[1].split(".")[0].replace(":", "-") - id = today + "-" + now - return id - - def update_json_report(self, report_data): - try: - with open(self.report_path + '/report_data.json', 'w') as report_json_file: - json.dump(report_data, report_json_file) - report_json_file.close() - except Exception as e: - print(e) - - -def main(): - Reporting() - - -if __name__ == '__main__': - main() diff --git a/tools/README.md b/tools/README.md deleted file mode 100644 index b6fce0ede..000000000 --- a/tools/README.md +++ /dev/null @@ -1,2 +0,0 @@ -## Tools -Handy tools made by utliziing the cloud and ap libraries diff --git a/tools/USAGE_EXAMPLES.txt b/tools/USAGE_EXAMPLES.txt deleted file mode 100644 index 26de00b41..000000000 --- a/tools/USAGE_EXAMPLES.txt +++ /dev/null @@ -1,126 +0,0 @@ - - -All of this assumes you are running on some developer system, with ssh tunnels -into the 'ubuntu' jumphost machine. - -ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ - -L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ - -L 8890:lf9:4002 -L 8891:lf9:5901 -L 8892:lf9:8080 -L 8893:lab-ctlr3:22 \ - -L 8900:lf10:4002 -L 8901:lf10:5901 -L 8902:lf10:8080 -L 8903:lab-ctlr3:22 \ - -L 8910:lf11:4002 -L 8911:lf11:5901 -L 8912:lf11:8080 -L 8913:lab-ctlr3:22 \ - -L 8950:lf15:4002 -L 8951:lf15:5901 -L 8952:lf115:8080 -L 8953:lab-ctlr4:22 \ - -L 8820:lf12:4002 -L 8821:lf12:5901 -L 8822:lf12:8080 -L 8823:lab-ctlr4:22 \ - ubuntu@orch - -The ports are used as: - 4002: LANforge GUI connection to LANforge in the testbed. - 5901: VNC connection to LANforge machine. - 8080: LANforge JSON/API connection. - 22: ssh shell access to lab controller - - Each testbed will have a set of 4 ssh tunnels. Some are duplicated since - lab-controllers are shared. I figure a consistent pattern is worth a few - duplicated tunnels. - -Testbed-01 - -# Set AP profile on NOLA-01 -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8802 --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build --skip-radius --skip-wpa --verbose --testbed "NOLA-01" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build - - -./Nightly_Sanity.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01r" --lanforge-ip-address localhost --lanforge-port-number 8802 --default_ap_profile TipWlan-2-Radios --lanforge-2g-radio 1.1.wiphy4 --lanforge-5g-radio 1.1.wiphy5 --skip-upgrade True --testrail-milestone milestone-1 --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build - - -Testbed-09 (perfecto) - -# Set AP profile (ssid, etc) on 'b' chamber. AP is ttyAP4 -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 \ - --lanforge-ip-address localhost --lanforge-port-number 8892 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-09b" \ - --ssid-5g-wpa2 Default-SSID-5gl-perfecto-b --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g-perfecto-b --psk-2g-wpa2 12345678 --mode bridge - -# Upgrade 'b' chamber AP -./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --testbed \"NOLA-09b\" \ - --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true - -# Set AP profile (ssid, etc) on 'a' chamber. AP is ttyAP1 -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 \ - --lanforge-ip-address localhost --lanforge-port-number 8892 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-09a" \ - --ssid-5g-wpa2 Default-SSID-5gl-perfecto --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g-perfecto --psk-2g-wpa2 12345678 --mode bridge - -# Upgrade 'a' chamber AP -./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8893 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-09a\" \ - --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true - - - -Testbed 10 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc) - -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --lanforge-ip-address localhost --lanforge-port-number 8902 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-10" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge - -# Upgrade AP -./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8903 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP2 --testbed \"NOLA-10\" \ - --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true - - -Testbed 11 (Advanced setup, 2D turntable chamber plus medium chamber, RF attenuator, etc) - -./sdk_set_profile.py --testrail-user-id NONE --model eap102 --ap-jumphost-address localhost --ap-jumphost-port 8913 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP3 --lanforge-ip-address localhost --lanforge-port-number 8912 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-11" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge - -# Upgrade AP -./sdk_upgrade_fw.py --testrail-user-id NONE --model eap102 --ap-jumphost-address localhost --ap-jumphost-port 8913 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP3 --testbed \"NOLA-11\" \ - --sdk-base-url https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build --force-upgrade true - - -Testbed 12 (Basic, wf188n) - -# Upgrade firmware to latest -./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \ - --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --force-upgrade true - -./sdk_set_profile.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --lanforge-ip-address localhost --lanforge-port-number 8822 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-12" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 - -# Query an ssid -./query_sdk.py --testrail-user-id NONE --model wf188n --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build \ - --sdk-user-id support@example.com --sdk-user-password support --equipment_id 3 --type profile --cmd get --object_id 11 - - -Testbed-15 - -# Set AP profile on NOLA-15 -./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8953 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --lanforge-ip-address localhost --lanforge-port-number 8952 \ - --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-nola-15.cicd.lab.wlan.tip.build \ - --skip-radius --skip-wpa --verbose --testbed "NOLA-15" --ssid-5g-wpa2 Default-SSID-5gl --psk-5g-wpa2 12345678 \ - --ssid-2g-wpa2 Default-SSID-2g --psk-2g-wpa2 12345678 --mode bridge - -# Update firmware -./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8953 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP4 --testbed \"NOLA-15\" \ - --sdk-base-url https://wlan-portal-svc-nola-15.cicd.lab.wlan.tip.build --force-upgrade true - - diff --git a/tools/debug_nola01.sh b/tools/debug_nola01.sh deleted file mode 100755 index 1d9644e0e..000000000 --- a/tools/debug_nola01.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Commands to grab debug info off of NOLA-01. Everything is hard-coded assuming you use -# ssh tunnel in the suggested way. Otherwise, you will need to edit things... - -set -x - -NOLANUM=01 -PORTAL=wlan-portal-svc.cicd.lab.wlan.tip.build -APPORT=8803 -APTTY=/dev/ttyAP1 -MODEL=ecw5410 - -# cloud sdk profile dump -./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \ - --sdk-user-password support --type profile --cmd get > /tmp/nola-$NOLANUM-profiles.txt - -# cloud version info -./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \ - --sdk-user-password support --type ping > /tmp/nola-$NOLANUM-sdk-ping.txt - -# ovsdb-client dump -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "ovsdb-client dump" > /tmp/nola-$NOLANUM-ap.txt - -# interface info -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "iwinfo && brctl show" > /tmp/nola-$NOLANUM-ap-if.txt - - -# TODO: Add more things here as we learn what better provides debug info to cloud. - -echo "Grab: /tmp/nola-$NOLANUM-profiles.txt /tmp/nola-$NOLANUM-ap.txt /tmp/nola-$NOLANUM-ap-if.txt /tmp/nola-$NOLANUM-sdk-ping.txt" diff --git a/tools/debug_nola12.sh b/tools/debug_nola12.sh deleted file mode 100755 index 648b242ef..000000000 --- a/tools/debug_nola12.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Commands to grab debug info off of NOLA-12. Everything is hard-coded assuming you use -# ssh tunnel in the suggested way. Otherwise, you will need to edit things... - -set -x - -NOLANUM=12 -PORTAL=wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build -APPORT=8823 -APTTY=/dev/ttyAP1 -MODEL=wf188n - -# cloud sdk profile dump -./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \ - --sdk-user-password support --type profile --cmd get > /tmp/nola-$NOLANUM-profiles.txt - -# cloud version info -./query_sdk.py --testrail-user-id NONE --model $MODEL --sdk-base-url https://$PORTAL --sdk-user-id support@example.com \ - --sdk-user-password support --type ping > /tmp/nola-$NOLANUM-sdk-ping.txt - -# ovsdb-client dump -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "ovsdb-client dump" > /tmp/nola-$NOLANUM-ap.txt - -# interface info -./query_ap.py --ap-jumphost-address localhost --ap-jumphost-port $APPORT --ap-jumphost-password pumpkin77 --ap-jumphost-tty $APTTY -m $MODEL --cmd "iwinfo && brctl show" > /tmp/nola-$NOLANUM-ap-if.txt - - -# TODO: Add more things here as we learn what better provides debug info to cloud. - -echo "Grab: /tmp/nola-$NOLANUM-profiles.txt /tmp/nola-$NOLANUM-ap.txt /tmp/nola-$NOLANUM-ap-if.txt /tmp/nola-$NOLANUM-sdk-ping.txt" diff --git a/tools/logs/README.md b/tools/logs/README.md deleted file mode 100644 index c1d294cb1..000000000 --- a/tools/logs/README.md +++ /dev/null @@ -1 +0,0 @@ -Logs go here, don't commit them! diff --git a/tools/query_ap.py b/tools/query_ap.py deleted file mode 100755 index 2cb44532a..000000000 --- a/tools/query_ap.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python3 - -# Example command line: -#./query_ap.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --cmd "ifconfig -a" - -import sys - -sys.path.append(f'../tests') - -from UnitTestBase import * - -parser = argparse.ArgumentParser(description="Query AP", add_help=False) -parser.add_argument("--cmd", type=str, help="Command-line to run on AP", - default = "ifconfig -a") -parser.add_argument("--ap_ssh", type=str, help="ap_ssh method to execute.", - default = None, choices=["get_vif_config", "get_vif_state"]) - -reporting = Reporting(reports_root=os.getcwd() + "/reports/") -base = UnitTestBase("query-ap", parser, reporting) - -cmd = base.command_line_args.cmd - -try: - - if base.command_line_args.ap_ssh != None: - ap_cmd = base.command_line_args.ap_ssh - if ap_cmd == "get_vif_config": - print(get_vif_config(base.command_line_args)) - sys.exit(0) - if ap_cmd == "get_vif_state": - print(get_vif_state(base.command_line_args)) - sys.exit(0) - - print("Un-known ap-ssh method: %s"%(ap_cmd)) - sys.exit(1) - - print("Command: %s"%(cmd)) - rv = ap_ssh_cmd(base.command_line_args, cmd) - print("Command Output:\n%s"%(rv)) - -except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to execute command on AP") diff --git a/tools/query_sdk.py b/tools/query_sdk.py deleted file mode 100755 index f67feb40e..000000000 --- a/tools/query_sdk.py +++ /dev/null @@ -1,253 +0,0 @@ -#!/usr/bin/python3 - -import sys - -sys.path.append(f'../tests') - -from UnitTestBase import * - -parser = argparse.ArgumentParser(description="Query SDK Objects", add_help=False) -parser.add_argument("--type", type=str, help="Type of thing to query", - choices=['profile', 'customer', 'location', 'equipment', 'portalUser', - 'status', 'client-sessions', 'client-info', 'alarm', 'service-metric', - 'event', 'firmware', 'ping', 'all'], - default = "all") -parser.add_argument("--cmd", type=str, help="Operation to do, default is 'get'", - choices=['get', 'delete', 'child_of'], - default = "get") -parser.add_argument("--brief", type=str, help="Show output in brief mode?", - choices=["true", "false"], - default = "false") - -reporting = Reporting(reports_root=os.getcwd() + "/reports/") - -base = UnitTestBase("query-sdk", parser, reporting) - -qtype = base.command_line_args.type -cmd = base.command_line_args.cmd -brief = False -if base.command_line_args.brief == "true": - brief = True - -def get_profile(url, bearer, cust_id, object_id): - if (object_id == None or object_id.isdigit()): - return base.cloud.get_customer_profiles(url, bearer, cust_id, object_id) - else: - return [base.cloud.get_customer_profile_by_name(url, bearer, cust_id, object_id)] - -if qtype == 'all' or qtype == 'profile': - # Get customer profiles - try: - if cmd == "get": - rv = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id) - print("Profiles for customer %s (%i pages):"%(base.customer_id, len(rv))) - #jobj = json.load(ssids) - for r in rv: - if brief: - for p in r['items']: - print("Profile id: %s name: %s type: %s"%(p['id'], p['name'], p['profileType'])) - else: - print(json.dumps(r, indent=4, sort_keys=True)) - - if cmd == "delete": - delid = base.command_line_args.object_id; - if delid.isdigit(): - rv = base.cloud.delete_profile(base.cloudSDK_url, base.bearer, base.command_line_args.object_id) - print("Delete profile for customer %s, id: %s results:"%(base.customer_id, base.command_line_args.object_id)) - print(rv.json()) - else: - # Query object by name to find its ID - targets = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id) - for me in targets: - rv = base.cloud.delete_profile(base.cloudSDK_url, base.bearer, str(me['id'])) - print("Delete profile for customer %s, id: %s results:"%(base.customer_id, base.command_line_args.object_id)) - print(rv.json()) - - if cmd == "child_of": - targets = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, base.command_line_args.object_id) - for me in targets: - meid = me['id'] - print("Profiles using profile: %s %s"%(meid, me['name'])) - - # Get all profiles and search - rv = get_profile(base.cloudSDK_url, base.bearer, base.customer_id, None) - #jobj = json.load(ssids) - for r in rv: - for p in r['items']: - #print("profile: %s %s, checking children..."%(p['id'], p['name'])) - if 'childProfileIds' in p: - for child in p['childProfileIds']: - #print("profile: %s %s, checking child: %s my-id: %s"%(p['id'], p['name'], child, meid)) - if child == meid: - print("Used-By: %s %s"%(p['id'], p['name'])) - - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read customer profiles") - -if qtype == 'all' or qtype == 'customer': - try: - rv = base.cloud.get_customer(base.cloudSDK_url, base.bearer, base.customer_id) - print("Customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - print(json.dumps(rv, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %i"%(customer_id)) - -if qtype == 'all' or qtype == 'ping': - try: - rv = base.cloud.ping(base.cloudSDK_url, base.bearer) - print("Cloud Ping %s:"%(base.cloudSDK_url)) - #jobj = json.load(ssids) - print(json.dumps(rv, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Cloud Ping %i"%(base.cloudSDK_url)) - -if qtype == 'all' or qtype == 'firmware': - try: - rv = base.cloud.CloudSDK_images(base.command_line_args.model, base.cloudSDK_url, base.bearer) - print("Firmware for model:", base.command_line_args.model) - #jobj = json.load(ssids) - print(json.dumps(rv, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Firmware") - -if qtype == 'all' or qtype == 'location': - # Get location info - try: - # NOTE: Could also use base.customer_id to get single one that user may have specified. - rv = base.cloud.get_customer_locations(base.cloudSDK_url, base.bearer, base.customer_id) - print("Locations for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - print(json.dumps(rv, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s locations"%(base.customer_id)) - -if qtype == 'all' or qtype == 'equipment': - # Get equipment info - try: - if cmd == "get": - rv = base.cloud.get_customer_equipment(base.customer_id) - print("Equipment for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - if brief: - for eq in e['items']: - print("Equipment id: %s inventoryId: %s profileId: %s type: %s"%(eq['id'], eq['inventoryId'], eq['profileId'], eq['equipmentType'])) - else: - print(json.dumps(e, indent=4, sort_keys=True)) - if cmd == "delete": - delid = base.command_line_args.object_id; - rv = base.cloud.delete_equipment(base.cloudSDK_url, base.bearer, base.command_line_args.object_id) - print("Delete Equipment, id: %s results:"%(base.command_line_args.object_id)) - print(rv.json()) - - - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s equipment"%(base.customer_id)) - -if qtype == 'all' or qtype == 'portalUser': - # Get portalUser info - try: - rv = base.cloud.get_customer_portal_users(base.cloudSDK_url, base.bearer, base.customer_id) - print("PortalUsers for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s portalUsers"%(base.customer_id)) - -if qtype == 'all' or qtype == 'status': - # Get status info - try: - rv = base.cloud.get_customer_status(base.cloudSDK_url, base.bearer, base.customer_id) - print("Status for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s status"%(base.customer_id)) - -if qtype == 'all' or qtype == 'client-sessions': - # Get client sessions info - try: - rv = base.cloud.get_customer_client_sessions(base.cloudSDK_url, base.bearer, base.customer_id) - print("Sessions for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s sessions"%(base.customer_id)) - -if qtype == 'all' or qtype == 'client-info': - # Get clients info - try: - rv = base.cloud.get_customer_clients(base.cloudSDK_url, base.bearer, base.customer_id) - print("Clients for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s clients"%(base.customer_id)) - -if qtype == 'all' or qtype == 'alarm': - # Get alarms info - try: - rv = base.cloud.get_customer_alarms(base.cloudSDK_url, base.bearer, base.customer_id) - print("Alarms for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s alarms"%(base.customer_id)) - -if qtype == 'all' or qtype == 'service-metric': - # Get service metrics - try: - fromTime = "0" - toTime = "%i"%(0xFFFFFFFFFFFF) # something past now, units are msec - rv = base.cloud.get_customer_service_metrics(base.cloudSDK_url, base.bearer, base.customer_id, fromTime, toTime) - print("Service Metrics for customer %s:"%(base.customer_id)) - for e in rv: - #jobj = json.load(ssids) - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s service metrics"%(base.customer_id)) - -if qtype == 'all' or qtype == 'event': - # Get system events - try: - fromTime = "0" - toTime = "%i"%(0xFFFFFFFFFFFF) # something past now, units are msec - rv = base.cloud.get_customer_system_events(base.cloudSDK_url, base.bearer, base.customer_id, fromTime, toTime) - #print("System Events for customer %s:"%(base.customer_id)) - #jobj = json.load(ssids) - for e in rv: - print(json.dumps(e, indent=4, sort_keys=True)) - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - print("Failed to read Customer %s system events"%(base.customer_id)) diff --git a/tools/sdk_set_profile.py b/tools/sdk_set_profile.py deleted file mode 100755 index dedc15452..000000000 --- a/tools/sdk_set_profile.py +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/python3 -u - -# Example to set profile on NOLA-12 testbed: -# ./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8823 --ap-jumphost-password pumpkin77 \ -# --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-12" --lanforge-ip-address localhost --lanforge-port-number 8822 \ -# --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --skip-radius - -# Example to set profile on NOLA-01 testbed -# ./sdk_set_profile.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \ -# --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed "NOLA-01" --lanforge-ip-address localhost \ -# --lanforge-port-number 8802 --default-ap-profile TipWlan-2-Radios --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build \ -# --skip-radius - -import sys - -sys.path.append(f'../tests') - -from UnitTestBase import * -from cloudsdk import CreateAPProfiles - -def main(): - parser = argparse.ArgumentParser(description="SDK Set Profile", add_help=False) - parser.add_argument("--default-ap-profile", type=str, - help="Default AP profile to use as basis for creating new ones, typically: TipWlan-2-Radios or TipWlan-3-Radios", - required=True) - parser.add_argument("--skip-radius", dest="skip_radius", action='store_true', - help="Should we skip the RADIUS configs or not", default=False) - parser.add_argument("--skip-wpa", dest="skip_wpa", action='store_true', - help="Should we skip the WPA ssid or not", default=False) - parser.add_argument("--skip-wpa2", dest="skip_wpa2", action='store_true', - help="Should we skip the WPA2 ssid or not", default=False) - parser.add_argument("--skip-profiles", dest="skip_profiles", action='store_true', - help="Should we skip creating new ssid profiles?", default=False) - - parser.add_argument("--psk-5g-wpa2", dest="psk_5g_wpa2", type=str, - help="Allow over-riding the 5g-wpa2 PSK value.") - parser.add_argument("--psk-5g-wpa", dest="psk_5g_wpa", type=str, - help="Allow over-riding the 5g-wpa PSK value.") - parser.add_argument("--psk-2g-wpa2", dest="psk_2g_wpa2", type=str, - help="Allow over-riding the 2g-wpa2 PSK value.") - parser.add_argument("--psk-2g-wpa", dest="psk_2g_wpa", type=str, - help="Allow over-riding the 2g-wpa PSK value.") - - parser.add_argument("--ssid-5g-wpa2", dest="ssid_5g_wpa2", type=str, - help="Allow over-riding the 5g-wpa2 SSID value.") - parser.add_argument("--ssid-5g-wpa", dest="ssid_5g_wpa", type=str, - help="Allow over-riding the 5g-wpa SSID value.") - parser.add_argument("--ssid-2g-wpa2", dest="ssid_2g_wpa2", type=str, - help="Allow over-riding the 2g-wpa2 SSID value.") - parser.add_argument("--ssid-2g-wpa", dest="ssid_2g_wpa", type=str, - help="Allow over-riding the 2g-wpa SSID value.") - - parser.add_argument("--mode", dest="mode", choices=['bridge', 'nat', 'vlan'], type=str, - help="Mode of AP Profile [bridge/nat/vlan]", required=True) - - parser.add_argument("--sleep-after-profile", dest="sleep", type=int, - help="Enter the sleep interval delay between each profile push", required=False, default=5000) - # Not implemented yet. - #parser.add_argument("--rf-mode", type=str, - # choices=["modeN", "modeAC", "modeGN", "modeX", "modeA", "modeB", "modeG", "modeAB"], - # help="Allow over-riding the 2g-wpa SSID value.") - - - reporting = Reporting(reports_root=os.getcwd() + "/reports/") - - base = UnitTestBase("skd-set-profile", parser) - - command_line_args = base.command_line_args - print(command_line_args.mode) - - # cmd line takes precedence over env-vars. - cloudSDK_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL') - local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR') - report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR') - report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE') - - ## TestRail Information - tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER') - tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD') - milestoneId = command_line_args.milestone # was os.getenv('MILESTONE') - projectId = command_line_args.testrail_project # was os.getenv('PROJECT_ID') - testRunPrefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX') - - ##Jfrog credentials - jfrog_user = command_line_args.jfrog_user_id # was os.getenv('JFROG_USER') - jfrog_pwd = command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD') - - ##EAP Credentials - identity = command_line_args.eap_id # was os.getenv('EAP_IDENTITY') - ttls_password = command_line_args.ttls_password # was os.getenv('EAP_PWD') - - ## AP Credentials - ap_username = command_line_args.ap_username # was os.getenv('AP_USER') - - ##LANForge Information - lanforge_ip = command_line_args.lanforge_ip_address - lanforge_port = command_line_args.lanforge_port_number - lanforge_prefix = command_line_args.lanforge_prefix - - build = command_line_args.build_id - - logger = base.logger - hdlr = base.hdlr - - if command_line_args.testbed == None: - print("ERROR: Must specify --testbed argument for this test.") - sys.exit(1) - - client: TestRail_Client = TestRail_Client(command_line_args) - - ###Get Cloud Bearer Token - cloud: CloudSDK = CloudSDK(command_line_args) - bearer = cloud.get_bearer(cloudSDK_url, cloud_type) - - cloud.assert_bad_response = True - - model_id = command_line_args.model - equipment_id = command_line_args.equipment_id - - print("equipment-id: %s" % (equipment_id)) - - if equipment_id == "-1": - eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id') - print("EQ Id: %s" % (eq_id)) - - # Now, query equipment to find something that matches. - eq = cloud.get_customer_equipment(customer_id) - for item in eq: - for e in item['items']: - print(e['id'], " ", e['inventoryId']) - if e['inventoryId'].endswith("_%s" % (eq_id)): - print("Found equipment ID: %s inventoryId: %s" % (e['id'], e['inventoryId'])) - equipment_id = str(e['id']) - - if equipment_id == "-1": - print("ERROR: Could not find equipment-id.") - sys.exit(1) - - ###Get Current AP Firmware and upgrade - try: - ap_cli_info = ssh_cli_active_fw(command_line_args) - ap_cli_fw = ap_cli_info['active_fw'] - except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ap_cli_info = "ERROR" - print("FAILED: Cannot Reach AP CLI."); - sys.exit(1) - - fw_model = ap_cli_fw.partition("-")[0] - - print('Current Active AP FW from CLI:', ap_cli_fw) - - # Create Report Folder for Today - today = str(date.today()) - try: - os.mkdir(report_path + today) - except OSError: - print("Creation of the directory %s failed" % report_path) - else: - print("Successfully created the directory %s " % report_path) - - logger.info('Report data can be found here: ' + report_path + today) - - # Get Bearer Token to make sure its valid (long tests can require re-auth) - bearer = cloud.get_bearer(cloudSDK_url, cloud_type) - radius_name = "%s-%s-%s" % (command_line_args.testbed, fw_model, "Radius") - - sleep = command_line_args.sleep - sleep = sleep/1000 - - args = command_line_args - - print("Profiles Created") - - ap_object = CreateAPProfiles(args, cloud=cloud, client=client, fw_model=fw_model, sleep=sleep) - - # Logic to create AP Profiles (Bridge Mode) - - ap_object.set_ssid_psk_data(ssid_2g_wpa=args.ssid_2g_wpa, - ssid_5g_wpa=args.ssid_5g_wpa, - psk_2g_wpa=args.psk_2g_wpa, - psk_5g_wpa=args.psk_5g_wpa, - ssid_2g_wpa2=args.ssid_2g_wpa2, - ssid_5g_wpa2=args.ssid_5g_wpa2, - psk_2g_wpa2=args.psk_2g_wpa2, - psk_5g_wpa2=args.psk_5g_wpa2) - - print(ap_object) - rid = client.get_run_id(test_run_name=args.testrail_run_prefix + fw_model + "_" + today + "_" + "ecw5410-2021-02-12-pending-e8bb466") - print("creating Profiles") - ssid_template = "TipWlan-Cloud-Wifi" - - if not args.skip_profiles: - if not args.skip_radius: - # Radius Profile needs to be set here - radius_name = "Test-Radius-" + str(time.time()).split(".")[0] - radius_template = "templates/radius_profile_template.json" - ap_object.create_radius_profile(radius_name=radius_name, radius_template=radius_template, rid=rid, key=fw_model) - - ap_object.create_ssid_profiles(ssid_template=ssid_template, skip_eap=args.skip_radius, skip_wpa=args.skip_wpa, - skip_wpa2=args.skip_wpa2, mode=args.mode) - - - print("Create AP with equipment-id: ", equipment_id) - time.sleep(sleep) - ap_object.create_ap_profile(eq_id=equipment_id, fw_model=fw_model, mode=args.mode) - ap_object.validate_changes(mode=args.mode) - time.sleep(5) - ap_object.cleanup_profile(equipment_id=equipment_id) - print("Profiles Created") - - -main() - diff --git a/tools/sdk_upgrade_fw.py b/tools/sdk_upgrade_fw.py deleted file mode 100755 index edaf9c10b..000000000 --- a/tools/sdk_upgrade_fw.py +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/python3 -u - -# Example to upgrade firmware on NOLA-12 testbed: -""" -./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \ - --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --force-upgrade true - - # Use specified firmware image, not just the latest. - ./sdk_upgrade_fw.py --testrail-user-id NONE --model wf188n --ap-jumphost-address localhost --ap-jumphost-port 8823 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-12\" \ - --sdk-base-url https://wlan-portal-svc-ben-testbed.cicd.lab.wlan.tip.build --ap-image wf188n-2021-02-01-pending-686c4df --verbose - -# Example to upgrade fw on NOLA-01 testbed -./sdk_upgrade_fw.py --testrail-user-id NONE --model ecw5410 --ap-jumphost-address localhost --ap-jumphost-port 8803 \ - --ap-jumphost-password pumpkin77 --ap-jumphost-tty /dev/ttyAP1 --testbed \"NOLA-01\" \ - --sdk-base-url https://wlan-portal-svc.cicd.lab.wlan.tip.build --verbose - -""" - -import sys - -sys.path.append(f'../tests') - -from UnitTestBase import * -from JfrogHelper import * -from cloudsdk import CreateAPProfiles - -parser = argparse.ArgumentParser(description="SDK Upgrade Firmware", add_help=False) -parser.add_argument("--ap-image", type=str, - help="Specify an AP image to install. Will use latest found on jfrog if this is not specified.", - default=None) -base = UnitTestBase("sdk-upgrade-fw", parser) - -command_line_args = base.command_line_args - - -# cmd line takes precedence over env-vars. -cloudSDK_url = command_line_args.sdk_base_url # was os.getenv('CLOUD_SDK_URL') -local_dir = command_line_args.local_dir # was os.getenv('SANITY_LOG_DIR') -report_path = command_line_args.report_path # was os.getenv('SANITY_REPORT_DIR') -report_template = command_line_args.report_template # was os.getenv('REPORT_TEMPLATE') - -## TestRail Information -tr_user = command_line_args.testrail_user_id # was os.getenv('TR_USER') -tr_pw = command_line_args.testrail_user_password # was os.getenv('TR_PWD') -milestoneId = command_line_args.milestone # was os.getenv('MILESTONE') -projectId = command_line_args.testrail_project # was os.getenv('PROJECT_ID') -testRunPrefix = command_line_args.testrail_run_prefix # os.getenv('TEST_RUN_PREFIX') - -##Jfrog credentials -jfrog_user = command_line_args.jfrog_user_id # was os.getenv('JFROG_USER') -jfrog_pwd = command_line_args.jfrog_user_password # was os.getenv('JFROG_PWD') - -##EAP Credentials -identity = command_line_args.eap_id # was os.getenv('EAP_IDENTITY') -ttls_password = command_line_args.ttls_password # was os.getenv('EAP_PWD') - -## AP Credentials -ap_username = command_line_args.ap_username # was os.getenv('AP_USER') - -##LANForge Information -lanforge_ip = command_line_args.lanforge_ip_address -lanforge_port = command_line_args.lanforge_port_number -lanforge_prefix = command_line_args.lanforge_prefix - -build = command_line_args.build_id - -logger = base.logger -hdlr = base.hdlr - -client: TestRail_Client = TestRail_Client(command_line_args) -rid = 0 # testrails run-id, not actually supported at the moment. - -###Get Cloud Bearer Token -cloud: CloudSDK = CloudSDK(command_line_args) -bearer = cloud.get_bearer(cloudSDK_url, cloud_type) - -cloud.assert_bad_response = True - -model_id = command_line_args.model -equipment_id = command_line_args.equipment_id - -print("equipment-id: %s"%(equipment_id)) - -if equipment_id == "-1": - eq_id = ap_ssh_ovsh_nodec(command_line_args, 'id') - print("EQ Id: %s"%(eq_id)) - - # Now, query equipment to find something that matches. - eq = cloud.get_customer_equipment(customer_id) - for item in eq: - for e in item['items']: - print(e['id'], " ", e['inventoryId']) - if e['inventoryId'].endswith("_%s"%(eq_id)): - print("Found equipment ID: %s inventoryId: %s"%(e['id'], e['inventoryId'])) - equipment_id = str(e['id']) - -if equipment_id == "-1": - print("ERROR: Could not find equipment-id.") - sys.exit(1) - -###Get Current AP Firmware and upgrade -try: - ap_cli_info = ssh_cli_active_fw(command_line_args) - ap_cli_fw = ap_cli_info['active_fw'] -except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ap_cli_info = "ERROR" - print("FAILED: Cannot Reach AP CLI."); - sys.exit(1) - -fw_model = ap_cli_fw.partition("-")[0] -print('Current Active AP FW from CLI:', ap_cli_fw) - -############################################################################ -#################### Create Report ######################################### -############################################################################ - -# Create Report Folder for Today -today = str(date.today()) -try: - os.mkdir(report_path + today) -except OSError: - print("Creation of the directory %s failed" % report_path) -else: - print("Successfully created the directory %s " % report_path) - -logger.info('Report data can be found here: ' + report_path + today) - -###Dictionaries -ap_image = command_line_args.ap_image - -############################################################################ -#################### Jfrog Firmware Check ################################## -############################################################################ - -apModel = model_id -cloudModel = cloud_sdk_models[apModel] -build = command_line_args.build_id # ie, pending - -if not ap_image: - # then get latest from jfrog - Build: GetBuild = GetBuild(jfrog_user, jfrog_pwd, build) - ap_image = Build.get_latest_image(apModel) - -##Get Bearer Token to make sure its valid (long tests can require re-auth) -bearer = cloud.get_bearer(cloudSDK_url, cloud_type) - -print("AP MODEL UNDER TEST IS", model_id) -try: - ap_cli_info = ssh_cli_active_fw(command_line_args) - ap_cli_fw = ap_cli_info['active_fw'] -except Exception as ex: - print(ex) - logging.error(logging.traceback.format_exc()) - ap_cli_info = "ERROR" - print("Cannot Reach AP CLI, will not test this variant"); - sys.exit(1) - -fw_model = ap_cli_fw.partition("-")[0] -print('Current Active AP FW from CLI:', ap_cli_fw) -###Find Latest FW for Current AP Model and Get FW ID - -##Compare Latest and Current AP FW and Upgrade -report_data = None -key = None # model name I think, if we are doing reporting? - -do_upgrade = cloud.should_upgrade_ap_fw(command_line_args.force_upgrade, command_line_args.skip_upgrade, - report_data, ap_image, fw_model, ap_cli_fw, logger, key) - -cloudModel = cloud_sdk_models[model_id] -pf = cloud.do_upgrade_ap_fw(command_line_args, report_data, test_cases, client, - ap_image, cloudModel, model_id, jfrog_user, jfrog_pwd, rid, - customer_id, equipment_id, logger) - -if pf: - sys.exit(0) - -sys.exit(1) - -