mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-01 19:37:54 +00:00
wct initial merge
Signed-off-by: shivamcandela <shivam.thakur@candelatech.com>
This commit is contained in:
10
.github/workflows/cloud-controller-build.yaml
vendored
10
.github/workflows/cloud-controller-build.yaml
vendored
@@ -19,23 +19,23 @@ env:
|
||||
testbeds: '[
|
||||
{
|
||||
"number": "ext-01",
|
||||
"version": "1.1.0-SNAPSHOT-2021-04-27"
|
||||
"version": "1.1.0-rc2"
|
||||
},
|
||||
{
|
||||
"number": "ext-02",
|
||||
"version": "1.1.0-SNAPSHOT-2021-04-27"
|
||||
"version": "1.1.0-rc2"
|
||||
},
|
||||
{
|
||||
"number": "ext-03",
|
||||
"version": "1.1.0-RC1"
|
||||
"version": "1.0.0"
|
||||
},
|
||||
{
|
||||
"number": "ext-04",
|
||||
"version": "1.1.0-RC1"
|
||||
"version": "1.1.0-rc2"
|
||||
},
|
||||
{
|
||||
"number": "01",
|
||||
"version": "1.1.0-RC1"
|
||||
"version": "1.1.0-rc2"
|
||||
}
|
||||
]'
|
||||
|
||||
|
||||
235
.github/workflows/nightly.yml
vendored
235
.github/workflows/nightly.yml
vendored
@@ -2,10 +2,8 @@ name: nightly build
|
||||
env:
|
||||
# thirdparties
|
||||
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
DOCKER_USER_NAME: ${{ secrets.DOCKER_USER_NAME }}
|
||||
DOCKER_USER_NAME: wlan-testing-cicd
|
||||
DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
TESTRAIL_USER_PASSWORD: ${{ secrets.TESTRAIL_USER_PASSWORD }}
|
||||
JFROG_USER_PASSWORD: ${{ secrets.JFROG_USER_PASSWORD }}
|
||||
# AWS credentials
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
@@ -16,12 +14,20 @@ env:
|
||||
# Cloud SDK certs
|
||||
CACERT: ${{ secrets.CACERT }}
|
||||
CAKEY: ${{ secrets.CAKEY }}
|
||||
ALLURE_CLI_VERSION: 2.14.0
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
schedule:
|
||||
- cron: '15 0 * * *'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -31,117 +37,186 @@ jobs:
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Checkout LANforge scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-lanforge-scripts
|
||||
repository: Telecominfraproject/wlan-lanforge-scripts
|
||||
|
||||
- name: import LANforge scripts
|
||||
working-directory: wlan-testing
|
||||
run: ./sync_repos.bash
|
||||
|
||||
# build and push docker image
|
||||
- name: docker login
|
||||
shell: bash
|
||||
run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }}
|
||||
- name: build docker image
|
||||
shell: bash
|
||||
run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_id }} -f wlan-testing/pytest/Dockerfile .
|
||||
working-directory: wlan-testing
|
||||
run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_number }} -f docker/Dockerfile .
|
||||
- name: push docker image
|
||||
shell: bash
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_id }}
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_number }}
|
||||
|
||||
cloudsdk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout pki scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-pki
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
- name: Checkout Cloud SDK repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-helm
|
||||
repository: Telecominfraproject/wlan-cloud-helm
|
||||
- name: Checkout helm values repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: toolsmith
|
||||
repository: Telecominfraproject/Toolsmith
|
||||
token: ${{ secrets.PAT_TOKEN }}
|
||||
|
||||
- name: Prepare environment
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ./wlan-pki/testCA/private
|
||||
mkdir -p ./wlan-pki/testCA/newcerts
|
||||
mkdir -p ./wlan-pki/generated
|
||||
touch ./wlan-pki/testCA/index.txt
|
||||
echo "01" > ./wlan-pki/testCA/serial.txt
|
||||
echo "${{ env.CACERT }}" | base64 -d > ./wlan-pki/testCA/cacert.pem
|
||||
echo "${{ env.CAKEY }}" | base64 -d > ./wlan-pki/testCA/private/cakey.pem
|
||||
cp ./toolsmith/helm-values/aws-cicd.yaml ./wlan-helm/tip-wlan/resources/environments/aws-cicd.yaml
|
||||
|
||||
- name: Generate certs
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./wlan-pki
|
||||
./generate_all.sh true
|
||||
./copy-certs-to-helm.sh "../wlan-helm"
|
||||
|
||||
- name: Deploy Cloud SDK
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./wlan-helm/tip-wlan
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
# start deployment
|
||||
helm dependency update
|
||||
helm upgrade --install tip . -f resources/environments/aws-cicd.yaml --create-namespace --namespace tip
|
||||
# cloudsdk:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: Checkout pki scripts repo
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# path: wlan-pki
|
||||
# repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
# - name: Checkout Cloud SDK repo
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# path: wlan-helm
|
||||
# repository: Telecominfraproject/wlan-cloud-helm
|
||||
# - name: Checkout helm values repo
|
||||
# uses: actions/checkout@v2
|
||||
# with:
|
||||
# path: toolsmith
|
||||
# repository: Telecominfraproject/Toolsmith
|
||||
# token: ${{ secrets.PAT_TOKEN }}
|
||||
#
|
||||
# - name: Prepare environment
|
||||
# run: |
|
||||
# mkdir -p ./wlan-pki/testCA/private
|
||||
# mkdir -p ./wlan-pki/testCA/newcerts
|
||||
# mkdir -p ./wlan-pki/generated
|
||||
# touch ./wlan-pki/testCA/index.txt
|
||||
# echo "01" > ./wlan-pki/testCA/serial.txt
|
||||
# echo "${{ env.CACERT }}" | base64 -d > ./wlan-pki/testCA/cacert.pem
|
||||
# echo "${{ env.CAKEY }}" | base64 -d > ./wlan-pki/testCA/private/cakey.pem
|
||||
# cp ./toolsmith/helm-values/aws-cicd.yaml ./wlan-helm/tip-wlan/resources/environments/aws-cicd.yaml
|
||||
#
|
||||
# - name: Generate certs
|
||||
# run: |
|
||||
# cd ./wlan-pki
|
||||
# ./generate_all.sh true
|
||||
# ./copy-certs-to-helm.sh "../wlan-helm"
|
||||
#
|
||||
# - name: Deploy Cloud SDK
|
||||
# run: |
|
||||
# cd ./wlan-helm/tip-wlan
|
||||
# aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
# # start deployment
|
||||
# helm dependency update
|
||||
# helm upgrade --install tip . -f resources/environments/aws-cicd.yaml --create-namespace --namespace tip
|
||||
#
|
||||
# - name: Show pod state on deployment failure
|
||||
# if: failure()
|
||||
# run: |
|
||||
# kubectl get pods -n tip
|
||||
# kubectl describe pods -n tip
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build, cloudsdk ]
|
||||
needs: [ build ]
|
||||
steps:
|
||||
- name: run tests
|
||||
run: |
|
||||
today=$(date +"%d-%m-%Y")
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
kubectl delete job nightly-ci-$today --wait=true --ignore-not-found=true
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- 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
|
||||
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::nightly-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: run sanity tests
|
||||
run: |
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: nightly-ci-$today
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_id }}
|
||||
args:
|
||||
- "-c"
|
||||
- "pytest --no-testrails --skip-update-firmware -o lanforge-ip-address=10.28.3.6; sleep 3000"
|
||||
command: [ "bash" ]
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:pytest-${{ github.run_number }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m sanity -s -vvv --testbed=basic-02 --skip-testrail --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
exit \$ret
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: configuration
|
||||
secret:
|
||||
secretName: configuration
|
||||
backoffLimit: 0
|
||||
EOF
|
||||
sleep 60 # needed to wait for the pod to come up
|
||||
podname=$(kubectl get pods -o name -l job-name=nightly-ci-$today | sed "s/pod\///")
|
||||
|
||||
sleep 60 # wait for the pod to come up
|
||||
|
||||
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
|
||||
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
echo "waiting for tests to complete"
|
||||
kubectl cp $podname:/ci/test_everything.xml test_everything.xml
|
||||
sleep 15
|
||||
sleep 10
|
||||
echo "waiting for tests to complete..."
|
||||
kubectl cp $podname:/wlan-testing/tests/test_everything.xml test_everything.xml >/dev/null 2>&1
|
||||
done
|
||||
echo "tests completed"
|
||||
|
||||
echo "downloading allure results..."
|
||||
kubectl cp $podname:/tmp/allure-results allure-results >/dev/null 2>&1
|
||||
|
||||
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
|
||||
|
||||
# placeholder for now
|
||||
echo "Grafana Link: https://grafana.lab.wlan.tip.build/TO_BE_PROVIDED"
|
||||
echo "Kibana Link: https://kibana.lab.wlan.tip.build/TO_BE_PROVIDED"
|
||||
shell: bash
|
||||
- name: Publish Unit Test Results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1.7
|
||||
- name: upload Allure results as artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
files: "**/*.xml"
|
||||
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
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -151,4 +151,6 @@ pytest/*
|
||||
!pytest/pytest.ini
|
||||
pytest/nightly*log
|
||||
|
||||
test_everything.xml
|
||||
test_everything.xml
|
||||
.vscode
|
||||
.envrc
|
||||
|
||||
@@ -134,7 +134,15 @@ pip3 install pytest==6.2.2
|
||||
pip3 install bs4
|
||||
pip3 install paramiko
|
||||
pip3 install xlsxwriter
|
||||
pip3 install influxdb_client
|
||||
pip3 install allure-pytest
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
Note: Add the pip3 module if any module not found error hits
|
||||
|
||||
#### Step 3
|
||||
|
||||
Please ensure you follow the steps outlined in [here](./libs/controller/README.md)
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
FROM python:3.8
|
||||
WORKDIR /ci
|
||||
|
||||
RUN apt update && apt install vim -y && rm -rf /var/lib/apt/lists/*
|
||||
RUN pip3 install requests xlsxwriter pandas
|
||||
|
||||
COPY wlan-lanforge-scripts/py-json/LANforge /ci/LANforge
|
||||
COPY wlan-lanforge-scripts/py-json/realm.py /ci
|
||||
COPY wlan-lanforge-scripts/py-json/generic_cx.py /ci
|
||||
COPY wlan-lanforge-scripts/py-scripts/sta_connect2.py /ci
|
||||
COPY wlan-lanforge-scripts/py-scripts/__init__.py /ci
|
||||
COPY wlan-testing/docker/nightly.py /ci
|
||||
COPY wlan-testing/docker/nightly_test_config.json /ci
|
||||
|
||||
ENTRYPOINT [ "/ci/nightly.py" ]
|
||||
RUN mkdir ~/.pip
|
||||
RUN echo "[global]" > ~/.pip/pip.conf
|
||||
RUN echo "index-url = https://pypi.org/simple" >> ~/.pip/pip.conf
|
||||
RUN echo "extra-index-url = https://tip-read:tip-read@tip.jfrog.io/artifactory/api/pypi/tip-wlan-python-pypi-local/simple" >> ~/.pip/pip.conf
|
||||
RUN pip3 install pytest==6.2.2 bs4 paramiko xlsxwriter requests pandas influxdb influxdb-client scp allure-pytest tip-wlan-cloud selenium perfecto-py37 Appium-Python-Client
|
||||
COPY lanforge /wlan-testing/lanforge
|
||||
COPY tests /wlan-testing/tests
|
||||
COPY libs /wlan-testing/libs
|
||||
WORKDIR /wlan-testing
|
||||
ENTRYPOINT ["bash"]
|
||||
19
docker/README.md
Normal file
19
docker/README.md
Normal file
@@ -0,0 +1,19 @@
|
||||
## Docker based environment
|
||||
|
||||
### Building a docker image
|
||||
|
||||
From the root directory of this repository (wlan-testing) run the following command:
|
||||
```bash
|
||||
docker build -f ./docker/Dockerfile -t wlantest .
|
||||
```
|
||||
This will produce a docker image, which you can verify by running docker images command.
|
||||
|
||||
### Running a docker image
|
||||
|
||||
From the root directory of this repository (wlan-testing) run the following command. This command executes
|
||||
connectivity tests on a specific lab. **NOTE:** Use appropriate marker for your pytest execution,
|
||||
configuration.py and replace ${YOUR_ALLURE_RESULTS_DIR} with your allure result dir.
|
||||
|
||||
```bash
|
||||
docker run -i -t -v $(YOUR_ALLURE_RESULT_DIR):/allure-results -v $(pwd)/configuration.py:/wlan-testing/configuration.py wlantest /bin/bash -c "cd tests; pytest -s -vvv --testbed=basic-02 -m client_connectivity_test --skip-testrail --alluredir=/allure-result"
|
||||
```
|
||||
@@ -1,438 +0,0 @@
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import re
|
||||
import requests
|
||||
import json
|
||||
import logging
|
||||
import argparse
|
||||
from time import sleep, gmtime, strftime
|
||||
from unittest.mock import Mock
|
||||
|
||||
# the below hack is only needed for local dev
|
||||
# This should be replaced with a module and added to dockerfile
|
||||
import sys
|
||||
for folder in 'py-json','py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge/{folder}')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
from sta_connect2 import StaConnect2
|
||||
|
||||
# Run from remote dev machine on ssh tunnel through to LANforge in TIP Lab, without testrails being used.
|
||||
# SSH tunnel created with login to orchestrator with option: -L 10080:lf1:8080
|
||||
# python3 ./nightly.py --skip-update-firmware --no-testrails --lanforge-ip-address localhost --lanforge-port-number 10080
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--sdk-base-url", type=str, help="cloudsdk base url",
|
||||
default="https://wlan-portal-svc.cicd.lab.wlan.tip.build")
|
||||
parser.add_argument("--sdk-user-id", type=str, help="cloudsdk user id",
|
||||
default="support@example.com")
|
||||
parser.add_argument("--sdk-user-password", type=str, help="cloudsdk user password",
|
||||
default="support")
|
||||
parser.add_argument("--jfrog-base-url", type=str, help="jfrog base url",
|
||||
default="tip.jFrog.io/artifactory/tip-wlan-ap-firmware")
|
||||
parser.add_argument("--jfrog-user-id", type=str, help="jfrog user id",
|
||||
default="tip-read")
|
||||
parser.add_argument("--jfrog-user-password", type=str, help="jfrog user password",
|
||||
default="tip-read")
|
||||
parser.add_argument("--testrail-base-url", type=str, help="testrail base url",
|
||||
default="https://telecominfraproject.testrail.com")
|
||||
parser.add_argument("--testrail-project", type=str, help="testrail project name",
|
||||
default="opsfleet-wlan")
|
||||
parser.add_argument("--testrail-user-id", type=str, help="testrail user id",
|
||||
default="gleb@opsfleet.com")
|
||||
parser.add_argument("--testrail-user-password", type=str, help="testrail user password",
|
||||
default="password")
|
||||
parser.add_argument("--lanforge-ip-address", type=str, help="ip address of the lanforge gui",
|
||||
default="10.28.3.6")
|
||||
parser.add_argument("--lanforge-port-number", type=str, help="port of the lanforge gui",
|
||||
default="8080")
|
||||
parser.add_argument('--skip-update-firmware', dest='update_firmware', action='store_false')
|
||||
parser.add_argument('--no-testrails', dest='use_testrails', action='store_false')
|
||||
parser.set_defaults(update_firmware=True)
|
||||
parser.set_defaults(use_testrails=True)
|
||||
command_line_args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format="%(asctime)s %(levelname)-8s %(message)s file:%(pathname)s line:%(lineno)d",
|
||||
datefmt="%m-%d %H:%M",
|
||||
filename="nightly_cicd_sanity.log",
|
||||
filemode="a")
|
||||
formatter = logging.Formatter("%(asctime)s %(levelname)-8s %(message)s")
|
||||
console = logging.StreamHandler()
|
||||
console.setLevel(logging.INFO)
|
||||
console.setFormatter(formatter)
|
||||
logging.getLogger().addHandler(console)
|
||||
logging.info("------------------------")
|
||||
logging.info("nightly sanity run start")
|
||||
|
||||
# Initialize constants
|
||||
with open("nightly_test_config.json") as json_file:
|
||||
TEST_DATA = json.load(json_file)
|
||||
TESTRAIL = {
|
||||
True: {
|
||||
"statusCode": 1, # status_id is 1 for Passed, 2 For Blocked, 4 for Retest, 5 for Failed
|
||||
"message": "success"
|
||||
},
|
||||
False: {
|
||||
"statusCode": 5,
|
||||
"message": "failure"
|
||||
}
|
||||
}
|
||||
|
||||
# Class to interact with Testrail; better to replace this with pytest\nunit
|
||||
class TestRail_Client:
|
||||
def __new__(cls, *args, **kwargs):
|
||||
if command_line_args.use_testrails:
|
||||
return super().__new__(cls, *args, **kwargs)
|
||||
else:
|
||||
mock = Mock()
|
||||
mock.get_project_id.return_value = -1
|
||||
mock.create_testrun.return_value = -1
|
||||
return mock
|
||||
|
||||
def __init__(self):
|
||||
self.user = command_line_args.testrail_user_id
|
||||
self.password = command_line_args.testrail_user_password
|
||||
self.__url = f"{command_line_args.testrail_base_url}/index.php?/api/v2/"
|
||||
|
||||
def send_get(self, uri, filepath=None):
|
||||
"""Issue a GET request (read) against the API.
|
||||
|
||||
Args:
|
||||
uri: The API method to call including parameters, e.g. get_case/1.
|
||||
filepath: The path and file name for attachment download; used only
|
||||
for "get_attachment/:attachment_id".
|
||||
|
||||
Returns:
|
||||
A dict containing the result of the request.
|
||||
"""
|
||||
return self.__send_request("GET", uri, filepath)
|
||||
|
||||
def send_post(self, uri, data):
|
||||
"""Issue a POST request (write) against the API.
|
||||
|
||||
Args:
|
||||
uri: The API method to call, including parameters, e.g. add_case/1.
|
||||
data: The data to submit as part of the request as a dict; strings
|
||||
must be UTF-8 encoded. If adding an attachment, must be the
|
||||
path to the file.
|
||||
|
||||
Returns:
|
||||
A dict containing the result of the request.
|
||||
"""
|
||||
return self.__send_request("POST", uri, data)
|
||||
|
||||
def __send_request(self, method, uri, data):
|
||||
url = self.__url + uri
|
||||
headers = {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
logging.debug(f"Method: {method}; Url: {url}; Data: {data}")
|
||||
|
||||
if method == "POST":
|
||||
if uri[:14] == "add_attachment": # add_attachment API method
|
||||
files = { "attachment": open(data, "rb") }
|
||||
response = requests.post(url, headers=headers, files=files, auth=(self.user, self.password))
|
||||
files["attachment"].close()
|
||||
else:
|
||||
payload = bytes(json.dumps(data), "utf-8")
|
||||
response = requests.post(url, headers=headers, data=payload, auth=(self.user, self.password))
|
||||
else:
|
||||
response = requests.get(url, headers=headers, auth=(self.user, self.password))
|
||||
logging.debug(f"headers: {headers}; response: {response.text}; response code: {response.status_code}")
|
||||
|
||||
if response.status_code > 201:
|
||||
try:
|
||||
error = response.json()
|
||||
except: # response.content not formatted as JSON
|
||||
error = str(response.content)
|
||||
logging.info(f"TestRail API returned HTTP status code {response.status_code} with the following: ({error})")
|
||||
return
|
||||
else:
|
||||
logging.debug(uri[:15])
|
||||
if uri[:15] == "get_attachments": # Expecting file, not JSON
|
||||
try:
|
||||
logging.info (str(response.content))
|
||||
open(data, "wb").write(response.content)
|
||||
return (data)
|
||||
except:
|
||||
return ("Error saving attachment.")
|
||||
else:
|
||||
try:
|
||||
return response.json()
|
||||
except: # Nothing to return
|
||||
return {}
|
||||
|
||||
def get_project_id(self, project_name):
|
||||
"Get the project ID using project name"
|
||||
projects = testrail.send_get("get_projects")
|
||||
logging.debug(projects)
|
||||
for project in projects:
|
||||
if project["name"] == project_name:
|
||||
return project["id"]
|
||||
|
||||
def update_testrail(self, case_id, run_id, status_id, msg):
|
||||
logging.info(f"Update TestRail; result status: {status_id}; case id: {case_id}; run id: {run_id}")
|
||||
if run_id is not None:
|
||||
try:
|
||||
result = testrail.send_post(
|
||||
f"add_result_for_case/{run_id}/{case_id}",
|
||||
{ "status_id": status_id, "comment": msg }
|
||||
)
|
||||
logging.info(f"Updating TestRail result: {result}")
|
||||
except Exception as e:
|
||||
logging.info(f"Exception in update_testrail(): {e}")
|
||||
else:
|
||||
logging.info(f"Updated test result for case: {case_id} in test run: {run_id} with msg: {msg}")
|
||||
|
||||
def create_testrun(self, name, case_ids, project_id):
|
||||
result = testrail.send_post(
|
||||
f"add_run/{project_id}",
|
||||
{"name": name, "case_ids": case_ids, "include_all": False}
|
||||
)
|
||||
logging.debug(result)
|
||||
return result["id"]
|
||||
|
||||
# Class for jFrog Interaction
|
||||
class jFrog_Client:
|
||||
def __init__(self):
|
||||
self.user = command_line_args.jfrog_user_id
|
||||
self.password = command_line_args.jfrog_user_password
|
||||
self.baseUrl = command_line_args.jfrog_base_url
|
||||
|
||||
def get_latest_image(self, model):
|
||||
# todo handle auth errors
|
||||
logging.debug(f"searching for the latest firmware on url: {model}")
|
||||
response = requests.get(f"https://{self.baseUrl}/{model}/dev/", auth=(self.user, self.password))
|
||||
return re.findall('href="(.+pending.+).tar.gz"', response.text)[-1]
|
||||
|
||||
def get_latest_image_url(self, model, latest_image):
|
||||
return f"https://{self.user}:{self.password}@{self.baseUrl}/{model}/dev/{latest_image}.tar.gz"
|
||||
|
||||
# Class for CloudSDK Interaction via RestAPI
|
||||
class CloudSDK_Client:
|
||||
def __init__(self):
|
||||
self.baseUrl = command_line_args.sdk_base_url
|
||||
cloud_login_url = f"{self.baseUrl}/management/v1/oauth2/token"
|
||||
payload = {
|
||||
"userId": command_line_args.sdk_user_id,
|
||||
"password": command_line_args.sdk_user_password
|
||||
}
|
||||
headers = {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
try:
|
||||
token_response = requests.post(cloud_login_url, headers=headers, data=json.dumps(payload))
|
||||
except requests.exceptions.RequestException as e:
|
||||
raise SystemExit(f"Exiting Script! Cloud not get bearer token for reason: {e}")
|
||||
token_data = token_response.json()
|
||||
self.headers = {
|
||||
"Authorization": f"Bearer {token_data['access_token']}"
|
||||
}
|
||||
|
||||
def ap_firmware(self, customer_id, equipment_id):
|
||||
equip_fw_url = f"{self.baseUrl}/portal/status/forEquipment?customerId={customer_id}&equipmentId={equipment_id}&statusDataTypes="
|
||||
status_response = requests.get(equip_fw_url, headers=self.headers)
|
||||
logging.debug(status_response.json())
|
||||
return (status_response.json())[2]["details"]["reportedSwVersion"]
|
||||
|
||||
def get_images(self, apModel):
|
||||
getFW_url = f"{self.baseUrl}/portal/firmware/version/byEquipmentType?equipmentType=AP&modelId={apModel}"
|
||||
status_response = requests.get(getFW_url, headers=self.headers)
|
||||
logging.debug(status_response.json())
|
||||
return([ version.get("versionName") for version in status_response.json()])
|
||||
|
||||
def firwmare_upload(self, apModel, latest_image, fw_url):
|
||||
fw_upload_url = f"{self.baseUrl}/portal/firmware/version"
|
||||
payload = {
|
||||
"model_type": "FirmwareVersion",
|
||||
"id": 0,
|
||||
"equipmentType": "AP",
|
||||
"modelId": apModel,
|
||||
"versionName": latest_image,
|
||||
"description": "",
|
||||
"filename": fw_url,
|
||||
"commit": latest_image.split("-")[-1],
|
||||
"validationMethod": "MD5_CHECKSUM",
|
||||
"validationCode": "19494befa87eb6bb90a64fd515634263",
|
||||
"releaseDate": 1596192028877,
|
||||
"createdTimestamp": 0,
|
||||
"lastModifiedTimestamp": 0
|
||||
}
|
||||
self.headers["Content-Type"] = "application/json"
|
||||
response = requests.post(fw_upload_url, headers=self.headers, data=json.dumps(payload))
|
||||
self.headers.pop("Content-Type", None)
|
||||
logging.debug(response)
|
||||
return(response.json())
|
||||
|
||||
def get_firmware_id(self, image):
|
||||
logging.debug(image)
|
||||
fw_id_url = f"{self.baseUrl}/portal/firmware/version/byName?firmwareVersionName={image}"
|
||||
response = requests.get(fw_id_url, headers=self.headers)
|
||||
fw_data = response.json()
|
||||
return fw_data["id"]
|
||||
|
||||
def update_firmware(self, equipment_id, latest_firmware_id):
|
||||
url = f"{self.baseUrl}/portal/equipmentGateway/requestFirmwareUpdate?equipmentId={equipment_id}&firmwareVersionId={latest_firmware_id}"
|
||||
response = requests.post(url, headers=self.headers)
|
||||
logging.info(response.text)
|
||||
|
||||
def set_ap_profile(self, equipment_id, test_profile_id):
|
||||
url = f"{self.baseUrl}/portal/equipment?equipmentId={equipment_id}"
|
||||
response = requests.get(url, headers=self.headers)
|
||||
logging.debug(response.json())
|
||||
|
||||
# Add Lab Profile ID to Equipment
|
||||
equipment_info = response.json()
|
||||
logging.debug(equipment_info)
|
||||
equipment_info["profileId"] = test_profile_id
|
||||
|
||||
# Update AP Info with Required Profile ID
|
||||
url = f"{self.baseUrl}/portal/equipment"
|
||||
self.headers["Content-Type"] = "application/json"
|
||||
response = requests.put(url, headers=self.headers, data=json.dumps(equipment_info))
|
||||
self.headers.pop("Content-Type", None)
|
||||
logging.debug(response.text)
|
||||
|
||||
# Instantiate clients and configuration
|
||||
sdk: CloudSDK_Client = CloudSDK_Client()
|
||||
testrail: TestRail_Client = TestRail_Client()
|
||||
jFrog: jFrog_Client = jFrog_Client()
|
||||
|
||||
# 1. Find Latest firmware on jFrog for each AP Model
|
||||
# 2. Find Available firmware on CloudSDK
|
||||
# 3. If Latest firmware not present, upload
|
||||
# 4. Update Firmware on each AP Model
|
||||
# 5. Run tests
|
||||
for model in TEST_DATA["ap_models"].keys():
|
||||
# Get latest firmware on jFrog and Cloud SDK
|
||||
latest_image = jFrog.get_latest_image(model)
|
||||
firmware_list_by_model = sdk.get_images(model)
|
||||
TEST_DATA["ap_models"][model]["firmware"] = latest_image
|
||||
logging.info(f"Model: {model}; Latest firmware on jFrog: {latest_image}; Firmware on Cloud SDK: {firmware_list_by_model}")
|
||||
|
||||
if latest_image in firmware_list_by_model:
|
||||
model_firmware_id = sdk.get_firmware_id(latest_image)
|
||||
logging.info(f"Latest firmware {latest_image} present on CloudSDK!")
|
||||
else:
|
||||
logging.info(f"Uploading {latest_image} firmware to CloudSDK")
|
||||
fw_url = jFrog.get_latest_image_url(model, latest_image)
|
||||
fw_upload_status = sdk.firwmare_upload(model, latest_image, fw_url)
|
||||
model_firmware_id = fw_upload_status['id']
|
||||
logging.info(f"Upload Complete. {latest_image}; firmware ID is {model_firmware_id}")
|
||||
|
||||
# Get Current AP Firmware and upgrade\run tests if needed
|
||||
ap_fw = sdk.ap_firmware(TEST_DATA["customer_id"], TEST_DATA["ap_models"][model]["id"])
|
||||
logging.info(f"Firmware: {ap_fw}; latest firmware is: {latest_image} with ID: {model_firmware_id}")
|
||||
|
||||
if ap_fw == latest_image and command_line_args.update_firmware:
|
||||
logging.info("Model does not require firmware upgrade, skipping sanity tests")
|
||||
else:
|
||||
if command_line_args.update_firmware:
|
||||
firmware_update_case = [2831]
|
||||
logging.info("Model requires firmware update, will update and sleep")
|
||||
sdk.update_firmware(TEST_DATA["ap_models"][model]["id"], model_firmware_id)
|
||||
sleep(300) # need to have a proper wait\retry here
|
||||
else:
|
||||
firmware_update_case = []
|
||||
|
||||
test_cases_data = {
|
||||
2832: { # 2.4 GHz Open
|
||||
"radio": "wiphy4",
|
||||
"station": ["sta2234"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["twoFourG_OPEN_SSID"],
|
||||
"ssid_psk": "BLANK",
|
||||
"security": "open"
|
||||
},
|
||||
2835: { # 2.4 GHz WPA2
|
||||
"radio": "wiphy4",
|
||||
"station": ["sta2237"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["twoFourG_WPA2_SSID"],
|
||||
"ssid_psk": TEST_DATA["ap_models"][model]["info"]["twoFourG_WPA2_PSK"],
|
||||
"security": "wpa2"
|
||||
},
|
||||
2833: { # 5 GHz Open
|
||||
"radio": "wiphy3",
|
||||
"station": ["sta2235"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["fiveG_OPEN_SSID"],
|
||||
"ssid_psk": "BLANK",
|
||||
"security": "open"
|
||||
},
|
||||
2834: { # 5 GHz WPA2
|
||||
"radio": "wiphy3",
|
||||
"station": ["sta2236"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["fiveG_WPA2_SSID"],
|
||||
"ssid_psk": TEST_DATA["ap_models"][model]["info"]["fiveG_WPA2_PSK"],
|
||||
"security": "wpa2"
|
||||
},
|
||||
2836: { # 5 GHz WPA
|
||||
"radio": "wiphy3",
|
||||
"station": ["sta2419"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["fiveG_WPA_SSID"],
|
||||
"ssid_psk": TEST_DATA["ap_models"][model]["info"]["fiveG_WPA_PSK"],
|
||||
"security": "wpa"
|
||||
},
|
||||
2837: { # 2.4 GHz WPA
|
||||
"radio": "wiphy0",
|
||||
"station": ["sta2420"],
|
||||
"ssid_name": TEST_DATA["ap_models"][model]["info"]["twoFourG_WPA_SSID"],
|
||||
"ssid_psk": TEST_DATA["ap_models"][model]["info"]["twoFourG_WPA_PSK"],
|
||||
"security": "wpa"
|
||||
}
|
||||
}
|
||||
|
||||
# Create Test Run
|
||||
testrail_project_id = testrail.get_project_id(project_name=command_line_args.testrail_project)
|
||||
runId = testrail.create_testrun(
|
||||
name=f'Nightly_model_{model}_firmware_{ap_fw}_{strftime("%Y-%m-%d", gmtime())}',
|
||||
case_ids=( [*test_cases_data] + firmware_update_case ),
|
||||
project_id=testrail_project_id
|
||||
)
|
||||
logging.info(f"Testrail project id: {testrail_project_id}; run ID is: {runId}")
|
||||
|
||||
# Check if upgrade worked
|
||||
if command_line_args.update_firmware:
|
||||
results = TESTRAIL[(sdk.ap_firmware(TEST_DATA["customer_id"], TEST_DATA["ap_models"][model]["id"]) == latest_image)]
|
||||
testrail.update_testrail(case_id="2831", run_id=runId, status_id=results["statusCode"], msg=f"Upgrade {results['message']}")
|
||||
logging.info(f"Upgrade {results['statusCode']}")
|
||||
if results["message"] == "failure": # might want to fail all the other tests in testrails
|
||||
continue
|
||||
|
||||
# Set Proper AP Profile
|
||||
test_profile_id = TEST_DATA["ap_models"][model]["info"]["profile_id"]
|
||||
sdk.set_ap_profile(TEST_DATA["ap_models"][model]["id"], test_profile_id)
|
||||
logging.info(f"Test profile id: {test_profile_id}")
|
||||
|
||||
# Run Client Single Connectivity Test Cases
|
||||
for testcase in test_cases_data.keys():
|
||||
if test_cases_data[testcase]["ssid_name"] != "skip": # to be refactored with pytest, good enough for now
|
||||
logging.info(f"Test parameters are:\n radio = {test_cases_data[testcase]['radio']}\n ssid_name = {test_cases_data[testcase]['ssid_name']}\n ssid_psk = {test_cases_data[testcase]['ssid_psk']}\n security = {test_cases_data[testcase]['security']}\n station = {test_cases_data[testcase]['station']}\n testcase = {testcase}")
|
||||
staConnect = StaConnect2(command_line_args.lanforge_ip_address, command_line_args.lanforge_port_number, debug_ = False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = "eth2"
|
||||
staConnect.radio = test_cases_data[testcase]["radio"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = test_cases_data[testcase]["ssid_name"]
|
||||
staConnect.dut_passwd = test_cases_data[testcase]["ssid_psk"]
|
||||
staConnect.dut_security = test_cases_data[testcase]["security"]
|
||||
staConnect.station_names = test_cases_data[testcase]["station"]
|
||||
staConnect.runtime_secs = 30
|
||||
staConnect.clean_all_sta = True
|
||||
staConnect.cleanup_on_exit = True
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
logging.info(f"sleeping {staConnect.runtime_secs} seconds")
|
||||
sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
for result in staConnect.get_result_list():
|
||||
logging.info(f"test result: {result}")
|
||||
results = TESTRAIL[staConnect.passes()]
|
||||
logging.info(f"Single client connection to {test_cases_data[testcase]['ssid_name']} successful. Test {results['message']}")
|
||||
testrail.update_testrail(case_id=testcase, run_id=runId, status_id=results["statusCode"], msg=f"Test {results['message']}")
|
||||
|
||||
logging.info("----------------------")
|
||||
logging.info("End of Sanity Test run")
|
||||
logging.info("----------------------")
|
||||
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"customer_id": "2",
|
||||
"ap_models": {
|
||||
"ecw5410": {
|
||||
"id": "3",
|
||||
"firmware": "unknown",
|
||||
"info": {
|
||||
"profile_id": "6",
|
||||
"fiveG_WPA2_SSID": "skip",
|
||||
"fiveG_WPA2_PSK": "w1r3l3ss-fr33d0m",
|
||||
"fiveG_WPA_SSID": "skip",
|
||||
"fiveG_WPA_PSK": "w1r3l3ss-fr33d0m",
|
||||
"fiveG_OPEN_SSID": "skip",
|
||||
"twoFourG_OPEN_SSID": "skip",
|
||||
"twoFourG_WPA2_SSID": "TipWlan-cloud-wifi",
|
||||
"twoFourG_WPA2_PSK": "w1r3l3ss-fr33d0m",
|
||||
"twoFourG_WPA_SSID": "skip",
|
||||
"twoFourG_WPA_PSK": "w1r3l3ss-fr33d0m"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,6 @@ class APNOS:
|
||||
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
var = str(stdout.read())
|
||||
print(var)
|
||||
if var.__contains__("True"):
|
||||
allure.attach(name="openwrt_ctl Setup", body=str(var))
|
||||
print("APNOS Serial Setup OK")
|
||||
@@ -58,8 +57,8 @@ class APNOS:
|
||||
def ssh_cli_connect(self):
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
print("Connecting to jumphost: %s@%s:%s with password: %s" % (
|
||||
self.username, self.ip, self.port, self.password))
|
||||
print("Connecting to jumphost: %s@%s:%s" % (
|
||||
self.username, self.ip, self.port))
|
||||
client.connect(self.ip, username=self.username, password=self.password,
|
||||
port=self.port, timeout=10, allow_agent=False, banner_timeout=200)
|
||||
|
||||
@@ -135,6 +134,31 @@ class APNOS:
|
||||
return ssid_list
|
||||
|
||||
# Method to get the vif_state ssid's of AP using AP-CLI/ JUMPHOST-CLI
|
||||
def get_ssid_info(self):
|
||||
stdout = self.get_vif_state()
|
||||
ssid_info_list = []
|
||||
info = []
|
||||
for i in stdout.splitlines():
|
||||
ssid = str(i).replace(" ", "").split(".")
|
||||
# print(ssid)
|
||||
if ssid[0].split(":")[0] == "b'mac":
|
||||
mac_info_list = ssid[0].split(":")
|
||||
mac_info_list.pop(0)
|
||||
info.append(":".join(mac_info_list).replace("'", ""))
|
||||
if ssid[0].split(":")[0] == "b'security":
|
||||
security = ssid[0].split(":")[1].split(",")[2].replace("]", "").replace('"', "")
|
||||
info.append(security)
|
||||
security_key = ssid[0].split(":")[1].split(",")[4].replace('"', "").replace("]", "")
|
||||
info.append(security_key)
|
||||
if ssid[0].split(":")[0] == "b'ssid":
|
||||
info.append(ssid[0].split(":")[1].replace("'", ""))
|
||||
ssid_info_list.append(info)
|
||||
info = []
|
||||
print(ssid_info_list)
|
||||
# allure.attach(name="get_vif_state_ssids ", body=str(ssid_list))
|
||||
return ssid_info_list
|
||||
|
||||
# Get VIF State parameters
|
||||
def get_vif_state_ssids(self):
|
||||
stdout = self.get_vif_state()
|
||||
ssid_list = []
|
||||
@@ -255,13 +279,13 @@ class APNOS:
|
||||
if __name__ == '__main__':
|
||||
obj = {
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.230",
|
||||
'ip': "192.168.200.80",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'jumphost_tty': '/dev/ttyUSB0',
|
||||
|
||||
}
|
||||
var = APNOS(credentials=obj)
|
||||
r = var.get_redirector()
|
||||
r = var.get_ssid_info()
|
||||
print(r)
|
||||
@@ -4,6 +4,8 @@
|
||||
1. controller_data/sdk_base_url
|
||||
2. login credentials
|
||||
"""
|
||||
import base64
|
||||
import datetime
|
||||
import json
|
||||
import re
|
||||
import ssl
|
||||
@@ -12,12 +14,9 @@ import urllib
|
||||
|
||||
import requests
|
||||
import swagger_client
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from swagger_client import EquipmentGatewayApi
|
||||
from swagger_client import FirmwareManagementApi
|
||||
import allure
|
||||
|
||||
from swagger_client import EquipmentGatewayApi
|
||||
from bs4 import BeautifulSoup
|
||||
import threading
|
||||
|
||||
|
||||
@@ -88,8 +87,11 @@ class Controller(ConfigureController):
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = False
|
||||
self.disconnect = False
|
||||
self.semaphore = False
|
||||
# Token expiry in seconds
|
||||
self.token_expiry = 1000
|
||||
self.token_timestamp = time.time()
|
||||
try:
|
||||
|
||||
self.bearer = self.get_bearer_token()
|
||||
# t1 = threading.Thread(target=self.refresh_instance)
|
||||
# t1.start()
|
||||
@@ -115,57 +117,52 @@ class Controller(ConfigureController):
|
||||
return self.login_client.get_access_token(request_body)
|
||||
|
||||
def refresh_instance(self):
|
||||
# Connecting to Controller
|
||||
# while True:
|
||||
# print("Controller Refresh Thread Started")
|
||||
# for i in range(0, 800):
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# time.sleep(1)
|
||||
# if self.disconnect:
|
||||
# break
|
||||
# self.semaphore = True
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = self.get_bearer_token()
|
||||
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
self.status_client = swagger_client.StatusApi(api_client=self.api_client)
|
||||
self.equipment_client = swagger_client.EquipmentApi(self.api_client)
|
||||
self.profile_client = swagger_client.ProfileApi(self.api_client)
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
self.default_profiles = {}
|
||||
# print(self.bearer)
|
||||
if self.ping_response._application_name != 'PortalServer':
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
# self.semaphore = False
|
||||
# Refresh token 10 seconds before it's expiry
|
||||
if time.time() - self.token_timestamp > self.token_expiry:
|
||||
self.token_timestamp = time.time()
|
||||
print("Refreshing the controller API token")
|
||||
self.api_client = swagger_client.ApiClient(self.configuration)
|
||||
self.login_client = swagger_client.LoginApi(api_client=self.api_client)
|
||||
self.bearer = self.get_bearer_token()
|
||||
self.api_client.default_headers['Authorization'] = "Bearer " + self.bearer._access_token
|
||||
self.status_client = swagger_client.StatusApi(api_client=self.api_client)
|
||||
self.equipment_client = swagger_client.EquipmentApi(self.api_client)
|
||||
self.profile_client = swagger_client.ProfileApi(self.api_client)
|
||||
self.api_client.configuration.api_key_prefix = {
|
||||
"Authorization": "Bearer " + self.bearer._access_token
|
||||
}
|
||||
self.api_client.configuration.refresh_api_key_hook = self.refresh_instance
|
||||
self.ping_response = self.portal_ping()
|
||||
# print(self.bearer)
|
||||
if self.ping_response._application_name != 'PortalServer':
|
||||
print("Server not Reachable")
|
||||
exit()
|
||||
print("Connected to Controller Server")
|
||||
|
||||
def portal_ping(self):
|
||||
self.refresh_instance()
|
||||
return self.login_client.portal_ping()
|
||||
|
||||
def disconnect_Controller(self):
|
||||
self.refresh_instance()
|
||||
self.disconnect = True
|
||||
self.api_client.__del__()
|
||||
|
||||
# Returns a List of All the Equipments that are available in the cloud instances
|
||||
def get_equipment_by_customer_id(self, max_items=10):
|
||||
self.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": """ + str(max_items) + """
|
||||
}"""
|
||||
|
||||
self.refresh_instance()
|
||||
equipment_data = self.equipment_client.get_equipment_by_customer_id(customer_id=self.customer_id,
|
||||
pagination_context=pagination_context)
|
||||
return equipment_data._items
|
||||
|
||||
# check if equipment with the given equipment_id is available in cloud instance or not
|
||||
def validate_equipment_availability(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
data = self.get_equipment_by_customer_id()
|
||||
for i in data:
|
||||
if i._id == equipment_id:
|
||||
@@ -174,34 +171,38 @@ class Controller(ConfigureController):
|
||||
|
||||
# Need to be added in future
|
||||
def request_ap_reboot(self):
|
||||
self.refresh_instance()
|
||||
pass
|
||||
|
||||
# Get the equipment id, of a equipment with a serial number
|
||||
def get_equipment_id(self, serial_number=None):
|
||||
self.refresh_instance()
|
||||
equipment_data = self.get_equipment_by_customer_id(max_items=100)
|
||||
|
||||
# print(len(equipment_data))
|
||||
for equipment in equipment_data:
|
||||
print(equipment._id)
|
||||
if equipment._serial == serial_number:
|
||||
return equipment._id
|
||||
|
||||
# Get the equipment model name of a given equipment_id
|
||||
def get_model_name(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
if equipment_id is None:
|
||||
return None
|
||||
self.refresh_instance()
|
||||
data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id)
|
||||
print(str(data._details._equipment_model))
|
||||
return str(data._details._equipment_model)
|
||||
|
||||
# Needs Bug fix from swagger code generation side
|
||||
def get_ap_firmware_new_method(self, equipment_id=None):
|
||||
|
||||
self.refresh_instance()
|
||||
response = self.status_client.get_status_by_customer_equipment(customer_id=self.customer_id,
|
||||
equipment_id=equipment_id)
|
||||
print(response[2])
|
||||
|
||||
# Old Method, will be depreciated in future
|
||||
def get_ap_firmware_old_method(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
url = self.configuration.host + "/portal/status/forEquipment?customerId=" + str(
|
||||
self.customer_id) + "&equipmentId=" + str(equipment_id)
|
||||
payload = {}
|
||||
@@ -214,7 +215,7 @@ class Controller(ConfigureController):
|
||||
current_ap_fw = status_data[2]['details']['reportedSwVersion']
|
||||
# print(current_ap_fw)
|
||||
return current_ap_fw
|
||||
except Exception as e:
|
||||
except:
|
||||
current_ap_fw = "error"
|
||||
return False
|
||||
|
||||
@@ -226,11 +227,13 @@ class Controller(ConfigureController):
|
||||
"""
|
||||
|
||||
def get_current_profile_on_equipment(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
default_equipment_data = self.equipment_client.get_equipment_by_id(equipment_id=equipment_id, async_req=False)
|
||||
return default_equipment_data._profile_id
|
||||
|
||||
# Get the ssid's that are used by the equipment
|
||||
def get_ssids_on_equipment(self, equipment_id=None):
|
||||
self.refresh_instance()
|
||||
profile_id = self.get_current_profile_on_equipment(equipment_id=equipment_id)
|
||||
all_profiles = self.profile_client.get_profile_with_children(profile_id=profile_id)
|
||||
ssid_name_list = []
|
||||
@@ -241,6 +244,7 @@ class Controller(ConfigureController):
|
||||
|
||||
# Get the child ssid profiles that are used by equipment ap profile of given profile id
|
||||
def get_ssid_profiles_from_equipment_profile(self, profile_id=None):
|
||||
self.refresh_instance()
|
||||
equipment_ap_profile = self.profile_client.get_profile_by_id(profile_id=profile_id)
|
||||
ssid_name_list = []
|
||||
child_profile_ids = equipment_ap_profile.child_profile_ids
|
||||
@@ -257,10 +261,10 @@ class Controller(ConfigureController):
|
||||
create a RF Profile
|
||||
create a Radius Profile
|
||||
create ssid profiles, and add the radius profile in them, if needed (only used by eap ssid's)
|
||||
|
||||
|
||||
create equipment_ap profile, and add the rf profile and ssid profiles
|
||||
Now using push profile method, equipment_ap profile will be pushed to an AP of given equipment_id
|
||||
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -274,6 +278,7 @@ class ProfileUtility:
|
||||
if sdk_client is None:
|
||||
sdk_client = Controller(controller_data=controller_data, customer_id=customer_id)
|
||||
self.sdk_client = sdk_client
|
||||
self.sdk_client.refresh_instance()
|
||||
self.profile_client = swagger_client.ProfileApi(api_client=self.sdk_client.api_client)
|
||||
self.profile_creation_ids = {
|
||||
"ssid": [],
|
||||
@@ -285,6 +290,7 @@ class ProfileUtility:
|
||||
self.profile_ids = []
|
||||
|
||||
def cleanup_objects(self):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.profile_creation_ids = {
|
||||
"ssid": [],
|
||||
"ap": [],
|
||||
@@ -295,6 +301,7 @@ class ProfileUtility:
|
||||
self.profile_ids = []
|
||||
|
||||
def get_profile_by_name(self, profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 1000
|
||||
@@ -308,6 +315,7 @@ class ProfileUtility:
|
||||
return None
|
||||
|
||||
def get_ssid_name_by_profile_id(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
profiles = self.profile_client.get_profile_by_id(profile_id=profile_id)
|
||||
return profiles._details["ssid"]
|
||||
|
||||
@@ -326,6 +334,7 @@ class ProfileUtility:
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 100
|
||||
}"""
|
||||
self.sdk_client.refresh_instance()
|
||||
items = self.profile_client.get_profiles_by_customer_id(customer_id=self.sdk_client.customer_id,
|
||||
pagination_context=pagination_context)
|
||||
|
||||
@@ -348,6 +357,7 @@ class ProfileUtility:
|
||||
# This will delete the Profiles associated with an equipment of givwn equipment_id, and associate it to default
|
||||
# equipment_ap profile
|
||||
def delete_current_profile(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
equipment_data = self.sdk_client.equipment_client.get_equipment_by_id(equipment_id=equipment_id)
|
||||
|
||||
data = self.profile_client.get_profile_with_children(profile_id=equipment_data._profile_id)
|
||||
@@ -366,6 +376,7 @@ class ProfileUtility:
|
||||
|
||||
# This will delete all the profiles on an controller instance, except the default profiles
|
||||
def cleanup_profiles(self):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
self.get_default_profiles()
|
||||
pagination_context = """{
|
||||
@@ -398,6 +409,7 @@ class ProfileUtility:
|
||||
|
||||
# Delete any profile with the given name
|
||||
def delete_profile_by_name(self, profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 5000
|
||||
@@ -416,6 +428,7 @@ class ProfileUtility:
|
||||
# This method will set all the equipments to default equipment_ap profile, those having the profile_id passed in
|
||||
# argument
|
||||
def set_equipment_to_profile(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 5000
|
||||
@@ -436,6 +449,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def set_rf_profile(self, profile_data=None, mode=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.get_default_profiles()
|
||||
if mode == "wifi5":
|
||||
default_profile = self.default_profiles['rf']
|
||||
@@ -475,6 +489,7 @@ class ProfileUtility:
|
||||
|
||||
# Open
|
||||
def create_open_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -498,6 +513,8 @@ class ProfileUtility:
|
||||
|
||||
# wpa personal
|
||||
def create_wpa_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
self.get_default_profiles()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -520,6 +537,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa2 personal
|
||||
def create_wpa2_personal_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -543,6 +561,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 personal
|
||||
def create_wpa3_personal_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -566,6 +585,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 personal mixed mode
|
||||
def create_wpa3_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -589,6 +609,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa wpa2 personal mixed mode
|
||||
def create_wpa_wpa2_personal_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -610,14 +631,14 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa enterprise
|
||||
# wpa enterprise done
|
||||
def create_wpa_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
@@ -634,8 +655,9 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa wpa2 enterprise mixed mode
|
||||
# wpa wpa2 enterprise mixed mode done
|
||||
def create_wpa_wpa2_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -648,7 +670,7 @@ class ProfileUtility:
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details["radiusServiceId"] = self.profile_creation_ids["radius"][0]
|
||||
default_profile._child_profile_ids = self.profile_creation_ids["radius"]
|
||||
default_profile._details['secureMode'] = 'wpa2OnlyRadius'
|
||||
default_profile._details['secureMode'] = 'wpa2Radius'
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
@@ -660,6 +682,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa2 enterprise mode ssid profile
|
||||
def create_wpa2_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -684,6 +707,7 @@ class ProfileUtility:
|
||||
|
||||
# wpa3 enterprise mode
|
||||
def create_wpa3_enterprise_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -705,8 +729,9 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa3 enterprise mixed mode
|
||||
# wpa3 enterprise mixed mode done
|
||||
def create_wpa3_enterprise_mixed_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
@@ -728,11 +753,54 @@ class ProfileUtility:
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
# wpa3 enterprise mixed mode done
|
||||
def create_wep_ssid_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
try:
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['ssid']
|
||||
default_profile._details['appliedRadios'] = profile_data["appliedRadios"]
|
||||
default_profile._name = profile_data['profile_name']
|
||||
default_profile._details['vlanId'] = profile_data['vlan']
|
||||
default_profile._details['ssid'] = profile_data['ssid_name']
|
||||
default_profile._details['forwardMode'] = profile_data['mode']
|
||||
default_profile._details['secureMode'] = 'wep'
|
||||
default_profile._details['wepConfig'] = {}
|
||||
default_profile._details['wepConfig']["model_type"] = "WepConfiguration"
|
||||
default_profile._details['wepConfig']["wepAuthType"] = "open"
|
||||
default_profile._details['wepConfig']["primaryTxKeyId"] = profile_data["default_key_id"]
|
||||
default_profile._details['wepConfig']["wepKeys"] = [{'model_type': 'WepKey',
|
||||
'txKey': profile_data["wep_key"],
|
||||
'txKeyConverted': None,
|
||||
'txKeyType': 'wep64'},
|
||||
{'model_type': 'WepKey',
|
||||
'txKey': profile_data["wep_key"],
|
||||
'txKeyConverted': None,
|
||||
'txKeyType': 'wep64'},
|
||||
{'model_type': 'WepKey',
|
||||
'txKey': profile_data["wep_key"],
|
||||
'txKeyConverted': None,
|
||||
'txKeyType': 'wep64'},
|
||||
{'model_type': 'WepKey',
|
||||
'txKey': profile_data["wep_key"],
|
||||
'txKeyConverted': None,
|
||||
'txKeyType': 'wep64'}]
|
||||
profile = self.profile_client.create_profile(body=default_profile)
|
||||
profile_id = profile._id
|
||||
self.profile_creation_ids['ssid'].append(profile_id)
|
||||
self.profile_ids.append(profile_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
profile = False
|
||||
return profile
|
||||
|
||||
"""
|
||||
method call: used to create a ap profile that contains the given ssid profiles
|
||||
"""
|
||||
|
||||
def set_ap_profile(self, profile_data=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_data is None:
|
||||
return False
|
||||
default_profile = self.default_profiles['equipment_ap_2_radios']
|
||||
@@ -754,8 +822,10 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def create_radius_profile(self, radius_info=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
default_profile = self.default_profiles['radius']
|
||||
default_profile._name = radius_info['name']
|
||||
default_profile._details['primaryRadiusAuthServer'] = {}
|
||||
default_profile._details['primaryRadiusAuthServer']['ipAddress'] = radius_info['ip']
|
||||
default_profile._details['primaryRadiusAuthServer']['port'] = radius_info['port']
|
||||
default_profile._details['primaryRadiusAuthServer']['secret'] = radius_info['secret']
|
||||
@@ -765,12 +835,12 @@ class ProfileUtility:
|
||||
return default_profile
|
||||
|
||||
"""
|
||||
|
||||
method to push the profile to the given equipment
|
||||
"""
|
||||
|
||||
# Under a Bug, depreciated until resolved, should be used primarily
|
||||
def push_profile(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
pagination_context = """{
|
||||
"model_type": "PaginationContext",
|
||||
"maxItemsPerPage": 100
|
||||
@@ -785,6 +855,7 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def update_ssid_name(self, profile_name=None, new_profile_name=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if profile_name is None:
|
||||
print("profile name is None, Please specify the ssid profile name that you want to modify")
|
||||
return False
|
||||
@@ -805,11 +876,13 @@ class ProfileUtility:
|
||||
"""
|
||||
|
||||
def delete_profile(self, profile_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
for i in profile_id:
|
||||
self.profile_client.delete_profile(profile_id=i)
|
||||
|
||||
# Need to be depreciated by using push_profile method
|
||||
def push_profile_old_method(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if equipment_id is None:
|
||||
return 0
|
||||
url = self.sdk_client.configuration.host + "/portal/equipment?equipmentId=" + str(equipment_id)
|
||||
@@ -828,53 +901,8 @@ class ProfileUtility:
|
||||
return response
|
||||
|
||||
|
||||
"""
|
||||
JfrogUtility base class used for FirmwareUtility for Artifactory Management
|
||||
Used for getting the latest firmware image
|
||||
credentials required are as follows:
|
||||
username
|
||||
password
|
||||
jfrog-base-url
|
||||
build [pending]
|
||||
branch [dev, trunk]
|
||||
"""
|
||||
|
||||
|
||||
class JFrogUtility:
|
||||
|
||||
def __init__(self, credentials=None):
|
||||
if credentials is None:
|
||||
exit()
|
||||
self.jfrog_url = credentials["jfrog-base-url"]
|
||||
self.build = credentials["build"]
|
||||
self.branch = credentials["branch"]
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
|
||||
def get_build(self, model=None, version=None):
|
||||
jfrog_url = self.jfrog_url + "/" + model + "/" + self.branch + "/"
|
||||
|
||||
''' FIND THE LATEST FILE NAME'''
|
||||
print(jfrog_url)
|
||||
req = urllib.request.Request(jfrog_url)
|
||||
response = urllib.request.urlopen(req)
|
||||
# print(response)
|
||||
html = response.read()
|
||||
soup = BeautifulSoup(html, features="html.parser")
|
||||
if self.branch == "trunk":
|
||||
self.build = model
|
||||
last_link = soup.find_all('a', href=re.compile(self.build))
|
||||
latest_fw = None
|
||||
for i in last_link:
|
||||
|
||||
if str(i['href']).__contains__(version):
|
||||
latest_fw = i['href']
|
||||
|
||||
latest_fw = latest_fw.replace('.tar.gz', '')
|
||||
print("Using Firmware Image: ", latest_fw)
|
||||
return latest_fw
|
||||
|
||||
|
||||
"""
|
||||
FirmwareUtility class
|
||||
uses JfrogUtility base class
|
||||
sdk_client [ controller_tests instance ]
|
||||
@@ -883,75 +911,71 @@ class JFrogUtility:
|
||||
"""
|
||||
|
||||
|
||||
class FirmwareUtility(JFrogUtility):
|
||||
class FirmwareUtility:
|
||||
|
||||
def __init__(self,
|
||||
sdk_client=None,
|
||||
jfrog_credentials=None,
|
||||
controller_data=None,
|
||||
customer_id=None,
|
||||
customer_id=2,
|
||||
model=None,
|
||||
version=None):
|
||||
super().__init__(credentials=jfrog_credentials)
|
||||
version_url=None):
|
||||
# super().__init__(credentials=jfrog_credentials)
|
||||
if sdk_client is None:
|
||||
sdk_client = Controller(controller_data=controller_data, customer_id=customer_id)
|
||||
self.sdk_client = sdk_client
|
||||
self.sdk_client.refresh_instance()
|
||||
self.firmware_client = FirmwareManagementApi(api_client=sdk_client.api_client)
|
||||
self.jfrog_client = JFrogUtility(credentials=jfrog_credentials)
|
||||
# self.jfrog_client = JFrogUtility(credentials=jfrog_credentials)
|
||||
self.equipment_gateway_client = EquipmentGatewayApi(api_client=sdk_client.api_client)
|
||||
self.model = model
|
||||
self.fw_version = version
|
||||
self.fw_version = version_url
|
||||
|
||||
def get_fw_version(self):
|
||||
# Get The equipment model
|
||||
self.latest_fw = self.get_build(model=self.model, version=self.fw_version)
|
||||
# print("shivam", self.latest_fw)
|
||||
return self.latest_fw
|
||||
fw_version = self.fw_version.split("/")[-1]
|
||||
return fw_version
|
||||
|
||||
def upload_fw_on_cloud(self, fw_version=None, force_upload=False):
|
||||
print("Upload fw version :", fw_version)
|
||||
# force_upload = True
|
||||
# if fw_latest available and force upload is False -- Don't upload
|
||||
# if fw_latest available and force upload is True -- Upload
|
||||
# if fw_latest is not available -- Upload
|
||||
def upload_fw_on_cloud(self, force_upload=False):
|
||||
self.sdk_client.refresh_instance()
|
||||
fw_version = self.fw_version.split("/")[-1]
|
||||
print("Upload fw version :", self.fw_version)
|
||||
fw_id = self.is_fw_available(fw_version=fw_version)
|
||||
if fw_id and not force_upload:
|
||||
print("Firmware Version Already Available, Skipping upload", "Force Upload :", force_upload)
|
||||
print("Skipping upload, Firmware Already Available", "Force Upload :", force_upload)
|
||||
# Don't Upload the fw
|
||||
return fw_id
|
||||
else:
|
||||
if fw_id and force_upload:
|
||||
print("Firmware Version Already Available, Deleting and Uploading Again")
|
||||
print("Firmware Version Already Available, Deleting and Uploading Again",
|
||||
" Force Upload :", force_upload)
|
||||
self.firmware_client.delete_firmware_version(firmware_version_id=fw_id)
|
||||
print("Force Upload :", force_upload, " Deleted current Image")
|
||||
print("Deleted Firmware Image from cloud, uploading again")
|
||||
time.sleep(2)
|
||||
# if force_upload is true and latest image available, then delete the image
|
||||
firmware_data = {
|
||||
"id": 0,
|
||||
"equipmentType": "AP",
|
||||
"modelId": fw_version.split("-")[0],
|
||||
"versionName": fw_version + ".tar.gz",
|
||||
"modelId": str(self.model).upper(),
|
||||
"versionName": fw_version,
|
||||
"description": fw_version + " FW VERSION",
|
||||
"filename": self.jfrog_url + "/" + self.model + "/" + self.branch + "/" + fw_version + ".tar.gz",
|
||||
"filename": self.fw_version,
|
||||
}
|
||||
print(firmware_data["filename"])
|
||||
firmware_id = self.firmware_client.create_firmware_version(body=firmware_data)
|
||||
print("Force Upload :", force_upload, " Uploaded the Image")
|
||||
print("Uploaded the Image: ", fw_version)
|
||||
return firmware_id._id
|
||||
|
||||
def upgrade_fw(self, equipment_id=None, force_upgrade=False, force_upload=False):
|
||||
self.sdk_client.refresh_instance()
|
||||
if equipment_id is None:
|
||||
print("No Equipment Id Given")
|
||||
exit()
|
||||
if (force_upgrade is True) or (self.should_upgrade_ap_fw(equipment_id=equipment_id)):
|
||||
model = self.sdk_client.get_model_name(equipment_id=equipment_id).lower()
|
||||
latest_fw = self.get_fw_version()
|
||||
firmware_id = self.upload_fw_on_cloud(fw_version=latest_fw, force_upload=force_upload)
|
||||
firmware_id = self.upload_fw_on_cloud(force_upload=force_upload)
|
||||
print(firmware_id)
|
||||
time.sleep(5)
|
||||
try:
|
||||
obj = self.equipment_gateway_client.request_firmware_update(equipment_id=equipment_id,
|
||||
firmware_version_id=firmware_id)
|
||||
|
||||
print("Request firmware upgrade Success! waiting for 300 sec")
|
||||
time.sleep(300)
|
||||
except Exception as e:
|
||||
@@ -961,6 +985,7 @@ class FirmwareUtility(JFrogUtility):
|
||||
# Write the upgrade fw logic here
|
||||
|
||||
def should_upgrade_ap_fw(self, equipment_id=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
current_fw = self.sdk_client.get_ap_firmware_old_method(equipment_id=equipment_id)
|
||||
latest_fw = self.get_fw_version()
|
||||
print(self.model, current_fw, latest_fw)
|
||||
@@ -970,11 +995,12 @@ class FirmwareUtility(JFrogUtility):
|
||||
return True
|
||||
|
||||
def is_fw_available(self, fw_version=None):
|
||||
self.sdk_client.refresh_instance()
|
||||
if fw_version is None:
|
||||
exit()
|
||||
try:
|
||||
firmware_version = self.firmware_client.get_firmware_version_by_name(
|
||||
firmware_version_name=fw_version + ".tar.gz")
|
||||
firmware_version_name=fw_version)
|
||||
firmware_version = firmware_version._id
|
||||
print("Firmware ID: ", firmware_version)
|
||||
except Exception as e:
|
||||
@@ -984,23 +1010,28 @@ class FirmwareUtility(JFrogUtility):
|
||||
return firmware_version
|
||||
|
||||
|
||||
# This is for Unit tests on Controller Library
|
||||
if __name__ == '__main__':
|
||||
"""
|
||||
Examples to Try Out
|
||||
"""
|
||||
controller = {
|
||||
'url': "https://wlan-portal-svc-nola-ext-03.cicd.lab.wlan.tip.build", # API base url for the controller
|
||||
'url': "https://wlan-portal-svc-nola-01.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-04-27"
|
||||
}
|
||||
sdk_client = Controller(controller_data=controller)
|
||||
# Use Library/ Method Here
|
||||
sdk_client.disconnect_Controller()
|
||||
api = Controller(controller_data=controller)
|
||||
profile = ProfileUtility(sdk_client=api)
|
||||
# print(profile.get_profile_by_name(profile_name="basic-ext-03-03-SSID-open-0-VLAN"))
|
||||
profile.get_default_profiles()
|
||||
# profile = ProfileUtility(sdk_client=api)
|
||||
# profile.get_default_profiles()
|
||||
# profile_data = {
|
||||
# "profile_name": "ssid_wep_2g",
|
||||
# "ssid_name": "ssid_wep_2g",
|
||||
# "appliedRadios": ["is2dot4GHz"],
|
||||
# "default_key_id" : 1,
|
||||
# "wep_key" : 1234567890,
|
||||
# "vlan": 1,
|
||||
# "mode": "BRIDGE"
|
||||
# }
|
||||
# profile.create_wep_ssid_profile(profile_data=profile_data)
|
||||
# print(profile.get_profile_by_name(profile_name="wpa_wpa2_eap"))
|
||||
# profile.get_default_profiles()
|
||||
api.disconnect_Controller()
|
||||
|
||||
|
||||
@@ -25,24 +25,33 @@ import time
|
||||
# from eap_connect import EAPConnect
|
||||
from test_ipv4_ttls import TTLSTest
|
||||
from lf_wifi_capacity_test import WiFiCapacityTest
|
||||
from create_station import CreateStation
|
||||
import lf_dataplane_test
|
||||
from lf_dataplane_test import DataplaneTest
|
||||
|
||||
|
||||
class RunTest:
|
||||
|
||||
def __init__(self, lanforge_data=None, debug=False):
|
||||
def __init__(self, lanforge_data=None, local_report_path="../reports/", debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
self.upstream_port = lanforge_data["upstream"]
|
||||
self.upstream_port = lanforge_data["upstream"].split(".")[2]
|
||||
self.twog_prefix = lanforge_data["2.4G-Station-Name"]
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.debug = debug
|
||||
self.lf_ssh_port = lanforge_data["ssh_port"]
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=debug)
|
||||
self.dataplane_obj = None
|
||||
self.local_report_path = local_report_path
|
||||
if not os.path.exists(self.local_report_path):
|
||||
os.mkdir(self.local_report_path)
|
||||
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", station_name=[],
|
||||
def Client_Connectivity(self, ssid="[BLANK]", passkey="[BLANK]", security="open", extra_securities=[],
|
||||
station_name=[],
|
||||
mode="BRIDGE", vlan_id=1, band="twog"):
|
||||
'''SINGLE CLIENT CONNECTIVITY using test_connect2.py'''
|
||||
self.staConnect.sta_mode = 0
|
||||
@@ -68,7 +77,7 @@ class RunTest:
|
||||
self.staConnect.bringup_time_sec = 60
|
||||
self.staConnect.cleanup_on_exit = True
|
||||
# self.staConnect.cleanup()
|
||||
self.staConnect.setup()
|
||||
self.staConnect.setup(extra_securities=extra_securities)
|
||||
self.staConnect.start()
|
||||
print("napping %f sec" % self.staConnect.runtime_secs)
|
||||
time.sleep(self.staConnect.runtime_secs)
|
||||
@@ -87,8 +96,8 @@ class RunTest:
|
||||
time.sleep(3)
|
||||
return self.staConnect.passes(), result
|
||||
|
||||
|
||||
def EAP_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog", vlan_id=100,
|
||||
def EAP_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", extra_securities=[],
|
||||
mode="BRIDGE", band="twog", vlan_id=100,
|
||||
station_name=[], key_mgmt="WPA-EAP",
|
||||
pairwise="NA", group="NA", wpa_psk="DEFAULT",
|
||||
ttls_passwd="nolastart",
|
||||
@@ -99,11 +108,14 @@ class RunTest:
|
||||
self.eap_connect.station_profile.sta_mode = 0
|
||||
self.eap_connect.upstream_resource = 1
|
||||
if mode == "BRIDGE":
|
||||
self.eap_connect.upstream_port = self.upstream_port
|
||||
self.eap_connect.l3_cx_obj_udp.upstream = self.upstream_port
|
||||
self.eap_connect.l3_cx_obj_tcp.upstream = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.eap_connect.upstream_port = self.upstream_port
|
||||
self.eap_connect.l3_cx_obj_udp.upstream = self.upstream_port
|
||||
self.eap_connect.l3_cx_obj_tcp.upstream = self.upstream_port
|
||||
else:
|
||||
self.eap_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
self.eap_connect.l3_cx_obj_udp.upstream = self.upstream_port + "." + str(vlan_id)
|
||||
self.eap_connect.l3_cx_obj_tcp.upstream = self.upstream_port + "." + str(vlan_id)
|
||||
if band == "twog":
|
||||
self.eap_connect.radio = self.twog_radios[0]
|
||||
# self.eap_connect.sta_prefix = self.twog_prefix
|
||||
@@ -128,7 +140,7 @@ class RunTest:
|
||||
self.eap_connect.password = passkey
|
||||
self.eap_connect.security = security
|
||||
self.eap_connect.sta_list = station_name
|
||||
self.eap_connect.build()
|
||||
self.eap_connect.build(extra_securities=extra_securities)
|
||||
self.eap_connect.start(station_name, True, True)
|
||||
self.eap_connect.stop()
|
||||
self.eap_connect.cleanup(station_name)
|
||||
@@ -157,6 +169,76 @@ class RunTest:
|
||||
result = True
|
||||
return result
|
||||
|
||||
def Client_Connect(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", band="twog",
|
||||
vlan_id=100,
|
||||
station_name=[]):
|
||||
|
||||
self.client_connect = CreateStation(_host=self.lanforge_ip, _port=self.lanforge_port,
|
||||
_sta_list=station_name, _password=passkey, _ssid=ssid, _security=security)
|
||||
|
||||
self.client_connect.station_profile.sta_mode = 0
|
||||
self.client_connect.upstream_resource = 1
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
else:
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
if band == "twog":
|
||||
self.client_connect.radio = self.twog_radios[0]
|
||||
# self.client_connect.sta_prefix = self.twog_prefix
|
||||
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._pass("ALL Stations got IP's", print_=True)
|
||||
return self.client_connect
|
||||
else:
|
||||
return False
|
||||
|
||||
def Client_disconnect(self, station_name=[]):
|
||||
self.client_dis = CreateStation(_host=self.lanforge_ip, _port=self.lanforge_port,
|
||||
_sta_list=station_name, _password="passkey", _ssid="ssid", _security="security")
|
||||
self.client_dis.station_profile.cleanup(station_name)
|
||||
return True
|
||||
|
||||
def dataplane(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
|
||||
upload_rate="85%", duration="1m", instance_name="test_demo"):
|
||||
if mode == "BRIDGE":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
elif mode == "NAT":
|
||||
self.client_connect.upstream_port = self.upstream_port
|
||||
else:
|
||||
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
|
||||
|
||||
self.dataplane_obj = DataplaneTest(lf_host=self.lanforge_ip,
|
||||
lf_port=self.lanforge_port,
|
||||
ssh_port=self.lf_ssh_port,
|
||||
local_path=self.local_report_path,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name=instance_name,
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + self.upstream_port,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed=download_rate,
|
||||
upload_speed=upload_rate,
|
||||
duration=duration,
|
||||
dut=dut_name,
|
||||
station="1.1." + station_name[0],
|
||||
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"],
|
||||
)
|
||||
self.dataplane_obj.setup()
|
||||
self.dataplane_obj.run()
|
||||
return self.dataplane_obj
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lanforge_data = {
|
||||
"ip": "192.168.200.81",
|
||||
@@ -164,11 +246,11 @@ if __name__ == '__main__':
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "eth1",
|
||||
"upstream": "1.1.eth1",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax",
|
||||
}
|
||||
obj = RunTest(lanforge_data=lanforge_data, debug=False)
|
||||
# print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip"))
|
||||
obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
# obj.EAP_Connect(station_name=["sta0000", "sta0001"], eap="TTLS", ssid="testing_radius")
|
||||
|
||||
94
libs/lanforge/lf_tools.py
Normal file
94
libs/lanforge/lf_tools.py
Normal file
@@ -0,0 +1,94 @@
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
import time
|
||||
from LANforge.lfcli_base import LFCliBase
|
||||
|
||||
|
||||
class ChamberView:
|
||||
|
||||
def __init__(self, lanforge_data=None, access_point_data=None, debug=False, testbed=None):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
self.upstream_port = lanforge_data["upstream"]
|
||||
self.twog_prefix = lanforge_data["2.4G-Station-Name"]
|
||||
self.fiveg_prefix = lanforge_data["5G-Station-Name"]
|
||||
self.ax_prefix = lanforge_data["AX-Station-Name"]
|
||||
self.uplink_port = lanforge_data["uplink"] # eth2
|
||||
self.upstream_subnet = lanforge_data["upstream_subnet"]
|
||||
self.testbed = testbed
|
||||
self.upstream_resources = self.upstream_port.split(".")[0] + "." + self.upstream_port.split(".")[1]
|
||||
self.uplink_resources = self.uplink_port.split(".")[0] + "." + self.uplink_port.split(".")[1]
|
||||
self.delete_old_scenario = True
|
||||
# For chamber view
|
||||
self.scenario_name = "TIP-" + self.testbed
|
||||
|
||||
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"]
|
||||
]
|
||||
# This is for rawline input | see create_chamberview_dut.py for more details
|
||||
|
||||
self.CreateChamberview = CreateChamberview(self.lanforge_ip, self.lanforge_port)
|
||||
|
||||
if access_point_data:
|
||||
# for DUT
|
||||
self.dut_name = testbed
|
||||
self.ap_model = access_point_data[0]["model"]
|
||||
self.version = access_point_data[0]["version"].split("/")[-1]
|
||||
self.serial = access_point_data[0]["serial"]
|
||||
|
||||
self.CreateDut = DUT(lfmgr=self.lanforge_ip,
|
||||
port=self.lanforge_port,
|
||||
dut_name=self.testbed,
|
||||
sw_version=self.version,
|
||||
hw_version=self.ap_model,
|
||||
model_num=self.ap_model,
|
||||
serial_num=self.serial
|
||||
)
|
||||
self.CreateDut.ssid = []
|
||||
|
||||
|
||||
|
||||
def Chamber_View(self):
|
||||
if self.delete_old_scenario:
|
||||
self.CreateChamberview.clean_cv_scenario(type="Network-Connectivity", scenario_name=self.scenario_name)
|
||||
self.CreateChamberview.setup(create_scenario=self.scenario_name,
|
||||
raw_line=self.raw_line
|
||||
)
|
||||
self.CreateChamberview.build(self.scenario_name)
|
||||
self.CreateChamberview.sync_cv()
|
||||
time.sleep(2)
|
||||
self.CreateChamberview.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateChamberview.sync_cv()
|
||||
return self.CreateChamberview, self.scenario_name
|
||||
|
||||
|
||||
def Create_Dut(self):
|
||||
self.CreateDut.setup()
|
||||
self.CreateDut.add_ssids()
|
||||
self.CreateDut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateDut.cv_test.sync_cv()
|
||||
time.sleep(2)
|
||||
self.CreateDut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
self.CreateDut.cv_test.sync_cv()
|
||||
return self.CreateDut, self.dut_name
|
||||
|
||||
def update_ssid(self, ssid_data=[]):
|
||||
self.CreateDut.ssid = ssid_data
|
||||
self.CreateDut.add_ssids()
|
||||
# SSID data should be in this format
|
||||
# [
|
||||
# ['ssid_idx=0 ssid=Default-SSID-2g security=WPA|WEP| password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
# ['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
# ]
|
||||
pass
|
||||
|
||||
def json_get(self,_req_url="/"):
|
||||
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
|
||||
@@ -1 +0,0 @@
|
||||
## Perfecto libraries
|
||||
2
libs/perfecto_libs/README.md
Normal file
2
libs/perfecto_libs/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
## Perfecto libraries
|
||||
#Initial Check in - Raj
|
||||
34
libs/perfecto_libs/android_lib.py
Normal file
34
libs/perfecto_libs/android_lib.py
Normal file
@@ -0,0 +1,34 @@
|
||||
# !/usr/local/lib64/python3.8
|
||||
"""
|
||||
Controller Library
|
||||
1. controller_data/sdk_base_url
|
||||
2. login credentials
|
||||
"""
|
||||
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
|
||||
|
||||
def openApp(appName, setup_perfectoMobile):
|
||||
print("Refreshing App: " + appName)
|
||||
setup_perfectoMobile[1].step_start("Opening App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
#Open/Close/Open Action is performed to ensure the app is back to its Original Settings
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
|
||||
|
||||
def closeApp(appName, setup_perfectoMobile):
|
||||
print("Closing App.." + appName)
|
||||
setup_perfectoMobile[1].step_start("Closing App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
|
||||
|
||||
494
libs/perfecto_libs/iOS_lib.py
Normal file
494
libs/perfecto_libs/iOS_lib.py
Normal file
@@ -0,0 +1,494 @@
|
||||
# !/usr/local/lib64/python3.8
|
||||
"""
|
||||
Controller Library
|
||||
1. controller_data/sdk_base_url
|
||||
2. login credentials
|
||||
"""
|
||||
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
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
from appium.webdriver.common.mobileby import MobileBy
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
|
||||
|
||||
def openApp(appName, setup_perfectoMobile):
|
||||
#print("Refreshing App: " + appName)
|
||||
setup_perfectoMobile[1].step_start("Opening App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
#Open/Close/Open Action is performed to ensure the app is back to its Original Settings
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:open', params)
|
||||
|
||||
def closeApp(appName, setup_perfectoMobile):
|
||||
#print("Closing App.." + appName)
|
||||
setup_perfectoMobile[1].step_start("Closing App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
|
||||
def rebootPhone(setup_perfectoMobile):
|
||||
#print("Closing App.." + appName)
|
||||
setup_perfectoMobile[1].step_start("Rebooting Phone...")
|
||||
params = {}
|
||||
setup_perfectoMobile[0].execute_script('mobile:handset:reboot', params)
|
||||
|
||||
def set_APconnMobileDevice_iOS(WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
|
||||
print("Verifying Wifi/AP Connection Details....")
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
contexts = driver.contexts
|
||||
#print(contexts)
|
||||
|
||||
driver.switch_to.context(contexts[0])
|
||||
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
#Open Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Verifying Connected Wifi Connection")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - UpdateXpath")
|
||||
#NEED to fail if Wifi AP NAME isn't in the approved list AKA 5g & 2g.
|
||||
#print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
#print("Wifi Name Matches - Already Connected To: " + WifiName)
|
||||
|
||||
if Wifi_AP_Name.__eq__(WifiName):
|
||||
print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
report.step_start("Verify Wifi Connection Status..")
|
||||
#print("Click Wifi Connection..")
|
||||
element.click()
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
#print("Verify Wifi Connection Status..")
|
||||
report.step_start("Verify Wifi Connected Status")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ Wifi_AP_Name + "']"
|
||||
elementWifName = driver.find_element_by_xpath(WifiXpath)
|
||||
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error..")
|
||||
report.step_start("Checking Internet Connection Error..")
|
||||
|
||||
try:
|
||||
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
|
||||
|
||||
else:
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
#try:
|
||||
report.step_start("Selecting Wifi...: " + WifiName)
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element.click()
|
||||
# except NoSuchElementException:
|
||||
# print("Exception: Selection Wifi Network")
|
||||
|
||||
try:
|
||||
wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
|
||||
wifiXpath2.click()
|
||||
|
||||
except NoSuchElementException:
|
||||
print("\n Can't find Wifi/AP NAME.....CheckXpath & Wifi Name")
|
||||
|
||||
#Set password if Needed
|
||||
try:
|
||||
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
|
||||
wifiPassword.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Enter Password Page Not Loaded ")
|
||||
|
||||
try:
|
||||
joinBTN = driver.find_element_by_xpath("//*[@label='Join']")
|
||||
joinBTN.click()
|
||||
except NoSuchElementException:
|
||||
print("Join Button Not Enabled...Verify if Password is set properly ")
|
||||
|
||||
try:
|
||||
WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
print("No Wifi-AP Error Internet Error: " + WifiName)
|
||||
|
||||
def Toggle_AirplaneMode_iOS(setup_perfectoMobile, connData):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
currentResult = True
|
||||
|
||||
#Open Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
#Toggle Airplane Mode
|
||||
print("Toggle Airplane Mode..")
|
||||
report.step_start("Toggle Airplane Mode")
|
||||
try:
|
||||
AirplaneMode = driver.find_element_by_xpath("//XCUIElementTypeSwitch[@label='Airplane Mode']")
|
||||
#Toggle Airplane Mode
|
||||
AirplaneMode.click()
|
||||
|
||||
#Verify Cellular Mode Text
|
||||
report.step_start("Verify Cellular Mode")
|
||||
try:
|
||||
CellularMsgEle = driver.find_element_by_xpath("//*[@name='Airplane Mode' and @value='Airplane Mode']")
|
||||
#ssertEqual(CellularMsgEle.text, "Airplane Mode", "Airplane Mode Not Triggerd")
|
||||
print("Verify Cellular Mode Text: Airplane Mode Success")
|
||||
except NoSuchElementException:
|
||||
currentResult = False
|
||||
print("Cellular Mode Not in Airplane Mode: ERROR")
|
||||
|
||||
#Set Airplane Mode Back
|
||||
AirplaneMode.click()
|
||||
except NoSuchElementException:
|
||||
currentResult = False
|
||||
print("Airplane Wifi Button not loaded...")
|
||||
|
||||
#Verify No Sim Card Installed Msg Popup
|
||||
report.step_start("Verify No Sim Card Installed Msg Popup")
|
||||
print("Verify No Sim Card Installed Msg Popup..")
|
||||
try:
|
||||
NoSimCardErrorMsg = driver.find_element_by_xpath("//*[@value='No SIM Card Installed']")
|
||||
except NoSuchElementException:
|
||||
print("No Sim Card AlertMsg")
|
||||
|
||||
#Click ok on No Sim Card Msg Popup
|
||||
print("Click ok on No Sim Card Msg Popup..")
|
||||
report.step_start("Click ok on No Sim Card Msg Popup")
|
||||
try:
|
||||
NoSimCardErrorMsgOK = driver.find_element_by_xpath("//*[@label='OK']")
|
||||
NoSimCardErrorMsgOK.click()
|
||||
except NoSuchElementException:
|
||||
print("No Sim Card AlertMsg")
|
||||
|
||||
return currentResult
|
||||
|
||||
def verify_APconnMobileDevice_iOS(WifiName, setup_perfectoMobile, connData):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Verifying WifiName: " + WifiName)
|
||||
|
||||
#Refresh Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
#Verifies if AP is connected to Wifi status
|
||||
try:
|
||||
# print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Verifying Connected Wifi Connection")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - UpdateXpath")
|
||||
|
||||
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
|
||||
|
||||
def ForgetWifiConnection(setup_perfectoMobile, wifiName, connData):
|
||||
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
|
||||
print(contexts)
|
||||
|
||||
report.step_start("Forget Existing Wifi")
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
# 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
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - UpdateXpath")
|
||||
|
||||
if Wifi_AP_Name.__eq__(wifiName):
|
||||
print("Wifi Name Matches Connected To: " + Wifi_AP_Name)
|
||||
element.click()
|
||||
|
||||
print("More Info on Wifi: " + Wifi_AP_Name)
|
||||
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 PopUp: " + Wifi_AP_Name)
|
||||
report.step_start("Forget Wifi Network PopUp Confirm")
|
||||
WifiXpathForgetWifi = "//*[@label='Forget']"
|
||||
elementforgetWifi = driver.find_element_by_xpath(WifiXpathForgetWifi)
|
||||
elementforgetWifi.click()
|
||||
|
||||
else:
|
||||
print("Connected To: " + Wifi_AP_Name)
|
||||
print("Initial Wifi: " + wifiName)
|
||||
element.click()
|
||||
|
||||
report.step_start("Click on More Info on Wifi")
|
||||
WifiXpathMoreInfo = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ wifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
|
||||
elementMoreInfo = driver.find_element_by_xpath(WifiXpathMoreInfo)
|
||||
elementMoreInfo.click()
|
||||
|
||||
print("Forget Wifi Network " + wifiName)
|
||||
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()
|
||||
|
||||
def Toggle_WifiMode_iOS(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:
|
||||
WifiMode = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
|
||||
#Toggle Wifi Mode
|
||||
WifiMode.click()
|
||||
#Verify Radio Button Mode
|
||||
try:
|
||||
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")
|
||||
except NoSuchElementException:
|
||||
print("Wifi Radio Button Not Disabled...")
|
||||
|
||||
#Set Airplane Mode Back
|
||||
WifiDissconnected.click()
|
||||
print("Wifi Radio Button Toggled to Enabled")
|
||||
except NoSuchElementException:
|
||||
print("Airplane Wifi Button not loaded...")
|
||||
|
||||
def get_WifiIPAddress_iOS(setup_perfectoMobile, connData, wifiName):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
# print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Loading Wifi Page")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - unable to click on Wifi")
|
||||
|
||||
report.step_start("Wifi Page")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ wifiName + "']"
|
||||
elementWifName = driver.find_element_by_xpath(WifiXpath)
|
||||
#Check AP Internet Error Msg
|
||||
print("Checking Internet Connection Error...")
|
||||
report.step_start("Checking Internet Connection Error..")
|
||||
|
||||
try:
|
||||
driver.implicitly_wait(5)
|
||||
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
|
||||
except NoSuchElementException:
|
||||
#Need to fail test case
|
||||
driver.implicitly_wait(25)
|
||||
print("Wifi Connected without any errors: " + wifiName)
|
||||
#Fail TEST CASE
|
||||
|
||||
try:
|
||||
WifiInternetInfo=driver.find_element_by_xpath("(//XCUIElementTypeButton[@label='More Info'])[1]")
|
||||
WifiInternetInfo.click()
|
||||
except NoSuchElementException:
|
||||
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||
|
||||
try:
|
||||
WifiIPaddress= driver.find_element_by_xpath("(//*[@label='Router']/parent::*/XCUIElementTypeStaticText)[2]").text
|
||||
return WifiIPaddress
|
||||
except NoSuchElementException:
|
||||
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||
|
||||
return None
|
||||
|
||||
def ping_deftapps_iOS(setup_perfectoMobile, AP_IPaddress):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Pinging deftapps....")
|
||||
try:
|
||||
pingHost = "//*[@value='<Hostname or IP address>']"
|
||||
element2 = driver.find_element_by_xpath(pingHost)
|
||||
element2.clear()
|
||||
#element2.send_keys(AP_IPaddress)
|
||||
element2.send_keys("8.8.8.8")
|
||||
|
||||
#Ping Enable
|
||||
report.step_start("Pingin Host")
|
||||
print("Pingin Host..")
|
||||
element3 = driver.find_element_by_xpath("//*[@label='go']")
|
||||
element3.click()
|
||||
|
||||
time.sleep(10)
|
||||
|
||||
#handle any popup
|
||||
|
||||
report.step_start("Stop Ping Host")
|
||||
print("Stop Ping Host..")
|
||||
element4 = driver.find_element_by_xpath("//*[@label='Stop']")
|
||||
element4.click()
|
||||
|
||||
# /* Check Packet Loss */
|
||||
report.step_start("Verifying Packet Loss..")
|
||||
print("Verifying Packet Loss..")
|
||||
try:
|
||||
element5 = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='0']")
|
||||
#assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
except NoSuchElementException:
|
||||
print("No Packet Loss Detected 1st Attempt")
|
||||
|
||||
report.step_start("Verifying Packet Sent..")
|
||||
print("Verifying Packet Sent..")
|
||||
try:
|
||||
packetSent = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='Sent']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
#assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
except NoSuchElementException:
|
||||
print("-------Exception: Packet Sent Error, check object ID")
|
||||
|
||||
report.step_start("Verifying Packet Received..")
|
||||
print("Verifying Packet Received..")
|
||||
try:
|
||||
packetReceived = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='Received']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
#assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
except NoSuchElementException:
|
||||
print("-------Exception: Packet Sent Error, check object ID")
|
||||
|
||||
print("Total Packet Sent: " + packetSent + " Packed Recieved: " + packetReceived)
|
||||
|
||||
# Also Check #Sendto: No route to host
|
||||
print("Verifying No route to host Error Msg....")
|
||||
report.step_start("Verifying No route to host Error Msg..")
|
||||
try:
|
||||
element7 = driver.find_element_by_xpath("(//XCUIElementTypeStaticText[@label='Sendto: No route to host'])[2]")
|
||||
print("Packet Loss Detected on AP!!!!!: " + AP_IPaddress)
|
||||
#self.assertNotEqual(element7.text, "Sendto: No route to host", "Packet Loss Exist, Please Check Device AP: " + Wifi_AP_Name)
|
||||
except NoSuchElementException:
|
||||
print("\nNo Packet Loss Detected on AP!!!!!: " + AP_IPaddress)
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Exception while ping Deft App on iOS")
|
||||
|
||||
return None
|
||||
|
||||
def tearDown(setup_perfectoMobile):
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Exception Failure Tear Down....")
|
||||
|
||||
try:
|
||||
print(" -- Tear Down --")
|
||||
report.test_stop(TestResultFactory.create_failure)
|
||||
print('Report-Url: ' + report.report_url() + '\n')
|
||||
driver.close()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To close --")
|
||||
print (e.message)
|
||||
finally:
|
||||
try:
|
||||
driver.quit()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To Quit --")
|
||||
print (e.message)
|
||||
|
||||
def verifyUploadDownloadSpeediOS(setup_perfectoMobile, get_APToMobileDevice_data):
|
||||
print("Verify Upload Download Speed")
|
||||
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
currentResult = True
|
||||
|
||||
contexts = driver.contexts
|
||||
print("Printing Context")
|
||||
print(contexts)
|
||||
|
||||
driver.switch_to.context('WEBVIEW_1')
|
||||
|
||||
try:
|
||||
print("Launching Safari")
|
||||
report.step_start("Google Home Page")
|
||||
driver.get(connData["webURL"])
|
||||
print("Enter Search Text")
|
||||
elementFindTxt = driver.find_element_by_xpath(connData["lblSearch"])
|
||||
elementFindTxt.send_keys("Internet Speed Test")
|
||||
|
||||
try:
|
||||
print("Click Search Button")
|
||||
elelSearch = driver.find_element_by_xpath("//*[@class='aajZCb']/li[1]/div[1]")
|
||||
elelSearch.click()
|
||||
except NoSuchElementException:
|
||||
currentResult = False
|
||||
print("Search Drop Down not active...")
|
||||
|
||||
print("Click Run Speed Test Button...")
|
||||
report.step_start("Click Run Speed Test Button")
|
||||
driver.find_element_by_xpath(connData["BtnRunSpeedTest"]).click()
|
||||
|
||||
#Get upload/Download Speed
|
||||
try:
|
||||
report.step_start("Get upload/Download Speed")
|
||||
time.sleep(60)
|
||||
downloadMbps = driver.find_element_by_xpath(connData["downloadMbps"])
|
||||
downloadSpeed = downloadMbps.text
|
||||
print("Download: " + downloadSpeed + " Mbps")
|
||||
|
||||
UploadMbps = driver.find_element_by_xpath(connData["UploadMbps"])
|
||||
uploadSpeed = UploadMbps.text
|
||||
print("Upload: " + uploadSpeed + " Mbps")
|
||||
|
||||
print("Access Point Verification Completed Successfully")
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Access Point Verification NOT Completed, checking Connection....")
|
||||
currentResult = False
|
||||
except Exception as e:
|
||||
print (e.message)
|
||||
|
||||
|
||||
return currentResult
|
||||
|
||||
|
||||
@@ -1,95 +1,60 @@
|
||||
"""
|
||||
ec420 basic-03
|
||||
ecw5410 basic-01
|
||||
ecw5211 not available in basic
|
||||
wf188n basic-05
|
||||
eap102 basic-06
|
||||
eap101 basic-02
|
||||
wf194c baisc-08-02
|
||||
|
||||
ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \ # basic-01
|
||||
-L 8720:lf2:4002 -L 8721:lf2:5901 -L 8722:lf2:8080 -L 8723:lab-ctlr:22 \ # basic-02
|
||||
-L 8830:lf3:4002 -L 8831:lf3:5901 -L 8832:lf3:8080 -L 8833:lab-ctlr:22 \ # basic-03
|
||||
-L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \ # basic-04
|
||||
-L 8850:lf12:4002 -L 8851:lf12:5901 -L 8852:lf12:8080 -L 8853:lab-ctlr4:22 \ # basic-05
|
||||
-L 8860:lf13:4002 -L 8861:lf13:5901 -L 8862:lf13:8080 -L 8863:lab-ctlr4:22 \ # basic-06
|
||||
-L 8870:lf14:4002 -L 8871:lf14:5901 -L 8872:lf14:8080 -L 8873:lab-ctlr4:22 \ # basic-07
|
||||
-L 8880:lf15:4002 -L 8881:lf15:5901 -L 8882:lf15:8080 -L 8883:lab-ctlr4:22 \ # basic-08
|
||||
ubuntu@3.130.51.163
|
||||
|
||||
|
||||
|
||||
ssh -C -L 8800:lf1:4002 -L 8801:lf1:5901 -L 8802:lf1:8080 -L 8803:lab-ctlr:22 \
|
||||
-L 8720:lf2:4002 -L 8721:lf2:5901 -L 8722:lf2:8080 -L 8723:lab-ctlr:22 \
|
||||
-L 8830:lf3:4002 -L 8831:lf3:5901 -L 8832:lf3:8080 -L 8833:lab-ctlr:22 \
|
||||
-L 8810:lf4:4002 -L 8811:lf4:5901 -L 8812:lf4:8080 -L 8813:lab-ctlr:22 \
|
||||
-L 8850:lf12:4002 -L 8851:lf12:5901 -L 8852:lf12:8080 -L 8853:lab-ctlr4:22 \
|
||||
-L 8860:lf13:4002 -L 8861:lf13:5901 -L 8862:lf13:8080 -L 8863:lab-ctlr4:22 \
|
||||
-L 8870:lf14:4002 -L 8871:lf14:5901 -L 8872:lf14:8080 -L 8873:lab-ctlr4:22 \
|
||||
-L 8880:lf15:4002 -L 8881:lf15:5901 -L 8882:lf15:8080 -L 8883:lab-ctlr4:22 \
|
||||
ubuntu@3.130.51.163
|
||||
|
||||
"""
|
||||
|
||||
CONFIGURATION = {
|
||||
"basic-ext-04-01": {
|
||||
|
||||
|
||||
# This is sample Config of a Testbed
|
||||
"basic-lab": {
|
||||
"controller": {
|
||||
'url': "https://wlan-portal-svc-nola-ext-04.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-04-27"
|
||||
'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
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'ecw5410',
|
||||
'mode': "wifi5",
|
||||
'serial': '903cb394486f',
|
||||
'jumphost': True,
|
||||
'ip': "192.168.200.81",
|
||||
'username': "lanforge",
|
||||
'password': "lanforge",
|
||||
'port': 22,
|
||||
'jumphost_tty': '/dev/ttyAP1',
|
||||
'version': "ecw5410-2021-04-23-30496b1"
|
||||
'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': '3c2c99f44e77', # "node" command has serial_number information
|
||||
'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
|
||||
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.0.0-rc2.tar.gz" # Enter the Target AP Version URL for Testing
|
||||
}
|
||||
],
|
||||
# Traffic generator
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"name": "lanforge", #( lanforge/ perfecto)
|
||||
# Details for LANforge system
|
||||
"details": {
|
||||
"ip": "192.168.200.81",
|
||||
"port": 8080,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
"5G-Radio": ["wiphy1"],
|
||||
"AX-Radio": ["wiphy2"],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "192.168.200.0/24",
|
||||
"uplink" : "1.1.eth2",
|
||||
"ip": "localhost", # localhost,
|
||||
"port": 8802, # 8802,
|
||||
"2.4G-Radio": ["wiphy4"],
|
||||
"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-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FIRMWARE = {
|
||||
# jFrog parameters
|
||||
"JFROG":
|
||||
{
|
||||
"jfrog-base-url": "https://tip.jFrog.io/artifactory/tip-wlan-ap-firmware",
|
||||
"build": "pending",
|
||||
"branch": "trunk"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "192.168.200.75",
|
||||
"ip": "10.10.10.72",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "nolaradius",
|
||||
"password": "nolastart",
|
||||
"user": "user",
|
||||
"password": "password",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
@@ -150,3 +115,4 @@ TEST_CASES = {
|
||||
"nat_ssid_update": 8743,
|
||||
"vlan_ssid_update": 8744
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# import files in the current directory
|
||||
"""
|
||||
Pytest fixtures: High level Resource Management and base setup fixtures
|
||||
"""
|
||||
import datetime
|
||||
import sys
|
||||
import os
|
||||
@@ -27,22 +29,20 @@ if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from cv_test_manager import cv_test
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import TEST_CASES
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import FIRMWARE
|
||||
from testrails.testrail_api import APIClient
|
||||
from testrails.reporting import Reporting
|
||||
import sta_connect2
|
||||
from lf_tools import ChamberView
|
||||
from sta_connect2 import StaConnect2
|
||||
from cv_test_manager import cv_test
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
"""pytest addoption function: contains ini objects and options"""
|
||||
parser.addini("tr_url", "Test Rail URL")
|
||||
parser.addini("tr_prefix", "Test Rail Prefix (Generally Testbed_name_)")
|
||||
parser.addini("tr_user", "Testrail Username")
|
||||
@@ -59,6 +59,15 @@ def pytest_addoption(parser):
|
||||
default=False,
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--exit-on-fail",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--force-upgrade",
|
||||
@@ -87,6 +96,35 @@ def pytest_addoption(parser):
|
||||
help="Stop using Testrails"
|
||||
)
|
||||
|
||||
# Perfecto Parameters
|
||||
parser.addini("perfectoURL", "Cloud URL")
|
||||
parser.addini("securityToken", "Security Token")
|
||||
parser.addini("platformName-iOS", "iOS Platform")
|
||||
parser.addini("platformName-android", "Android Platform")
|
||||
parser.addini("model-iOS", "iOS Devices")
|
||||
parser.addini("model-android", "Android Devices")
|
||||
parser.addini("bundleId-iOS", "iOS Devices")
|
||||
parser.addini("bundleId-iOS-Settings", "iOS Settings App")
|
||||
parser.addini("appPackage-android", "Android Devices")
|
||||
parser.addini("bundleId-iOS-Safari", "Safari BundleID")
|
||||
parser.addini("wifi-SSID-2g-Pwd", "Wifi 2g Password")
|
||||
parser.addini("Default-SSID-5gl-perfecto-b", "Wifi 5g AP Name")
|
||||
parser.addini("Default-SSID-2g-perfecto-b", "Wifi 2g AP Name")
|
||||
parser.addini("Default-SSID-perfecto-b", "Wifi AP Name")
|
||||
parser.addini("bundleId-iOS-Ping", "Ping Bundle ID")
|
||||
parser.addini("browserType-iOS", "Mobile Browser Name")
|
||||
parser.addini("projectName", "Project Name")
|
||||
parser.addini("projectVersion", "Project Version")
|
||||
parser.addini("jobName", "CI Job Name")
|
||||
parser.addini("jobNumber", "CI Job Number")
|
||||
parser.addini("reportTags", "Report Tags")
|
||||
parser.addoption(
|
||||
"--access-points-perfecto",
|
||||
# nargs="+",
|
||||
default=["Perfecto"],
|
||||
help="list of access points to test"
|
||||
)
|
||||
|
||||
|
||||
"""
|
||||
Test session base fixture
|
||||
@@ -96,16 +134,13 @@ Test session base fixture
|
||||
# To be depreciated as testrails will go
|
||||
@pytest.fixture(scope="session")
|
||||
def test_cases():
|
||||
"""Yields the test cases from configuration.py: will be depreciated"""
|
||||
yield TEST_CASES
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_jFrog():
|
||||
yield FIRMWARE["JFROG"]
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def testbed(request):
|
||||
"""yields the testbed option selection"""
|
||||
var = request.config.getoption("--testbed")
|
||||
allure.attach(body=str(var),
|
||||
name="Testbed Selected : ")
|
||||
@@ -114,35 +149,45 @@ def testbed(request):
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upload_firmware(request):
|
||||
"""yields the --force-upload option for firmware upload selection"""
|
||||
yield request.config.getoption("--force-upload")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def should_upgrade_firmware(request):
|
||||
"""yields the --force-upgrade option for firmware upgrade selection"""
|
||||
yield request.config.getoption("--force-upgrade")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def exit_on_fail(request):
|
||||
"""yields the --exit-on-fail option for exiting the test case if it fails without teardown"""
|
||||
yield request.config.getoption("--exit-on-fail")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def radius_info():
|
||||
"""yields the radius server information from lab info file"""
|
||||
allure.attach(body=str(RADIUS_SERVER_DATA), name="Radius server Info: ")
|
||||
yield RADIUS_SERVER_DATA
|
||||
|
||||
|
||||
# Get Configuration data f
|
||||
@pytest.fixture(scope="session")
|
||||
def get_configuration(testbed):
|
||||
"""yields the selected testbed information from lab info file (configuration.py)"""
|
||||
allure.attach(body=str(testbed), name="Testbed Selected: ")
|
||||
yield CONFIGURATION[testbed]
|
||||
|
||||
|
||||
# APNOS Library
|
||||
@pytest.fixture(scope="session")
|
||||
def get_apnos():
|
||||
"""yields the LIBRARY for APNOS, Reduces the use of imports across files"""
|
||||
yield APNOS
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
"""yields the equipment-id of the AP by checking the serial number"""
|
||||
equipment_id_list = []
|
||||
for i in get_configuration['access_point']:
|
||||
equipment_id_list.append(setup_controller.get_equipment_id(
|
||||
@@ -150,10 +195,9 @@ def get_equipment_id(setup_controller, testbed, get_configuration):
|
||||
yield equipment_id_list
|
||||
|
||||
|
||||
# APNOS SETUP
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Used to add openwrtctl.py in case of serial console mode
|
||||
"""setup the access point connectivity"""
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
if access_point_info["jumphost"]:
|
||||
allure.attach(name="added openwrtctl.py to :",
|
||||
@@ -169,6 +213,7 @@ def instantiate_access_point(testbed, get_apnos, get_configuration):
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
"""sets up the controller connection and yields the sdk_client object"""
|
||||
try:
|
||||
sdk_client = Controller(controller_data=get_configuration["controller"])
|
||||
allure.attach(body=str(get_configuration["controller"]), name="Controller Instantiated: ")
|
||||
@@ -186,24 +231,27 @@ def setup_controller(request, get_configuration, instantiate_access_point):
|
||||
yield sdk_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def instantiate_firmware(setup_controller, instantiate_jFrog, get_configuration):
|
||||
@pytest.fixture(scope="session")
|
||||
def instantiate_firmware(setup_controller, get_configuration):
|
||||
"""sets up firmware utility and yields the object for firmware upgrade"""
|
||||
firmware_client_obj = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
firmware_client = FirmwareUtility(jfrog_credentials=instantiate_jFrog, sdk_client=setup_controller,
|
||||
firmware_client = FirmwareUtility(sdk_client=setup_controller,
|
||||
model=access_point_info["model"],
|
||||
version=access_point_info["version"])
|
||||
version_url=access_point_info["version"])
|
||||
firmware_client_obj.append(firmware_client)
|
||||
yield firmware_client_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def get_latest_firmware(instantiate_firmware):
|
||||
"""yields the list of firmware version"""
|
||||
fw_version_list = []
|
||||
try:
|
||||
|
||||
for fw_obj in instantiate_firmware:
|
||||
latest_firmware = fw_obj.get_fw_version()
|
||||
latest_firmware = latest_firmware.replace(".tar.gz", "")
|
||||
fw_version_list.append(latest_firmware)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
@@ -212,19 +260,20 @@ def get_latest_firmware(instantiate_firmware):
|
||||
yield fw_version_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware):
|
||||
"""yields the firmware_id that is uploaded to cloud"""
|
||||
firmware_id_list = []
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(fw_version=get_latest_firmware[i],
|
||||
force_upload=should_upload_firmware)
|
||||
firmware_id = instantiate_firmware[i].upload_fw_on_cloud(force_upload=should_upload_firmware)
|
||||
firmware_id_list.append(firmware_id)
|
||||
yield firmware_id_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
"""yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
|
||||
status_list = []
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
@@ -233,13 +282,13 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
else:
|
||||
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=True,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
for i in range(0, len(instantiate_firmware)):
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
status_list.append(status)
|
||||
else:
|
||||
@@ -248,16 +297,18 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
|
||||
yield status_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
|
||||
"""yields the active version of firmware on cloud"""
|
||||
ap_fw_list = []
|
||||
for i in get_equipment_id:
|
||||
ap_fw_list.append(setup_controller.get_ap_firmware_old_method(equipment_id=i))
|
||||
yield ap_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_ssh(get_configuration):
|
||||
"""yields the active version of firmware on ap"""
|
||||
active_fw_list = []
|
||||
try:
|
||||
for access_point in get_configuration['access_point']:
|
||||
@@ -270,6 +321,15 @@ def check_ap_firmware_ssh(get_configuration):
|
||||
yield active_fw_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_test_run(setup_controller, upgrade_firmware, check_ap_firmware_cloud, check_ap_firmware_ssh):
|
||||
"""used to upgrade the firmware on AP and should be called on each test case on a module level"""
|
||||
if check_ap_firmware_ssh == check_ap_firmware_cloud:
|
||||
yield True
|
||||
else:
|
||||
pytest.exit("AP is not Upgraded tp Target Firmware versions")
|
||||
|
||||
|
||||
"""
|
||||
Instantiate Reporting
|
||||
"""
|
||||
@@ -277,6 +337,7 @@ Instantiate Reporting
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def update_report(request, testbed, get_configuration):
|
||||
"""used to update the test report on testrail/allure"""
|
||||
if request.config.getoption("--skip-testrail"):
|
||||
tr_client = Reporting()
|
||||
else:
|
||||
@@ -298,20 +359,23 @@ def update_report(request, testbed, get_configuration):
|
||||
|
||||
"""
|
||||
FRAMEWORK MARKER LOGIC
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_security_flags():
|
||||
"""used to get the essential markers on security and band"""
|
||||
# Add more classifications as we go
|
||||
security = ["open", "wpa", "wpa2_personal", "wpa3_personal", "wpa3_personal_mixed",
|
||||
"wpa_wpa2_personal_mixed", "wpa2_enterprise", "wpa3_enterprise", "twog", "fiveg", "radius"]
|
||||
security = ["open", "wpa", "wep", "wpa2_personal", "wpa3_personal", "wpa3_personal_mixed",
|
||||
"wpa_wpa2_enterprise_mixed",
|
||||
"wpa_wpa2_personal_mixed", "wpa_enterprise", "wpa2_enterprise", "wpa3_enterprise_mixed",
|
||||
"wpa3_enterprise", "twog", "fiveg", "radius"]
|
||||
yield security
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_markers(request, get_security_flags):
|
||||
"""used to get the markers on the selected test case class, used in setup_profiles"""
|
||||
session = request.node
|
||||
markers = list()
|
||||
security = get_security_flags
|
||||
@@ -319,7 +383,7 @@ def get_markers(request, get_security_flags):
|
||||
for item in session.items:
|
||||
for j in item.iter_markers():
|
||||
markers.append(j.name)
|
||||
# print(set(markers))
|
||||
print(set(markers))
|
||||
for i in security:
|
||||
if set(markers).__contains__(i):
|
||||
security_dict[i] = True
|
||||
@@ -333,11 +397,10 @@ def get_markers(request, get_security_flags):
|
||||
# Will be availabe as a test case
|
||||
@pytest.fixture(scope="function")
|
||||
def test_access_point(testbed, get_apnos, get_configuration):
|
||||
"""used to check the manager status of AP, should be used as a setup to verify if ap can reach cloud"""
|
||||
mgr_status = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
ap_ssh.reboot()
|
||||
time.sleep(100)
|
||||
status = ap_ssh.get_manager_state()
|
||||
if "ACTIVE" not in status:
|
||||
time.sleep(30)
|
||||
@@ -347,13 +410,10 @@ def test_access_point(testbed, get_apnos, get_configuration):
|
||||
yield mgr_status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def client_connectivity():
|
||||
yield StaConnect2
|
||||
|
||||
|
||||
# Not used anymore, needs to depreciate it
|
||||
@pytest.fixture(scope="session")
|
||||
def get_lanforge_data(get_configuration):
|
||||
"""depreciate it"""
|
||||
lanforge_data = {}
|
||||
if get_configuration['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
@@ -373,21 +433,73 @@ def get_lanforge_data(get_configuration):
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_lanforge_connectivity(testbed, get_configuration):
|
||||
lanforge_ip = get_configuration['traffic_generator']['details']['ip']
|
||||
lanforge_port = get_configuration['traffic_generator']['details']['port']
|
||||
|
||||
try:
|
||||
cv = cv_test(lanforge_ip, lanforge_port)
|
||||
url_data = cv.get_ports("/")
|
||||
lanforge_GUI_version = url_data["VersionInfo"]["BuildVersion"]
|
||||
lanforge_gui_git_version = url_data["VersionInfo"]["GitVersion"]
|
||||
lanforge_gui_build_date = url_data["VersionInfo"]["BuildDate"]
|
||||
print(lanforge_GUI_version, lanforge_gui_build_date, lanforge_gui_git_version)
|
||||
if not (lanforge_GUI_version or lanforge_gui_build_date or lanforge_gui_git_version):
|
||||
def traffic_generator_connectivity(testbed, get_configuration):
|
||||
if get_configuration['traffic_generator']['name'] == "lanforge":
|
||||
lanforge_ip = get_configuration['traffic_generator']['details']['ip']
|
||||
lanforge_port = get_configuration['traffic_generator']['details']['port']
|
||||
# Condition :
|
||||
# if gui connection is not available
|
||||
# yield False
|
||||
# Condition :
|
||||
# If Gui Connection is available
|
||||
# yield the gui version
|
||||
try:
|
||||
cv = cv_test(lanforge_ip, lanforge_port)
|
||||
url_data = cv.get_ports("/")
|
||||
lanforge_GUI_version = url_data["VersionInfo"]["BuildVersion"]
|
||||
lanforge_gui_git_version = url_data["VersionInfo"]["GitVersion"]
|
||||
lanforge_gui_build_date = url_data["VersionInfo"]["BuildDate"]
|
||||
print(lanforge_GUI_version, lanforge_gui_build_date, lanforge_gui_git_version)
|
||||
if not (lanforge_GUI_version or lanforge_gui_build_date or lanforge_gui_git_version):
|
||||
yield False
|
||||
else:
|
||||
yield True
|
||||
except:
|
||||
yield False
|
||||
else:
|
||||
yield True
|
||||
except:
|
||||
yield False
|
||||
else:
|
||||
yield True
|
||||
|
||||
|
||||
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(get_configuration, testbed):
|
||||
ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
|
||||
testbed=testbed, access_point_data=get_configuration["access_point"])
|
||||
yield True
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def create_vlan(request, testbed, get_configuration):
|
||||
if request.param["mode"] == "VLAN":
|
||||
vlan_list = list()
|
||||
ssid_modes = request.param["ssid_modes"].keys()
|
||||
for mode in ssid_modes:
|
||||
for ssid in range(len(request.param["ssid_modes"][mode])):
|
||||
if "vlan" in request.param["ssid_modes"][mode][ssid]:
|
||||
vlan_list.append(request.param["ssid_modes"][mode][ssid]["vlan"])
|
||||
if vlan_list:
|
||||
chamberview_obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
|
||||
testbed=testbed, access_point_data=get_configuration["access_point"])
|
||||
|
||||
lanforge_data = get_configuration["traffic_generator"]["details"]
|
||||
upstream_port = lanforge_data["upstream"]
|
||||
upstream_resources = upstream_port.split(".")[0] + "." + upstream_port.split(".")[1]
|
||||
for vlan in vlan_list:
|
||||
if 1 > vlan or vlan > 4095:
|
||||
continue
|
||||
chamberview_obj.raw_line.append(["profile_link " + upstream_resources + " vlan-100 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
|
||||
|
||||
|
||||
@@ -8,22 +8,21 @@ from configuration import CONFIGURATION
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.sdk_version_check
|
||||
def test_cloud_sdk_version(instantiate_controller, testbed, test_cases, instantiate_testrail, instantiate_project):
|
||||
def test_cloud_sdk_version(setup_controller, testbed, test_cases, update_report):
|
||||
try:
|
||||
response = instantiate_controller.portal_ping()
|
||||
response = setup_controller.portal_ping()
|
||||
if CONFIGURATION[testbed]['controller']['version'] == response._project_version:
|
||||
PASS = True
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=1, msg='Read CloudSDK version from API successfully')
|
||||
PASS = True
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API - '
|
||||
'version missmatch')
|
||||
PASS = False
|
||||
except Exception as e:
|
||||
print(e)
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_ver"], run_id=instantiate_project,
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API - Exception '
|
||||
'occured')
|
||||
PASS = False
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.rf
|
||||
class TestRFProfiles:
|
||||
|
||||
def test_rf_profile(self):
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.radius
|
||||
class TestRadiusProfile:
|
||||
|
||||
def test_radius_profile(self):
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.ssid
|
||||
class TestSSIDProfile:
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_open_ssid_2g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_open_ssid_5g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_wpa_ssid_2g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_ssid_5g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_personal_ssid_2g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_personal_ssid_5g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_ssid_2g(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_ssid_5g(self):
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.equipment_ap_profile
|
||||
class TestEquipmentAPProfile:
|
||||
|
||||
@pytest.mark.bridge
|
||||
def test_equipment_ap_profile_bridge(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.nat
|
||||
def test_equipment_ap_profile_nat(self):
|
||||
assert True
|
||||
|
||||
@pytest.mark.vlan
|
||||
def test_equipment_ap_profile_vlan(self):
|
||||
assert True
|
||||
@@ -21,114 +21,177 @@ Test cases can be bunched on a
|
||||
1. class level (have a module/ test_xx.py , have one or more classes, do setup once for each class)
|
||||
2. function level (have a module/ test_xx.py , have one or more functions, do setup once for each function)
|
||||
|
||||
|
||||
# Use the below sample template for starting to write test cases in basic
|
||||
### SAMPLE Test Case Example:
|
||||
|
||||
test_featureA_bridge.py
|
||||
|
||||
```python
|
||||
import pytest
|
||||
pytestmark = [pytest.mark.test_featureA, pytest.mark.bridge]
|
||||
import allure
|
||||
|
||||
# Module level Marking
|
||||
pytestmark = [pytest.mark.usefixtures("setup_test_run"), pytest.mark.featureA]
|
||||
|
||||
# It is compulsory to put pytest.mark.usefixtures("setup_test_run") in module level marking
|
||||
|
||||
profile_config = {
|
||||
"mode": "NAT", # Mode of config ("BRIDGE"/"NAT"/"VLAN")
|
||||
|
||||
# SSID modes and its Config: Enter the json data structure in the below format for test cases
|
||||
"ssid_modes": {
|
||||
# Enter the ssid modes:
|
||||
# (open/wpa/wpa2_personal/wpa3_personal/wpa3_personal_mixed/wpa_wpa2_personal_mixed/
|
||||
# wpa_enterprise/wpa2_enterprise/wpa3_enterprise/wpa_wpa2_enterprise_mixed/wpa3_enterprise_mixed
|
||||
# /wep)
|
||||
# Each security type can have multiple ssid config placed in a list and is customizable
|
||||
"wpa": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"], "vlan": 1 },
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]
|
||||
},
|
||||
# rf config data that is need to be pushed,
|
||||
# Leave Blank for default (default config is taken from configuration.py for the selected testbed and AP Model)
|
||||
"rf": {},
|
||||
# True if you want to create a Radius Profile(Radius config by default is taken from configuration.py)
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.test_featureA
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
# Class level Marking
|
||||
@pytest.mark.suite_a
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["BRIDGE"], ["BRIDGE"])],
|
||||
'setup_profiles', # Name of the fixture
|
||||
[profile_config], # Passing the above static profile_config data for setup for tests in this class
|
||||
indirect=True,
|
||||
scope="class"
|
||||
scope="class" # Scope of the fixture (Its experimental for current framework (keep it "class" for default scenario))
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestFeatureABridge(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
@pytest.mark.wpa # Marker for the wifi encryption needed - Compulsory
|
||||
@pytest.mark.twog # Marker for band (twog/fiveg) - Compulsory
|
||||
def test_client_wpa_2g(self):
|
||||
profile_data = profile_config["ssid_modes"]["wpa"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog" # refer to appliedRadios in ssid_modes config (twog/fiveg)
|
||||
# vlan = 1 # 1 for "BRIDGE"/"NAT" # Can be customised in the ssid config json
|
||||
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
# Some Recommendations:
|
||||
# If your test case has components that are to be used by other test case,
|
||||
# then make it library and call its instance from fixture.
|
||||
# If your test case has some reports, then attach it as an allure report
|
||||
|
||||
allure.attach(name="Test case report", body="Test case result description") # Check its usages for more detail
|
||||
|
||||
PASS_FAIL_CONDITION = True
|
||||
assert PASS_FAIL_CONDITION
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa_5g(self):
|
||||
profile_data = profile_config["ssid_modes"]["wpa"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg" # refer to appliedRadios in ssid_modes config (twog/fiveg)
|
||||
vlan = 1 # 1 for "BRIDGE"/"NAT" # Can be customised in the ssid config json
|
||||
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
# Some Recommendations:
|
||||
# If your test case has components that are to be used by other test case,
|
||||
# then make it library and call its instance from fixture.
|
||||
# If your test case has some reports, then attach it as an allure report
|
||||
|
||||
allure.attach(name="Test case report", body="Test case result description") # Check its usages for more detail
|
||||
|
||||
PASS_FAIL_CONDITION = True
|
||||
assert PASS_FAIL_CONDITION
|
||||
|
||||
@pytest.mark.wpa2_personal # Marker for the wifi encryption needed - Compulsory
|
||||
@pytest.mark.twog # Marker for band (twog/fiveg) - Compulsory
|
||||
def test_client_wpa2_personal_2g(self):
|
||||
profile_data = profile_config["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog" # refer to appliedRadios in ssid_modes config (twog/fiveg)
|
||||
# vlan = 1 # 1 for "BRIDGE"/"NAT" # Can be customised in the ssid config json
|
||||
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
# Some Recommendations:
|
||||
# If your test case has components that are to be used by other test case,
|
||||
# then make it library and call its instance from fixture.
|
||||
# If your test case has some reports, then attach it as an allure report
|
||||
|
||||
allure.attach(name="Test case report", body="Test case result description") # Check its usages for more detail
|
||||
|
||||
PASS_FAIL_CONDITION = True
|
||||
assert PASS_FAIL_CONDITION
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_5g(self):
|
||||
profile_data = profile_config["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg" # refer to appliedRadios in ssid_modes config (twog/fiveg)
|
||||
vlan = 1 # 1 for "BRIDGE"/"NAT" # Can be customised in the ssid config json
|
||||
|
||||
# Write Your test case Here
|
||||
PASS = True
|
||||
assert PASS
|
||||
# Some Recommendations:
|
||||
# If your test case has components that are to be used by other test case,
|
||||
# then make it library and call its instance from fixture.
|
||||
# If your test case has some reports, then attach it as an allure report
|
||||
|
||||
allure.attach(name="Test case report", body="Test case result description") # Check its usages for more detail
|
||||
|
||||
PASS_FAIL_CONDITION = True
|
||||
assert PASS_FAIL_CONDITION
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
```
|
||||
##General Guardrails:
|
||||
```
|
||||
setup_profile is a Fixture that collects markers
|
||||
from the test case to decide which security modes and band is need to be applied on the Access Point
|
||||
|
||||
Test cases can be selected based upon the markers
|
||||
|
||||
# This selection will push all the config for the above scenario, considering that you have specified all required markers
|
||||
pytest -m featureA
|
||||
|
||||
# This selection will select only wpa test cases and will push the config for wpa mode only because wpa2_personal marker is not selected
|
||||
pytest -m "featureA and wpa"
|
||||
|
||||
Conclusion: Security modes for SSID has some specific markers which are specified as follows
|
||||
|
||||
open/wpa/wpa2_personal/wpa3_personal/wpa3_personal_mixed/wpa_wpa2_personal_mixed
|
||||
wpa_enterprise/wpa2_enterprise/wpa3_enterprise/wpa_wpa2_enterprise_mixed/wpa3_enterprise_mixed/wep
|
||||
|
||||
and for band, its (twog/fiveg)
|
||||
|
||||
if you don't specifi the marker, then no matter what profile_config you are passing to setup_profile fixture,
|
||||
it will not be pushed
|
||||
|
||||
Refer other test cases for more reference
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
### Follow the e2e/basic/client_connectivity_test, for more understanding
|
||||
|
||||
## NOTE:
|
||||
1. Marking the test case is important, setup will take the markers associated with it, and decide the configuration
|
||||
2. PARAMETRIZATION:
|
||||
```python
|
||||
import pytest
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["BRIDGE"], ["BRIDGE"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestSomething(object):
|
||||
...
|
||||
```
|
||||
### Passing the parameters to the "setup_profiles" and "create_profiles" will setup in each of the asked modes
|
||||
### For setup to be done in BRIDGE mode, see the above example
|
||||
### setup can be done on different scope levels, mentioned below
|
||||
####[scope="class", scope="function"]
|
||||
## If you have special Config requirements for test case, then reach out to Shivam Thakur on Slack, or email (shivam.thakur@candelatech.com)
|
||||
@@ -1,195 +0,0 @@
|
||||
|
||||
"""
|
||||
Test Case Module: setup test cases for basic test cases
|
||||
Details: Firmware Upgrade
|
||||
|
||||
"""
|
||||
import pytest
|
||||
import time
|
||||
|
||||
@pytest.mark.configure_lanforge
|
||||
def test_configure_lanforge(configure_lanforge):
|
||||
|
||||
assert True
|
||||
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup_dut
|
||||
def test_lanforge_scenario_setup_dut(create_lanforge_chamberview_dut):
|
||||
print(create_lanforge_chamberview_dut)
|
||||
ssid = [
|
||||
['ssid_idx=0 ssid=Default-SSID-2g password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
]
|
||||
|
||||
create_lanforge_chamberview_dut.ssid = ssid
|
||||
create_lanforge_chamberview_dut.setup()
|
||||
create_lanforge_chamberview_dut.add_ssids()
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
time.sleep(2)
|
||||
create_lanforge_chamberview_dut.cv_test.show_text_blob(None, None, True) # Show changes on GUI
|
||||
create_lanforge_chamberview_dut.cv_test.sync_cv()
|
||||
|
||||
assert True
|
||||
|
||||
@pytest.mark.lanforge_scenario_setup
|
||||
def test_lanforge_scenario_setup(create_lanforge_chamberview):
|
||||
# raw_line = [
|
||||
# ["profile_link 1.1 vlan-100 1 NA NA eth2,AUTO -1 100"]
|
||||
# ]
|
||||
# print(create_lanforge_chamberview.setup_scenario(create_scenario="TIP-test",raw_line=raw_line))
|
||||
# create_lanforge_chamberview.build_scenario("TIP-test")
|
||||
assert True
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.firmware
|
||||
class TestFirmware(object):
|
||||
|
||||
@pytest.mark.firmware_create
|
||||
def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
if upload_firmware != 0:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Create new FW version by API successful')
|
||||
PASS = True
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='Error creating new FW version by API')
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
print()
|
||||
if not upgrade_firmware:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
status_id=0,
|
||||
msg='Error requesting upgrade via API')
|
||||
PASS = False
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Upgrade request using API successful')
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
|
||||
instantiate_project, test_cases):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='CLOUDSDK reporting correct firmware version.')
|
||||
|
||||
assert get_latest_firmware == check_ap_firmware_cloud
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.bridge
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.check_active_firmware_ap
|
||||
def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
|
||||
test_cases):
|
||||
if check_ap_firmware_ssh == get_latest_firmware:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
status_id=4,
|
||||
msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
|
||||
assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
|
||||
# """
|
||||
# Test Case Module: setup test cases for basic test cases
|
||||
# Details: Firmware Upgrade
|
||||
#
|
||||
# """
|
||||
# import pytest
|
||||
#
|
||||
# @pytest.mark.configure_lanforge
|
||||
# def test_configure_lanforge(configure_lanforge):
|
||||
#
|
||||
# assert True
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.firmware
|
||||
# class TestFirmware(object):
|
||||
#
|
||||
# @pytest.mark.firmware_create
|
||||
# def test_firmware_create(self, upload_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# if upload_firmware != 0:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Create new FW version by API successful')
|
||||
# PASS = True
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["create_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='Error creating new FW version by API')
|
||||
# PASS = False
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, instantiate_testrail, instantiate_project, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["upgrade_api"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
#
|
||||
# @pytest.mark.check_active_firmware_cloud
|
||||
# def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, instantiate_testrail,
|
||||
# instantiate_project, test_cases):
|
||||
# if get_latest_firmware != check_ap_firmware_cloud:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=5,
|
||||
# msg='CLOUDSDK reporting incorrect firmware version.')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["cloud_fw"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='CLOUDSDK reporting correct firmware version.')
|
||||
#
|
||||
# assert get_latest_firmware == check_ap_firmware_cloud
|
||||
#
|
||||
#
|
||||
# @pytest.mark.sanity
|
||||
# @pytest.mark.bridge
|
||||
# @pytest.mark.nat
|
||||
# @pytest.mark.vlan
|
||||
# @pytest.mark.check_active_firmware_ap
|
||||
# def test_ap_firmware(check_ap_firmware_ssh, get_latest_firmware, instantiate_testrail, instantiate_project,
|
||||
# test_cases):
|
||||
# if check_ap_firmware_ssh == get_latest_firmware:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=1,
|
||||
# msg='Upgrade to ' + get_latest_firmware + ' successful')
|
||||
# else:
|
||||
# instantiate_testrail.update_testrail(case_id=test_cases["ap_upgrade"], run_id=instantiate_project,
|
||||
# status_id=4,
|
||||
# msg='Cannot reach AP after upgrade to check CLI - re-test required')
|
||||
#
|
||||
# assert check_ap_firmware_ssh == get_latest_firmware
|
||||
|
||||
@@ -1,403 +0,0 @@
|
||||
"""
|
||||
Test Case Module: Client Connectivity Test
|
||||
Mode: BRIDGE
|
||||
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity_test, pytest.mark.bridge]
|
||||
|
||||
import sys
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
import sta_connect2
|
||||
from sta_connect2 import StaConnect2
|
||||
import eap_connect
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.client_connectivity
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["BRIDGE"], ["BRIDGE"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestBridgeModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_controller, instantiate_project, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
print(profile_data, get_lanforge_data)
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
if exit_on_fail and eap_connect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
if exit_on_fail and eap_connect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
eap_connect.stop()
|
||||
try:
|
||||
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'bridge mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_bridge"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - bridge mode' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@pytest.mark.parametrize(
|
||||
'update_ssid',
|
||||
(["BRIDGE, WPA, 5G, Sanity-updated-5G-WPA-BRIDGE"]),
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases, instantiate_controller, exit_on_fail):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
if exit_on_fail and staConnect.passes():
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - bridge mode '
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["bridge_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - bridge mode updated ssid' + str(run_results))
|
||||
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
@@ -1,398 +0,0 @@
|
||||
"""
|
||||
Test Case Module: Client Connectivity Test
|
||||
Mode: NAT
|
||||
|
||||
"""
|
||||
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity_test, pytest.mark.nat]
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
from sta_connect2 import StaConnect2
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
#
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.nat
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestNatModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_controller, instantiate_project, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
print(profile_data, get_lanforge_data)
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except:
|
||||
pass
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'nat mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_nat"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - nat mode' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@pytest.mark.parametrize(
|
||||
'update_ssid',
|
||||
(["NAT, WPA, 5G, Sanity-updated-5G-WPA-NAT"]),
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases, instantiate_controller, exit_on_fail):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_bridge_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - nat mode '
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["nat_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - nat mode updated ssid' + str(run_results))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed! exit_on_fail Exit")
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
@@ -1,382 +0,0 @@
|
||||
"""
|
||||
Test Case Module: Client Connectivity Test
|
||||
Mode: VLAN
|
||||
|
||||
"""
|
||||
|
||||
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity_test, pytest.mark.vlan]
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-something")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
|
||||
from LANforge.LFUtils import *
|
||||
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
|
||||
from sta_connect2 import StaConnect2
|
||||
from eap_connect import EAPConnect
|
||||
import time
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["VLAN"], ["VLAN"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestVlanModeClientConnectivity(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_controller, instantiate_testrail, instantiate_project, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
print(profile_data, get_lanforge_data)
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2420
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2419
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2237
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, request, get_lanforge_data, setup_profile_data,
|
||||
instantiate_controller, instantiate_project, instantiate_testrail, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa2"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_wpa2_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
# C2236
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["2G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_2dot4g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_2dot4g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["2g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
# C5214
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_5g(self, request, get_lanforge_data, setup_profile_data, instantiate_project,
|
||||
instantiate_controller, instantiate_testrail, radius_info, test_cases):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
eap_connect = EAPConnect(get_lanforge_data["lanforge_ip"], get_lanforge_data["lanforge-port-number"])
|
||||
eap_connect.upstream_resource = 1
|
||||
eap_connect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
eap_connect.security = "wpa2"
|
||||
eap_connect.sta_list = station_names
|
||||
eap_connect.station_names = station_names
|
||||
eap_connect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
eap_connect.ssid = profile_data["ssid_name"]
|
||||
eap_connect.radio = get_lanforge_data["lanforge_5g"]
|
||||
eap_connect.eap = "TTLS"
|
||||
eap_connect.identity = radius_info["user"]
|
||||
eap_connect.ttls_passwd = radius_info["password"]
|
||||
eap_connect.runtime_secs = 40
|
||||
eap_connect.setup()
|
||||
eap_connect.start()
|
||||
print("napping %f sec" % eap_connect.runtime_secs)
|
||||
time.sleep(eap_connect.runtime_secs)
|
||||
eap_connect.stop()
|
||||
try:
|
||||
eap_connect.cleanup()
|
||||
eap_connect.cleanup()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
run_results = eap_connect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", eap_connect.passes)
|
||||
if eap_connect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Passed successfully - '
|
||||
'vlan mode' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["5g_eap_vlan"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA2 ENTERPRISE Client Connectivity Failed - vlan mode' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert eap_connect.passes()
|
||||
|
||||
@pytest.mark.modify_ssid
|
||||
@pytest.mark.parametrize(
|
||||
'update_ssid',
|
||||
(["VLAN, WPA, 5G, Sanity-updated-5G-WPA-VLAN"]),
|
||||
indirect=True
|
||||
)
|
||||
def test_modify_ssid(self, request, update_ssid, get_lanforge_data, setup_profile_data, instantiate_testrail,
|
||||
instantiate_project, test_cases, instantiate_controller):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
station_names = []
|
||||
for i in range(0, int(request.config.getini("num_stations"))):
|
||||
station_names.append(get_lanforge_data["lanforge_5g_prefix"] + "0" + str(i))
|
||||
staConnect = StaConnect2(get_lanforge_data["lanforge_ip"], int(get_lanforge_data["lanforge-port-number"]),
|
||||
debug_=False)
|
||||
staConnect.sta_mode = 0
|
||||
staConnect.upstream_resource = 1
|
||||
staConnect.upstream_port = get_lanforge_data["lanforge_vlan_port"]
|
||||
staConnect.radio = get_lanforge_data["lanforge_5g"]
|
||||
staConnect.resource = 1
|
||||
staConnect.dut_ssid = profile_data["ssid_name"]
|
||||
staConnect.dut_passwd = profile_data["security_key"]
|
||||
staConnect.dut_security = "wpa"
|
||||
staConnect.station_names = station_names
|
||||
staConnect.sta_prefix = get_lanforge_data["lanforge_5g_prefix"]
|
||||
staConnect.runtime_secs = 40
|
||||
staConnect.bringup_time_sec = 60
|
||||
staConnect.cleanup_on_exit = True
|
||||
# staConnect.cleanup()
|
||||
staConnect.setup()
|
||||
staConnect.start()
|
||||
print("napping %f sec" % staConnect.runtime_secs)
|
||||
time.sleep(staConnect.runtime_secs)
|
||||
staConnect.stop()
|
||||
staConnect.cleanup()
|
||||
run_results = staConnect.get_result_list()
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
# result = 'pass'
|
||||
print("Single Client Connectivity :", staConnect.passes)
|
||||
if staConnect.passes():
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_ssid_update"], run_id=instantiate_project,
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - vlan mode '
|
||||
'updated ssid' + str(run_results))
|
||||
else:
|
||||
instantiate_testrail.update_testrail(case_id=test_cases["vlan_ssid_update"], run_id=instantiate_project,
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - vlan mode updated ssid' + str(run_results))
|
||||
instantiate_controller.refresh_instance()
|
||||
assert staConnect.passes()
|
||||
@@ -0,0 +1,324 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.bridge, pytest.mark.sanity, pytest.mark.enterprise, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("BRIDGE MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupBridgeEnterpriseSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("BRIDGE MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupBridgeEnterpriseSuiteB(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -2,7 +2,7 @@ import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.bridge, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.bridge, pytest.mark.sanity, pytest.mark.general, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
@@ -34,29 +34,29 @@ class TestSetupBridge(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -65,12 +65,12 @@ class TestSetupBridge(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -96,12 +96,12 @@ class TestSetupBridge(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -112,12 +112,12 @@ class TestSetupBridge(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -126,12 +126,12 @@ class TestSetupBridge(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -140,12 +140,12 @@ class TestSetupBridge(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -153,16 +153,14 @@ class TestSetupBridge(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
@@ -201,12 +199,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -216,12 +214,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -230,12 +228,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -245,12 +243,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -261,12 +259,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -277,12 +275,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -291,12 +289,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_bridge"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -305,12 +303,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -318,177 +316,13 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("BRIDGE MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupBridgeEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["bridge_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -0,0 +1,326 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.nat, pytest.mark.sanity, pytest.mark.enterprise,
|
||||
pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("NAT MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupNATEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("BRIDGE MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupNATEnterpriseSuiteB(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_na"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_na"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -2,7 +2,7 @@ import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.NAT, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.nat, pytest.mark.sanity, pytest.mark.general, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
@@ -34,29 +34,29 @@ class TestSetupNAT(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["open_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -65,12 +65,12 @@ class TestSetupNAT(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -80,12 +80,12 @@ class TestSetupNAT(object):
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -96,12 +96,12 @@ class TestSetupNAT(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -112,12 +112,12 @@ class TestSetupNAT(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_personal_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -126,12 +126,12 @@ class TestSetupNAT(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -140,12 +140,12 @@ class TestSetupNAT(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -153,16 +153,14 @@ class TestSetupNAT(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
@@ -201,12 +199,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -216,12 +214,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -230,12 +228,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -245,12 +243,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -261,12 +259,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -277,12 +275,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -291,12 +289,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_nat"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -305,12 +303,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -318,177 +316,13 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("NAT MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupNATEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["nat_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -0,0 +1,336 @@
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.vlan, pytest.mark.sanity, pytest.mark.enterprise, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("VLAN MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupvlanEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("VLAN MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupVLANEnterpriseSuiteB(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"create_vlan",
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.vlan_create
|
||||
def test_vlan(create_vlan):
|
||||
assert True
|
||||
@@ -2,7 +2,9 @@ import allure
|
||||
import pytest
|
||||
import time
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.VLAN, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.vlan, pytest.mark.sanity, pytest.mark.general, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
pytestmark = [pytest.mark.setup, pytest.mark.vlan, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -30,11 +32,11 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupVLAN(object):
|
||||
class TestSetupvlan(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
status_id=1,
|
||||
@@ -48,7 +50,7 @@ class TestSetupVLAN(object):
|
||||
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
def test_setup_open_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
@@ -126,12 +128,12 @@ class TestSetupVLAN(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -140,12 +142,12 @@ class TestSetupVLAN(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -153,16 +155,14 @@ class TestSetupVLAN(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ setup_params_general_two = {
|
||||
}
|
||||
|
||||
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@allure.feature("vlan MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general_two],
|
||||
@@ -195,18 +195,18 @@ setup_params_general_two = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeConnectivitySuiteTwo(object):
|
||||
class TestvlanModeConnectivitySuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['open_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -216,12 +216,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['open_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['open_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["open_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -230,12 +230,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_personal_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -245,12 +245,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
def test_setup_wpa3_personal_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_personal_mixed_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -261,12 +261,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_2g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -277,12 +277,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa2_personal_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_personal_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g"],
|
||||
update_report.update_testrail(case_id=test_cases["wpa_wpa2_personal_mixed_5g_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -291,12 +291,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap_vlan"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
@@ -305,12 +305,12 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifc"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
@@ -318,177 +318,13 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@allure.feature("VLAN MODE ENTERPRISE SETUP")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestSetupVLANEnterprise(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
if setup_profiles['wpa2_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
|
||||
|
||||
if setup_profiles['wpa2_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa2_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa2_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_2g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_2g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_2g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['wpa3_enterprise_5g']:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['wpa3_enterprise_5g']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["wpa3_enterprise_5g"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['equipment_ap']:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=1,
|
||||
msg='profile created successfully')
|
||||
assert setup_profiles['equipment_ap']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["equipment_ap"],
|
||||
status_id=5,
|
||||
msg='Failed to create profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_config(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
|
||||
if setup_profiles['vifc']:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
assert setup_profiles['vifc']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifc"],
|
||||
update_report.update_testrail(case_id=test_cases["vlan_vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
assert False
|
||||
|
||||
def test_verify_vif_state(self, setup_profiles, update_report,
|
||||
test_cases):
|
||||
if setup_profiles['vifs']:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=1,
|
||||
msg='profile pushed successfully')
|
||||
time.sleep(100)
|
||||
assert setup_profiles['vifs']
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["vifs"],
|
||||
status_id=5,
|
||||
msg='Failed to push profile')
|
||||
time.sleep(100)
|
||||
assert False
|
||||
@@ -12,6 +12,7 @@ if "libs" not in sys.path:
|
||||
from controller.controller import ProfileUtility
|
||||
import time
|
||||
from lanforge.lf_tests import RunTest
|
||||
from lanforge.lf_tools import ChamberView
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
@@ -21,6 +22,26 @@ def instantiate_profile():
|
||||
yield ProfileUtility
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_tools(get_configuration, testbed):
|
||||
lf_tools_obj = ChamberView(lanforge_data=get_configuration['traffic_generator']['details'],
|
||||
access_point_data=get_configuration['access_point'],
|
||||
testbed=testbed)
|
||||
yield lf_tools_obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview(lf_tools):
|
||||
scenario_object, scenario_name = lf_tools.Chamber_View()
|
||||
return scenario_name
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(lf_tools):
|
||||
dut_object, dut_name = lf_tools.Create_Dut()
|
||||
return dut_name
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def setup_vlan():
|
||||
vlan_id = [100]
|
||||
@@ -31,7 +52,7 @@ def setup_vlan():
|
||||
@allure.feature("CLIENT CONNECTIVITY SETUP")
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment_id,
|
||||
instantiate_profile, get_markers,
|
||||
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos):
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
@@ -104,7 +125,6 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + testbed
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + testbed)
|
||||
try:
|
||||
# pass
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
allure.attach(body=str(radius_info),
|
||||
name="Radius Profile Created")
|
||||
@@ -114,7 +134,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
test_cases['radius_profile'] = False
|
||||
|
||||
# SSID Profile Creation
|
||||
print(get_markers)
|
||||
lf_dut_data = []
|
||||
for mode in profile_data['ssid']:
|
||||
if mode == "open":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
@@ -123,6 +143,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -136,6 +157,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_open_ssid_profile(profile_data=j)
|
||||
test_cases["open_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -145,7 +167,6 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
test_cases["open_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
@@ -153,6 +174,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -165,6 +187,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -181,6 +204,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -193,6 +217,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa2_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -210,7 +235,9 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(profile_data=j)
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa_wpa2_personal_mixed_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
@@ -222,7 +249,9 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(profile_data=j)
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa_wpa2_personal_mixed_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
@@ -238,6 +267,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -250,6 +280,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_personal_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -266,6 +297,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_personal_mixed_2g"] = True
|
||||
@@ -279,6 +311,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_personal_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_personal_mixed_5g"] = True
|
||||
@@ -290,6 +323,37 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa_enterprise":
|
||||
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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_enterprise_2g"] = 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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
if mode == "wpa2_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
@@ -297,6 +361,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -309,6 +374,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa2_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa2_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -318,7 +384,6 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
test_cases["wpa2_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa3_enterprise":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
@@ -326,6 +391,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "twog" in get_markers.keys() and get_markers["twog"] and "is2dot4GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -338,6 +404,7 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
try:
|
||||
if "fiveg" in get_markers.keys() and get_markers["fiveg"] and "is5GHz" in list(
|
||||
j["appliedRadios"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
@@ -348,6 +415,102 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wpa_wpa2_enterprise_mixed":
|
||||
print("shivam", mode)
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_enterprise_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_2g"] = 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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa_wpa2_enterprise_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
if mode == "wpa3_enterprise_mixed":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_2g"] = 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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wpa3_enterprise_mixed_ssid_profile(
|
||||
profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
|
||||
if mode == "wep":
|
||||
for j in profile_data["ssid"][mode]:
|
||||
# print(j)
|
||||
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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wep_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_2g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_2g"] = 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"]):
|
||||
lf_dut_data.append(j)
|
||||
creates_profile = instantiate_profile.create_wep_ssid_profile(profile_data=j)
|
||||
test_cases["wpa3_enterprise_5g"] = True
|
||||
allure.attach(body=str(creates_profile),
|
||||
name="SSID Profile Created")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases["wpa3_enterprise_5g"] = False
|
||||
allure.attach(body=str(e),
|
||||
name="SSID Profile Creation Failed")
|
||||
# Equipment AP Profile Creation
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data['equipment_ap'])
|
||||
@@ -405,7 +568,22 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
time.sleep(10)
|
||||
allure.attach(body=str("VIF Config: " + str(vif_config) + "\n" + "VIF State: " + str(vif_state)),
|
||||
name="SSID Profiles in VIF Config and VIF State: ")
|
||||
print(test_cases)
|
||||
|
||||
ssid_info = ap_ssh.get_ssid_info()
|
||||
ssid_data = []
|
||||
for i in range(0, len(ssid_info)):
|
||||
ssid = ["ssid_idx=" + str(i) + " ssid=" + ssid_info[i][3] +
|
||||
" password=" + ssid_info[i][2] + " bssid=" + ssid_info[i][0]]
|
||||
ssid_data.append(ssid)
|
||||
|
||||
# Add bssid password and security from iwinfo data
|
||||
# Format SSID Data in the below format
|
||||
# ssid_data = [
|
||||
# ['ssid_idx=0 ssid=Default-SSID-2g security=WPA|WEP| password=12345678 bssid=90:3c:b3:94:48:58'],
|
||||
# ['ssid_idx=1 ssid=Default-SSID-5gl password=12345678 bssid=90:3c:b3:94:48:59']
|
||||
# ]
|
||||
|
||||
lf_tools.update_ssid(ssid_data=ssid_data)
|
||||
|
||||
def teardown_session():
|
||||
print("\nRemoving Profiles")
|
||||
@@ -423,7 +601,9 @@ def setup_profiles(request, setup_controller, testbed, setup_vlan, get_equipment
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration):
|
||||
# print(get_configuration)
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'])
|
||||
# pytest.exit("")
|
||||
yield obj
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,13 @@
|
||||
import pytest
|
||||
pytestmark = [pytest.mark.dataplane_throughput_test, pytest.mark.bridge]
|
||||
import sys
|
||||
import allure
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
import lf_dataplane_test
|
||||
import time
|
||||
from lf_dataplane_test import DataplaneTest
|
||||
import create_station
|
||||
from create_station import CreateStation
|
||||
import os
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.bridge, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"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"],
|
||||
@@ -40,194 +28,70 @@ setup_params_general = {
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDataplaneThroughputBridge(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.shivamt
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, setup_profiles, get_lanforge_data):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(20)
|
||||
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_2g_bridge",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1."+station_name,
|
||||
raw_lines=['pkts: Custom;60;142;256;512;1024;MTU'],
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
# Write Your test case Here
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_5g_bridge",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1."+station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_2g(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_2g_bridge",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
|
||||
assert PASS
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["BRIDGE"]["WPA2_P"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_5g(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut, get_configuration):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
# Write Your test case Here
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = 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 station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode, instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/"+report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf, name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_5g_bridge",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
import os
|
||||
import pytest
|
||||
pytestmark = [pytest.mark.dataplane_throughput_test, pytest.mark.nat]
|
||||
import sys
|
||||
import time
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
import lf_dataplane_test
|
||||
from lf_dataplane_test import DataplaneTest
|
||||
import create_station
|
||||
from create_station import CreateStation
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"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"],
|
||||
@@ -30,7 +17,7 @@ setup_params_general = {
|
||||
|
||||
|
||||
@pytest.mark.basic
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
@@ -38,298 +25,74 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestDataplaneThroughputNat(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_2g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines=["pkts: Custom"],
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
# Write Your test case Here
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_5g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1."+station_name,
|
||||
raw_lines=["pkts: Custom"],
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
class TestDataplaneThroughputNAT(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_2g(self, setup_profiles, lf_test, station_names_twog, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_2g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines=["pkts: Custom"],
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
# Write Your test case Here
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_5g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_e_2g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_enterprise_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_E"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
# Write Your test case Here
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_e_5g_nat",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = 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 station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -1,368 +1,100 @@
|
||||
import os
|
||||
|
||||
import pytest
|
||||
pytestmark = [pytest.mark.dataplane_throughput_test, pytest.mark.vlan]
|
||||
import sys
|
||||
import time
|
||||
import allure
|
||||
|
||||
for folder in 'py-json', 'py-scripts':
|
||||
if folder not in sys.path:
|
||||
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
|
||||
import lf_dataplane_test
|
||||
from lf_dataplane_test import DataplaneTest
|
||||
import create_station
|
||||
from create_station import CreateStation
|
||||
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test, pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"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.dataplane_throughput_test
|
||||
@pytest.mark.vlan
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.basic
|
||||
@pytest.mark.shivam
|
||||
@allure.feature("VLAN MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["VLAN"], ["VLAN"])],
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestDataplaneThroughputVlan(object):
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_2g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1."+station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
# Write Your test case Here
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa_5g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1."+station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
class TestDataplaneThroughputVLAN(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
def test_client_wpa2_personal_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_2g(self, setup_profiles, lf_test, station_names_twog, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_2g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
if station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_twog, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_2G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_personal_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_P"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
def test_client_wpa2_personal_5g(self, setup_profiles, lf_test, station_names_fiveg, get_configuration,
|
||||
create_lanforge_chamberview_dut):
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
# Write Your test case Here
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_p_5g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.radius
|
||||
def test_client_wpa2_enterprise_2g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["2G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_2dot4g"]
|
||||
station_name = get_lanforge_data["lanforge_2dot4g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_e_2g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
|
||||
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_client_wpa2_enterprise_5g(self, get_lanforge_data, setup_profile_data):
|
||||
profile_data = setup_profile_data["VLAN"]["WPA2_E"]["5G"]
|
||||
lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
ssid = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
upstream = get_lanforge_data["lanforge_vlan_port"]
|
||||
radio = get_lanforge_data["lanforge_5g"]
|
||||
# Write Your test case Here
|
||||
station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
create_station = CreateStation(_host=lanforge_ip,
|
||||
_port=lanforge_port,
|
||||
_ssid=ssid,
|
||||
_password=security_key,
|
||||
_security=security,
|
||||
_sta_list=[station_name],
|
||||
_radio=radio)
|
||||
|
||||
create_station.build()
|
||||
time.sleep(60)
|
||||
PASS = False
|
||||
if create_station.wait_for_ip([station_name]):
|
||||
create_station._pass("ALL Stations got IP's", print_=True)
|
||||
CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
lf_port=lanforge_port,
|
||||
lf_user="lanforge",
|
||||
lf_password="lanforge",
|
||||
instance_name="dpt_instance_wpa2_e_5g_vlan",
|
||||
config_name="dpt_config",
|
||||
upstream="1.1." + upstream,
|
||||
pull_report=True,
|
||||
load_old_cfg=False,
|
||||
download_speed="85%",
|
||||
upload_speed="0",
|
||||
duration="15s",
|
||||
dut="TIP",
|
||||
station="1.1." + station_name,
|
||||
raw_lines="pkts: Custom",
|
||||
)
|
||||
CV_Test.setup()
|
||||
CV_Test.run()
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
# @pytest.mark.modify_ssid
|
||||
# @pytest.mark.parametrize(
|
||||
# 'update_ssid',
|
||||
# (["VLAN, WPA, 5G, Sanity-updated-5G-WPA-VLAN"]),
|
||||
# indirect=True
|
||||
# )
|
||||
# def test_modify_ssid(self, get_lanforge_data, setup_profile_data):
|
||||
# profile_data = setup_profile_data["VLAN"]["WPA"]["5G"]
|
||||
# lanforge_ip = get_lanforge_data["lanforge_ip"]
|
||||
# lanforge_port = int(get_lanforge_data["lanforge-port-number"])
|
||||
# ssid = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# upstream = get_lanforge_data["lanforge_bridge_port"]
|
||||
# radio = get_lanforge_data["lanforge_5g"]
|
||||
# # Write Your test case Here
|
||||
# station_name = get_lanforge_data["lanforge_5g_station"]
|
||||
# create_station = CreateStation(_host=lanforge_ip,
|
||||
# _port=lanforge_port,
|
||||
# _ssid=ssid,
|
||||
# _password=security_key,
|
||||
# _security=security,
|
||||
# _sta_list=[station_name],
|
||||
# _radio=radio)
|
||||
#
|
||||
# create_station.build()
|
||||
# time.sleep(60)
|
||||
# PASS = False
|
||||
# if create_station.wait_for_ip([station_name]):
|
||||
# create_station._pass("ALL Stations got IP's", print_=True)
|
||||
# CV_Test = DataplaneTest(lf_host=lanforge_ip,
|
||||
# lf_port=lanforge_port,
|
||||
# lf_user="lanforge",
|
||||
# lf_password="lanforge",
|
||||
# instance_name="dpt_instance_wpa_vlan_5g_vlan",
|
||||
# config_name="dpt_config",
|
||||
# upstream="1.1." + upstream,
|
||||
# pull_report=True,
|
||||
# load_old_cfg=False,
|
||||
# download_speed="85%",
|
||||
# upload_speed="0",
|
||||
# duration="15s",
|
||||
# dut="TIP",
|
||||
# station="1.1." + station_name,
|
||||
# raw_lines="pkts: Custom",
|
||||
# )
|
||||
# CV_Test.setup()
|
||||
# CV_Test.run()
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
station = 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 station:
|
||||
dp_obj = lf_test.dataplane(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="TIP_PERF_DPT_WPA2_5G",
|
||||
vlan_id=vlan, dut_name=dut_name)
|
||||
report_name = dp_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "_dataplane")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -25,20 +25,20 @@ class TestFirmware(object):
|
||||
PASS = False
|
||||
assert PASS
|
||||
|
||||
# @pytest.mark.firmware_upgrade
|
||||
# def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
# print()
|
||||
# if not upgrade_firmware:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=0,
|
||||
# msg='Error requesting upgrade via API')
|
||||
# PASS = False
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
# status_id=1,
|
||||
# msg='Upgrade request using API successful')
|
||||
# PASS = True
|
||||
# assert PASS
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, upgrade_firmware, update_report, test_cases):
|
||||
print(upgrade_firmware)
|
||||
if not upgrade_firmware:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=0,
|
||||
msg='Error requesting upgrade via API')
|
||||
PASS = False
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["upgrade_api"],
|
||||
status_id=1,
|
||||
msg='Upgrade request using API successful')
|
||||
PASS = True
|
||||
assert PASS
|
||||
|
||||
@pytest.mark.check_active_firmware_cloud
|
||||
def test_active_version_cloud(self, get_latest_firmware, check_ap_firmware_cloud, update_report, test_cases):
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.test_lanforge_connectivity
|
||||
def test_cv(check_lanforge_connectivity):
|
||||
assert True
|
||||
@@ -0,0 +1,426 @@
|
||||
# import allure
|
||||
# import pytest
|
||||
#
|
||||
# # pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity,
|
||||
# pytest.mark.usefixtures("setup_test_run")]
|
||||
#
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeEnterpriseTLSSuiteOne(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
#
|
||||
# setup_params_enterprise_two = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeEnterpriseTLSSuiteTwo(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
@@ -0,0 +1,383 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.general, pytest.mark.sanity, pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
@@ -349,11 +349,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
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)
|
||||
|
||||
@@ -377,11 +378,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
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)
|
||||
|
||||
@@ -398,212 +400,81 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeEnterprise(object):
|
||||
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "BRIDGE"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "BRIDGE",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestBridgeModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "BRIDGE"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_bridge"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - bridge mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
@@ -0,0 +1,425 @@
|
||||
# import allure
|
||||
# import pytest
|
||||
#
|
||||
# # pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity, pytest.mark.usefixtures("setup_test_run")]
|
||||
#
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "NAT",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestNATModeEnterpriseTLSSuiteOne(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
#
|
||||
# setup_params_enterprise_two = {
|
||||
# "mode": "NAT",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestNATModeEnterpriseTLSSuiteTwo(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
@@ -0,0 +1,383 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.NAT, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat, pytest.mark.general, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
@@ -102,12 +102,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -129,12 +129,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -157,12 +157,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -185,12 +185,12 @@ class TestNATModeConnectivitySuiteOne(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_nat"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_nat"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -245,12 +245,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -272,12 +272,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -301,12 +301,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -329,12 +329,12 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -349,21 +349,22 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
@@ -377,233 +378,103 @@ class TestNATModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestNATModeEnterprise(object):
|
||||
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "NAT"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "NAT"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_NAT"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "NAT",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestNATModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "NAT"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - NAT mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
@@ -0,0 +1,425 @@
|
||||
# import allure
|
||||
# import pytest
|
||||
#
|
||||
# # pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.tls, pytest.mark.sanity]
|
||||
#
|
||||
# setup_params_enterprise = {
|
||||
# "mode": "VLAN",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestVLANModeEnterpriseTLSSuiteOne(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
#
|
||||
# setup_params_enterprise_two = {
|
||||
# "mode": "VLAN",
|
||||
# "ssid_modes": {
|
||||
# "wpa_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa2_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa3_enterprise": [
|
||||
# {"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
#
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_enterprise],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestVLANModeEnterpriseTLSSuiteTwo(object):
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa"
|
||||
# extra_secu = ["wpa2"]
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa2_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa3_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security = "wpa3"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
@@ -0,0 +1,385 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.ttls,
|
||||
pytest.mark.sanity]
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
|
||||
setup_params_enterprise_two = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_wpa2_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_mixed_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise_two],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
if exit_on_fail:
|
||||
pytest.exit("Test Case Failed")
|
||||
assert passes
|
||||
@@ -1,7 +1,7 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.VLAN, pytest.mark.sanity]
|
||||
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan, pytest.mark.general, pytest.mark.sanity]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
@@ -41,18 +41,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
@@ -68,18 +68,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "open"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
# if result:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
@@ -96,18 +96,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -123,18 +123,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -151,18 +151,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA2 Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA2 Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -179,18 +179,18 @@ class TestVLANModeConnectivitySuiteOne(object):
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_vlan"],
|
||||
status_id=1,
|
||||
msg='5G WPA2 Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["5g_wpa2_vlan"],
|
||||
status_id=5,
|
||||
msg='5G WPA2 Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -239,18 +239,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -266,18 +266,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -295,18 +295,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -323,18 +323,18 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -349,21 +349,22 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
@@ -377,233 +378,103 @@ class TestVLANModeConnectivitySuiteTwo(object):
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
security = "wpa"
|
||||
extra_secu = ["wpa2"]
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
vlan = 100
|
||||
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)
|
||||
|
||||
if result:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert result
|
||||
|
||||
|
||||
setup_params_enterprise = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.enterprise
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_enterprise],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestVLANModeEnterprise(object):
|
||||
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.twog
|
||||
# def test_wpa_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wpa_enterprise
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wpa_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# ttls_passwd = radius_info["password"]
|
||||
# eap = "TTLS"
|
||||
# identity = radius_info['user']
|
||||
# passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
test_cases, radius_info):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security = "wpa3"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
ttls_passwd = radius_info["password"]
|
||||
eap = "TTLS"
|
||||
identity = radius_info['user']
|
||||
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
|
||||
mode=mode, band=band,
|
||||
eap=eap, ttls_passwd=ttls_passwd, identity=identity,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if passes:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=1,
|
||||
msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
passes))
|
||||
else:
|
||||
update_report.update_testrail(case_id=test_cases["2g_wpa_VLAN"],
|
||||
status_id=5,
|
||||
msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
passes))
|
||||
assert passes
|
||||
# setup_params_wep = {
|
||||
# "mode": "VLAN",
|
||||
# "ssid_modes": {
|
||||
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["is2dot4GHz"], "default_key_id": 1,
|
||||
# "wep_key": 1234567890},
|
||||
# {"ssid_name": "ssid_wep_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "default_key_id": 1, "wep_key": 1234567890}]
|
||||
# },
|
||||
# "rf": {},
|
||||
# "radius": True
|
||||
# }
|
||||
#
|
||||
#
|
||||
# @pytest.mark.enterprise
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_wep],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# class TestVLANModeWEP(object):
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.twog
|
||||
# def test_wep_2g(self, station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
#
|
||||
# @pytest.mark.wep
|
||||
# @pytest.mark.fiveg
|
||||
# def test_wep_5g(self, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
|
||||
# test_cases, radius_info):
|
||||
# profile_data = setup_params_wep["ssid_modes"]["wep"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# wep_key = "[BLANK]"
|
||||
# security = "open"
|
||||
# extra_secu = []
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
|
||||
# passkey=wep_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
#
|
||||
# if passes:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=1,
|
||||
# msg='2G WPA Client Connectivity Passed successfully - VLAN mode' + str(
|
||||
# passes))
|
||||
# else:
|
||||
# update_report.update_testrail(case_id=test_cases["2g_wpa_vlan"],
|
||||
# status_id=5,
|
||||
# msg='2G WPA Client Connectivity Failed - VLAN mode' + str(
|
||||
# passes))
|
||||
# assert passes
|
||||
15
tests/e2e/interOp/README.md
Normal file
15
tests/e2e/interOp/README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# wlan-testing framework Information
|
||||
|
||||
## pytest uses setup > test > tear_down
|
||||
#### Fixtures : Code that needs to be part of more than 1 test cases, Setup and teardown is Implemented in Fixtures
|
||||
|
||||
|
||||
#pip3 install selenium
|
||||
#pip3 install perfecto-py37
|
||||
#pip3 install Appium-Python-Client
|
||||
|
||||
#### For any Clarifications, regarding Framework,
|
||||
#### Email : shivam.thakur@candelatech.com
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,478 @@
|
||||
import datetime
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
import warnings
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
import urllib3
|
||||
from perfecto.model.model import Job, Project
|
||||
from perfecto import (PerfectoExecutionContext, PerfectoReportiumClient,TestContext, TestResultFactory)
|
||||
import pytest
|
||||
import logging
|
||||
import re
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
if "libs" not in sys.path:
|
||||
sys.path.append(f'../libs')
|
||||
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller import Controller
|
||||
from controller.controller import ProfileUtility
|
||||
from controller.controller import FirmwareUtility
|
||||
import pytest
|
||||
import logging
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
os.path.realpath(__file__)
|
||||
)
|
||||
)
|
||||
if "tests" not in sys.path:
|
||||
sys.path.append(f'../tests')
|
||||
|
||||
from configuration import CONFIGURATION
|
||||
|
||||
from urllib3 import exceptions
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_perfectoMobileWeb(request):
|
||||
from selenium import webdriver
|
||||
rdriver = None
|
||||
reporting_client = None
|
||||
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
capabilities = {
|
||||
'platformName': request.config.getini("platformName-iOS"),
|
||||
'model': request.config.getini("model-iOS"),
|
||||
'browserName': request.config.getini("browserType-iOS"),
|
||||
'securityToken' : request.config.getini("securityToken"),
|
||||
}
|
||||
|
||||
rdriver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
||||
rdriver.implicitly_wait(35)
|
||||
|
||||
projectname = request.config.getini("projectName")
|
||||
projectversion = request.config.getini("projectVersion")
|
||||
jobname = request.config.getini("jobName")
|
||||
jobnumber = request.config.getini("jobNumber")
|
||||
tags = request.config.getini("reportTags")
|
||||
testCaseName = request.config.getini("jobName")
|
||||
|
||||
print("Setting Perfecto ReportClient....")
|
||||
perfecto_execution_context = PerfectoExecutionContext(rdriver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
||||
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
||||
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||
|
||||
def teardown():
|
||||
try:
|
||||
print(" -- Tear Down --")
|
||||
reporting_client.test_stop(TestResultFactory.create_success())
|
||||
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
||||
rdriver.close()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To close --")
|
||||
print (e.message)
|
||||
finally:
|
||||
try:
|
||||
rdriver.quit()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To Quit --")
|
||||
print (e.message)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
if rdriver is None:
|
||||
yield -1
|
||||
else:
|
||||
yield rdriver,reporting_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_perfectoMobile_iOS(request):
|
||||
from appium import webdriver
|
||||
driver = None
|
||||
reporting_client = None
|
||||
|
||||
warnings.simplefilter("ignore", ResourceWarning)
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
|
||||
|
||||
|
||||
capabilities = {
|
||||
'platformName': request.config.getini("platformName-iOS"),
|
||||
'model': request.config.getini("model-iOS"),
|
||||
'browserName': 'safari',
|
||||
#'automationName' : 'Appium',
|
||||
'securityToken' : request.config.getini("securityToken"),
|
||||
'useAppiumForWeb' : 'false',
|
||||
'useAppiumForHybrid' : 'false',
|
||||
#'bundleId' : request.config.getini("bundleId-iOS"),
|
||||
}
|
||||
|
||||
driver = webdriver.Remote('https://'+request.config.getini("perfectoURL")+'.perfectomobile.com/nexperience/perfectomobile/wd/hub', capabilities)
|
||||
driver.implicitly_wait(35)
|
||||
|
||||
TestCaseFullName = os.environ.get('PYTEST_CURRENT_TEST').split(':')[-1].split(' ')[0]
|
||||
nCurrentTestMethodNameSplit = re.sub(r'\[.*?\]\ *', "", TestCaseFullName)
|
||||
TestCaseName = nCurrentTestMethodNameSplit.removeprefix('test_')
|
||||
#print ("\nTestCaseName: " + TestCaseName)
|
||||
|
||||
projectname = request.config.getini("projectName")
|
||||
projectversion = request.config.getini("projectVersion")
|
||||
jobname = request.config.getini("jobName")
|
||||
jobnumber = request.config.getini("jobNumber")
|
||||
tags = request.config.getini("reportTags")
|
||||
testCaseName = TestCaseName
|
||||
|
||||
print("\nSetting Perfecto ReportClient....")
|
||||
perfecto_execution_context = PerfectoExecutionContext(driver, tags, Job(jobname, jobnumber),Project(projectname, projectversion))
|
||||
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
||||
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||
|
||||
def teardown():
|
||||
try:
|
||||
print(" -- Tear Down --")
|
||||
reporting_client.test_stop(TestResultFactory.create_success())
|
||||
print('Report-Url: ' + reporting_client.report_url() + '\n')
|
||||
driver.close()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To close --")
|
||||
print (e.message)
|
||||
finally:
|
||||
try:
|
||||
driver.quit()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To Quit --")
|
||||
print (e.message)
|
||||
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
if driver is None:
|
||||
yield -1
|
||||
else:
|
||||
yield driver,reporting_client
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_PassPointConniOS_data(request):
|
||||
passPoint_data = {
|
||||
"netAnalyzer-inter-Con-Xpath": "//*[@label='Network Connected']/parent::*/XCUIElementTypeButton",
|
||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||
"bundleId-iOS-Ping": request.config.getini("bundleId-iOS-Ping")
|
||||
}
|
||||
yield passPoint_data
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_APToMobileDevice_data(request):
|
||||
passPoint_data = {
|
||||
"webURL": "https://www.google.com",
|
||||
"lblSearch": "//*[@class='gLFyf']",
|
||||
"elelSearch": "(//*[@class='sbic sb43'])[1]",
|
||||
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||
"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']",
|
||||
"lblSearch2": "test "
|
||||
}
|
||||
yield passPoint_data
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_AccessPointConn_data(request):
|
||||
passPoint_data = {
|
||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||
"bundleId-iOS-Ping": request.config.getini("bundleId-iOS-Ping")
|
||||
}
|
||||
yield passPoint_data
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_ToggleAirplaneMode_data(request):
|
||||
passPoint_data = {
|
||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings"),
|
||||
"lblSearch": "//*[@class='gLFyf']",
|
||||
"elelSearch": "(//*[@class='fSXkBc'])[1]",
|
||||
"BtnRunSpeedTest": "//*[text()='RUN SPEED TEST']",
|
||||
"downloadMbps": "//*[@id='knowledge-verticals-internetspeedtest__download']/P[@class='spiqle']",
|
||||
"UploadMbps": "//*[@id='knowledge-verticals-internetspeedtest__upload']/P[@class='spiqle']",
|
||||
|
||||
}
|
||||
yield passPoint_data
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_ToggleWifiMode_data(request):
|
||||
passPoint_data = {
|
||||
"bundleId-iOS-Settings": request.config.getini("bundleId-iOS-Settings")
|
||||
}
|
||||
yield passPoint_data
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_lanforge_data(testbed):
|
||||
lanforge_data = {}
|
||||
if CONFIGURATION[testbed]['traffic_generator']['name'] == 'lanforge':
|
||||
lanforge_data = {
|
||||
"lanforge_ip": CONFIGURATION[testbed]['traffic_generator']['details']['ip'],
|
||||
"lanforge-port-number": CONFIGURATION[testbed]['traffic_generator']['details']['port'],
|
||||
"lanforge_2dot4g": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Radio'][0],
|
||||
"lanforge_5g": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Radio'][0],
|
||||
"lanforge_2dot4g_prefix": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_prefix": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_2dot4g_station": CONFIGURATION[testbed]['traffic_generator']['details']['2.4G-Station-Name'],
|
||||
"lanforge_5g_station": CONFIGURATION[testbed]['traffic_generator']['details']['5G-Station-Name'],
|
||||
"lanforge_bridge_port": CONFIGURATION[testbed]['traffic_generator']['details']['upstream'],
|
||||
"lanforge_vlan_port": CONFIGURATION[testbed]['traffic_generator']['details']['upstream'] + ".100",
|
||||
"vlan": 100
|
||||
}
|
||||
yield lanforge_data
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def instantiate_profile(instantiate_controller):
|
||||
#try:
|
||||
profile_object = ProfileUtility(sdk_client=instantiate_controller)
|
||||
#except:
|
||||
#profile_object = False
|
||||
yield profile_object
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_equipment_id(instantiate_controller, testbed):
|
||||
equipment_id = 0
|
||||
if len(CONFIGURATION[testbed]['access_point']) == 1:
|
||||
equipment_id = instantiate_controller.get_equipment_id(
|
||||
serial_number=CONFIGURATION[testbed]['access_point'][0]['serial'])
|
||||
yield equipment_id
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upload_firmware(should_upload_firmware, instantiate_firmware, get_latest_firmware):
|
||||
firmware_id = instantiate_firmware.upload_fw_on_cloud(fw_version=get_latest_firmware,
|
||||
force_upload=should_upload_firmware)
|
||||
yield firmware_id
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_firmware_cloud, get_latest_firmware,
|
||||
should_upgrade_firmware):
|
||||
if get_latest_firmware != check_ap_firmware_cloud:
|
||||
if request.config.getoption("--skip-upgrade"):
|
||||
status = "skip-upgrade"
|
||||
else:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
if should_upgrade_firmware:
|
||||
status = instantiate_firmware.upgrade_fw(equipment_id=get_equipment_id, force_upload=False,
|
||||
force_upgrade=should_upgrade_firmware)
|
||||
else:
|
||||
status = "skip-upgrade"
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def check_ap_firmware_cloud(instantiate_controller, get_equipment_id):
|
||||
yield instantiate_controller.get_ap_firmware_old_method(equipment_id=get_equipment_id)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Profiles Related Fixtures
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def get_current_profile_cloud(instantiate_profile):
|
||||
ssid_names = []
|
||||
for i in instantiate_profile.profile_creation_ids["ssid"]:
|
||||
ssid_names.append(instantiate_profile.get_ssid_name_by_profile_id(profile_id=i))
|
||||
yield ssid_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def setup_profiles(request, create_profiles, instantiate_profile, get_equipment_id, get_current_profile_cloud, testbed):
|
||||
test_cases = {}
|
||||
mode = str(request.param[0]).lower()
|
||||
try:
|
||||
instantiate_profile.push_profile_old_method(equipment_id=get_equipment_id)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("failed to Push Profile")
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
|
||||
get_current_profile_cloud.sort()
|
||||
# This loop will check the VIF Config with cloud profile
|
||||
for i in range(0, 18):
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(get_current_profile_cloud)
|
||||
if get_current_profile_cloud == vif_config:
|
||||
test_cases[mode + '_vifc'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
ap_ssh = APNOS(CONFIGURATION[testbed]['access_point'][0], pwd="../libs/apnos/")
|
||||
# This loop will check the VIF Config with VIF State
|
||||
for i in range(0, 18):
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
vif_state.sort()
|
||||
vif_config = list(ap_ssh.get_vif_config_ssids())
|
||||
vif_config.sort()
|
||||
print(vif_config)
|
||||
print(vif_state)
|
||||
if vif_state == vif_config:
|
||||
test_cases[mode + '_vifs'] = True
|
||||
break
|
||||
time.sleep(10)
|
||||
#
|
||||
yield test_cases
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def create_profiles(request, testbed, get_security_flags, get_markers, instantiate_profile, setup_profile_data):
|
||||
profile_id = {"ssid": [], "rf": None, "radius": None, "equipment_ap": None}
|
||||
mode = str(request.param[0])
|
||||
test_cases = {}
|
||||
if mode not in ["BRIDGE", "NAT", "VLAN"]:
|
||||
print("Invalid Mode: ", mode)
|
||||
yield False
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Equipment-AP-" + mode)
|
||||
for i in setup_profile_data[mode]:
|
||||
for j in setup_profile_data[mode][i]:
|
||||
instantiate_profile.delete_profile_by_name(
|
||||
profile_name=setup_profile_data[mode][i][j]['profile_name'])
|
||||
instantiate_profile.delete_profile_by_name(profile_name=testbed + "-Automation-Radius-Profile-" + mode)
|
||||
instantiate_profile.get_default_profiles()
|
||||
profile_data = {
|
||||
"name": "RF-Profile-" + CONFIGURATION[testbed]['access_point'][0]['mode'] +
|
||||
CONFIGURATION[testbed]['access_point'][0]['model'] + "_" + mode + "_" + testbed
|
||||
}
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['name'])
|
||||
instantiate_profile.set_rf_profile(profile_data=profile_data,
|
||||
mode=CONFIGURATION[testbed]['access_point'][0]['mode'])
|
||||
# Create RF Profile Here
|
||||
if get_markers["radius"]:
|
||||
radius_info = RADIUS_SERVER_DATA
|
||||
radius_info["name"] = testbed + "-Automation-Radius-Profile-" + mode
|
||||
try:
|
||||
instantiate_profile.create_radius_profile(radius_info=radius_info)
|
||||
test_cases['radius_profile'] = True
|
||||
except Exception as e:
|
||||
test_cases['radius_profile'] = False
|
||||
for i in get_security_flags:
|
||||
if get_markers[i] and i == "open":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_open_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["OPEN"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_open_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_open_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=True, fiveg=False, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa_ssid_profile(two4g=False, fiveg=True, profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_personal":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_wpa2_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_P"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_personal_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_wpa2_' + mode.lower()] = False
|
||||
if get_markers[i] and i == "wpa2_enterprise":
|
||||
if get_markers["twog"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["2G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=True, fiveg=False,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_2g_eap_' + mode.lower()] = False
|
||||
if get_markers["fiveg"]:
|
||||
profile_data = setup_profile_data[mode]["WPA2_E"]["5G"]
|
||||
try:
|
||||
id = instantiate_profile.create_wpa2_enterprise_ssid_profile(two4g=False, fiveg=True,
|
||||
profile_data=profile_data)
|
||||
profile_id["ssid"].append(profile_data['ssid_name'])
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
test_cases['ssid_5g_eap_' + mode.lower()] = False
|
||||
|
||||
# Create Equipment AP Profile Here
|
||||
profile_data = {
|
||||
"profile_name": testbed + "-Equipment-AP-" + mode
|
||||
}
|
||||
try:
|
||||
instantiate_profile.set_ap_profile(profile_data=profile_data)
|
||||
test_cases['ap_' + mode.lower()] = True
|
||||
except Exception as e:
|
||||
print(e)
|
||||
test_cases['ap_' + mode.lower()] = False
|
||||
|
||||
def teardown_profiles():
|
||||
print("\nRemoving Profiles")
|
||||
instantiate_profile.delete_profile_by_name(profile_name=profile_data['profile_name'])
|
||||
time.sleep(20)
|
||||
|
||||
request.addfinalizer(teardown_profiles)
|
||||
yield test_cases
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def update_ssid(request, instantiate_profile, setup_profile_data):
|
||||
requested_profile = str(request.param).replace(" ", "").split(",")
|
||||
profile = setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]
|
||||
status = instantiate_profile.update_ssid_name(profile_name=profile["profile_name"],
|
||||
new_profile_name=requested_profile[3])
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["profile_name"] = \
|
||||
requested_profile[3]
|
||||
setup_profile_data[requested_profile[0]][requested_profile[1]][requested_profile[2]]["ssid_name"] = \
|
||||
requested_profile[3]
|
||||
time.sleep(90)
|
||||
yield status
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
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
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
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
|
||||
|
||||
@pytest.mark.AccessPassPointConnectivety
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestAccessPointConnectivety(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_AccessPointConnection_5g_WPA2_Personal(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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_AccessPointConn_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Need An ip To ping
|
||||
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_AccessPointConnection_2g_WPA2_Personal(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
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_AccessPointConn_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Need An ip To ping
|
||||
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_AccessPointConnection_5g_WPA(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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_AccessPointConn_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Need An ip To ping
|
||||
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_AccessPointConnection_2g_WPA(self, setup_profile_data, get_AccessPointConn_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
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_AccessPointConn_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Need An ip To ping
|
||||
wifi_ip = get_WifiIPAddress_iOS(setup_perfectoMobile_iOS, connData, ssidName)
|
||||
|
||||
#Open Ping Application
|
||||
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)
|
||||
|
||||
ping_deftapps_iOS(setup_perfectoMobile_iOS, wifi_ip)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
136
tests/e2e/interOp/iOS/AirplaneMode/test_ToggleAirplaneMode.py
Normal file
136
tests/e2e/interOp/iOS/AirplaneMode/test_ToggleAirplaneMode.py
Normal file
@@ -0,0 +1,136 @@
|
||||
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
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
@pytest.mark.ToggleAirplaneMode
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestToggleAirplaneMode(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ToogleAirplaneMode_5g_WPA2_Personal(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
assert Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ToogleAirplaneMode_2g_WPA2_Personal(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ToogleAirplaneMode_5g_WPA(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ToogleAirplaneMode_2g_WPA(self, setup_profile_data, get_ToggleAirplaneMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle AirplaneMode
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
assert verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
138
tests/e2e/interOp/iOS/PassPoint/test_PassPointConnection.py
Normal file
138
tests/e2e/interOp/iOS/PassPoint/test_PassPointConnection.py
Normal file
@@ -0,0 +1,138 @@
|
||||
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
|
||||
|
||||
from urllib3 import exceptions
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
@pytest.mark.PassPointConnection
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestPassPointConnection(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_PassPointConnection_5g_WPA2_Personal(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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_PassPointConniOS_data
|
||||
|
||||
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||
assert Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
#Close Settings App
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_PassPointConnection_2g_WPA2_Personal(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
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_PassPointConniOS_data
|
||||
|
||||
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
#Close Settings App
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_PassPointConnection_2g_WPA(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
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_PassPointConniOS_data
|
||||
|
||||
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
#Close Settings App
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_PassPointConnection_5g_WPA(self,setup_profile_data, setup_perfectoMobile_iOS, get_PassPointConniOS_data):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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_PassPointConniOS_data
|
||||
|
||||
#Set Wifi Access Mode to #Default-SSID-5gl-perfecto-b/#Default-SSID-2gl-perfecto-b
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle Airplane Mode and Ensure Wifi Connection.
|
||||
Toggle_AirplaneMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
#Close Settings App
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile_iOS)
|
||||
140
tests/e2e/interOp/iOS/WifiMode/test_ToggleWifiMode.py
Normal file
140
tests/e2e/interOp/iOS/WifiMode/test_ToggleWifiMode.py
Normal file
@@ -0,0 +1,140 @@
|
||||
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
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, Toggle_AirplaneMode_iOS, ForgetWifiConnection, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
@pytest.mark.ToggleWifiMode
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestToggleWifiMode(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ToogleWifiMode_5g_WPA2_Personal(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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_ToggleWifiMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle WifiMode
|
||||
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
assert value
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ToogleWifiMode_2g_WPA2_Personal(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
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_ToggleWifiMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle WifiMode
|
||||
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
assert value
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ToogleWifiMode_5g_WPA(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
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_ToggleWifiMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle WifiMode
|
||||
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
assert value
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ToogleWifiMode_2g_WPA(self, setup_profile_data, get_ToggleWifiMode_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
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_ToggleWifiMode_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Toggle WifiMode
|
||||
Toggle_WifiMode_iOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify AP After AirplaneMode
|
||||
value = verify_APconnMobileDevice_iOS(ssidName, setup_perfectoMobile_iOS, connData)
|
||||
assert value
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
125
tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py
Normal file
125
tests/e2e/interOp/iOS/client_connectivity/test_NatMode.py
Normal file
@@ -0,0 +1,125 @@
|
||||
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
|
||||
#pytestmark = [pytest.mark.ClientConnectivity, pytest.mark.nat, pytest.mark.interop]
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, verifyUploadDownloadSpeediOS, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown
|
||||
|
||||
@pytest.mark.ClientConnectivity
|
||||
@pytest.mark.wifi5
|
||||
@pytest.mark.wifi6
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles, create_profiles',
|
||||
[(["NAT"], ["NAT"])],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.usefixtures("create_profiles")
|
||||
class TestNatMode(object):
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_5g_WPA2_Personal(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["5G"]
|
||||
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(ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(setup_perfectoMobile_iOS, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobile_iOS, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_2g_WPA2_Personal(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA2_P"]["2G"]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
assert verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_2g_WPA(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["2G"]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_5g_WPA(self, setup_profile_data, get_APToMobileDevice_data, setup_perfectoMobileWeb):
|
||||
|
||||
profile_data = setup_profile_data["NAT"]["WPA"]["5G"]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print ("SSID_NAME: " + ssidName)
|
||||
print ("SSID_PASS: " + ssidPassword)
|
||||
|
||||
report = setup_perfectoMobileWeb[1]
|
||||
driver = setup_perfectoMobileWeb[0]
|
||||
connData = get_APToMobileDevice_data
|
||||
|
||||
#Set Wifi/AP Mode
|
||||
set_APconnMobileDevice_iOS(ssidName, ssidPassword, setup_perfectoMobileWeb, connData)
|
||||
|
||||
#Verify Upload download Speed from device Selection
|
||||
verifyUploadDownloadSpeediOS(setup_perfectoMobileWeb, connData)
|
||||
|
||||
#ForgetWifi
|
||||
ForgetWifiConnection(setup_perfectoMobileWeb, ssidName, connData)
|
||||
@@ -32,3 +32,35 @@ filterwarnings =
|
||||
markers =
|
||||
sanity: Run the sanity for Client Connectivity test
|
||||
|
||||
|
||||
#--- Perfecto parameters -----
|
||||
perfectoURL=tip
|
||||
securityToken=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJqdGkiOiJjYjRjYjQzYi05Y2FiLTQxNzQtOTYxYi04MDEwNTZkNDM2MzgiLCJleHAiOjAsIm5iZiI6MCwiaWF0IjoxNjExNTk0NzcxLCJpc3MiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoMi5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvdGlwLXBlcmZlY3RvbW9iaWxlLWNvbSIsInN1YiI6IjdiNTMwYWUwLTg4MTgtNDdiOS04M2YzLTdmYTBmYjBkZGI0ZSIsInR5cCI6Ik9mZmxpbmUiLCJhenAiOiJvZmZsaW5lLXRva2VuLWdlbmVyYXRvciIsIm5vbmNlIjoiZTRmOTY4NjYtZTE3NS00YzM2LWEyODMtZTQwMmI3M2U5NzhlIiwiYXV0aF90aW1lIjowLCJzZXNzaW9uX3N0YXRlIjoiYWNkNTQ3MTctNzJhZC00MGU3LWI0ZDctZjlkMTAyNDRkNWZlIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJyZXBvcnRpdW0iOnsicm9sZXMiOlsiYWRtaW5pc3RyYXRvciJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.SOL-wlZiQ4BoLLfaeIW8QoxJ6xzrgxBjwSiSzkLBPYw
|
||||
#PS Token
|
||||
#securityToken=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIyODhhNDIyNS1jOTE1LTQwZDctOTc2YS04MDhiMWE3YTFmODYifQ.eyJpYXQiOjE2MjA4NTU1NTcsImp0aSI6IjNiMWJiNWNhLTkzOTgtNDViOC04YmZkLTAxNjdhNGZjNDY1NCIsImlzcyI6Imh0dHBzOi8vYXV0aC5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvcHMtcGVyZmVjdG9tb2JpbGUtY29tIiwiYXVkIjoiaHR0cHM6Ly9hdXRoLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy9wcy1wZXJmZWN0b21vYmlsZS1jb20iLCJzdWIiOiIzOTNiMzFhNC00MmJlLTQ2YjEtODkwZS1iZGU3NjdlYTNiNDYiLCJ0eXAiOiJPZmZsaW5lIiwiYXpwIjoib2ZmbGluZS10b2tlbi1nZW5lcmF0b3IiLCJub25jZSI6IjI3MTY4ZjBmLTdlMmItNGI3YS1hZjNjLWFhMGE1NjhkZjE2ZCIsInNlc3Npb25fc3RhdGUiOiJlOWZjZTQ5Mi05NDA3LTQ1ZDItYjU4NS02ZDFiNTAzYzM4ZTUiLCJzY29wZSI6Im9wZW5pZCBvZmZsaW5lX2FjY2VzcyJ9.Z_rJHVkrmR26fZ366yLUSkt2oZX4a8KN7IRCd_QG3qo
|
||||
#demo Cloud
|
||||
#securityToken=eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI4YmI4YmZmZS1kMzBjLTQ2MjctYmMxMS0zNTYyMmY1ZDkyMGYifQ.eyJpYXQiOjE2MjA5MTMzMjAsImp0aSI6ImRkOWI3OTFiLTA5NzUtNGVhMC05NDczLWU2MjEzOThhN2U0NyIsImlzcyI6Imh0dHBzOi8vYXV0aC5wZXJmZWN0b21vYmlsZS5jb20vYXV0aC9yZWFsbXMvZGVtby1wZXJmZWN0b21vYmlsZS1jb20iLCJhdWQiOiJodHRwczovL2F1dGgucGVyZmVjdG9tb2JpbGUuY29tL2F1dGgvcmVhbG1zL2RlbW8tcGVyZmVjdG9tb2JpbGUtY29tIiwic3ViIjoiZjAyNGVkZGItODZkMy00OTA5LThhZjQtOGY1OTA1Yzc5ZjA4IiwidHlwIjoiT2ZmbGluZSIsImF6cCI6Im9mZmxpbmUtdG9rZW4tZ2VuZXJhdG9yIiwibm9uY2UiOiI5ZDdkMjI5Ny1lYzk1LTQ5NjUtYmRmMC1mZWJiYTk4NzI1MzUiLCJzZXNzaW9uX3N0YXRlIjoiMTI1NjFlMDQtMGUwMS00ZTYxLWE4NjMtMGQ2N2RhNzc1NjhiIiwic2NvcGUiOiJvcGVuaWQgb2ZmbGluZV9hY2Nlc3MifQ.voz1Fca_tOlPDMbIMsoPvTmZHBioeMUetA2sVsQ_SWw
|
||||
|
||||
# Perfecto CI Report
|
||||
projectName = TIP-PyTest-Execution
|
||||
projectVersion = 1.0
|
||||
jobName = Tip-PyTest-Execution
|
||||
jobNumber = 1
|
||||
reportTags = TestTag
|
||||
|
||||
# iOS Device Capabilities
|
||||
platformName-iOS=iOS
|
||||
#manufacturer-iOS=Apple
|
||||
model-iOS=iPhone-11.*
|
||||
bundleId-iOS=com.apple.Preferences
|
||||
#default iOS settings app
|
||||
bundleId-iOS-Settings=com.apple.Preferences
|
||||
bundleId-iOS-Ping=com.deftapps.ping
|
||||
#browserType-iOS=Safari
|
||||
browserType-iOS=Safari
|
||||
bundleId-iOS-Safari=com.apple.mobilesafari
|
||||
|
||||
# Android Device Capabilities
|
||||
platformName-android=Android
|
||||
model-android=Android.*
|
||||
appPackage-android=com.android.settings
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
"""
|
||||
Test Case Module: Testing Basic Connectivity with Resources
|
||||
"""
|
||||
import sys
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
pytestmark = [pytest.mark.test_resources]
|
||||
pytestmark = [pytest.mark.usefixtures("setup_test_run"), pytest.mark.test_resources, pytest.mark.sanity]
|
||||
|
||||
|
||||
@pytest.mark.sanity
|
||||
@allure.testcase(name="Test Resources", url="")
|
||||
class TestResources(object):
|
||||
"""Test Case Class: Test cases to cover resource Connectivity"""
|
||||
|
||||
@pytest.mark.test_cloud_controller
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller, update_report, test_cases):
|
||||
"""Test case to verify cloud Controller Connectivity"""
|
||||
if setup_controller.bearer:
|
||||
allure.attach(name="Controller Connectivity Success", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
@@ -24,26 +24,24 @@ class TestResources(object):
|
||||
allure.attach(name="Controller Connectivity Failed", body="")
|
||||
update_report.update_testrail(case_id=test_cases["cloud_ver"],
|
||||
status_id=0, msg='Could not read CloudSDK version from API')
|
||||
pytest.exit("Resource Not Available")
|
||||
# print(setup_controller.bearer)
|
||||
pytest.exit("Controller Not Available")
|
||||
assert setup_controller.bearer
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, update_report, test_cases):
|
||||
"""Test case to verify Access Points Connectivity"""
|
||||
flag = True
|
||||
print(test_access_point)
|
||||
for i in test_access_point:
|
||||
if "ACTIVE" not in i:
|
||||
flag = False
|
||||
|
||||
if flag is False:
|
||||
allure.attach(name="Access Point Connectivity Success", body=str(test_access_point))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
status_id=5,
|
||||
msg='CloudSDK connectivity failed')
|
||||
|
||||
pytest.exit("Access Point Manafer state is not ACtive")
|
||||
pytest.exit("Access Point Manager state is not Active")
|
||||
else:
|
||||
allure.attach(name="Access Point Connectivity Failed", body=str(test_access_point))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
@@ -52,3 +50,21 @@ class TestResources(object):
|
||||
|
||||
assert flag
|
||||
|
||||
@pytest.mark.traffic_generator_connectivity
|
||||
@allure.testcase(name="test_traffic_generator_connectivity", url="")
|
||||
def test_traffic_generator_connectivity(self, traffic_generator_connectivity, update_report, test_cases):
|
||||
"""Test case to verify Traffic Generator Connectivity"""
|
||||
if traffic_generator_connectivity is False:
|
||||
allure.attach(name="Access Point Connectivity Success", body=str(traffic_generator_connectivity))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
status_id=5,
|
||||
msg='CloudSDK connectivity failed')
|
||||
|
||||
pytest.exit("Traffic Generator is not Available")
|
||||
else:
|
||||
allure.attach(name="Access Point Connectivity Failed", body=str(traffic_generator_connectivity))
|
||||
update_report.update_testrail(case_id=test_cases["cloud_connection"],
|
||||
status_id=1,
|
||||
msg='Manager status is Active')
|
||||
|
||||
assert traffic_generator_connectivity
|
||||
|
||||
Reference in New Issue
Block a user