Merge branch 'master' into feature-wifi-2548

This commit is contained in:
Shivam Thakur
2021-06-29 15:43:42 +05:30
committed by GitHub
46 changed files with 8523 additions and 1312 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -19,6 +19,16 @@ env:
on:
workflow_dispatch:
inputs:
additional_markers:
default: ''
description: 'Pass additional markers that will be and-combined with the interop marker, e.g. "twog or fiveg" -> "interop and twog or fiveg"'
required: false
push:
branches:
- master
schedule:
- cron: '15 0 * * *'
defaults:
run:
@@ -57,6 +67,8 @@ jobs:
test:
runs-on: ubuntu-latest
needs: [ build ]
outputs:
additional_markers: ${{ steps.marker.outputs.additional }}
steps:
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
@@ -70,12 +82,24 @@ jobs:
id: job
run: echo "::set-output name=name::interop-ci-${{ github.run_number }}"
# - name: create configuration.py secret
# run: |
# cat << EOF > configuration.py
# ${{ secrets.LAB_CONFIGURATION }}
# EOF
# kubectl create secret generic configuration --from-file=configuration=./configuration.py
- name: create configuration.py secret
run: |
cat << EOF > configuration.py
${{ secrets.LAB_CONFIGURATION }}
EOF
kubectl create secret generic configuration --from-file=configuration=./configuration.py
- name: calculate marker expression
id: marker
run: |
MARKER_EXPRESSION="interop"
ADDITIONAL_MARKERS="${{ github.event.inputs.additional_markers || '' }}"
if [ ! -z "$ADDITIONAL_MARKERS" ]; then
MARKER_EXPRESSION="$MARKER_EXPRESSION and ${ADDITIONAL_MARKERS}"
fi
echo "::set-output name=additional::${ADDITIONAL_MARKERS}"
echo "::set-output name=expression::${MARKER_EXPRESSION}"
- name: run interop tests
run: |
@@ -96,7 +120,7 @@ jobs:
- -c
- |
cd tests
pytest -m "interop_and and interop_iOS" -s -vvv --testbed=interop -o 'jobName=Github-Interop' -o 'jobNumber=${{ github.run_number }}' --skip-testrail --alluredir=/tmp/allure-results
pytest -m "${{ steps.marker.outputs.expression }}" -s -vvv --testbed=interop -o 'jobName=Github-Interop' -o 'jobNumber=${{ github.run_number }}' --skip-testrail --alluredir=/tmp/allure-results
ret=\$?
# sleep some time to be able to download the Allure results
sleep 60
@@ -115,8 +139,13 @@ jobs:
secretName: configuration
backoffLimit: 0
EOF
sleep 60 # wait for the pod to come up
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
until [ -s test_everything.xml ]
do
sleep 10
@@ -129,11 +158,13 @@ jobs:
echo "waiting for pod to exit"
kubectl logs -f $podname >/dev/null 2>&1
exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}")
- name: print logs
if: ${{ always() }}
run: |
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl logs $podname
- name: upload Allure results as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v2
@@ -141,19 +172,89 @@ jobs:
name: allure-results
path: allure-results
- name: generate Allure report
if: ${{ always() }}
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
- name: upload Allure report as artifact
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: allure-report
path: allure-report
- name: cleanup
if: ${{ always() }}
run: |
kubectl delete job "${{ steps.job.outputs.name }}" --wait=true --ignore-not-found=true
kubectl delete secret configuration --wait=true --ignore-not-found=true
report:
needs: [ test ]
if: always()
runs-on: ubuntu-latest
steps:
- name: install Allure CLI tool
run: |
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
- uses: actions/download-artifact@v2
with:
name: allure-results
path: allure-results
- name: checkout testing repo
uses: actions/checkout@v2
with:
path: wlan-testing
- name: get reports branch
uses: actions/checkout@v2
continue-on-error: true
with:
ref: gh-pages
path: reports
- name: copy history into results
run: |
if [ -e "reports/interop/interop/latest" ] ; then
cp -r reports/interop/interop/latest/history/ allure-results/history
fi
- name: add report metadata
run: |
cat << EOF >> allure-results/environment.properties
Testbed=interop
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
CiRun.Id=${{ github.run_id }}
CiRun.Number=${{ github.run_number }}
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
EOF
- name: generate Allure report
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
- name: upload Allure report as artifact
uses: actions/upload-artifact@v2
with:
name: allure-report
path: allure-report
- name: copy new report
run: |
mkdir -p reports/interop/interop
cp -Tr allure-report reports/interop/interop/${{ github.run_number }}
- name: update latest symlink
working-directory: reports/interop/interop
run: ln -fns ${{ github.run_number }} latest
- name: generate new index.html
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
- name: commit reports update
working-directory: reports
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Automated deployment: $(date -u)"
- name: push
if: github.ref == 'refs/heads/master' && needs.test.outputs.additional_markers == ''
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: reports

View File

@@ -1,4 +1,4 @@
name: nightly build
name: sanity testing
env:
# thirdparties
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
@@ -19,17 +19,14 @@ env:
on:
workflow_dispatch:
inputs:
testbed:
default: 'basic-02'
description: 'Testbed to test'
testbeds:
default: '["basic-01","basic-02"]'
description: 'Testbed(s) to test'
required: false
marker_expression:
default: 'sanity'
description: 'Pytest marker expression that will be used to select the tests to execute'
required: false
push:
branches:
- master
schedule:
- cron: '15 0 * * *'
@@ -117,9 +114,29 @@ jobs:
# kubectl get pods -n tip
# kubectl describe pods -n tip
generate-matrix:
name: generate testbed matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: generate-matrix
id: set-matrix
run: |
set -x
TESTBEDS="${{ github.event.inputs.testbeds || '[\"basic-01\",\"basic-02\"]' }}"
echo "$TESTBEDS"
TESTBED_ARRAY=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})')
echo "$TESTBED_ARRAY"
echo "::set-output name=matrix::{\"include\":${TESTBED_ARRAY}}"
test:
runs-on: ubuntu-latest
needs: [ build ]
needs: [ build, generate-matrix ]
strategy:
max-parallel: 1
fail-fast: false
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
steps:
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
@@ -131,7 +148,15 @@ jobs:
- name: set job name
id: job
run: echo "::set-output name=name::nightly-ci-${{ github.run_number }}"
run: echo "::set-output name=name::testing-${{ github.run_number }}"
- name: prepare namespace
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
kubectl create ns $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
echo "::set-output name=name::${NAMESPACE}"
- name: create configuration.py secret
run: |
@@ -160,7 +185,7 @@ jobs:
- -c
- |
cd tests
pytest -m "${{ github.event.inputs.marker_expression || 'sanity' }}" -s -vvv --testbed="${{ github.event.inputs.testbed || 'basic-02' }}" --skip-testrail --alluredir=/tmp/allure-results
pytest -m "${{ github.event.inputs.marker_expression || 'sanity' }}" -s -vvv --testbed="${{ matrix.testbed }}" --skip-testrail --alluredir=/tmp/allure-results
ret=\$?
# sleep some time to be able to download the Allure results
sleep 60
@@ -180,10 +205,15 @@ jobs:
backoffLimit: 0
EOF
sleep 60 # wait for the pod to come up
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]
do
sleep 10
@@ -210,19 +240,22 @@ jobs:
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
name: allure-results-${{ matrix.testbed }}
path: allure-results
- name: cleanup
if: always()
run: |
kubectl delete job "${{ steps.job.outputs.name }}" --wait=true --ignore-not-found=true
kubectl delete secret configuration --wait=true --ignore-not-found=true
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
report:
needs: [ test ]
if: always()
runs-on: ubuntu-latest
needs: [ test, generate-matrix ]
if: always()
strategy:
max-parallel: 1
fail-fast: false
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
steps:
- name: install Allure CLI tool
run: |
@@ -231,7 +264,7 @@ jobs:
- uses: actions/download-artifact@v2
with:
name: allure-results
name: allure-results-${{ matrix.testbed }}
path: allure-results
- name: checkout testing repo
@@ -248,14 +281,14 @@ jobs:
- name: copy history into results
run: |
if [ -e "reports/sanity/latest" ] ; then
cp -r reports/sanity/latest/history/ allure-results/history
if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then
cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history
fi
- name: add report metadata
run: |
cat << EOF >> allure-results/environment.properties
Testbed=${{ github.event.inputs.testbed || 'basic-02' }}
Testbed=${{ matrix.testbed }}
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
CiRun.Id=${{ github.run_id }}
CiRun.Number=${{ github.run_number }}
@@ -268,18 +301,18 @@ jobs:
- name: upload Allure report as artifact
uses: actions/upload-artifact@v2
with:
name: allure-report
name: allure-report-${{ matrix.testbed }}
path: allure-report
- name: copy new report
if: ${{ (github.event.inputs.marker_expression || 'sanity') == 'sanity' }}
run: |
mkdir -p reports/sanity
cp -Tr allure-report reports/sanity/${{ github.run_number }}
mkdir -p reports/sanity/${{ matrix.testbed }}
cp -Tr allure-report reports/sanity/${{ matrix.testbed }}/${{ github.run_number }}
- name: update latest symlink
if: ${{ (github.event.inputs.marker_expression || 'sanity') == 'sanity' }}
working-directory: reports/sanity
working-directory: reports/sanity/${{ matrix.testbed }}
run: ln -fns ${{ github.run_number }} latest
- name: generate new index.html
@@ -295,6 +328,7 @@ jobs:
git commit -m "Automated deployment: $(date -u)"
- name: push
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -61,9 +61,9 @@ https://docs.pytest.org/en/latest/example/markers.html
https://docs.pytest.org/en/latest/usage.html
http://pythontesting.net/framework/pytest/pytest-introduction/
### Build status
[![nightly build](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/nightly.yml/badge.svg)](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/nightly.yml)
### Test status
[![sanity testing](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/sanity.yml/badge.svg)](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/sanity.yml)
[![interop testing](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/interop.yml/badge.svg)](https://github.com/Telecominfraproject/wlan-testing/actions/workflows/interop.yml)
### Best Practice

Submodule lanforge/lanforge-scripts added at 7e1dc7dce7

View File

@@ -321,6 +321,43 @@ class APNOS:
logs = ""
return logs
def get_vifc(self):
client = self.ssh_cli_connect()
cmd = "vifC"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./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()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_vifs(self):
client = self.ssh_cli_connect()
cmd = "vifS"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./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()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_vlan(self):
stdout = self.get_vifs()
vlan_list = []
for i in stdout.splitlines():
vlan = str(i.strip()).replace("|",".").split(".")
try:
if not vlan[0].find("b'vlan_id"):
vlan_list.append(vlan[1].strip())
except:
pass
return vlan_list
if __name__ == '__main__':
obj = {
@@ -329,9 +366,11 @@ if __name__ == '__main__':
'username': "lanforge",
'password': "pumpkin77",
'port': 8803,
'jumphost_tty': '/dev/ttyAP2',
'jumphost_tty': '/dev/ttyAP2'
}
var = APNOS(credentials=obj)
r = var.get_ssid_info()
print(r)
print(var.get_ssid_info())
print(var.get_manager_state())
print(var.get_vlan())

View File

@@ -64,7 +64,7 @@ class RunTest:
# self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[],
station_name=[], mode="BRIDGE", vlan_id=1, band="twog"):
station_name=[], mode="BRIDGE", vlan_id=1, band="twog", cleanup=True):
"""SINGLE CLIENT CONNECTIVITY using test_connect2.py"""
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
self.staConnect.sta_mode = 0
@@ -108,7 +108,8 @@ class RunTest:
except Exception as e:
print(e)
self.staConnect.stop()
self.staConnect.cleanup()
if cleanup:
self.staConnect.cleanup()
run_results = self.staConnect.get_result_list()
for result in run_results:
print("test result: " + result)
@@ -243,11 +244,11 @@ class RunTest:
if band == "fiveg":
self.client_connect.radio = self.fiveg_radios[0]
self.client_connect.build()
self.client_connect.wait_for_ip(station_name)
print(self.client_connect.wait_for_ip(station_name))
if self.client_connect.wait_for_ip(station_name):
self.client_connect.wait_for_ip(station_name, timeout_sec=60)
if self.client_connect.wait_for_ip(station_name, timeout_sec=60):
self.client_connect._pass("ALL Stations got IP's", print_=True)
return self.client_connect
return True
else:
return False
@@ -263,14 +264,12 @@ class RunTest:
self.client_connect.upstream_port = self.upstream_port
elif mode == "NAT":
self.client_connect.upstream_port = self.upstream_port
else:
elif mode == "VLAN":
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
if raw_lines is None:
raw_lines = [['pkts: Custom;60;142;256;512;1024;MTU'],
['directions: DUT Transmit;DUT Receive'],
['traffic_types: UDP;TCP'], ["show_3s: 1"],
["show_ll_graphs: 1"], ["show_log: 1"]]
raw_lines = [['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types: UDP;TCP'],
["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]]
self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip,
lf_port=self.lanforge_port,
@@ -288,15 +287,15 @@ class RunTest:
duration=duration,
dut=dut_name,
station="1.1." + station_name[0],
raw_lines=raw_lines,
)
raw_lines=raw_lines)
self.dataplane_obj.setup()
self.dataplane_obj.run()
report_name = self.dataplane_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
influx = CSVtoInflux(influxdb=self.influxdb,
_influx_tag=self.influx_params["influx_tag"],
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv")
influx.post_to_influx()
return self.dataplane_obj

View File

@@ -2,11 +2,11 @@ from create_chamberview import CreateChamberview
from create_chamberview_dut import DUT
import time
from LANforge.lfcli_base import LFCliBase
import json
class ChamberView:
def __init__(self, lanforge_data=None, access_point_data=None, debug=False, testbed=None):
def __init__(self, lanforge_data=None, access_point_data=None, debug=True, testbed=None):
self.lanforge_ip = lanforge_data["ip"]
self.lanforge_port = lanforge_data["port"]
self.twog_radios = lanforge_data["2.4G-Radio"]
@@ -24,13 +24,16 @@ class ChamberView:
self.delete_old_scenario = True
# For chamber view
self.scenario_name = "TIP-" + self.testbed
self.debug = debug
self.exit_on_error = False
self.raw_line = [
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
[2] + ",AUTO -1 NA"],
["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet
+ "' NA " + self.uplink_port.split(".")[2] + " -1 NA"]
+ "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"]
]
# This is for rawline input | see create_chamberview_dut.py for more details
self.CreateChamberview = CreateChamberview(self.lanforge_ip, self.lanforge_port)
@@ -89,3 +92,16 @@ class ChamberView:
cli_base = LFCliBase(_lfjson_host=self.lanforge_ip, _lfjson_port=self.lanforge_port, )
json_response = cli_base.json_get(_req_url=_req_url)
return json_response
def json_post(self, req_url, shelf, resources, port, current, intrest):
data = {
"shelf": shelf,
"resource": resources,
"port": port,
"current_flags": current,
"interest": intrest
}
cli_base = LFCliBase(_lfjson_host=self.lanforge_ip, _lfjson_port=self.lanforge_port, )
return cli_base.json_post(req_url, data)

View File

@@ -35,6 +35,18 @@ def closeApp(appName, setup_perfectoMobile):
params = {'identifier': appName}
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
def scrollDown(setup_perfectoMobile):
print("Scroll Down")
setup_perfectoMobile[1].step_start("Scroll Down")
params2 = {}
params2["start"] = "50%,90%"
params2["end"] = "50%,20%"
params2["duration"] = "4"
time.sleep(5)
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
time.sleep(5)
def getDeviceID(setup_perfectoMobile):
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
@@ -406,7 +418,7 @@ def ForgetWifiConnection(request, setup_perfectoMobile, WifiName, connData):
report.step_start("Verify if wifi is disconnected from: " + WifiName)
WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
print("Wifi Not disconnected, check xpath for: " + WifiName)
except NoSuchElementException:
except NoSuchElementException and Exception:
print("Wifi Disconnected Successfully: " + WifiName)
else:
@@ -430,10 +442,11 @@ def ForgetWifiConnection(request, setup_perfectoMobile, WifiName, connData):
print("Verify if wifi is disconnected from: " + WifiName)
try:
report.step_start("Verify if wifi is disconnected from: " + WifiName)
WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
#WifiForget= driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")
print("Wifi Not disconnected, check xpath for: " + WifiName)
except NoSuchElementException:
WifiForget = WebDriverWait(driver, 20).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
except NoSuchElementException and TimeoutException and Exception:
assert True
print("Wifi Disconnected Successfully: " + WifiName)
@@ -615,7 +628,7 @@ def Toggle_WifiMode_android(request, setup_perfectoMobile, WifiName, connData):
WifiNameElement3 = WebDriverWait(driver, 35).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@resource-id='android:id/summary']")))
Wifi_AP_Name3 = WifiNameElement3.text
print("Current Wifi Status Name: " + Wifi_AP_Name3)
except NoSuchElementException:
except NoSuchElementException and TimeoutException:
Wifi_AP_Name3="Null"
print("Device did not connect back to Wifi: " + WifiName)
@@ -683,3 +696,200 @@ def verifyUploadDownloadSpeed_android(request, setup_perfectoMobile, get_APToMob
return currentResult
def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile, connData):
print("\n-------------------------------------")
print("Installing Android Profile ")
print("-------------------------------------")
OpenRoamingWifiName = ""
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
driver.switch_to.context('WEBVIEW_1')
print("Launching Safari with OpenRoaming Profile")
report.step_start("Open Roaming Download Page")
driver.get(profileDownloadURL)
try:
print("Accept Popup")
report.step_start("Accept Popup")
driver.switch_to.context('NATIVE_APP')
WebDriverWait(driver, 40).until(EC.alert_is_present(), 'Time out confirmation popup to appear')
alert = driver.switch_to.alert
alert.accept()
print("Alert Accepted")
except TimeoutException:
print("no alert")
#//*[@resource-id="android:id/button1"]
#Open Settings Application
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile, connData):
print("\n-----------------------------")
print("Delete Open Roaming Profile")
print("-----------------------------")
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
report.step_start("Switching Driver Context")
print("Switching Context to Native")
driver.switch_to.context('NATIVE_APP')
contexts = driver.contexts
#Open Settings Application
openApp(connData["appPackage-android"], setup_perfectoMobile)
deviceModelName = getDeviceModelName(setup_perfectoMobile)
if deviceModelName!=("Pixel 4"):
#Not a pixel Device
print ("Selected Device Model: " + deviceModelName)
report.step_start("Forget Profile: " + profileName)
# three dotss
#//*[@resource-id='com.android.settings:id/round_corner']
try:
print("Click Connections")
report.step_start("Click Connections")
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
connElement.click()
except NoSuchElementException:
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
try:
report.step_start("Clicking Wi-Fi")
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
wifiElement.click()
except NoSuchElementException:
print("Exception: Clicking Wi-Fi - Update/check Xpath for Click Wifi Connection ")
try:
print ("Click Advanced Menu 3 Dot")
report.step_start("Click Advanced Menu 3 Dot")
ThreeDotMenuBtn = driver.find_element_by_xpath("//*[@content-desc='More options']")
ThreeDotMenuBtn.click()
except NoSuchElementException:
print("Exception: Click Advanced Menu Not Loaded")
# Click Advanced
# //*[@text='Advanced']
try:
print ("Click Advanced")
report.step_start("Click Advanced")
AdvBtn = driver.find_element_by_xpath("//*[@text='Advanced']")
AdvBtn.click()
except NoSuchElementException:
print("Exception: Click Advanced")
#Scroll Down
scrollDown(setup_perfectoMobile)
#Click HotSpot
#//*[@text="Hotspot 2.0"]
try:
print ("Click HotSpot")
report.step_start("Click HotSpot")
HotSpotBtn = driver.find_element_by_xpath("//*[@text='Hotspot 2.0']")
HotSpotBtn.click()
except NoSuchElementException:
print("Exception: Click HotSpot")
#Click Ameriband
#//*[@text="Ameriband"]
try:
print ("Click Ameriband")
report.step_start("Click Ameriband")
AmeribandXpath = "//*[@text='Ameriband']"
AmeribandBtn = WebDriverWait(driver, 25).until(EC.presence_of_element_located((MobileBy.XPATH, AmeribandXpath)))
AmeribandBtn.click()
except NoSuchElementException and TimeoutException and Exception:
report.step_start("Exception: Profile Don't Exist")
print("Exception: Profile Don't Exist")
#Click Forget
#//*[@resource-id="com.android.settings:id/icon"]
try:
print ("Click Forget")
report.step_start("Click Forget")
ForgetBTN = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/icon']")
ForgetBTN.click()
except NoSuchElementException:
print("Exception: Click Forget")
#Click Forget Confirm
#//*[@resource-id="android:id/button1"]
try:
print ("Click Forget Confirm")
report.step_start("Click Forget Confirm")
ForgetConfirm = driver.find_element_by_xpath("//*[@resource-id='android:id/button1']")
ForgetConfirm.click()
except NoSuchElementException:
print("Exception: Click Forget Confirm")
else:
#Pixel Device
print ("Pixel Device Not supported: " + deviceModelName)
report.step_start("Pixel Device Not supported: ")
assert False
closeApp(connData["appPackage-android"], setup_perfectoMobile)
def verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile, connData):
print("\n-----------------------------")
print("Verify Connected Network ")
print("-----------------------------")
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
report.step_start("Switching Driver Context")
print("Switching Context to Native")
driver.switch_to.context('NATIVE_APP')
contexts = driver.contexts
#Open Settings Application
openApp(connData["appPackage-android"], setup_perfectoMobile)
deviceModelName = getDeviceModelName(setup_perfectoMobile)
if deviceModelName!=("Pixel 4"):
#Not a pixel Device
print ("Selected Device Model: " + deviceModelName)
report.step_start("Click Connections")
try:
print("Click Connections")
report.step_start("Click Connections")
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
connElement.click()
except NoSuchElementException:
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
print("Clicking Wi-Fi")
report.step_start("Clicking Wi-Fi")
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
wifiElement.click()
try:
print("Verify if Wifi is Connected to: " + profileNameSSID)
report.step_start("Verify if Wifi is Connected: " + profileNameSSID)
#WifiInternetErrMsg = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + profileNameSSID + "']")
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='Ameriband']")
print("Wifi Successfully Connected")
except NoSuchElementException:
print("Wifi Connection Error: " + profileNameSSID)
report.step_start("Wifi Connection Error: " + profileNameSSID)
assert False
else:
#Pixel Device
print ("Pixel Device Not supported: " + deviceModelName)
report.step_start("Pixel Device Not supported: ")
assert False
closeApp(connData["appPackage-android"], setup_perfectoMobile)

View File

@@ -31,14 +31,15 @@ def openApp(appName, setup_perfectoMobile):
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
def scrollDown(setup_perfectoMobile):
#print("Refreshing App: " + appName)
print("Scroll Down")
setup_perfectoMobile[1].step_start("Scroll Down")
params = {'start': "40%,90%"}
params = {'end': "40%,20%"}
params = {'duration': "2"}
#Open/Close/Open Action is performed to ensure the app is back to its Original Settings
setup_perfectoMobile[0].execute_script('mobile:application:swipe', params)
params2 = {}
params2["start"] = "50%,90%"
params2["end"] = "50%,20%"
params2["duration"] = "4"
time.sleep(5)
setup_perfectoMobile[0].execute_script('mobile:touch:swipe', params2)
time.sleep(5)
def closeApp(appName, setup_perfectoMobile):
#print("Closing App.." + appName)
@@ -52,7 +53,7 @@ def rebootPhone(setup_perfectoMobile):
params = {}
setup_perfectoMobile[0].execute_script('mobile:handset:reboot', params)
def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile, connData):
def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMobile, connData):
consoleOutput = ""
print("\n-------------------------------------")
@@ -67,12 +68,13 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
report.step_start("Switching Driver Context")
print("Switching Context to Native")
contexts = driver.contexts
#contexts = driver.contexts
#print(contexts)
driver.switch_to.context('NATIVE_APP')
#driver.switch_to.context(contexts[0])
driver.switch_to.context(contexts[0])
report.step_start("Set Wifi Network to " + WifiName)
print(WifiNameSSID)
report.step_start("Set Wifi Network to " + WifiNameSSID)
#Open Settings Application
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
@@ -87,7 +89,7 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
#print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
#print("Wifi Name Matches - Already Connected To: " + WifiName)
if Wifi_AP_Name.__eq__(WifiName):
if Wifi_AP_Name.__eq__(WifiNameSSID):
print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
#Verify if Ap is connected with Wifi
@@ -115,13 +117,13 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
else:
print("Selecting Wifi: " + WifiName)
print("Selecting Wifi: " + WifiNameSSID)
#consoleOutput+=str(WifiName)+ "\n"
report.step_start("Selecting Wifi...: " + WifiName)
report.step_start("Selecting Wifi...: " + WifiNameSSID)
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
element.click()
try:
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiNameSSID + "']")))
wifiXpath2.click()
except Exception as e:
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
@@ -147,7 +149,9 @@ def set_APconnMobileDevice_iOS(request, WifiName, WifiPass, setup_perfectoMobile
reportFlag = False
except NoSuchElementException:
reportFlag = True
print("No Wifi-AP Error Internet Error: " + WifiName)
print("No Wifi-AP Error Internet Error: " + WifiNameSSID)
#Need to add Wait for Selected Wifi Xpath
time.sleep(3)
return reportFlag
def Toggle_AirplaneMode_iOS(request, setup_perfectoMobile, connData):
@@ -220,32 +224,47 @@ def verify_APconnMobileDevice_iOS(request, WifiName, setup_perfectoMobile, connD
#Verifies if AP is connected to Wifi status
try:
# print("Verifying Connected Wifi Connection")
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
wifiXpath2.click()
print("Get Connected Wifi Name")
report.step_start("Get Connected Wifi Name")
element = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")))
#element = driver.find_element_by_xpath("")
element.click()
report.step_start("Verifying Connected Wifi Connection")
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
Wifi_AP_Name = element.text
print("Verifying if SSID Wifi Shows up")
report.step_start("Verifying if SSID Wifi Shows up")
wifiXpath2 = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
print("SSID is Present: " + WifiName)
report.step_start("SSID is Present: " + WifiName)
try:
print("Waiting for Auto Connection to: " + WifiName)
report.step_start("Waiting for Auto Connection to: " + WifiName)
selectedWifiNetwork = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork)))
except Exception as e:
#Toggle Wifi Mode
Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData)
time.sleep(15)
try:
print("Waiting for Auto Connection After Toggle: " + WifiName)
selectedWifiNetwork2 = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork2)))
except Exception as e:
print("SSID Not Connected Within allocated Time: " + WifiName)
report.step_start("SSID Not Connected: " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
reportFlag = False
assert reportFlag
except Exception as e:
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
print("SSID Not Connected Within allocated Time: " + WifiName)
report.step_start("SSID Not Connected: " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
#allure.attach(name="Raj", body="hello world")
assert False
reportFlag = False
assert reportFlag
try:
if Wifi_AP_Name.__eq__(WifiName):
print("Wifi Name Matched Successful ")
#print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'" + " Not Equal To: " + WifiName + "....Check AP Name Syntax")
return True
else:
print ("-- Wifi Don't Match Match -- ")
#print("Wifi_AP_ConnName: " + "'"+ Wifi_AP_Name + "'" + " Not Equal To: " + WifiName + "....Check AP Name Syntax")
return False
except NoSuchElementException:
print("Exception Checking Wifi/AP connection NAME...")
return None
return True
def ForgetWifiConnection(request, setup_perfectoMobile, wifiName, connData):
print("\n-----------------------------")
@@ -258,7 +277,7 @@ def ForgetWifiConnection(request, setup_perfectoMobile, wifiName, connData):
report.step_start("Switching Driver Context")
print("Switching Context to Native")
driver.switch_to.context('NATIVE_APP')
contexts = driver.contexts
#contexts = driver.contexts
#print(contexts)
report.step_start("Forget Existing Wifi")
@@ -323,17 +342,19 @@ def Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData):
report = setup_perfectoMobile[1]
driver = setup_perfectoMobile[0]
#Open Settings Application
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
report.step_start("Toggle Wifi Mode")
print("Toggle Wifi Mode..")
try:
print("Disable Wifi Radio Btn")
report.step_start("Disable Wifi Radio Btn")
WifiMode = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
#Toggle Wifi Mode
WifiMode.click()
time.sleep(5)
#Verify Radio Button Mode
try:
print("Enable Wifi Radio Btn")
report.step_start("Enable Wifi Radio Btn")
WifiDissconnected = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
#self.assertEqual(WifiDissconnected.text, "Airplane Mode", "Airplane Mode Not Triggerd")
print("Wifi Radio Button Toggled to Disable")
@@ -532,7 +553,7 @@ def verifyUploadDownloadSpeediOS(request, setup_perfectoMobile, get_APToMobileDe
return currentResult
def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMobileDevice_data):
def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile, get_APToMobileDevice_data):
print("\n-------------------------------------")
print("Download Open Roaming Profile")
print("-------------------------------------")
@@ -551,7 +572,7 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
print("Launching Safari with OpenRoaming Profile")
report.step_start("Open Roaming Download Page")
driver.get(connData["openRoaming-iOS-URL"])
driver.get(profileDownloadURL)
try:
print("Accept Popup")
@@ -620,22 +641,38 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
print("Switching Context to Webview")
driver.switch_to.context('WEBVIEW_1')
print("Launching Google to Reset Browser")
report.step_start("Launching Google to Reset Browser")
driver.get("https://www.google.com")
print("Switching Context to Native")
report.step_start("Switching Driver Context Native")
driver.switch_to.context('NATIVE_APP')
closeApp(connData["bundleId-iOS-Safari"], setup_perfectoMobile)
#Open Settings Application
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
#openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
# try:
# print("Verifying OpenRoaming Connected Wifi")
# time.sleep(3)
# report.step_start("Verifying Connected Wifi Name")
# element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
# OpenRoamingWifiName = element.text
# element.click()
# except Exception as e:
# OpenRoamingWifiName = "None"
# print("Wifi Not Connected to OpenRoaming Profile: ")
# request.config.cache.set(key="SelectingWifiFailed", value=str(e))
# assert False
try:
print("Verifying OpenRoaming Connected Wifi")
time.sleep(20)
report.step_start("Verifying Connected Wifi Name")
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
OpenRoamingWifiName = element.text
element.click()
except Exception as e:
OpenRoamingWifiName = "None"
print("Wifi Not Connected to OpenRoaming Profile: ")
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
assert False
#try:
# report.step_start("Verify Wifi Connected Status")
@@ -651,7 +688,7 @@ def downloadInstallOpenRoamingProfile(request, setup_perfectoMobile, get_APToMob
#return OpenRoamingWifiName
def ForgetAllWifiConnection(request, setup_perfectoMobile, connData):
def ForgetProfileWifiConnection(request, setup_perfectoMobile, installedProfileSSID, connData):
print("\n-----------------------------")
print("Forget All Wifi/AP Connection")
print("-----------------------------")
@@ -669,37 +706,55 @@ def ForgetAllWifiConnection(request, setup_perfectoMobile, connData):
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
try:
#Also have to check with Connected Status xpath
print("Verifying Connected Wifi Connection")
report.step_start("Verifying Existing Connected Wifi Connection")
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
Wifi_AP_Name = element.text
element.click()
element22 = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
element22.click()
#WifiXpath2= "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[2]"
WifiXpath2 = WebDriverWait(driver, 20).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[2]")))
elementMoreInfo = driver.find_element_by_xpath(WifiXpath2)
Wifi_AP_Name = elementMoreInfo.text
print ("Connected to: " + Wifi_AP_Name)
except NoSuchElementException:
except NoSuchElementException and TimeoutException:
Wifi_AP_Name = "None"
print("Wifi Not Connected to anything")
if Wifi_AP_Name.__eq__("Not Connected"):
print("Not Connected to any wifi")
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
elif Wifi_AP_Name.__eq__("None"):
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
print("Not Connected to any wifi Network/None")
elif Wifi_AP_Name.__eq__(installedProfileSSID):
deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
else:
report.step_start("Click on More Info on Wifi")
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
elementMoreInfo.click()
try:
#element22.click()
report.step_start("Click on More Info on Wifi")
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
elementMoreInfo.click()
print("Forget Wifi Network " + Wifi_AP_Name)
report.step_start("Forget Wifi Network")
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
elementforgetWifi.click()
print("Forget Wifi Network " + Wifi_AP_Name)
report.step_start("Forget Wifi Network")
WifiXpathForgetWifi = "//*[@label='Forget This Network']"
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
elementforgetWifi.click()
report.step_start("Confirm Forget Wifi Network")
WifiXpathForgetWifi = "//*[@label='Forget']"
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
elementforgetWifi.click()
report.step_start("Confirm Forget Wifi Network")
WifiXpathForgetWifi = "//*[@label='Forget']"
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
elementforgetWifi.click()
def deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile, connData):
except NoSuchElementException:
print("Exception General Menu Not found")
assert False
def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile, connData):
print("\n-----------------------------")
print("Delete Open Roaming Profile")
print("-----------------------------")
@@ -728,45 +783,66 @@ def deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile, connData):
scrollDown(setup_perfectoMobile)
try:
print("Select Profile ")
report.step_start("Select Profile")
element = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profile']")
element.click()
except NoSuchElementException:
print("Exception Select Profile Button")
assert False
print("Verify if any Profile Installed ")
try:
print("Select Profile ")
report.step_start("Select Profile")
elementProfile = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profile']")
elementProfile.click()
except NoSuchElementException:
#Verify Multi Profiles
print("Multiple Profiles Maybe Installed, Checking Profiles")
try:
elementProfiles = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profiles']")
elementProfiles.click()
print("Exception Select Profile Button")
except NoSuchElementException:
print("No Profile Installed")
try:
print("Click Configuration Profile ")
report.step_start("Click Configuration Profile ")
element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='AmeriBand']")
element.click()
except NoSuchElementException:
print("Exception Click Configuration Button")
assert False
try:
print("Click Configuration Profile ")
report.step_start("Click Configuration Profile ")
element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='" + profileName + "']")
element.click()
except NoSuchElementException:
print("Exception Click AmeriBand Profile Btn")
assert False
try:
print("Remove Profile")
report.step_start("Remove Profile ")
element = driver.find_element_by_xpath("//*[@label='Remove Profile']")
element.click()
except NoSuchElementException:
print("Exception Remove")
assert False
try:
print("Remove Profile")
report.step_start("Remove Profile ")
element = driver.find_element_by_xpath("//*[@label='Remove Profile']")
element.click()
except NoSuchElementException:
print("Exception Remove")
assert False
try:
print("Click Remove Button")
report.step_start("Click Remove Button")
element = driver.find_element_by_xpath("//*[@label='Remove']")
element.click()
except NoSuchElementException:
print("Exception Remove Button")
assert False
try:
print("Click Remove Button")
report.step_start("Click Remove Button")
element = driver.find_element_by_xpath("//*[@label='Remove']")
element.click()
except NoSuchElementException:
print("Exception Remove Button")
assert False
try:
print("Verify No Profile Installed Msg")
report.step_start("Verify No Profile Installed Msg")
element = driver.find_element_by_xpath("//*[@label='No profiles are currently installed.']")
except NoSuchElementException:
print("Exception Verify No Profile Installed Msg")
assert False
#try:
# print("Verify No Profile Installed Msg")
# report.step_start("Verify No Profile Installed Msg")
# wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No profiles are currently installed.']")))
# assert True
#except NoSuchElementException and TimeoutException and Exception:
# assert True
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
# try:
# print("Checking if " + profileName + " is removed")
# element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='" + profileName + "']")
# assert False
# except NoSuchElementException and Exception:
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
# assert True
except Exception:
print("Exception There may be No Profiles Installed")
report.step_start("Exception There may be No Profiles Installed")

0
tests/__init__.py Normal file
View File

View File

@@ -1,7 +1,14 @@
"""
1.X Testbed Access using ssh tunnel
ssh -C -L 8801:lab-ctlr:22 -L 8802:lf1:8080 -L 8803:lf1:22 -L 8804:lf2:8080 -L 8805:lf2:22 -L 3389:lf1:3389 -L 3390:lf2:3389 ubuntu@orch
2.X Testbed Access using ssh tunnel
"""
CONFIGURATION = {
"basic-01": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
@@ -16,17 +23,17 @@ CONFIGURATION = {
'ip': "localhost", # localhost
'username': "lanforge",
'password': "pumpkin77",
'port': 8803, # 22,
'port': 8801, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/dev/ecw5410-2021-06-16-pending-e8418c0.tar.gz"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost", # localhost,
"port": 8801, # 8802,
"ssh_port": 8802,
"port": 8802, # 8802,
"ssh_port": 8803,
"2.4G-Radio": ["wiphy0", "wiphy4"],
"5G-Radio": ["wiphy0", "wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
@@ -38,10 +45,10 @@ CONFIGURATION = {
"AX-Station-Name": "ax"
}
}
},
}, # 1.X wifi-5 basic-01
"basic-02": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': "1.1.0-SNAPSHOT",
@@ -56,7 +63,7 @@ CONFIGURATION = {
'ip': "localhost",
'username': "lanforge",
'password': "pumpkin77",
'port': 8803,
'port': 8801,
'jumphost_tty': '/dev/ttyAP2',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/dev/eap101-2021-06-15-pending-39bd8f3.tar.gz"
}
@@ -65,8 +72,8 @@ CONFIGURATION = {
"name": "lanforge",
"details": {
"ip": "localhost",
"port": 8801,
"ssh_port": 8802,
"port": 8804,
"ssh_port": 8805,
"2.4G-Radio": ["wiphy0", "wiphy4"],
"5G-Radio": ["wiphy0", "wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
@@ -78,118 +85,107 @@ CONFIGURATION = {
"AX-Station-Name": "ax"
}
}
}, # checked
# This is sample Config of a Testbed
"basic-ext-01": {
}, # 1.x wifi-6 basic-02
"ext-03-01": {
"controller": {
'url': "http://wlan-portal-svc-digicert.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com', # cloud controller Login
'password': 'support', # Cloud Controller Login Password
'version': '1.1.0-SNAPSHOT', # Controller version
'commit_date': "2021-04-27" # Controller version sdk, commit date
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'commit_date': "2021-06-01"
},
'access_point': [
{
'model': 'ecw5410', # AP Model, can be found in ap console using "node" command
'mode': 'wifi5', # wifi5/wifi6 can be found on AP Hardware page on Confluence
'serial': '903cb3944873', # "node" command has serial_number information
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb3944857',
'jumphost': True,
# True, if you have AP On serial console and not ssh access, False, if you have AP ssh access from the machine
'ip': "192.168.80.99",
# IP Address of System, which has AP Connected to serial cable (if jumphost is True), else - AP IP Address
'username': "lanforge", # ssh username of system (lab-ctlr/ap)
'password': "lanforge", # ssh password for system (lab-ctlr/ap)
'port': 22, # 22, # ssh port for system (lab-ctlr/ap)
'jumphost_tty': '/dev/ttyAP1', # if jumphost is True, enter the serial console device name
'ip': "192.168.200.80", # localhost
'username': "lanforge",
'password': "lanforge",
'port': 22, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
# Enter the Target AP Version URL for Testing
}
],
# Traffic generator
"traffic_generator": {
"name": "lanforge", # ( lanforge/ perfecto)
# Details for LANforge system
"name": "lanforge",
"details": {
"ip": "192.168.80.99", # localhost,
"ip": "192.168.200.80", # localhost,
"port": 8080, # 8802,
"2.4G-Radio": ["wiphy4"],
"ssh_port": 22,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
"2.4G-Station-Name": "wlan0",
"5G-Station-Name": "wlan0",
"AX-Station-Name": "ax"
"AX-Radio": [],
"upstream": "1.1.eth1",
"upstream_subnet": "192.168.200.1/24",
"uplink": "1.1.eth2",
"2.4G-Station-Name": "twog0",
"5G-Station-Name": "fiveg0",
"AX-Station-Name": "ax0"
}
}
},
"basic-lab": {
}, # Anjali 192.168.200.80
"ext-03-02": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-04.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com', # cloud controller Login
'password': 'support', # Cloud Controller Login Password
'version': '1.1.0-SNAPSHOT', # Controller version
'commit_date': "2021-04-27" # Controller version sdk, commit date
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'commit_date': "2021-06-01"
},
'access_point': [
{
'model': 'ecw5410', # AP Model, can be found in ap console using "node" command
'mode': 'wifi5', # wifi5/wifi6 can be found on AP Hardware page on Confluence
'serial': '903cb3944873', # "node" command has serial_number information
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb394486f',
'jumphost': True,
# True, if you have AP On serial console and not ssh access, False, if you have AP ssh access from the machine
'ip': "localhost",
# IP Address of System, which has AP Connected to serial cable (if jumphost is True), else - AP IP Address
'username': "lanforge", # ssh username of system (lab-ctlr/ap)
'password': "pumpkin77", # ssh password for system (lab-ctlr/ap)
'port': 8803, # 22, # ssh port for system (lab-ctlr/ap)
'jumphost_tty': '/dev/ttyAP1', # if jumphost is True, enter the serial console device name
'ip': "192.168.200.81", # localhost
'username': "lanforge",
'password': "lanforge",
'port': 22, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
# Enter the Target AP Version URL for Testing
}
],
# Traffic generator
"traffic_generator": {
"name": "lanforge", # ( lanforge/ perfecto)
# Details for LANforge system
"name": "lanforge",
"details": {
"ip": "localhost", # localhost,
"port": 8802, # 8802,
"2.4G-Radio": ["wiphy4"],
"ip": "192.168.200.81", # localhost,
"port": 8080, # 8802,
"ssh_port": 22,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
"2.4G-Station-Name": "wlan0",
"5G-Station-Name": "wlan0",
"AX-Station-Name": "ax"
"AX-Radio": [],
"upstream": "1.1.eth1",
"upstream_subnet": "192.168.200.1/24",
"uplink": "1.1.eth2",
"2.4G-Station-Name": "twog0",
"5G-Station-Name": "fiveg0",
"AX-Station-Name": "ax0"
}
}
},
"interop": {
"controller": {
'url': "https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build", # API base url for the controller
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.0.0-SNAPSHOT',
'commit_date': '2021-03-01'
'version': '1.1.0-SNAPSHOT',
'commit_date': '2021-06-01'
},
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '68215fd2f78c',
'serial': '3c2c99f44e53',
'jumphost': True,
'ip': "localhost",
'username': "lanforge",
'password': "pumpkin77",
'port': 8803,
'jumphost_tty': '/dev/ttyAP1',
'version': "ecw5410-2021-04-26-pending-3fc41fa"
'jumphost_tty': '/dev/ttyAP4',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0-rc3.tar.gz"
}
],
"traffic_generator": {
@@ -198,17 +194,138 @@ CONFIGURATION = {
"securityToken": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw",
"perfectoURL": "tip"
}
}, # Nikita 192.168.200.81
"ext-03-03": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'commit_date': "2021-06-01"
},
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb3944817',
'jumphost': True,
'ip': "192.168.200.82", # localhost
'username': "lanforge",
'password': "lanforge",
'port': 22, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "192.168.200.82", # localhost,
"port": 8080, # 8802,
"ssh_port": 22,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy5"],
"AX-Radio": [],
"upstream": "1.1.eth1",
"upstream_subnet": "192.168.200.1/24",
"uplink": "1.1.eth2",
"2.4G-Station-Name": "twog0",
"5G-Station-Name": "fiveg0",
"AX-Station-Name": "ax0"
}
}
}, # Mahesh 192.168.200.82
"ext-03-04": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'commit_date': "2021-06-01"
},
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb3944873',
'jumphost': True,
'ip': "192.168.200.52", # localhost
'username': "lanforge",
'password': "lanforge",
'port': 22, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "192.168.52.100", # localhost,
"port": 8080, # 8802,
"ssh_port": 22,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy5"],
"AX-Radio": [],
"upstream": "1.1.eth1",
"upstream_subnet": "192.168.52.1/24",
"uplink": "1.1.eth2",
"2.4G-Station-Name": "twog0",
"5G-Station-Name": "fiveg0",
"AX-Station-Name": "ax0"
}
}
}, # Shivam 192.168.52.100
"ext-03-05": {
"controller": {
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'commit_date': "2021-06-01"
},
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '903cb3944857',
'jumphost': True,
'ip': "192.168.200.80", # localhost
'username': "lanforge",
'password': "lanforge",
'port': 22, # 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "192.168.200.80", # localhost,
"port": 8080, # 8802,
"ssh_port": 22,
"2.4G-Radio": ["wiphy0"],
"5G-Radio": ["wiphy5"],
"AX-Radio": [],
"upstream": "1.1.eth1",
"upstream_subnet": "192.168.200.1/24",
"uplink": "1.1.eth2",
"2.4G-Station-Name": "twog0",
"5G-Station-Name": "fiveg0",
"AX-Station-Name": "ax0"
}
}
}, # Sushant 192.168.51.___
}
}
RADIUS_SERVER_DATA = {
"ip": "10.10.10.72",
"ip": "192.168.200.75",
"port": 1812,
"secret": "testing123",
"user": "user",
"password": "password",
"user": "nolaradius",
"password": "nolastart",
"pk_password": "whatever"
}

View File

@@ -546,20 +546,23 @@ def create_vlan(request, testbed, get_configuration):
upstream_resources = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
for vlan in vlan_list:
chamberview_obj.raw_line.append(["profile_link " + upstream_resources + " vlan-100 1 NA "
chamberview_obj.raw_line.append(["profile_link " + upstream_resources + " Vlan 1 NA "
+ "NA " + upstream_port.split(".")[2] + ",AUTO -1 " + str(vlan)])
chamberview_obj.Chamber_View()
port_resource = upstream_resources.split(".")
try:
ip = (chamberview_obj.json_get("/port/" + port_resource[0] + "/" + port_resource[1] +
"/" + upstream_port.split(".")[2] + "." + str(vlan))["interface"]["ip"])
if ip:
yield vlan_list
except Exception as e:
print(e)
yield False
yield vlan_list
else:
yield False
# try:
# ip = chamberview_obj.json_get("/port/" + port_resource[0] + "/" + port_resource[1] +
# "/" + upstream_port.split(".")[2] + "." + str(vlan))["interface"]["ip"]
# if ip:
# yield vlan_list, ip
# except Exception as e:
# print(e)
# yield False
@pytest.fixture(scope="session")

View File

@@ -659,3 +659,12 @@ def get_vif_state(get_apnos, get_configuration):
vif_config.sort()
allure.attach(name="vif_state", body=str(vif_state))
yield vif_state
@pytest.fixture(scope="class")
def get_vlan_list(get_apnos, get_configuration):
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
vlan_list = list(ap_ssh.get_vlan())
vlan_list.sort()
allure.attach(name="vlan_list", body=str(vlan_list))
yield vlan_list

View File

@@ -8,7 +8,7 @@ import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.bridge, pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.bridge] #, pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "BRIDGE",

View File

@@ -84,7 +84,3 @@ def test_ap_firmware(get_configuration, get_apnos, get_latest_firmware, update_r
msg='Cannot reach AP after upgrade to check CLI - re-test required')
assert active_fw_list == get_latest_firmware
@pytest.mark.shivam
def test_abc(setup_controller):
assert True

View File

@@ -0,0 +1,370 @@
"""
Create VLAN ,connect stations and flow traffic through it : vlan Mode
pytest -m TestVlanConfigRadioFiveg
"""
import time
import allure
import pytest
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"], "vlan": 100}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something", "vlan": 125}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something", "vlan": 200}],
"wpa_wpa2_personal_mixed": [
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something", "vlan": 150}],
},
"rf": {},
"radius": False
}
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.parametrize(
"create_vlan",
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.TestVlanConfigRadioFiveg
class TestVlanConfigFivegRadio(object):
@pytest.mark.wpa
@pytest.mark.fiveg
@pytest.mark.valid_client_ip_wpa_fiveg # wifi-2169
@allure.testcase(name="test_station_ip_wpa_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2169")
def test_station_ip_wpa_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa, fiveg
pytest -m valid_client_ip_wpa_fiveg
"""
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "VLAN"
band = "fiveg"
vlan = 125
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
print("upstream_port: ",upstream_port)
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_fiveg)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.valid_client_ip_wpa2_fiveg # wifi-2157
@allure.testcase(name="test_station_ip_wpa2_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2157")
def test_station_ip_wpa2_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, fiveg
pytest -m valid_client_ip_wpa2_fiveg
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.disable_vlan_fiveg # wifi-2174
@allure.testcase(name="test_disable_vlan_wpa2_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2174")
def test_disable_vlan_wpa2_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, fiveg
pytest -m disable_vlan_fiveg
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_alias = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["alias"]
req_url = "cli-json/set_port"
lf_tools.json_post(req_url, port_resources[0], port_resources[1], vlan_alias, 1, 8388608)
down = False
while not down:
down = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["down"]
time.sleep(1)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan)
if not passes:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
print("station did not get an IP. Test passed")
print("station ip: ", station_ip)
assert True
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass
@pytest.mark.open
@pytest.mark.fiveg
@pytest.mark.valid_client_ip_open_fiveg # wifi-2161
@allure.testcase(name="test_station_ip_open_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2161")
def test_station_ip_open_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, open, fiveg
pytest -m valid_client_ip_open_fiveg
"""
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "VLAN"
band = "fiveg"
vlan = 100
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print("vlan_list", vlan_list)
lf_test.Client_disconnect(station_names_fiveg)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@pytest.mark.test_station_ip_wpa_wpa2_ssid_5g # wifi-2167
@allure.testcase(name="test_station_ip_wpa_wpa2_personal_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2167")
def test_station_ip_wpa_wpa2_personal_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test,
lf_tools, get_vlan_list, update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa, wpa2, fiveg
pytest -m test_station_ip_wpa_wpa2_ssid_5g
"""
profile_data = setup_params_general["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "VLAN"
band = "fiveg"
vlan = 150
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_fiveg)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.valid_client_ip_wpa2_personal # wifi-2172
@allure.testcase(name="test_station_ip_wpa2_personal_ssid_5g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2172")
def test_station_ip_wpa2_personal_ssid_5g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_fiveg,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, fiveg
pytest -m valid_client_ip_wpa2_personal
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_fiveg)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_fiveg, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_fiveg[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_fiveg)
except:
pass

View File

@@ -0,0 +1,369 @@
"""
Create VLAN ,connect stations and flow traffic through it : vlan Mode
pytest -m TestVlanConfigRadioTwog
"""
import time
import allure
import pytest
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"], "vlan": 100},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something", "vlan": 125},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something", "vlan": 200},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
"wpa_wpa2_personal_mixed": [
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something",
"vlan": 150},
{"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
"security_key": "something"}],
},
"rf": {},
"radius": False
}
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.parametrize(
"create_vlan",
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.TestVlanConfigRadioTwog
class TestVlanConfigTwogRadio(object):
@pytest.mark.wpa
@pytest.mark.twog
@pytest.mark.valid_client_ip_twog_wpa
@allure.testcase(name="test_station_ip_wpa_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2168")
def test_station_ip_wpa_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa, twog
pytest -m valid_client_ip_twog_wpa
"""
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "VLAN"
band = "twog"
vlan = 125
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_twog)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.valid_client_ip_twog_wpa2 # wifi-2156
@allure.testcase(name="test_station_ip_wpa2_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2156")
def test_station_ip_wpa2_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, twog
pytest -m valid_client_ip_twog_wpa2
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.disable_vlan_twog # wifi-2158
@allure.testcase(name="test_disable_vlan_wpa2_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2158")
def test_disable_vlan_wpa2_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, twog
pytest -m disable_vlan_twog
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_alias = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["alias"]
req_url = "cli-json/set_port"
lf_tools.json_post(req_url, port_resources[0], port_resources[1], vlan_alias, 1, 8388608)
down = False
while not down:
down = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["down"]
time.sleep(1)
passes = lf_test.Client_Connect(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan)
if not passes:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
print("station did not get an IP. Test passed")
print("station ip: ", station_ip)
assert True
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass
@pytest.mark.open
@pytest.mark.twog
@pytest.mark.valid_client_ip_twog_open
@allure.testcase(name="test_station_ip_open_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2160")
def test_station_ip_open_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, open, twog
pytest -m valid_client_ip_twog_open
"""
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "VLAN"
band = "twog"
vlan = 100
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_twog)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@pytest.mark.test_station_ip_twog_wpa_wpa2
@allure.testcase(name="test_station_ip_wpa_wpa2_personal_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2166")
def test_station_ip_wpa_wpa2_personal_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test,
lf_tools, get_vlan_list, update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa, wpa2, twog
pytest -m test_station_ip_twog_wpa_wpa2
"""
profile_data = setup_params_general["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "VLAN"
band = "twog"
vlan = 150
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_twog)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security, extra_securities=extra_secu,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.valid_client_ip_twog_wpa2 # wifi-2172
@allure.testcase(name="test_station_ip_wpa2_personal_ssid_2g",
url="https://telecominfraproject.atlassian.net/browse/WIFI-2172")
def test_station_ip_wpa2_personal_ssid_2g(self, get_lanforge_data, setup_profiles, create_vlan, lf_test, lf_tools,
get_vlan_list, update_report, station_names_twog,
test_cases, get_configuration):
"""
Client connectivity using vlan, wpa2, twog
pytest -m valid_client_ip_twog_wpa2
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 200
lanforge_data = get_configuration["traffic_generator"]["details"]
upstream_port = lanforge_data["upstream"]
port_resources = upstream_port.split(".")
vlan_list = get_vlan_list
print(vlan_list)
lf_test.Client_disconnect(station_names_twog)
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
passkey=security_key, mode=mode, band=band,
station_name=station_names_twog, vlan_id=vlan, cleanup=False)
if result:
station_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
station_names_twog[0])["interface"]["ip"]
vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + "/" +
port_resources[2] + "." + str(vlan))["interface"]["ip"]
station_ip = station_ip.split(".")
vlan_ip = vlan_ip.split(".")
print(station_ip[:2], vlan_ip[:2])
for i, j in zip(station_ip[:2], vlan_ip[:2]):
if i != j:
assert False
vlan_list = [int(i) for i in vlan_list]
if int(vlan) in vlan_list:
print("station got IP as per VLAN. Test passed")
assert True
else:
assert False
else:
assert False
try:
lf_test.Client_disconnect(station_names_twog)
except:
pass

View File

@@ -13,6 +13,8 @@ from selenium.common.exceptions import NoSuchElementException
import sys
import allure
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_and, pytest.mark.android, pytest.mark.AccessPointConnection]
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.AccessPointConnectionAndroid
@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ToggleAirplaneMode]
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
setup_params_general = {
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ToggleAirplaneModeAndroid
@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -1,138 +0,0 @@
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
"rf": {},
"radius": False
}
@pytest.mark.OpenRoamingAndroid
#@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoaming(object):
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_OpenRoaming_5g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Install Profile
#Verify Upload download Speed from device Selection
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_OpenRoaming_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa
def test_OpenRoaming_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa
def test_OpenRoaming_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)

View File

@@ -0,0 +1,345 @@
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.openRoaming, pytest.mark.bridge]
from android_lib import closeApp, set_APconnMobileDevice_android, verify_APconnMobileDevice_Android, deleteOpenRoamingInstalledProfile, downloadInstallOpenRoamingProfile, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
"""
EAP Passpoint Test: BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
setup_params_eap = {
"mode": "BRIDGE",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("BRIDGE MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoamingBridgeMode(object):
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_2g_WPA2_EAP(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
#ForgetWifi
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
try:
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_5g_WPA2_EAP(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
try:
verify_APconnMobileDevice_Android(request, profileName, setup_perfectoMobile_android, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
#ForgetWifi
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
try:
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_android):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/androidconfig.cfg"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
#ForgetWifi
#ForgetWifiConnection(request, setup_perfectoMobile_android, profileNameSSID, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_android, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_android, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_android, downloadProfileSSID, connData)
try:
verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMobile_android, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_android, connData)

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.PassPointConnection]
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_WifiMode_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
setup_params_general = {
@@ -30,9 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.PassPointConnectionAndroid
@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_and, pytest.mark.android, pytest.mark.ToggleWifiMode]
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_WifiMode_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
setup_params_general = {
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ToggleWifiModeAndroid
@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ClientConnectivity]
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, setup_perfectoMobile_android
setup_params_general = {
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ClientConnectivityAndroid
@pytest.mark.interop_and
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -210,10 +210,8 @@ def get_APToMobileDevice_data(request):
"bundleId-iOS-Safari": request.config.getini("bundleId-iOS-Safari"),
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
"openRoaming-iOS-URL": request.config.getini("openRoaming-iOS-URL"),
#Android
"platformName-android": request.config.getini("platformName-android"),
"openRoaming-and-URL": request.config.getini("openRoaming-and-URL"),
"appPackage-android": request.config.getini("appPackage-android")
}
yield passPoint_data
@@ -757,3 +755,11 @@ def failure_tracking_fixture(request):
print(tests_failed_during_module)
yield tests_failed_during_module
@pytest.fixture(scope="class")
def get_vif_state(get_apnos, get_configuration):
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/")
vif_state = list(ap_ssh.get_vif_state_ssids())
vif_state.sort()
allure.attach(name="vif_state", body=str(vif_state))
yield vif_state

View File

@@ -19,6 +19,8 @@ if 'perfecto_libs' not in sys.path:
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.AccessPassPointConnectivety]
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
@@ -31,17 +33,15 @@ setup_params_general = {
"radius": False
}
@pytest.mark.AccessPassPointConnectivety
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
#@pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
#)
#@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestAccessPointConnectivety(object):
@pytest.mark.fiveg
@@ -68,7 +68,7 @@ class TestAccessPointConnectivety(object):
#Open Ping Application
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@@ -96,7 +96,7 @@ class TestAccessPointConnectivety(object):
#Open Ping Application
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@@ -124,7 +124,7 @@ class TestAccessPointConnectivety(object):
#Open Ping Application
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@@ -152,7 +152,7 @@ class TestAccessPointConnectivety(object):
#Open Ping Application
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
ping_deftapps_iOS(request, setup_perfectoMobile_iOS, wifi_ip)
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)

View File

@@ -19,6 +19,8 @@ if 'perfecto_libs' not in sys.path:
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, \
verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.ToggleAirplaneMode]
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
@@ -31,8 +33,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ToggleAirplaneMode
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -0,0 +1,391 @@
import os
import sys
sys.path.append(
os.path.dirname(
os.path.realpath(__file__)
)
)
if "libs" not in sys.path:
sys.path.append(f"../libs")
import time
import pytest
import allure
from collections import defaultdict
from lanforge.lf_tests import RunTest
from configuration import PASSPOINT_RADIUS_SERVER_DATA
from configuration import PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
from configuration import PASSPOINT_PROVIDER_INFO
from configuration import PASSPOINT_OPERATOR_INFO
from configuration import PASSPOINT_VENUE_INFO
from configuration import PASSPOINT_PROFILE_INFO
from controller.controller import ProfileUtility
@allure.feature("PASSPOINT CONNECTIVITY SETUP")
@pytest.fixture(scope="class")
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
instantiate_profile, get_markers, passpoint_provider_info, passpoint_operator_info,
passpoint_venue_info, passpoint_profile_info,
get_configuration, passpoint_radius_server_info, passpoint_radius_accounting_server_info, get_apnos):
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
vlan_id, mode = 0, 0
instantiate_profile.cleanup_objects()
parameter = dict(request.param)
test_cases = {}
profile_data = {}
if parameter["mode"] not in ["BRIDGE", "NAT", "VLAN"]:
print("Invalid Mode: ", parameter["mode"])
allure.attach(body=parameter["mode"], name="Invalid Mode: ")
yield test_cases
if parameter["mode"] == "NAT":
mode = "NAT"
vlan_id = 1
if parameter["mode"] == "BRIDGE":
mode = "BRIDGE"
vlan_id = 1
if parameter["mode"] == "VLAN":
mode = "BRIDGE"
vlan_id = setup_vlan
ap_profile = testbed + "-Equipment-AP-Passpoint"
instantiate_profile.delete_profile_by_name(profile_name=ap_profile)
profile_data["equipment_ap"] = {"profile_name": ap_profile}
profile_data["ssid"] = {}
# Only passpoint SSID need to be applied with passpoint profiles leaving ssid used for
# profile download - passpoint_profile_download
profile_data["allowed_ssids"] = []
for i in parameter["ssid_modes"]:
profile_data["ssid"][i] = []
for j in range(len(parameter["ssid_modes"][i])):
profile_name = testbed + "-SSID-" + i + "-" + str(j) + "-" + parameter["mode"]
data = parameter["ssid_modes"][i][j]
data["profile_name"] = profile_name
if "mode" not in dict(data).keys():
data["mode"] = mode
if "vlan" not in dict(data).keys():
data["vlan"] = vlan_id
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
profile_data["ssid"][i].append(data)
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
time.sleep(10)
# RF Profile Creation
rf_profile_data = {
"name": testbed + "-RF-Profile-" + parameter["mode"] + "-" + get_configuration["access_point"][0]["mode"]
}
try:
instantiate_profile.delete_profile_by_name(profile_name=rf_profile_data["name"])
rf_profile_data = instantiate_profile.set_rf_profile(profile_data=rf_profile_data,
mode=get_configuration["access_point"][0]["mode"])
allure.attach(body=str(rf_profile_data),
name="RF Profile Created : " + get_configuration["access_point"][0]["mode"])
except Exception as e:
print(e)
allure.attach(body=str(e), name="Exception ")
# Radius Profile Creation
passpoint_radius_server_info = passpoint_radius_server_info
passpoint_radius_server_info["name"] = testbed + "-Automation-Radius-Profile"
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile")
try:
instantiate_profile.create_radius_profile(radius_info=passpoint_radius_server_info,
radius_accounting_info=passpoint_radius_accounting_server_info)
test_cases["radius_profile"] = True
allure.attach(body=str(passpoint_radius_server_info), name="Radius Profile Created")
except Exception as e:
print(e)
test_cases["radius_profile"] = False
# SSID Profile Creation
for mode in profile_data["ssid"]:
if mode == "open":
for j in profile_data["ssid"][mode]:
try:
if "is2dot4GHz" in list(j["appliedRadios"]):
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
if mode == "wpa_eap":
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa_eap_passpoint_ssid_profile(profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["wpa_eap_5g"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
if mode == "wpa2_eap":
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa2_eap_passpoint_ssid_profile(profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
if mode == "wpa2_only_eap":
for j in profile_data["ssid"][mode]:
if mode in get_markers.keys() and get_markers[mode]:
try:
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
try:
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
j["appliedRadios"]):
creates_profile = instantiate_profile.create_wpa2_only_eap_passpoint_ssid_profile(
profile_data=j)
profile_data["allowed_ssids"].append(creates_profile._id)
test_cases[j["ssid_name"]] = {"sdk": True}
allure.attach(body=str(creates_profile), name="SSID Profile Created")
except Exception as e:
print(e)
test_cases[j["ssid_name"]] = {"sdk": False}
allure.attach(body=str(e), name="SSID Profile Creation Failed")
# Passpoint OSU ID provider profile creation
passpoint_provider_info = passpoint_provider_info
test_cases["passpoint_osu_id_provider"] = dict()
profile_name = testbed + "-Automation-Passpoint-OSU-ID-Provider-Profile"
passpoint_provider_info["profile_name"] = profile_name
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
try:
creates_profile = instantiate_profile.create_passpoint_osu_id_provider_profile(
profile_data=passpoint_provider_info)
allure.attach(body=str(creates_profile), name="Passpoint OSU ID provider Profile Created")
test_cases["passpoint_osu_id_provider"] = {"sdk": True}
except Exception as e:
print(e)
test_cases["passpoint_osu_id_provider"] = {"sdk": False}
allure.attach(body=str(e), name="Passpoint OSU ID provider Profile Creation Failed")
# Passpoint operator profile creation
test_cases["passpoint_operator_profile"] = dict()
passpoint_operator_info = passpoint_operator_info
profile_name = testbed + "-Automation-Passpoint-Operator-Profile"
passpoint_operator_info["profile_name"] = profile_name
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
try:
creates_profile = instantiate_profile.create_passpoint_operator_profile(profile_data=passpoint_operator_info)
allure.attach(body=str(creates_profile), name="Passpoint Operator Profile Created")
test_cases["passpoint_operator_profile"] = {"sdk": True}
profile_data["passpoint_operator"] = profile_name
except Exception as e:
print(e)
test_cases["passpoint_operator_profile"] = {"sdk": False}
allure.attach(body=str(e), name="Passpoint Operator Profile Creation Failed")
# Passpoint Venue profile creation
passpoint_venue_info = passpoint_venue_info
test_cases["passpoint_venue_profile"] = dict()
profile_name = testbed + "-Automation-Passpoint-Venue-Profile"
passpoint_venue_info["profile_name"] = profile_name
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
try:
creates_profile = instantiate_profile.create_passpoint_venue_profile(profile_data=passpoint_venue_info)
allure.attach(body=str(creates_profile), name="Passpoint Venue Profile Created")
test_cases["passpoint_venue_profile"] = {"sdk": True}
profile_data["passpoint_venue"] = profile_name
except Exception as e:
print(e)
test_cases["passpoint_venue"] = {"sdk": False}
allure.attach(body=str(e), name="Passpoint Venue Profile Creation Failed")
# Passpoint profile creation
passpoint_profile_info = passpoint_profile_info
profile_name = testbed + "-Automation-Passpoint-Profile"
passpoint_profile_info["profile_name"] = profile_name
passpoint_profile_info["allowed_ssids"] = profile_data["allowed_ssids"]
instantiate_profile.delete_profile_by_name(profile_name=profile_name)
try:
creates_profile = instantiate_profile.create_passpoint_profile(profile_data=passpoint_profile_info)
allure.attach(body=str(creates_profile), name="Passpoint Profile Created")
test_cases["passpoint"] = {"sdk": True}
profile_data["passpoint"] = profile_name
except Exception as e:
print(e)
test_cases["passpoint"] = {"sdk": False}
allure.attach(body=str(e), name="Passpoint Profile Creation Failed")
# Update SSID profile with passpoint config
passpoint_profile_info = passpoint_profile_info
ssid_to_apply = None
for ssid_profile in profile_data["ssid"].keys():
for ssid in profile_data["ssid"][ssid_profile]:
if ssid["ssid_name"] == "passpoint_profile_download":
ssid_to_apply = ssid["ssid_name"]
continue
if ssid["ssid_name"] in test_cases.keys():
allure.attach(body=str(ssid), name="Updating SSID profile")
passpoint_profile_info["ssid_profile_name"] = ssid["profile_name"]
instantiate_profile.update_ssid_profile(profile_info=passpoint_profile_info)
# Equipment AP Profile Creation
ap_profile_info = dict()
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
ap_profile_info["ssid_names"] = [ssid_to_apply]
try:
instantiate_profile.set_ap_profile_custom(profile_data=ap_profile_info)
test_cases["equipment_ap"] = {"sdk": True}
allure.attach(body=str(profile_data["equipment_ap"]), name="Equipment AP Profile Created")
except Exception as e:
print(e)
test_cases["equipment_ap"] = {"sdk": False}
allure.attach(body=str(e), name="Equipment AP Profile Creation Failed")
def teardown_session():
print("\nRemoving Profiles")
instantiate_profile.delete_profile_by_name(profile_name=profile_data['equipment_ap']['profile_name'])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["ssid"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["radius"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["rf"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_osu_id_provider"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_operator"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint_venue"])
instantiate_profile.delete_profile(instantiate_profile.profile_creation_ids["passpoint"])
allure.attach(body=str(profile_data['equipment_ap']['profile_name'] + "\n"),
name="Tear Down in Profiles ")
time.sleep(20)
request.addfinalizer(teardown_session)
yield test_cases, instantiate_profile, profile_data
@pytest.fixture(scope="function")
def push_ap_profile(request, setup_profiles, get_equipment_id, get_apnos, get_configuration):
parameter = dict(request.param)
test_cases, instantiate_profile, profile_data = setup_profiles
ssid_names = parameter["ssid_names"]
ap_profile_info = dict()
ap_profile_info["profile_name"] = profile_data["equipment_ap"]["profile_name"]
test_cases = {}
ap_profile_info["ssid_names"] = ssid_names
try:
instantiate_profile.update_ap_profile(profile_data=ap_profile_info)
test_cases["equipment_ap"] = {"sdk": True}
allure.attach(body=str(ap_profile_info["profile_name"]), name="Equipment AP Profile Updated")
except Exception as e:
print(e)
test_cases["equipment_ap"] = {"sdk": False}
allure.attach(body=str(e), name="Equipment AP Profile Update Failed")
print("Pushing profiles on AP :: ", ap_profile_info)
allure.attach(body=str(ap_profile_info), name="Pushing profiles on AP :: ")
# Push the Equipment AP Profile to AP
try:
for i in get_equipment_id:
instantiate_profile.push_profile_old_method(equipment_id=i)
except Exception as e:
print(e)
print("failed to push AP Profile")
# Check the VIF Config and VIF State of SSIDs
time_start = time.time()
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
while time.time() - time_start < 240:
if ((time.time() - time_start) / 10) == 15:
ap_ssh = get_apnos(get_configuration["access_point"][0], pwd="../libs/apnos/")
vif_config = list(ap_ssh.get_vif_config_ssids())
vif_config.sort()
vif_state = list(ap_ssh.get_vif_state_ssids())
vif_state.sort()
for ssid in ssid_names:
test_cases[ssid] = dict()
test_cases[ssid]["vif_config"] = True if ssid in vif_config else False
test_cases[ssid]["vif_state"] = True if ssid in vif_state else False
ssid_names.sort()
if vif_config == ssid_names == vif_state:
print("Waiting for Radios to apply config ")
time.sleep(200)
break
time.sleep(10)
allure.attach(body=str(vif_config), name="vifC status on AP :: ")
allure.attach(body=str(vif_state), name="vifS status on AP :: ")
yield test_cases
@pytest.fixture(scope="session")
def passpoint_radius_server_info():
allure.attach(body=str(PASSPOINT_RADIUS_SERVER_DATA), name="Passpoint RADIUS server Info: ")
yield PASSPOINT_RADIUS_SERVER_DATA
@pytest.fixture(scope="session")
def passpoint_radius_accounting_server_info():
allure.attach(body=str(PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA), name="Passpoint RADIUS account server Info: ")
yield PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA
@pytest.fixture(scope="session")
def passpoint_provider_info():
allure.attach(body=str(PASSPOINT_PROVIDER_INFO), name="Passpoint Provider Info: ")
yield PASSPOINT_PROVIDER_INFO
@pytest.fixture(scope="session")
def passpoint_operator_info():
allure.attach(body=str(PASSPOINT_OPERATOR_INFO), name="Passpoint operator Info: ")
yield PASSPOINT_OPERATOR_INFO
@pytest.fixture(scope="session")
def passpoint_venue_info():
allure.attach(body=str(PASSPOINT_VENUE_INFO), name="Passpoint venue Info: ")
yield PASSPOINT_VENUE_INFO
@pytest.fixture(scope="session")
def passpoint_profile_info():
allure.attach(body=str(PASSPOINT_PROFILE_INFO), name="Passpoint profile Info: ")
yield PASSPOINT_PROFILE_INFO

View File

@@ -1,167 +0,0 @@
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
from iOS_lib import closeApp, openApp, ForgetAllWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
"rf": {},
"radius": False
}
@pytest.mark.OpenRoaming
#@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
#@pytest.mark.parametrize(
# 'setup_profiles',
# [setup_params_general],
# indirect=True,
# scope="class"
#)
#@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoaming(object):
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_OpenRoaming_5g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
#profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
#ssidName = profile_data["ssid_name"]
#ssidPassword = profile_data["security_key"]
ssidName = "ssid-passpoint-osu"
ssidPassword = "something"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
ssidName = "ssid-passpoint-osu"
ssidPassword = "something"
ForgetAllWifiConnection(request, setup_perfectoMobile_iOS, connData)
#Delete Profile Under Settings
#deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
#print ("OpenRoaming Profile Connected WifiName: " + OpenRoamingWifiName)
#assert verify_APconnMobileDevice_iOS(request, ssidName, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
#verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#Delete Profile Under Settings
#deleteOpenRoamingInstalledProfile(request, setup_perfectoMobile_iOS, connData)
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_OpenRoaming_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa
def test_OpenRoaming_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa
def test_OpenRoaming_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)

View File

@@ -0,0 +1,317 @@
"""
EAP Passpoint BRIDGE Mode
Run wpa2_eap & Run wpa2_only_eap:
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and bridge" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and bridge" -s -vvv --testbed interop --skip-upgrade
Run all:
pytest -m "openRoaming and interop_ios and bridge" -s -vvv --testbed interop --skip-upgrade --skip-testrail --collect-only
"""
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.bridge]
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_eap = {
"mode": "BRIDGE",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("BRIDGE MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoamingBridge(object):
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_2g_WPA2_EAP_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_5g_WPA2_EAP_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)

View File

@@ -0,0 +1,347 @@
"""
EAP Passpoint NAT Mode
Run wpa2_eap:
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and nat" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and nat" -s -vvv --testbed interop --skip-upgrade
Run wpa2_only_eap:
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and nat" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and nat" -s -vvv --testbed interop --skip-upgrade
Run all:
pytest -m "OpenRoaming and interop_ios and nat" -s -vvv --testbed interop --skip-upgrade
"""
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.nat]
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_eap = {
"mode": "NAT",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("NAT MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoamingNAT(object):
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_2g_WPA2_EAP_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_5g_WPA2_EAP_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#ForgetProfileWifiConnection(request, setup_perfectoMobile_iOS, profileNameSSID, connData)
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)

View File

@@ -0,0 +1,317 @@
"""
EAP Passpoint VLAN Mode
Run wpa2_eap & Run wpa2_only_eap:
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and vlan" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and vlan" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_only_eap and vlan" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_only_eap and vlan" -s -vvv --testbed interop --skip-upgrade
Run all:
pytest -m "openRoaming and interop_ios and vlan" -s -vvv --testbed interop --skip-upgrade --skip-testrail --collect-only
"""
from logging import exception
import unittest
import warnings
from perfecto.test import TestResultFactory
import pytest
import sys
import time
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.by import By
from appium import webdriver
from selenium.common.exceptions import NoSuchElementException
import sys
import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.vlan]
from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_eap = {
"mode": "VLAN",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("VLAN MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestOpenRoamingBridgeVLAN(object):
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_2g_WPA2_EAP_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_OpenRoaming_5g_WPA2_EAP_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Setting Perfecto ReportClient....
#SSID to download profile :: passpoint_profile_download
#SSID to validate connectivity :: ssid_wpa2_eap_passpoint_5g
#Profile download URL :: https://onboard.almondlabs.net/ios.html
#Profile name to remove :: AmeriBand
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
downloadProfileSSID = setup_params_eap["ssid_modes"]["open"][0]["ssid_name"]
downloadProfileSSIDPass = ""
#profileDownloadURL = passpoint_profile_info["profile_download_url_ios"]
profileDownloadURL = "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig"
profileName = passpoint_profile_info["profile_name_on_device"]
profileNameSSID = setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"]
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, downloadProfileSSID, downloadProfileSSIDPass, setup_perfectoMobile_iOS, connData)
#Install Profile
downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfectoMobile_iOS, connData)
#ForgetWifi Original
ForgetWifiConnection(request, setup_perfectoMobile_iOS, downloadProfileSSID, connData)
try:
assert verify_APconnMobileDevice_iOS(request, profileNameSSID, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
except Exception as e:
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)
assert False
#Delete Profile Under Settings
deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile_iOS, connData)

View File

@@ -14,6 +14,7 @@ from urllib3 import exceptions
import sys
import allure
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.PassPointConnection]
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
@@ -32,8 +33,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.PassPointConnection
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -1,220 +0,0 @@
"""
EAP Passpoint Test: BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
import allure
import pytest
pytestmark = [pytest.mark.interop_iOS, pytest.mark.eap_passpoint, pytest.mark.bridge]
setup_params_eap = {
"mode": "BRIDGE",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("BRIDGE MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestBRIDGEModeEapAuth(object):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
def test_eap_passpoint_osu_id_provider_creation(self, setup_profiles):
"""
EAP Passpoint BRIDGE Mode : OSU ID provider profile creation
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_osu_id_provider']['sdk']
if result:
allure.attach(name="OSU ID provider profile creation successful ", body="")
else:
allure.attach(name="OSU ID provider profile creation failed ", body="")
assert result
def test_eap_passpoint_operator_creation(self, setup_profiles):
"""
EAP Passpoint BRIDGE Mode : Passpoint operator profile creation
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_operator_profile']['sdk']
if result:
allure.attach(name="Passpoint operator profile creation successful ", body="")
else:
allure.attach(name="Passpoint operator profile creation failed ", body="")
assert result
def test_eap_passpoint_venue_creation(self, setup_profiles):
"""
EAP Passpoint BRIDGE Mode : Passpoint venue provider profile creation
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_venue_profile']['sdk']
if result:
allure.attach(name="Passpoint venue provider profile creation successful ", body="")
else:
allure.attach(name="Passpoint venue provider profile creation failed ", body="")
assert result
def test_eap_passpoint_creation(self, setup_profiles):
"""
EAP Passpoint BRIDGE Mode : Passpoint profile creation
pytest -m "interop_iOS and eap_passpoint and bridge"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint']['sdk']
if result:
allure.attach(name="Passpoint profile creation successful ", body="")
else:
allure.attach(name="Passpoint profile creation failed ", body="")
assert result
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])

View File

@@ -1,220 +0,0 @@
"""
EAP Passpoint Test: NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat"
"""
import allure
import pytest
pytestmark = [pytest.mark.interop_iOS, pytest.mark.eap_passpoint, pytest.mark.nat]
setup_params_eap = {
"mode": "NAT",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("NAT MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestNATModeEapAuth(object):
"""
EAP Passpoint NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat"
"""
def test_eap_passpoint_osu_id_provider_creation(self, setup_profiles):
"""
EAP Passpoint NAT Mode : OSU ID provider profile creation
pytest -m "interop_iOS and eap_passpoint and nat"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_osu_id_provider']['sdk']
if result:
allure.attach(name="OSU ID provider profile creation successful ", body="")
else:
allure.attach(name="OSU ID provider profile creation failed ", body="")
assert result
def test_eap_passpoint_operator_creation(self, setup_profiles):
"""
EAP Passpoint NAT Mode : Passpoint operator profile creation
pytest -m "interop_iOS and eap_passpoint and nat"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_operator_profile']['sdk']
if result:
allure.attach(name="Passpoint operator profile creation successful ", body="")
else:
allure.attach(name="Passpoint operator profile creation failed ", body="")
assert result
def test_eap_passpoint_venue_creation(self, setup_profiles):
"""
EAP Passpoint NAT Mode : Passpoint venue provider profile creation
pytest -m "interop_iOS and eap_passpoint and nat"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_venue_profile']['sdk']
if result:
allure.attach(name="Passpoint venue provider profile creation successful ", body="")
else:
allure.attach(name="Passpoint venue provider profile creation failed ", body="")
assert result
def test_eap_passpoint_creation(self, setup_profiles):
"""
EAP Passpoint NAT Mode : Passpoint profile creation
pytest -m "interop_iOS and eap_passpoint and nat"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint']['sdk']
if result:
allure.attach(name="Passpoint profile creation successful ", body="")
else:
allure.attach(name="Passpoint profile creation failed ", body="")
assert result
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat and wpa2_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat and wpa2_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat and wpa2_only_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint NAT Mode
pytest -m "interop_iOS and eap_passpoint and nat and wpa2_only_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])

View File

@@ -1,220 +0,0 @@
"""
EAP Passpoint Test: VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
import allure
import pytest
pytestmark = [pytest.mark.interop_iOS, pytest.mark.eap_passpoint, pytest.mark.vlan]
setup_params_eap = {
"mode": "VLAN",
"ssid_modes": {
"open": [
{"ssid_name": "passpoint_profile_download", "appliedRadios": ["is2dot4GHz"]}
],
"wpa2_eap": [
{"ssid_name": "ssid_wpa2_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
],
"wpa2_only_eap": [
{"ssid_name": "ssid_wpa2_only_eap_passpoint_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_wpa2_only_eap_passpoint_5g", "appliedRadios": ["is5GHz"]}
]
}
}
@allure.feature("VLAN MODE EAP PASSPOINT SETUP")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_eap],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestVLANModeEapAuth(object):
"""
EAP Passpoint VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
def test_eap_passpoint_osu_id_provider_creation(self, setup_profiles):
"""
EAP Passpoint VLAN Mode : OSU ID provider profile creation
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_osu_id_provider']['sdk']
if result:
allure.attach(name="OSU ID provider profile creation successful ", body="")
else:
allure.attach(name="OSU ID provider profile creation failed ", body="")
assert result
def test_eap_passpoint_operator_creation(self, setup_profiles):
"""
EAP Passpoint VLAN Mode : Passpoint operator profile creation
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_operator_profile']['sdk']
if result:
allure.attach(name="Passpoint operator profile creation successful ", body="")
else:
allure.attach(name="Passpoint operator profile creation failed ", body="")
assert result
def test_eap_passpoint_venue_creation(self, setup_profiles):
"""
EAP Passpoint VLAN Mode : Passpoint venue provider profile creation
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint_venue_profile']['sdk']
if result:
allure.attach(name="Passpoint venue provider profile creation successful ", body="")
else:
allure.attach(name="Passpoint venue provider profile creation failed ", body="")
assert result
def test_eap_passpoint_creation(self, setup_profiles):
"""
EAP Passpoint VLAN Mode : Passpoint profile creation
pytest -m "interop_iOS and eap_passpoint and vlan"
"""
test_cases, instantiate_profile, profile_data = setup_profiles
result = test_cases['passpoint']['sdk']
if result:
allure.attach(name="Passpoint profile creation successful ", body="")
else:
allure.attach(name="Passpoint profile creation failed ", body="")
assert result
@pytest.mark.wpa2_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan and wpa2_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan and wpa2_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.twog
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_2g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan and wpa2_only_eap and twog"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_2g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][0]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])
@pytest.mark.wpa2_only_eap
@pytest.mark.fiveg
@pytest.mark.parametrize(
'push_ap_profile',
[{"ssid_names": ["ssid_wpa2_only_eap_passpoint_5g", "passpoint_profile_download"]}],
indirect=True,
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g(self, passpoint_profile_info, push_ap_profile):
"""
EAP Passpoint VLAN Mode
pytest -m "interop_iOS and eap_passpoint and vlan and wpa2_only_eap and fiveg"
"""
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config push to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_state']
if result:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g successful ", body="")
else:
allure.attach(name="Config apply to AP for ssid_wpa2_only_eap_passpoint_5g failed", body="")
assert result
print("SSID to download profile :: ", setup_params_eap["ssid_modes"]["open"][0]["ssid_name"])
print("SSID to validate connectivity :: ", setup_params_eap["ssid_modes"]["wpa2_only_eap"][1]["ssid_name"])
print("Profile download URL :: ", passpoint_profile_info["profile_download_url_ios"])
print("Profile name to remove :: ", passpoint_profile_info["profile_name_on_device"])

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.ToggleWifiMode]
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_general = {
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ToggleWifiMode
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',

View File

@@ -16,6 +16,8 @@ import allure
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ClientConnectivity]
from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
setup_params_general = {
@@ -30,8 +32,6 @@ setup_params_general = {
"radius": False
}
@pytest.mark.ClientConnectivity
@pytest.mark.interop_iOS
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
@@ -68,7 +68,7 @@ class TestNatMode(object):
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
@@ -76,22 +76,22 @@ class TestNatMode(object):
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobileWeb[1]
driver = setup_perfectoMobileWeb[0]
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(ssidName, request, ssidPassword, setup_perfectoMobileWeb, connData)
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnectivity_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
def test_ClientConnectivity_2g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
@@ -99,22 +99,22 @@ class TestNatMode(object):
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobileWeb[1]
driver = setup_perfectoMobileWeb[0]
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnectivity_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobileWeb):
def test_ClientConnectivity_5g_WPA(self, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
@@ -122,15 +122,15 @@ class TestNatMode(object):
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
report = setup_perfectoMobileWeb[1]
driver = setup_perfectoMobileWeb[0]
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
#Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobileWeb, connData)
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobileWeb, ssidName, connData)
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)

View File

@@ -12,7 +12,6 @@ sdk-customer-id=2
#fIRMWARE Option
build=0
cloud_ctlr=0
# Influx Params
influx_host=influx.cicd.lab.wlan.tip.build
@@ -62,8 +61,7 @@ bundleId-iOS-Ping=com.deftapps.ping
#browserType-iOS=Safari
browserType-iOS=Safari
bundleId-iOS-Safari=com.apple.mobilesafari
openRoaming-iOS-URL=https://onboard.cicd.lab.wlan.tip.build/ttls/AmeriBand-Profile.mobileconfig
openRoaming-and-URL=https://onboard.cicd.lab.wlan.tip.build/aka/androidconfig.cfg
# Android Device Capabilities
platformName-android=Android
model-android=Galaxy S20