mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-10-29 18:12:34 +00:00
Merge pull request #31 from Telecominfraproject/pending-library-updates
staging-WIFI-1467
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -149,4 +149,6 @@ pytest/*
|
||||
!pytest/test_*.py
|
||||
!pytest/helpers
|
||||
!pytest/pytest.ini
|
||||
pytest/nightly*log
|
||||
pytest/nightly*log
|
||||
|
||||
test_everything.xml
|
||||
@@ -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 "";
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
breakP:
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
|
||||
if (cols.get(j).getText().equals(oldName) && i!=1) {
|
||||
cols.get(2).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
fail("Account not found");
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
Actions browser = new Actions(driver);
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(newName).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys("password").perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys("password").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 deleteAccount(String profile, int testId) throws Exception {
|
||||
try {
|
||||
WebElement tbl = driver.findElement(By.xpath("//table"));
|
||||
List<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
breakP:
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
|
||||
if (cols.get(j).getText().equals(profile) && i!=1) {
|
||||
cols.get(3).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
fail("Account not found");
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
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();
|
||||
} 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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Verifies whether profile exists
|
||||
public void findAccount(boolean expected, String profile, int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
WebElement tbl = driver.findElement(By.xpath("//table"));
|
||||
List<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
if (cols.get(j).getText().equals(profile) && i!=1) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expected != found && expected == true) {
|
||||
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("Account not found.");
|
||||
} else if (expected != found && expected == false){
|
||||
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("Account unexpectedly found in the list.");
|
||||
}
|
||||
} 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");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//C5116
|
||||
@Test
|
||||
public void addAccountPopupTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccountButton(5116);
|
||||
Thread.sleep(1000);
|
||||
obj.verifyAddAccountPopup(5116);
|
||||
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+"/5116", data);
|
||||
|
||||
}
|
||||
|
||||
//C5113
|
||||
@Test
|
||||
public void addAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","password","password", 5113);
|
||||
Thread.sleep(3000);
|
||||
obj.findAccount(true, "automationtest@gmail.com", 5113);
|
||||
Thread.sleep(1000);
|
||||
obj.deleteAccount("automationtest@gmail.com", 5113);
|
||||
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+"/5113", data);
|
||||
|
||||
}
|
||||
|
||||
//C5120
|
||||
@Test
|
||||
public void editAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","password","password", 5120);
|
||||
Thread.sleep(3000);
|
||||
obj.editAccount("automationtest@gmail.com", "automationtestEdit@gmail.com", 5120);
|
||||
Thread.sleep(1500);
|
||||
obj.findAccount(true, "automationtestEdit@gmail.com", 5120);
|
||||
obj.deleteAccount("automationtestEdit@gmail.com",5120);
|
||||
Thread.sleep(2000);
|
||||
obj.driver.navigate().refresh();
|
||||
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+"/5120", data);
|
||||
|
||||
}
|
||||
|
||||
//C5114
|
||||
@Test
|
||||
public void addAccountBlankDetailsTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("","password","password", 5114);
|
||||
Thread.sleep(1000);
|
||||
obj.blankEmailWarning(5114);
|
||||
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+"/5114", data);
|
||||
|
||||
}
|
||||
|
||||
//C5117
|
||||
@Test
|
||||
public void addAccountInvalidPasswordTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","password","password1",5117);
|
||||
Thread.sleep(1000);
|
||||
obj.invalidPasswordsWarning(5117);
|
||||
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+"/5117", data);
|
||||
|
||||
}
|
||||
|
||||
//C5118
|
||||
@Test
|
||||
public void addAccountInvalidEmailTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("abcd12234","password","password",5118);
|
||||
Thread.sleep(3000);
|
||||
obj.invalidEmailWarning(5118);
|
||||
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+"/5118", data);
|
||||
|
||||
}
|
||||
//C5121
|
||||
@Test
|
||||
public void deleteAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
AccountTest obj = new AccountTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen();
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","password","password",5121);
|
||||
Thread.sleep(3000);
|
||||
obj.deleteAccount("automationtest@gmail.com",5121);
|
||||
Thread.sleep(4000);
|
||||
obj.driver.navigate().refresh();
|
||||
Thread.sleep(3000);
|
||||
obj.findAccount(false, "automationtest@gmail.com",5121);
|
||||
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+"/5121", data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,387 +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.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.BeforeAll;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
|
||||
|
||||
public class DashboardTest {
|
||||
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 networkScreen() throws Exception {
|
||||
driver.findElement(By.linkText("Network")).click();
|
||||
}
|
||||
|
||||
public void clientDevicesScreen() {
|
||||
driver.findElement(By.linkText("Client Devices")).click();
|
||||
}
|
||||
|
||||
public void loadAllProfiles(int testId) throws Exception {
|
||||
try {
|
||||
while (driver.findElements(By.xpath("//span[contains(.,'Load More')]")).size() != 0) {
|
||||
driver.findElement(By.xpath("//span[contains(.,'Load More')]")).click();
|
||||
Thread.sleep(2500);
|
||||
}
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail("Number of AP's provisioned cannot be found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int verifyAPNumber(int testId) throws MalformedURLException, IOException, APIException {
|
||||
|
||||
try {
|
||||
String displayed = driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[1]/div[1]/div[2]/div[1]/div[2]")).getText();
|
||||
int displ;
|
||||
switch(displayed.length()) {
|
||||
case 3:
|
||||
displ = Integer.parseInt(displayed.substring(displayed.length()-1));
|
||||
return displ;
|
||||
case 4:
|
||||
displ = Integer.parseInt(displayed.substring(displayed.length()-2));
|
||||
return displ;
|
||||
}
|
||||
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail("Number of AP's provisioned cannot be found");
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public int verifyDevicesNumber(int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
String displayed = driver.findElement(By.xpath("//*[@id=\"root\"]/section/main/div/div/div[1]/div[2]/div[2]/div[1]/div[2]")).getText();
|
||||
int displ = Integer.parseInt(displayed.substring(displayed.length()-2));
|
||||
return displ;
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
|
||||
fail("Number of total devices associated cannot be found");
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
public void verifyGraphs(int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
|
||||
}catch (Exception E) {
|
||||
failure(testId);
|
||||
|
||||
fail("Number of total devices associated cannot be found");
|
||||
}
|
||||
List<WebElement> rows = driver.findElements(By.cssSelector("[class^='chart']"));
|
||||
List<WebElement> 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<WebElement> 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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
int count = 0;
|
||||
|
||||
|
||||
//row iteration
|
||||
for(int i=2; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> 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<WebElement> points = driver.findElements(By.cssSelector("[class^='highcharts-point']"));
|
||||
points.get(1).click();
|
||||
points.get(2).click();
|
||||
Thread.sleep(1000);
|
||||
List<WebElement> 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<WebElement> points = driver.findElements(By.cssSelector("[class^='highcharts-point']"));
|
||||
points.get(3).click();
|
||||
points.get(4).click();
|
||||
Thread.sleep(1000);
|
||||
List<WebElement> 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);
|
||||
// }
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
|
||||
//row iteration
|
||||
for(int i=2; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> 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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
|
||||
breakP:
|
||||
//row iteration
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size(); j++) {
|
||||
if (cols.get(j).getText().equals(profile)) {
|
||||
cols.get(j).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
failure(testId);
|
||||
fail("Network not found");
|
||||
}
|
||||
//Assert.assertEquals(false, found);
|
||||
}
|
||||
|
||||
public void verifyDevice(String profile, int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
if (driver.findElement(By.cssSelector(".index-module__DeviceDetailCard___2CFDA.ant-card-bordered > 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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
if (cols.get(j).getText().equals(profile)) {
|
||||
//System.out.prin
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expected != found && expected == true) {
|
||||
failure(testId);
|
||||
fail("Profile not found.");
|
||||
} else if (expected != found && expected == false){
|
||||
failure(testId);
|
||||
fail("Profile unexpectedly found in the list.");
|
||||
}
|
||||
//Assert.assertEquals(expected, found);
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//Verifies whether profile exists and clicks
|
||||
public void findProfile(String profile, int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
WebElement tbl = driver.findElement(By.xpath("//table"));
|
||||
List<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
breakP:
|
||||
//row iteration
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size(); j++) {
|
||||
if (cols.get(j).getText().equals(profile)) {
|
||||
cols.get(j).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
failure(testId);
|
||||
fail("Profile not found.");
|
||||
}
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
public void verifyProfile(String profile, int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
if (driver.findElement(By.cssSelector(".ant-form > .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);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
breakP:
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
|
||||
if (cols.get(j).getText().equals(oldName) && i!=1) {
|
||||
cols.get(2).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
failure(testId);
|
||||
fail("Account not found");
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
Actions browser = new Actions(driver);
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(newName).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys("Password1").perform();
|
||||
browser.sendKeys(Keys.TAB).perform();
|
||||
browser.sendKeys("Password1").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 deleteAccount(String profile, int testId) throws Exception {
|
||||
try {
|
||||
WebElement tbl = driver.findElement(By.xpath("//table"));
|
||||
List<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
breakP:
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
|
||||
if (cols.get(j).getText().equals(profile) && i!=1) {
|
||||
cols.get(3).click();
|
||||
found = true;
|
||||
break breakP;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
failure(testId);
|
||||
fail("Account not found");
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
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();
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail("Fail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Verifies whether profile exists
|
||||
public void findAccount(boolean expected, String profile, int testId) throws MalformedURLException, IOException, APIException {
|
||||
try {
|
||||
WebElement tbl = driver.findElement(By.xpath("//table"));
|
||||
List<WebElement> rows = tbl.findElements(By.tagName("tr"));
|
||||
boolean found = false;
|
||||
//row iteration
|
||||
for(int i=0; i<rows.size(); i++) {
|
||||
//check column each in row, identification with 'td' tag
|
||||
List<WebElement> cols = rows.get(i).findElements(By.tagName("td"));
|
||||
|
||||
//column iteration
|
||||
for(int j=0; j<cols.size()-1; j++) {
|
||||
if (cols.get(j).getText().equals(profile) && i!=1) {
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (expected != found && expected == true) {
|
||||
failure(testId);
|
||||
fail("Account not found.");
|
||||
} else if (expected != found && expected == false){
|
||||
failure(testId);
|
||||
fail("Account unexpectedly found in the list.");
|
||||
}
|
||||
} catch (Exception E) {
|
||||
failure(testId);
|
||||
fail("Fail");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//C5116
|
||||
@Test
|
||||
public void addAccountPopupTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5116);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccountButton(5116);
|
||||
Thread.sleep(1000);
|
||||
obj.verifyAddAccountPopup(5116);
|
||||
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+"/5116", data);
|
||||
|
||||
}
|
||||
|
||||
//C5113
|
||||
@Test
|
||||
public void addAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5113);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","Password1","Password1", 5113);
|
||||
Thread.sleep(3000);
|
||||
obj.findAccount(true, "automationtest@gmail.com", 5113);
|
||||
Thread.sleep(1000);
|
||||
obj.deleteAccount("automationtest@gmail.com", 5113);
|
||||
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+"/5113", data);
|
||||
|
||||
}
|
||||
|
||||
//C5120
|
||||
@Test
|
||||
public void editAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5120);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","Password1","Password1", 5120);
|
||||
Thread.sleep(3000);
|
||||
obj.editAccount("automationtest@gmail.com", "automationtestEdit@gmail.com", 5120);
|
||||
Thread.sleep(1500);
|
||||
obj.findAccount(true, "automationtestEdit@gmail.com", 5120);
|
||||
obj.deleteAccount("automationtestEdit@gmail.com",5120);
|
||||
Thread.sleep(2000);
|
||||
obj.driver.navigate().refresh();
|
||||
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+"/5120", data);
|
||||
|
||||
}
|
||||
|
||||
//C5114
|
||||
@Test
|
||||
public void addAccountBlankDetailsTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5114);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("","Password1","Password1", 5114);
|
||||
Thread.sleep(1000);
|
||||
obj.blankEmailWarning(5114);
|
||||
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+"/5114", data);
|
||||
|
||||
}
|
||||
|
||||
//C5117
|
||||
@Test
|
||||
public void addAccountInvalidPasswordTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5117);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","Password1","password1",5117);
|
||||
Thread.sleep(1000);
|
||||
obj.invalidPasswordsWarning(5117);
|
||||
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+"/5117", data);
|
||||
|
||||
}
|
||||
|
||||
//C5118
|
||||
@Test
|
||||
public void addAccountInvalidEmailTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5118);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("abcd12234","Password1","Password1",5118);
|
||||
Thread.sleep(3000);
|
||||
obj.invalidEmailWarning(5118);
|
||||
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+"/5118", data);
|
||||
|
||||
}
|
||||
//C5121
|
||||
@Test
|
||||
public void deleteAccountTest() throws Exception {
|
||||
Map data = new HashMap();
|
||||
UsersTest obj = new UsersTest();
|
||||
obj.launchBrowser();
|
||||
obj.logIn();
|
||||
Thread.sleep(3000);
|
||||
obj.accountsScreen(5121);
|
||||
Thread.sleep(2000);
|
||||
obj.addAccount("automationtest@gmail.com","Password1","Password1",5121);
|
||||
Thread.sleep(3000);
|
||||
obj.deleteAccount("automationtest@gmail.com",5121);
|
||||
Thread.sleep(4000);
|
||||
obj.driver.navigate().refresh();
|
||||
Thread.sleep(3000);
|
||||
obj.findAccount(false, "automationtest@gmail.com",5121);
|
||||
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+"/5121", data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package automationTests;
|
||||
|
||||
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.internal.TextListener;
|
||||
import org.junit.runner.JUnitCore;
|
||||
import org.junit.runner.Result;
|
||||
|
||||
public class TestSuite {
|
||||
static APIClient client;
|
||||
public static void main(String args[]) throws Exception {
|
||||
|
||||
client = new APIClient("https://telecominfraproject.testrail.com");
|
||||
client.setUser("syama.devi@connectus.ai");
|
||||
client.setPassword("Connect123$");
|
||||
|
||||
JUnitCore junit = new JUnitCore();
|
||||
junit.addListener(new TextListener(System.out));
|
||||
Result result = junit.run(SystemTests.class);
|
||||
Result result1 = junit.run(ProfilesTest.class);
|
||||
Result result2 = junit.run(NetworkTest.class);
|
||||
Result result3 = junit.run(LoginTest.class);
|
||||
Result result4 = junit.run(UsersTest.class);
|
||||
Result result5 = junit.run(DashboardTest.class);
|
||||
if (result3.getFailureCount() > 0) {
|
||||
System.out.println("Tests failed.");
|
||||
System.exit(1);
|
||||
} else {
|
||||
System.out.println("Tests finished successfully.");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
138
NOLA-README.md
138
NOLA-README.md
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
109
cicd/README.txt
109
cicd/README.txt
@@ -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/
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
493
cicd/jfrog.pl
493
cicd/jfrog.pl
@@ -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 href=\"(.*.tar.gz)\">(.*)<\/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;
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
134
libs/apnos/apnos.py
Normal file
134
libs/apnos/apnos.py
Normal file
@@ -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
|
||||
|
||||
@@ -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/
|
||||
0
libs/cloudsdk/__init__.py
Normal file
0
libs/cloudsdk/__init__.py
Normal file
2246
libs/cloudsdk/cloudsdk.py
Executable file → Normal file
2246
libs/cloudsdk/cloudsdk.py
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
23
libs/cloudsdk/testbed_info.py
Normal file
23
libs/cloudsdk/testbed_info.py
Normal file
@@ -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')
|
||||
}
|
||||
1367
libs/lab_ap_info.py
1367
libs/lab_ap_info.py
File diff suppressed because it is too large
Load Diff
7
libs/testrails/reporting.py
Normal file
7
libs/testrails/reporting.py
Normal file
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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'
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<!-- Snippet of HTML that will be added to the index.html to describe/document this testbed -->
|
||||
<P>
|
||||
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.
|
||||
<P>
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
DUT is an Edge-Core 5410, running TIP OpenWrt.
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
DUT is an Edge-Core 5410, running TIP OpenWrt.
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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 "<b>Top wlan-testing git commits.</b><br><pre>" > ./tmp_gitlog.html
|
||||
git log -n 8 --oneline >> ./tmp_gitlog.html
|
||||
echo "</pre>" >> ./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 "<b>Top wlan-ap git commits.</b><br><pre>" > $DUTGITLOG
|
||||
(cd ../../../wlan-ap && git log -n 8 --oneline $DUT_SW_VER >> $DUTGITLOG && cd -)
|
||||
echo "</pre>" >> $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"
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user