Merge branch 'master' into staging-wifi-3326

This commit is contained in:
haricharan-jaka
2021-08-07 17:31:32 +05:30
committed by GitHub
53 changed files with 3227 additions and 3515 deletions

View File

@@ -19,9 +19,9 @@ env:
on:
workflow_dispatch:
inputs:
testbeds:
default: 'basic-01,basic-02'
description: 'Testbed(s) to test'
testbed:
default: 'basic-01'
description: 'Testbed to test'
required: false
defaults:
@@ -57,79 +57,21 @@ jobs:
- name: push docker image
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
# 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
generate-matrix:
name: generate testbed matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: generate-matrix
id: set-matrix
run: |
TESTBEDS="${{ github.event.inputs.testbeds || 'basic-01,basic-02' }}"
# convert to JSON array
TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g')
TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})')
echo "::set-output name=matrix::{\"include\":${TESTBEDS}}"
test:
runs-on: ubuntu-latest
needs: [ build, generate-matrix ]
needs: [ build ]
strategy:
max-parallel: 1
fail-fast: false
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
matrix:
marker:
- dataplane_throughput_test
- single_station_dual_band_throughput
- wifi_capacity_test
outputs:
testbed: ${{ steps.testbed.outputs.name }}
steps:
- name: get EKS access credentials
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
@@ -138,27 +80,27 @@ jobs:
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::perf-${{ github.run_number }}"
run: echo "::set-output name=name::perf-${{ github.run_id }}"
- name: set testbed
id: testbed
run: echo "::set-output name=name::${{ github.event.inputs.testbed || 'basic-01' }}"
- name: prepare namespace
id: namespace
run: |
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
NAMESPACE="testing-${{ github.run_id }}-${{ steps.testbed.outputs.name }}"
kubectl create ns $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
echo "::set-output name=name::${NAMESPACE}"
- 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 perf tests
run: |
cat <<EOF | kubectl apply -f -
@@ -178,7 +120,7 @@ jobs:
- -c
- |
cd tests
pytest -m "performance" -s -vvv --testbed="${{ matrix.testbed }}" --skip-testrail --alluredir=/tmp/allure-results
pytest -m "performance and ${{ matrix.marker }}" -s -vvv --testbed="${{ steps.testbed.outputs.name }}" --skip-testrail --alluredir=/tmp/allure-results
ret=\$?
# sleep some time to be able to download the Allure results
sleep 60
@@ -197,16 +139,11 @@ jobs:
secretName: configuration
backoffLimit: 0
EOF
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]
do
sleep 10
@@ -214,51 +151,50 @@ jobs:
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
- name: upload Allure results as artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results-${{ matrix.testbed }}
name: allure-results-${{ matrix.marker }}
path: allure-results
- name: cleanup
if: always()
run: |
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
report:
runs-on: ubuntu-latest
needs: [ test, generate-matrix ]
needs: [ test ]
if: always()
strategy:
max-parallel: 1
fail-fast: false
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
steps:
- name: install Allure CLI tool
run: |
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
- uses: actions/download-artifact@v2
with:
name: allure-results-dataplane_throughput_test
path: allure-results-dataplane_throughput_test
- uses: actions/download-artifact@v2
with:
name: allure-results-${{ matrix.testbed }}
path: allure-results
name: allure-results-single_station_dual_band_throughput
path: allure-results-single_station_dual_band_throughput
- uses: actions/download-artifact@v2
with:
name: allure-results-wifi_capacity_test
path: allure-results-wifi_capacity_test
- name: checkout testing repo
uses: actions/checkout@v2
@@ -274,40 +210,42 @@ jobs:
- name: copy history into results
run: |
if [ -e "reports/performance/${{ matrix.testbed }}/latest" ] ; then
cp -r reports/performance/${{ matrix.testbed }}/latest/history/ allure-results/history
if [ -e "reports/performance/${{ needs.test.outputs.testbed }}/latest" ] ; then
cp -r reports/performance/${{ needs.test.outputs.testbed }}/latest/history/ allure-results-dataplane_throughput_test/history
cp -r reports/performance/${{ needs.test.outputs.testbed }}/latest/history/ allure-results-single_station_dual_band_throughput/history
cp -r reports/performance/${{ needs.test.outputs.testbed }}/latest/history/ allure-results-wifi_capacity_test/history
fi
- name: add report metadata
run: |
cat << EOF >> allure-results/environment.properties
Testbed=${{ matrix.testbed }}
cat << EOF >> allure-results-dataplane_throughput_test/environment.properties
Testbed=${{ needs.test.outputs.testbed }}
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
CiRun.Id=${{ github.run_id }}
CiRun.Number=${{ github.run_number }}
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
EOF
- name: generate Allure report
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate allure-results-dataplane_throughput_test allure-results-single_station_dual_band_throughput allure-results-wifi_capacity_test
- name: upload Allure report as artifact
uses: actions/upload-artifact@v2
with:
name: allure-report-${{ matrix.testbed }}
name: allure-report-${{ needs.test.outputs.testbed }}
path: allure-report
# doing this to be able to aggregate multiple reports together later on
- name: copy results into report
run: cp -r allure-results allure-report/results
run: |
mkdir -p allure-report/results
cp -r allure-results-dataplane_throughput_test allure-report/results
cp -r allure-results-single_station_dual_band_throughput/results
cp -r allure-results-wifi_capacity_test allure-report/results
- name: copy new report
run: |
mkdir -p reports/performance/${{ matrix.testbed }}
cp -Tr allure-report reports/performance/${{ matrix.testbed }}/${{ github.run_number }}
mkdir -p reports/performance/${{ needs.test.outputs.testbed }}
cp -Tr allure-report reports/performance/${{ needs.test.outputs.testbed }}/${{ github.run_number }}
- name: update latest symlink
working-directory: reports/performance/${{ matrix.testbed }}
working-directory: reports/performance/${{ needs.test.outputs.testbed }}
run: ln -fns ${{ github.run_number }} latest
- name: generate new index.html
@@ -318,10 +256,8 @@ jobs:
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Automated deployment: $(date -u)"
- name: push
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@v0.6.0

View File

@@ -77,7 +77,6 @@ jobs:
TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g')
TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})')
echo "::set-output name=matrix::{\"include\":${TESTBEDS}}"
test:
runs-on: ubuntu-latest
needs: [ build, generate-matrix ]
@@ -92,7 +91,6 @@ jobs:
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::testing-${{ github.run_number }}"
@@ -104,15 +102,12 @@ jobs:
kubectl create ns $NAMESPACE
kubectl config set-context --current --namespace=$NAMESPACE
echo "::set-output name=name::${NAMESPACE}"
- 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 -
@@ -151,16 +146,11 @@ jobs:
secretName: configuration
backoffLimit: 0
EOF
# wait for pod to spawn
sleep 1
podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///")
kubectl wait "pod/$podname" --for condition=ready
#sleep 30 # wait for the pod to come up
until [ -s test_everything.xml ]
do
sleep 10
@@ -168,21 +158,16 @@ jobs:
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
- name: upload Allure results as artifact
if: always()
uses: actions/upload-artifact@v2
@@ -194,7 +179,6 @@ jobs:
if: always()
run: |
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
report:
runs-on: ubuntu-latest
needs: [ test, generate-matrix ]
@@ -208,7 +192,6 @@ jobs:
run: |
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
- uses: actions/download-artifact@v2
with:
name: allure-results-${{ matrix.testbed }}
@@ -231,7 +214,6 @@ jobs:
if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then
cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history
fi
- name: add report metadata
run: |
cat << EOF >> allure-results/environment.properties
@@ -241,7 +223,6 @@ jobs:
CiRun.Number=${{ github.run_number }}
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
EOF
- name: generate Allure report
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
@@ -254,13 +235,12 @@ jobs:
# doing this to be able to aggregate multiple reports together later on
- name: copy results into report
run: cp -r allure-results allure-report/results
- name: copy new report
if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }}
run: |
mkdir -p reports/sanity/${{ matrix.testbed }}
cp -Tr allure-report reports/sanity/${{ matrix.testbed }}/${{ github.run_number }}
- name: update latest symlink
if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }}
working-directory: reports/sanity/${{ matrix.testbed }}
@@ -274,10 +254,8 @@ jobs:
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Automated deployment: $(date -u)"
- name: push
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@v0.6.0

View File

@@ -20,9 +20,17 @@ env:
testbeds: '[
{
"namespace": "qa01",
"ucentralgw_version": "v2.0.0",
"ucentralsec_version": "v2.0.0",
"ucentralgwui_version": "v2.0.0"
"ucentralgw_version": "master",
"ucentralsec_version": "main",
"ucentralfms_version": "main",
"ucentralgwui_version": "main"
},
{
"namespace": "dev01",
"ucentralgw_version": "master",
"ucentralsec_version": "main",
"ucentralfms_version": "main",
"ucentralgwui_version": "main"
}
]'
@@ -76,9 +84,11 @@ jobs:
sed -i '/wlan-cloud-ucentralgw@/s/ref=.*/ref='${{ matrix.ucentralgw_version }}'\"/g' Chart.yaml
sed -i '/wlan-cloud-ucentralgw-ui@/s/ref=.*/ref='${{ matrix.ucentralgwui_version }}'\"/g' Chart.yaml
sed -i '/wlan-cloud-ucentralsec@/s/ref=.*/ref='${{ matrix.ucentralsec_version }}'\"/g' Chart.yaml
sed -i '/wlan-cloud-ucentralfms@/s/ref=.*/ref='${{ matrix.ucentralfms_version }}'\"/g' Chart.yaml
export UCENTRALGW_VERSION_TAG=$(echo ${{ matrix.ucentralgw_version }} | tr '/' '-')
export UCENTRALGWUI_VERSION_TAG=$(echo ${{ matrix.ucentralgwui_version }} | tr '/' '-')
export UCENTRALSEC_VERSION_TAG=$(echo ${{ matrix.ucentralsec_version }} | tr '/' '-')
export UCENTRALFMS_VERSION_TAG=$(echo ${{ matrix.ucentralfms_version }} | tr '/' '-')
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependency update
@@ -89,6 +99,8 @@ jobs:
--set ucentralsec.configProperties."authentication\.default\.username"=${{ secrets.UCENTRALGW_AUTH_USERNAME }} \
--set ucentralsec.configProperties."authentication\.default\.password"=${{ secrets.UCENTRALGW_AUTH_PASSWORD }} \
--set rttys.config.token=${{ secrets.RTTY_TOKEN }} \
--set ucentralfms.configProperties."s3\.secret"=${{ secrets.UCENTRALFMS_S3_SECRET }} \
--set ucentralfms.configProperties."s3\.key"=${{ secrets.UCENTRALFMS_S3_KEY }} \
--set ucentralgw.services.ucentralgw.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=gw-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
--set ucentralgw.configProperties."ucentral\.fileuploader\.host\.0\.name"=gw-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
--set ucentralgw.configProperties."rtty\.server"=rtty-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
@@ -103,6 +115,10 @@ jobs:
--set ucentralgwui.ingresses.default.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=webui-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
--set ucentralgwui.ingresses.default.hosts={webui-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build} \
--set ucentralgwui.public_env_variables.DEFAULT_UCENTRALSEC_URL=https://sec-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build:16001 \
--set ucentralfms.services.ucentralfms.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=fms-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
--set ucentralfms.configProperties."ucentral\.system\.uri\.public"=https://fms-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build:16004 \
--set ucentralfms.configProperties."ucentral\.system\.uri\.private"=https://fms-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build:17004 \
--set ucentralfms.configProperties."ucentral\.system\.uri\.ui"=https://webui-ucentral-${{ matrix.namespace }}.cicd.lab.wlan.tip.build \
--set-file ucentralgw.certs."restapi-cert\.pem"=../../cert.pem \
--set-file ucentralgw.certs."restapi-key\.pem"=../../key.pem \
--set-file ucentralgw.certs."websocket-cert\.pem"=../../cert.pem \
@@ -111,9 +127,12 @@ jobs:
--set-file rttys.certs."restapi-key\.pem"=../../key.pem \
--set-file ucentralsec.certs."restapi-cert\.pem"=../../cert.pem \
--set-file ucentralsec.certs."restapi-key\.pem"=../../key.pem \
--set-file ucentralfms.certs."restapi-cert\.pem"=../../cert.pem \
--set-file ucentralfms.certs."restapi-key\.pem"=../../key.pem \
--set ucentralgw.images.ucentralgw.tag=$UCENTRALGW_VERSION_TAG \
--set ucentralgwui.images.ucentralgwui.tag=$UCENTRALGWUI_VERSION_TAG \
--set ucentralsec.images.ucentralsec.tag=$UCENTRALSEC_VERSION_TAG \
--set ucentralfms.images.ucentralfms.tag=$UCENTRALFMS_VERSION_TAG \
tip-ucentral .
- name: Show resource state on deployment failure

View File

@@ -119,3 +119,41 @@ ucentralgwui:
public_env_variables:
ALLOW_UCENTRALSEC_CHANGE: false
ucentralfms:
fullnameOverride: ucentralfms
services:
ucentralfms:
type: LoadBalancer
annotations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb-ip"
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "16104"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16004,17004"
certs:
restapi-ca.pem: |
-----BEGIN CERTIFICATE-----
MIIDojCCAoqgAwIBAgIUPVYBpqNbcLYygF6Mx+qxSWwQyFowDQYJKoZIhvcNAQEL
BQAwaTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG1RlbGVjb20gSW5mcmEgUHJvamVj
dCwgSW5jLjEMMAoGA1UECxMDVElQMSYwJAYDVQQDEx1UZWxlY29tIEluZnJhIFBy
b2plY3QgUm9vdCBDQTAeFw0yMTA0MTMyMjQyNDRaFw0zMTA0MTMyMjM4NDZaMGkx
CzAJBgNVBAYTAlVTMSQwIgYDVQQKExtUZWxlY29tIEluZnJhIFByb2plY3QsIElu
Yy4xDDAKBgNVBAsTA1RJUDEmMCQGA1UEAxMdVGVsZWNvbSBJbmZyYSBQcm9qZWN0
IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIGCibwf5u
AAwZ+1H8U0e3u2V+0d2gSctucoK86XwUmfe1V2a/qlCYZd29r80IuN1IIeB0naIm
KnK/MzXW87clF6tFd1+HzEvmlY/W4KyIXalVCTEzirFSvBEG2oZpM0yC3AefytAO
aOpA00LaM3xTfTqMKIRhJBuLy0I4ANUVG6ixVebbGuc78IodleqiLoWy2Q9QHyEO
t/7hZndJhiVogh0PveRhho45EbsACu7ymDY+JhlIleevqwlE3iQoq0YcmYADHno6
Eq8vcwLpZFxihupUafkd1T3WJYQAJf9coCjBu2qIhNgrcrGD8R9fGswwNRzMRMpX
720+GjcDW3bJAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFAJG
lmB5sVP2qfL3xZ8hQOTpkQH6MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF
AAOCAQEAVjl9dm4epG9NUYnagT9sg7scVQEPfz3Lt6w1NXJXgD8mAUlK0jXmEyvM
dCPD4514n+8+lM7US8fh+nxc7jO//LwK17Wm9FblgjNFR7+anv0Q99T9fP19DLlF
PSNHL2emogy1bl1lLTAoj8nxg2wVKPDSHBGviQ5LR9fsWUIJDv9Bs5k0qWugWYSj
19S6qnHeskRDB8MqRLhKMG82oDVLerSnhD0P6HjySBHgTTU7/tYS/OZr1jI6MPbG
L+/DtiR5fDVMNdBSGU89UNTi0wHY9+RFuNlIuvZC+x/swF0V9R5mN+ywquTPtDLA
5IOM7ItsRmen6u3qu+JXros54e4juQ==
-----END CERTIFICATE-----

Submodule lanforge/lanforge-scripts added at 7fe8579ceb

View File

@@ -9,6 +9,7 @@ Currently Having Methods:
5. Get current Firmware
"""
import json
import paramiko
from scp import SCPClient
@@ -18,9 +19,12 @@ import allure
class APNOS:
def __init__(self, credentials=None, pwd=os.getcwd()):
allure.attach(name="APNOS LIbrary: ", body=str(credentials))
def __init__(self, credentials=None, pwd=os.getcwd(), sdk="2.x"):
self.serial = credentials['serial']
self.owrt_args = "--prompt root@OpenAp -s serial --log stdout --user root --passwd openwifi"
self.sdk = sdk
if sdk == "2.x":
self.owrt_args = "--prompt root@" + self.serial + " -s serial --log stdout --user root --passwd openwifi"
if credentials is None:
print("No credentials Given")
exit()
@@ -34,26 +38,24 @@ class APNOS:
client = self.ssh_cli_connect()
cmd = '[ -f ~/cicd-git/ ] && echo "True" || echo "False"'
stdin, stdout, stderr = client.exec_command(cmd)
print(stdout.read())
if str(stdout.read()).__contains__("False"):
output = str(stdout.read())
print(output)
if output.__contains__("False"):
cmd = 'mkdir ~/cicd-git/'
client.exec_command(cmd)
stdin, stdout, stderr = client.exec_command(cmd)
cmd = '[ -f ~/cicd-git/openwrt_ctl.py ] && echo "True" || echo "False"'
stdin, stdout, stderr = client.exec_command(cmd)
print(stdout.read())
if str(stdout.read()).__contains__("False"):
output = str(stdout.read())
if output.__contains__("False"):
print("Copying openwrt_ctl serial control Script...")
with SCPClient(client.get_transport()) as scp:
scp.put(pwd + 'openwrt_ctl.py', '~/cicd-git/openwrt_ctl.py') # Copy my_file.txt to the server
scp.put(pwd + '/openwrt_ctl.py', '~/cicd-git/openwrt_ctl.py') # Copy my_file.txt to the server
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")
else:
allure.attach(name="openwrt_ctl Setup", body=str(var))
print("APNOS Serial Setup Fail")
# Method to connect AP-CLI/ JUMPHOST-CLI
@@ -77,10 +79,10 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="AP Reboot", body=str(output))
return output
# Method to get the iwinfo status of AP using AP-CLI/ JUMPHOST-CLI
def get_bssid_band_mapping(self):
client = self.ssh_cli_connect()
cmd = 'iwinfo'
@@ -90,8 +92,6 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
data = stdout.read()
client.close()
allure.attach(name="iwinfo Output Msg: ", body=str(data))
allure.attach(name="iwinfo config Err Msg: ", body=str(stderr))
data = str(data).replace(" ", "").split("\\r\\n")
band_info = []
for i in data:
@@ -111,7 +111,7 @@ class APNOS:
bssi_band_mapping = {}
for i in range(len(band_info)):
if (i % 2) == 0:
bssi_band_mapping[band_info[i][0]] = band_info[i+1][0]
bssi_band_mapping[band_info[i][0]] = band_info[i + 1][0]
return bssi_band_mapping
# Method to get the vif_config of AP using AP-CLI/ JUMPHOST-CLI
@@ -124,8 +124,7 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif config Output Msg: ", body=str(output))
allure.attach(name="vif config Err Msg: ", body=str(stderr))
return output
@@ -139,8 +138,6 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
# Method to get the vif_config ssid's of AP using AP-CLI/ JUMPHOST-CLI
@@ -151,7 +148,6 @@ class APNOS:
ssid = str(i).replace(" ", "").split(".")
if ssid[0].split(":")[0] == "b'ssid":
ssid_list.append(ssid[0].split(":")[1].replace("'", ""))
allure.attach(name="get_vif_config_ssids ", body=str(ssid_list))
return ssid_list
# Method to get the vif_state ssid's of AP using AP-CLI/ JUMPHOST-CLI
@@ -203,7 +199,6 @@ class APNOS:
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
@@ -214,7 +209,6 @@ class APNOS:
ssid = str(i).replace(" ", "").split(".")
if ssid[0].split(":")[0] == "b'ssid":
ssid_list.append(ssid[0].split(":")[1].replace("'", ""))
allure.attach(name="get_vif_state_ssids ", body=str(ssid_list))
return ssid_list
# Method to get the active firmware of AP using AP-CLI/ JUMPHOST-CLI
@@ -234,9 +228,7 @@ class APNOS:
client.close()
except Exception as e:
print(e)
allure.attach(name="get_active_firmware - Exception ", body=str(e))
cli_active_fw = "Error"
allure.attach(name="get_active_firmware ", body=str(cli_active_fw))
return cli_active_fw
# Method to get the manager state of AP using AP-CLI/ JUMPHOST-CLI
@@ -254,9 +246,7 @@ class APNOS:
client.close()
except Exception as e:
print(e)
allure.attach(name="get_active_firmware - Exception ", body=str(e))
status = "Error"
allure.attach(name="get_active_firmware ", body=str(status))
return status
def get_serial_number(self):
@@ -269,14 +259,11 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
output = output.decode('utf-8').splitlines()
allure.attach(name="get_serial_number output ", body=str(stderr))
serial = output[1].replace(" ", "").split("|")[1]
client.close()
except Exception as e:
print(e)
allure.attach(name="get_serial_number - Exception ", body=str(e))
serial = "Error"
allure.attach(name="get_serial_number ", body=str(serial))
return serial
def get_redirector(self):
@@ -290,14 +277,11 @@ class APNOS:
output = stdout.read()
print(output, stderr.read())
status = output.decode('utf-8').splitlines()
allure.attach(name="get_redirector output ", body=str(stderr))
redirector = status[1].replace(" ", "").split("|")[1]
client.close()
except Exception as e:
print(e)
allure.attach(name="get_redirector - Exception ", body=str(e))
redirector = "Error"
allure.attach(name="get_redirector ", body=redirector)
return redirector
def run_generic_command(self, cmd=""):
@@ -311,15 +295,154 @@ class APNOS:
output = stdout.read()
print(output, stderr.read())
status = output.decode('utf-8').splitlines()
allure.attach(name="get_redirector output ", body=str(stderr))
redirector = status[1].replace(" ", "").split("|")[1]
client.close()
except Exception as e:
print(e)
allure.attach(name="get_redirector - Exception ", body=str(e))
redirector = "Error"
allure.attach(name="get_redirector ", body=redirector)
return redirector
status = "Error"
return status
def get_ucentral_status(self):
try:
client = self.ssh_cli_connect()
cmd = "ubus call ucentral status"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
# print(output, stderr.read())
connected = False
if "connected" in output.decode('utf-8').splitlines()[2]:
connected = True
# connected = output.decode('utf-8').splitlines()[2]
latest = output.decode('utf-8').splitlines()[3].split(":")[1].replace(" ", "").replace(",", "")
active = output.decode('utf-8').splitlines()[4].split(":")[1].replace(" ", "").replace(",", "")
client.close()
except Exception as e:
print(e)
connected, latest, active = "Error", "Error", "Error"
return connected, latest, active
def get_uc_latest_config(self):
try:
connected, latest, active = self.get_ucentral_status()
print()
client = self.ssh_cli_connect()
cmd = "cat /etc/ucentral/ucentral.cfg." + latest
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().decode('utf-8').splitlines()[1]
print(output)
json_output = json.loads(output) # , sort_keys=True)
print(type(json_output))
client.close()
except Exception as e:
json_output = {}
print(e)
return json_output
def get_uc_active_config(self):
try:
connected, latest, active = self.get_ucentral_status()
client = self.ssh_cli_connect()
cmd = "cat /etc/ucentral/ucentral.cfg." + active
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().decode('utf-8').splitlines()[1]
json_output = json.loads(output) # , sort_keys=True)
print(json_output)
client.close()
except Exception as e:
json_output = {}
print(e)
return json_output
def get_interface_details(self):
r = self.get_wifi_status()
print(r)
wifi_info = {}
if self.sdk == "1.x":
for i in r:
for j in r[i]["interfaces"]:
encryption = j["config"]["encryption"]
if encryption == "psk" or encryption == "psk2" or encryption == "psk-mixed" or \
encryption == "sae" or encryption == "sae-mixed":
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], j["config"]["key"]]
else:
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], ""]
print(wifi_info)
data = self.get_iwinfo()
for i in wifi_info.keys():
wifi_info[i].append(data[i])
return wifi_info
if self.sdk == "2.x":
for i in r:
for j in r[i]["interfaces"]:
encryption = j["config"]["encryption"]
if encryption == "psk" or encryption == "psk2" or encryption == "psk-mixed" or \
encryption == "sae" or encryption == "sae-mixed":
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], j["config"]["key"]]
else:
wifi_info[j["ifname"]] = [j["config"]["ssid"], j["config"]["encryption"], ""]
data = self.get_iwinfo()
print(wifi_info)
print(data)
for i in wifi_info.keys():
wifi_info[i].append(data[i])
return wifi_info
def get_wifi_status(self):
try:
client = self.ssh_cli_connect()
cmd = "wifi status"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().decode('utf-8')
data = output.split()
data.pop(0)
data.pop(0)
data.pop(0)
OUT = "".join(data)
json_output = json.loads(OUT)
client.close()
except Exception as e:
json_output = False
print(e)
return json_output
def get_iwinfo(self):
try:
client = self.ssh_cli_connect()
cmd = "iwinfo"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().replace(b":~# iwinfo", b"").decode('utf-8')
o = output.split()
iwinfo_bssid_data = {}
for i in range(len(o)):
if o[i].__contains__("ESSID"):
if o[i + 9].__contains__("2.4"):
band = "2G"
else:
band = "5G"
iwinfo_bssid_data[o[i - 1]] = [o[i + 4], band]
client.close()
except Exception as e:
iwinfo_bssid_data = False
print(e)
return iwinfo_bssid_data
def logread(self):
try:
@@ -341,6 +464,17 @@ class APNOS:
logs = ""
return logs
def get_ap_version_ucentral(self):
client = self.ssh_cli_connect()
cmd = "cat /tmp/ucentral.version"
if self.mode:
cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \
f"cmd --value \"{cmd}\" "
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read().replace(b":~# cat /tmp/ucentral.version", b"").decode('utf-8')
client.close()
return output
def get_vifc(self):
client = self.ssh_cli_connect()
cmd = "vifC"
@@ -350,8 +484,6 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_vifs(self):
@@ -363,15 +495,13 @@ class APNOS:
stdin, stdout, stderr = client.exec_command(cmd)
output = stdout.read()
client.close()
allure.attach(name="vif state Output Msg: ", body=str(output))
allure.attach(name="vif state Err Msg: ", body=str(stderr))
return output
def get_vlan(self):
stdout = self.get_vifs()
vlan_list = []
for i in stdout.splitlines():
vlan = str(i.strip()).replace("|",".").split(".")
vlan = str(i.strip()).replace("|", ".").split(".")
try:
if not vlan[0].find("b'vlan_id"):
vlan_list.append(vlan[1].strip())
@@ -379,23 +509,20 @@ class APNOS:
pass
return vlan_list
if __name__ == '__main__':
obj = {
'model': 'ecw5211',
'mode': 'wifi5',
'serial': '001122090801',
'jumphost': True,
'ip': "10.28.3.100",
'username': "lanforge",
'password': "pumpkin77",
'port': 22,
'jumphost_tty': '/dev/ttyAP1'
'jumphost_tty': '/dev/ttyAP3',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin"
}
var = APNOS(credentials=obj)
abc = var.get_bssid_band_mapping()
# lst.remove("")
print(abc)
# r = var.get_ssid_info()
# print(r)
# print(var.get_ssid_info())
# print(var.get_manager_state())
# print(var.get_vlan())
var = APNOS(credentials=obj, sdk="2.x")
x = var.get_ap_version_ucentral()
print(x.split("\n")[1])

23
libs/controller/cert.pem Normal file
View File

@@ -0,0 +1,23 @@
-----BEGIN CERTIFICATE-----
MIIDyzCCArOgAwIBAgIUFH6sVGySAPHbX9TuNTCERV/sLdUwDQYJKoZIhvcNAQEL
BQAwdTELMAkGA1UEBhMCQ0ExCzAJBgNVBAgMAkJDMRIwEAYDVQQHDAlWYW5jb3V2
ZXIxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEiMCAGCSqGSIb3
DQEJARYTc3RlcGhhbmVAYXJpbGlhLmNvbTAeFw0yMTAyMjgwMDU4NDdaFw0zMTAy
MjYwMDU4NDdaMHUxCzAJBgNVBAYTAkNBMQswCQYDVQQIDAJCQzESMBAGA1UEBwwJ
VmFuY291dmVyMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxIjAg
BgkqhkiG9w0BCQEWE3N0ZXBoYW5lQGFyaWxpYS5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDSAT5BOKAR5o/Sfo1CVTQMK6bcXJ+Cgh0MT4pkLi9D
yIPyvuYZTBRxXgR2B6AFRpQODc1ZV3OGHeiTRrxaaebTHPQ3A7abrjY76qdl2Jb2
FJlCAkRQp9+MYfQFIjfWOxH3zSxY/TsEtHInI7/vldV1GraOFKVs+On8HB9/ubGz
eZigyxS+EI/VW014YrjHc9Gv0zr6IZHPAtoY4v5c9Kg4lpQr0QCOKGWPqrbh7LWK
zsmhvvuHJZiRFumxrnO2uiXU+s2A5jX5plVIKsfpY+VlNGLE/ltT0LwnOi39Pe03
Bmmir2a31ATj4AWuG4huKYSUgyZntZ4tl3/e7IqmavVbAgMBAAGjUzBRMB0GA1Ud
DgQWBBQkMn0xl4afjEcZsqnm9r98lWEpVjAfBgNVHSMEGDAWgBQkMn0xl4afjEcZ
sqnm9r98lWEpVjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQBo
0sVma03orhnw2b4D6IURr8wmk2qn917KW0kkklzkf28n5Gkj2CmM2cfvI4N22nwu
Cun841oOYE84gD246f1rUO2ebjveUVYHJWKGcLIvHJt50FCxIXSwLDdSbeVjRshg
8Dr2M3om0h4q55TCdT9j/ucbPSwJ1Y3g037iUVVZXbtrPmUMUQj9aAP9KUg+IprJ
rDPcm+smqzOy8bnGpBXg6WlZfdbhaWAKLsJULHuIi4DvAafmOHkRogEyuYmTMJg9
ob9D5kvmS9GMra3AIoMzsibv4sMWLObXk9pzvhDy5a/KPaQmwWmfibcQhahQZOUM
mgYyVxzP9sAyLY7mfL54
-----END CERTIFICATE-----

View File

@@ -484,7 +484,6 @@ class ProfileUtility:
profile = self.profile_client.create_profile(body=default_profile)
self.profile_creation_ids['rf'].append(profile._id)
return profile
if mode == "wifi6":
default_profile = self.default_profiles['rf']
default_profile._name = profile_data["name"]
@@ -1402,6 +1401,8 @@ if __name__ == '__main__':
}
profile.set_rf_profile(profile_data=profile_data, mode="wifi6")
print(profile.default_profiles["rf"])
# profile.cleanup_profiles()
# profile.get_default_profiles()
# profile_data = {
# "profile_name": "ssid_wep_2g",

View File

@@ -0,0 +1,380 @@
"""
Base Library for Ucentral
"""
import json
import ssl
import sys
import time
from urllib.parse import urlparse
import pytest
import allure
import requests
from pathlib import Path
from requests.adapters import HTTPAdapter
import logging
# logging.basicConfig(level=logging.DEBUG)
# from http.client import HTTPConnection
#
# HTTPConnection.debuglevel = 1
# requests.logging.getLogger()
class ConfigureController:
def __init__(self, controller_data):
self.username = controller_data["username"]
self.password = controller_data["password"]
self.host = urlparse(controller_data["url"])
print(self.host)
self.access_token = ""
# self.session = requests.Session()
self.login_resp = self.login()
self.gw_host = self.get_endpoint()
def build_uri_sec(self, path):
new_uri = 'https://%s:%d/api/v1/%s' % (self.host.hostname, self.host.port, path)
print(new_uri)
return new_uri
def build_uri(self, path):
new_uri = 'https://%s:%d/api/v1/%s' % (self.gw_host.hostname, self.gw_host.port, path)
print(new_uri)
return new_uri
def login(self):
uri = self.build_uri_sec("oauth2")
# self.session.mount(uri, HTTPAdapter(max_retries=15))
payload = json.dumps({"userId": self.username, "password": self.password})
resp = requests.post(uri, data=payload, verify=False, timeout=100)
self.check_response("POST", resp, "", payload, uri)
token = resp.json()
self.access_token = token["access_token"]
print(token)
# self.session.headers.update({'Authorization': self.access_token})
return resp
def get_endpoint(self):
uri = self.build_uri_sec("systemEndpoints")
print(uri)
resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=100)
print(resp)
self.check_response("GET", resp, self.make_headers(), "", uri)
devices = resp.json()
print(devices["endpoints"][0]["uri"])
gw_host = urlparse(devices["endpoints"][0]["uri"])
return gw_host
def logout(self):
uri = self.build_uri_sec('oauth2/%s' % self.access_token)
resp = requests.delete(uri, headers=self.make_headers(), verify=False, timeout=100)
self.check_response("DELETE", resp, self.make_headers(), "", uri)
print('Logged out:', resp.status_code)
return resp
def make_headers(self):
headers = {'Authorization': 'Bearer %s' % self.access_token,
"Connection": "keep-alive",
"Keep-Alive": "timeout=10, max=1000"
}
return headers
def check_response(self, cmd, response, headers, data_str, url):
if response.status_code >= 400:
if response.status_code >= 400:
print("check-response: ERROR, url: ", url)
else:
print("check-response: url: ", url)
print("Command: ", cmd)
print("response-status: ", response.status_code)
print("response-headers: ", response.headers)
print("response-content: ", response.content)
print("headers: ", headers)
print("data-str: ", data_str)
if response.status_code >= 400:
# if True:
raise NameError("Invalid response code.")
return True
class UController(ConfigureController):
def __init__(self, controller_data=None):
super().__init__(controller_data)
def get_devices(self):
uri = self.build_uri("devices/")
resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=100)
self.check_response("GET", resp, self.make_headers(), "", uri)
devices = resp.json()
# resp.close()()
return devices
def get_device_by_serial_number(self, serial_number=None):
uri = self.build_uri("device/" + serial_number)
resp = requests.get(uri, headers=self.make_headers(), verify=False, timeout=100)
self.check_response("GET", resp, self.make_headers(), "", uri)
device = resp.json()
# resp.close()()
return device
def get_device_uuid(self, serial_number):
device_info = self.get_device_by_serial_number(serial_number=serial_number)
return device_info["UUID"]
class UProfileUtility:
def __init__(self, sdk_client=None, controller_data=None):
if sdk_client is None:
self.sdk_client = UController(controller_data=controller_data)
self.sdk_client = sdk_client
self.base_profile_config = {
"uuid": 1,
"radios": [],
"interfaces": [{
"name": "WAN",
"role": "upstream",
"services": ["lldp", "dhcp-snooping"],
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
}
},
{
"name": "LAN",
"role": "downstream",
"services": ["ssh", "lldp", "dhcp-snooping"],
"ethernet": [
{
"select-ports": [
"LAN*"
]
}
],
"ipv4": {
"addressing": "static",
"subnet": "192.168.1.1/16",
"dhcp": {
"lease-first": 10,
"lease-count": 10000,
"lease-time": "6h"
}
},
}],
"metrics": {
"statistics": {
"interval": 60,
"types": ["ssids", "lldp", "clients"]
},
"health": {
"interval": 120
},
"wifi-frames": {
"filters": ["probe",
"auth",
"assoc",
"disassoc",
"deauth",
"local-deauth",
"inactive-deauth",
"key-mismatch",
"beacon-report",
"radar-detected"]
},
"dhcp-snooping": {
"filters": ["ack", "discover", "offer", "request", "solicit", "reply", "renew"]
}
},
"services": {
"lldp": {
"describe": "TIP OpenWiFi",
"location": "QA"
},
"ssh": {
"port": 22
}
}
}
self.vlan_section = {
"name": "WAN100",
"role": "upstream",
"vlan": {
"id": 100
},
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
}
}
self.mode = None
def set_radio_config(self, radio_config=None):
self.base_profile_config["radios"].append({
"band": "2G",
"country": "US",
# "channel-mode": "HE",
"channel-width": 20,
# "channel": 11
})
self.base_profile_config["radios"].append({
"band": "5G",
"country": "US",
# "channel-mode": "HE",
"channel-width": 80,
# "channel": "auto"
})
self.vlan_section["ssids"] = []
self.vlan_ids = []
def set_mode(self, mode):
self.mode = mode
if mode == "NAT":
self.base_profile_config['interfaces'][1]['ssids'] = []
elif mode == "BRIDGE":
del self.base_profile_config['interfaces'][1]
self.base_profile_config['interfaces'][0]['ssids'] = []
elif mode == "VLAN":
del self.base_profile_config['interfaces'][1]
self.base_profile_config['interfaces'][0]['ssids'] = []
self.base_profile_config['interfaces'] = []
wan_section_vlan = {
"name": "WAN",
"role": "upstream",
"services": ["lldp"],
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
}
}
self.base_profile_config['interfaces'].append(wan_section_vlan)
else:
print("Invalid Mode")
return 0
def add_ssid(self, ssid_data, radius=False, radius_auth_data={}, radius_accounting_data={}):
print("ssid data : ", ssid_data)
ssid_info = {'name': ssid_data["ssid_name"], "bss-mode": "ap", "wifi-bands": [], "services": ["wifi-frames"]}
for i in ssid_data["appliedRadios"]:
ssid_info["wifi-bands"].append(i)
ssid_info['encryption'] = {}
ssid_info['encryption']['proto'] = ssid_data["security"]
try:
ssid_info['encryption']['key'] = ssid_data["security_key"]
except Exception as e:
pass
ssid_info['encryption']['ieee80211w'] = "optional"
if radius:
ssid_info["radius"] = {}
ssid_info["radius"]["authentication"] = {
"host": radius_auth_data["ip"],
"port": radius_auth_data["port"],
"secret": radius_auth_data["secret"]
}
ssid_info["radius"]["accounting"] = {
"host": radius_accounting_data["ip"],
"port": radius_accounting_data["port"],
"secret": radius_accounting_data["secret"]
}
if self.mode == "NAT":
self.base_profile_config['interfaces'][1]['ssids'].append(ssid_info)
elif self.mode == "BRIDGE":
self.base_profile_config['interfaces'][0]['ssids'].append(ssid_info)
elif self.mode == "VLAN":
vid = ssid_data["vlan"]
self.vlan_section = {
"name": "WAN100",
"role": "upstream",
"services": ["lldp", "dhcp-snooping"],
"vlan": {
"id": 100
},
"ethernet": [
{
"select-ports": [
"WAN*"
]
}
],
"ipv4": {
"addressing": "dynamic"
}
}
vlan_section = self.vlan_section
if vid in self.vlan_ids:
print("sss", self.vlan_ids)
for i in self.base_profile_config['interfaces']:
if i["name"] == "WANv%s" % (vid):
i["ssids"].append(ssid_info)
else:
print(self.vlan_ids)
self.vlan_ids.append(vid)
vlan_section['name'] = "WANv%s" % (vid)
vlan_section['vlan']['id'] = int(vid)
vlan_section["ssids"] = []
vlan_section["ssids"].append(ssid_info)
self.base_profile_config['interfaces'].append(vlan_section)
print(vlan_section)
vsection = 0
else:
print("invalid mode")
pytest.exit("invalid Operating Mode")
def push_config(self, serial_number):
payload = {"configuration": self.base_profile_config, "serialNumber": serial_number, "UUID": 0}
uri = self.sdk_client.build_uri("device/" + serial_number + "/configure")
basic_cfg_str = json.dumps(payload)
allure.attach(name="ucentral_config: ", body=str(self.base_profile_config))
print(self.base_profile_config)
resp = requests.post(uri, data=basic_cfg_str, headers=self.sdk_client.make_headers(),
verify=False, timeout=100)
self.sdk_client.check_response("POST", resp, self.sdk_client.make_headers(), basic_cfg_str, uri)
print(resp.url)
resp.close()
print(resp)
if __name__ == '__main__':
controller = {
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
}
obj = UController(controller_data=controller)
profile = UProfileUtility(sdk_client=obj)
profile.set_mode(mode="BRIDGE")
profile.set_radio_config()
ssid = {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security": "psk", "security_key": "something",
"vlan": 100}
profile.add_ssid(ssid_data=ssid)
profile.push_config(serial_number="903cb39d6918")
# print(obj.get_devices())
obj.logout()

View File

@@ -26,6 +26,7 @@ from sta_connect2 import StaConnect2
import time
import string
import random
S = 12
# from eap_connect import EAPConnect
from test_ipv4_ttls import TTLSTest
@@ -118,6 +119,15 @@ class RunTest:
print("test result: " + result)
result = True
print("Client Connectivity :", self.staConnect.passes)
endp_data = []
for i in self.staConnect.resulting_endpoints:
endp_data.append(self.staConnect.resulting_endpoints[i]["endpoint"])
cx_data = ""
for i in endp_data:
for j in i:
cx_data = cx_data + str(j) + " : " + str(i[j]) + "\n"
cx_data = cx_data + "\n"
allure.attach(name="cx_data", body=str(cx_data))
if self.staConnect.passes():
print("client connection to", self.staConnect.dut_ssid, "successful. Test Passed")
else:
@@ -221,7 +231,7 @@ class RunTest:
instance_name=instance_name,
config_name="wifi_config",
upstream="1.1." + upstream_port,
batch_size="1,5,10,20,40,64",
batch_size="1,5,10,20,40,64,128",
loop_iter="1",
protocol=protocol,
duration=duration,
@@ -230,7 +240,6 @@ class RunTest:
upload_rate=upload_rate,
download_rate=download_rate,
sort="interleave",
# stations=stations,
create_stations=True,
radio=None,
security=None,
@@ -244,7 +253,6 @@ class RunTest:
wificapacity_obj.setup()
wificapacity_obj.run()
report_name = wificapacity_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv")
@@ -291,8 +299,17 @@ class RunTest:
instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S))
if mode == "BRIDGE":
self.client_connect.upstream_port = self.upstream_port
self.upstream_port = self.upstream_port
elif mode == "NAT":
self.upstream_port = self.upstream_port
elif mode == "VLAN":
self.upstream_port = self.upstream_port + "." + str(vlan_id)
if raw_lines is None:
raw_lines = [['pkts: 60;142;256;512;1024;MTU;4000'], ['directions: DUT Transmit;DUT Receive'],
['traffic_types: UDP;TCP'],
["show_3s: 1"], ["show_ll_graphs: 1"], ["show_log: 1"]]
self.client_connect.upstream_port = self.upstream_port
elif mode == "VLAN":
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
@@ -373,9 +390,9 @@ class RunTest:
# target_csv=self.local_report_path + report_name + "/kpi.csv")
# influx.post_to_influx()
return self.dualbandptest_obj
def ratevsrange(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP",
upload_rate="0", duration="1m", instance_name="test_demo", raw_lines=None):
upload_rate="0", duration="1m", instance_name="test_demo", raw_lines=None):
if mode == "BRIDGE":
self.client_connect.upstream_port = self.upstream_port
elif mode == "NAT":
@@ -384,31 +401,31 @@ class RunTest:
self.client_connect.upstream_port = self.upstream_port + "." + str(vlan_id)
self.rvr_obj = RvrTest(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="rvr_config",
upstream="1.1." + self.upstream_port,
pull_report=True,
load_old_cfg=False,
upload_speed=upload_rate,
download_speed=download_rate,
duration=duration,
station="1.1." + station_name[0],
dut=dut_name,
raw_lines=raw_lines)
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="rvr_config",
upstream="1.1." + self.upstream_port,
pull_report=True,
load_old_cfg=False,
upload_speed=upload_rate,
download_speed=download_rate,
duration=duration,
station="1.1." + station_name[0],
dut=dut_name,
raw_lines=raw_lines)
self.rvr_obj.setup()
self.rvr_obj.run()
report_name = self.rvr_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
influx = CSVtoInflux(influxdb=self.influxdb, _influx_tag=self.influx_params["influx_tag"],
target_csv=self.local_report_path + report_name + "/kpi.csv")
influx.post_to_influx()
return self.rvr_obj
if __name__ == '__main__':
lanforge_data = {
"ip": "localhost",

View File

@@ -33,6 +33,7 @@ class ChamberView:
self.debug = debug
self.exit_on_error = False
self.dut_idx_mapping = {}
self.ssid_list = []
self.raw_line = [
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
[2] + ",AUTO -1 NA"],
@@ -83,6 +84,12 @@ class ChamberView:
self.CreateChamberview.sync_cv()
return self.CreateChamberview, self.scenario_name
def add_vlan(self, vlan_ids=[]):
for vlans in vlan_ids:
self.raw_line.append(["profile_link 1.1 " + "vlan-100 1 " + self.upstream_port
+ " NA " + self.upstream_port.split(".")[2] + ",AUTO -1 " + str(vlans)])
self.Chamber_View()
def add_stations(self, band="2G", num_stations="max", dut="NA", ssid_name=[]):
idx = 0
print(self.dut_idx_mapping)
@@ -92,28 +99,36 @@ class ChamberView:
max_stations = 0
print(idx)
if band == "2G":
max_stations = 64 * len(self.twog_radios)
radio = ",".join(self.twog_radios)
if len(self.twog_radios) == 1:
radio = radio + ",AUTO"
# self.eap_connect.sta_prefix = self.twog_prefix
if num_stations != "max":
num_stations = int(num_stations / len(self.twog_radios))
for radio in self.twog_radios:
max_stations = 64
if num_stations == "max":
num_stations = max_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
if band == "5G":
max_stations = 64 * len(self.twog_radios)
radio = ",".join(self.fiveg_radios)
if len(self.fiveg_radios) == 1:
radio = radio + ",AUTO"
if num_stations != "max":
num_stations = int(num_stations / len(self.fiveg_radios))
for radio in self.fiveg_radios:
max_stations = 64
if num_stations == "max":
num_stations = max_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
if band == "ax":
max_stations = len(self.twog_radios)
radio = ",".join(self.fiveg_radios)
if len(self.fiveg_radios) == 1:
radio = radio + ",AUTO"
# self.eap_connect.sta_prefix = self.fiveg_prefix
if num_stations != "max":
max_stations = num_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(max_stations) + " 'DUT: " + dut + " Radio-" + str(int(idx)+1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
if num_stations != "max":
num_stations = int(num_stations / len(self.fiveg_radios))
for radio in self.ax_radios:
max_stations = 1
if num_stations == "max":
num_stations = max_stations
station_data = ["profile_link 1.1 STA-AUTO " + str(num_stations) + " 'DUT: " + dut + " Radio-" +
str(int(idx) + 1) + "'" + " NA " + radio]
self.raw_line.append(station_data)
def Create_Dut(self):
self.CreateDut.setup()
@@ -191,4 +206,3 @@ class ChamberView:
allure.attach.file(source=relevant_path + i,
name=i,
attachment_type="image/png", extension=None)

View File

@@ -112,8 +112,9 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
report.step_start("Checking Internet Connection Error..")
try:
WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
except NoSuchElementException:
#WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
NoInternetConnectionMsg = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']")))
except Exception as e:
print("No Error with Wifi-AP Connection: " + Wifi_AP_Name)
else:
@@ -135,20 +136,19 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
wifiPassword.send_keys(WifiPass)
except NoSuchElementException:
print("Enter Password Page Not Loaded ")
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 ")
except Exception as e:
print("Join Button Not Enabled...Password may not be needed")
try:
WifiInternetErrMsg2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']")))
#= driver.find_element_by_xpath("//*[@label='No Internet Connection']").text
reportFlag = False
except NoSuchElementException:
except Exception as e:
reportFlag = True
print("No Wifi-AP Error Internet Error: " + WifiNameSSID)
#Need to add Wait for Selected Wifi Xpath
@@ -231,39 +231,39 @@ def verify_APconnMobileDevice_iOS(request, WifiName, setup_perfectoMobile, connD
#element = driver.find_element_by_xpath("")
element.click()
print("Verifying if SSID Wifi Shows up")
report.step_start("Verifying if SSID Wifi Shows up")
wifiXpath2 = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
print("SSID is Present: " + WifiName)
report.step_start("SSID is Present: " + WifiName)
try:
print("Waiting for Auto Connection to: " + WifiName)
report.step_start("Waiting for Auto Connection to: " + WifiName)
selectedWifiNetwork = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork)))
except Exception as e:
#Toggle Wifi Mode
Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData)
time.sleep(15)
try:
print("Waiting for Auto Connection After Toggle: " + WifiName)
selectedWifiNetwork2 = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork2)))
except Exception as e:
print("SSID Not Connected Within allocated Time: " + WifiName)
report.step_start("SSID Not Connected: " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
reportFlag = False
assert reportFlag
except Exception as e:
print("SSID Not Connected Within allocated Time: " + WifiName)
report.step_start("SSID Not Connected: " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
reportFlag = False
assert reportFlag
assert reportFlag
#print("Verifying if SSID Wifi Shows up")
#report.step_start("Verifying if SSID Wifi Shows up")
#wifiXpath2 = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='"+ WifiName + "']")))
#print("SSID is Present: " + WifiName)
#report.step_start("SSID is Present: " + WifiName)
try:
print("Waiting for Auto Connection to: " + WifiName)
report.step_start("Waiting for Auto Connection to: " + WifiName)
selectedWifiNetwork = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork)))
except Exception as e:
#Toggle Wifi Mode
Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData)
time.sleep(15)
try:
print("Waiting for Auto Connection After Toggling Wifi: " + WifiName)
selectedWifiNetwork2 = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='"+ WifiName + "']/parent::*/XCUIElementTypeButton[@label='More Info']"
passPointWifi = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, selectedWifiNetwork2)))
except Exception as e:
print("SSID Not Connected Within allocated Time: " + WifiName)
report.step_start("SSID Not Connected: " + WifiName)
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
reportFlag = False
assert reportFlag
return True
@@ -796,6 +796,7 @@ def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile
try:
elementProfiles = driver.find_element_by_xpath("//*[@name='ManagedConfigurationList' and @label='Profiles']")
elementProfiles.click()
print("Exception Select Profile Button")
except NoSuchElementException:
print("No Profile Installed")
@@ -823,27 +824,12 @@ def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile
report.step_start("Click Remove Button")
element = driver.find_element_by_xpath("//*[@label='Remove']")
element.click()
except NoSuchElementException:
except Exception as e:
print("Exception Remove Button")
assert False
#try:
# print("Verify No Profile Installed Msg")
# report.step_start("Verify No Profile Installed Msg")
# wifiXpath2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No profiles are currently installed.']")))
# assert True
#except NoSuchElementException and TimeoutException and Exception:
# assert True
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
# try:
# print("Checking if " + profileName + " is removed")
# element = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='" + profileName + "']")
# assert False
# except NoSuchElementException and Exception:
# print("Exception Verify No Profile Installed Msg, There may be more Profiles Installed")
# assert True
except Exception:
print("Exception There may be No Profiles Installed")
report.step_start("Exception There may be No Profiles Installed")
report.step_start("Exception There may be No Profiles Installed")
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)

View File

@@ -1,10 +1,21 @@
## Test Case Execution Suite
### Run on 1.X SDK
```commandline
pytest -m sanity -s -vvv --testbed=basic-01 -o build=<firmware URL>
pytest -m sanity_55 -s -vvv --testbed=basic-01 -o build=<firmware URL>
pytest -m performance -s -vvv --testbed=basic-01 -o build=<firmware URL>
pytest -m firmware -s -vvv --testbed=basic-01 -o build=<firmware URL>
pytest -m sanity and not interop -s -vvv --testbed=basic-01 -o build=<firmware URL> --1.x
pytest -m sanity and interop -s -vvv --testbed=basic-01 -o build=<firmware URL> --1.x
pytest -m sanity_55 -s -vvv --testbed=basic-01 -o build=<firmware URL> --1.x
pytest -m performance -s -vvv --testbed=basic-01 -o build=<firmware URL> --1.x
pytest -m firmware -s -vvv --testbed=basic-01 -o build=<firmware URL> --1.x
```
### Run on 2.X SDK
```commandline
pytest -m uc_sanity -s -vvv --testbed=basic-03 -o build=<firmware URL>
pytest -m "performance and dataplane_throughput_test" -s -vvv --testbed=basic-03 -o build=<firmware URL>
```
## You can customize the markets with and/or/not logical options

View File

@@ -1,5 +1,38 @@
"""
ec420 basic-03
ecw5410 basic-04
ecw5211 not available in basic
wf188n config
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 \ # config
-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
"""
Customer = ""
server = ""
CONFIGURATION = {
"basic-01": {
"controller": {
@@ -69,8 +102,8 @@ CONFIGURATION = {
"ip": "10.28.3.8",
"port": 8080,
"ssh_port": 22,
"2.4G-Radio": ["wiphy0", "wiphy4"],
"5G-Radio": ["wiphy0", "wiphy5"],
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
@@ -83,11 +116,9 @@ CONFIGURATION = {
}, # checked deployed
"basic-03": {
"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.0.0-SNAPSHOT',
'commit_date': '2021-03-23'
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
'access_point': [
{
@@ -100,7 +131,7 @@ CONFIGURATION = {
'password': "pumpkin77",
'port': 22,
'jumphost_tty': '/dev/ttyAP3',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ec420/trunk/ec420-1.1.0.tar.gz"
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/tplink_ec420/20210728-tplink_ec420-uCentral-trunk-12ad0d5-upgrade.bin"
}
],
"traffic_generator": {
@@ -109,38 +140,36 @@ CONFIGURATION = {
"ip": "10.28.3.10",
"port": 8080,
"ssh_port": 22,
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"2.4G-Radio": ["1.1.wiphy4"],
"5G-Radio": ["1.1.wiphy5"],
"AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.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",
"2.4G-Station-Name": "sta00",
"5G-Station-Name": "sta10",
"AX-Station-Name": "ax"
}
}
}, # checked ---
},
"basic-04": {
"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-06-01"
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
'access_point': [
{
'model': 'ecw5211',
'mode': 'wifi5',
'serial': '68215f9d0c1a',
'serial': '68215fda456d',
'jumphost': True,
'ip': "10.28.3.100",
'username': "lanforge",
'password': "pumpkin77",
'port': 22,
'jumphost_tty': '/dev/ttyAP5',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5211/trunk/ecw5211-1.1.0.tar.gz"
'jumphost_tty': "/dev/ttyAP5",
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin"
}
],
"traffic_generator": {
@@ -149,9 +178,9 @@ CONFIGURATION = {
"ip": "10.28.3.12",
"port": 8080,
"ssh_port": 22,
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"2.4G-Radio": ["1.1.wiphy4"],
"5G-Radio": [ "1.1.wiphy5"],
"AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.wiphy3"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
@@ -163,11 +192,9 @@ CONFIGURATION = {
}, # checked uci
"basic-05": {
"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-06-01"
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
'access_point': [
{
@@ -180,7 +207,7 @@ CONFIGURATION = {
'password': "pumpkin77",
'port': 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/wf188n/trunk/wf188n-1.1.0.tar.gz"
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/cig_wf188/20210729-cig_wf188-v2.0.0-rc2-ec3662e-upgrade.bin"
}
],
"traffic_generator": {
@@ -189,21 +216,21 @@ CONFIGURATION = {
"ip": "10.28.3.28",
"port": 8080,
"ssh_port": 22,
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"2.4G-Radio": ["1.1.wiphy2"],
"5G-Radio": ["1.1.wiphy3"],
"AX-Radio": ["1.1.wiphy0", "1.1.wiphy1", "1.1.wiphy2", "1.1.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",
"uplink": "1.1.eth1",
"2.4G-Station-Name": "sta00",
"5G-Station-Name": "sta10",
"AX-Station-Name": "ax"
}
}
}, # checked uci
"basic-06": {
"controller": {
'url': 'https://sdk-ucentral-2.cicd.lab.wlan.tip.build:16001/api/v1/oauth2', # API base url for the controller
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
@@ -213,10 +240,10 @@ CONFIGURATION = {
'mode': 'wifi6',
'serial': '903cb39d6918',
'jumphost': True,
'ip': "localhost", # 10.28.3.103
'ip': "10.28.3.103", # 10.28.3.103
'username': "lanforge",
'password': "pumpkin77",
'port': 8863, # 22
'port': 22, # 22
'jumphost_tty': '/dev/ttyAP2',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin"
}
@@ -224,12 +251,12 @@ CONFIGURATION = {
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost", # 10.28.3.30
"port": 8862, # 8080
"ssh_port": 8864,
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
"AX-Radio": ["wiphy0", "wiphy1", "wiphy2", "wiphy3"],
"ip": "10.28.3.30", # 10.28.3.30
"port": 8080, # 8080
"ssh_port": 22,
"2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2"],
"5G-Radio": ["1.1.wiphy1", "1.1.wiphy3"],
"AX-Radio": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
@@ -238,34 +265,32 @@ CONFIGURATION = {
"AX-Station-Name": "ax"
}
}
}, # checked uci
},
"basic-07": {
"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-06-01"
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
'access_point': [
{
'model': 'eap102',
'model': 'eap101',
'mode': 'wifi6',
'serial': '00037f102014',
'serial': '903cb36ae223',
'jumphost': True,
'ip': "localhost", # 10.28.3.103
'ip': "10.28.3.103", # 10.28.3.103
'username': "lanforge",
'password': "pumpkin77",
'port': 8873, # 22
'port': 22, # 22
'jumphost_tty': '/dev/ttyAP3',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap102/trunk/eap102-1.1.0.tar.gz"
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap101/20210729-edgecore_eap101-v2.0.0-rc2-02244b8-upgrade.bin"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost", # 10.28.3.32
"port": 8872, # 8080
"ip": "10.28.3.32", # 10.28.3.32
"port": 8080, # 8080
"ssh_port": 22,
"2.4G-Radio": ["wiphy4"],
"5G-Radio": ["wiphy5"],
@@ -273,83 +298,41 @@ CONFIGURATION = {
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
"2.4G-Station-Name": "wlan0",
"5G-Station-Name": "wlan0",
"2.4G-Station-Name": "sta10",
"5G-Station-Name": "sta00",
"AX-Station-Name": "ax"
}
}
}, # checked uci
"basic-08-01": {
"basic-08": {
"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-06-01"
},
'access_point': [
{
'model': 'ecw5410',
'mode': 'wifi5',
'serial': '68215fd2f724',
'jumphost': True,
'ip': "localhost", # 10.28.3.103
'username': "lanforge",
'password': "pumpkin77",
'port': 8883, # 22
'jumphost_tty': '/dev/ttyAP4',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost", # 10.28.3.34
"port": 8882, # 8080
"ssh_port": 22,
"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"
}
}
}, # checked
"basic-08-02": {
"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-06-01"
'url': 'https://sec-ucentral-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
'username': "tip@ucentral.com",
'password': 'openwifi',
},
'access_point': [
{
'model': 'wf194c',
'mode': 'wifi6',
'serial': '089B4BB2F10C',
'serial': '089b4bb2f10c',
'jumphost': True,
'ip': "localhost", # 10.28.3.103
'ip': "10.28.3.103", # 10.28.3.103
'username': "lanforge",
'password': "pumpkin77",
'port': 8883, # 22
'port': 22, # 22
'jumphost_tty': '/dev/ttyAP5',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/wf194c/trunk/wf194c-1.1.0.tar.gz"
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/cig_wf194c/20210729-cig_wf194c-v2.0.0-rc2-02244b8-upgrade.bin"
}
],
"traffic_generator": {
"name": "lanforge",
"details": {
"ip": "localhost", # 10.28.3.34
"port": 8882, # 8080
"ip": "10.28.3.34", # 10.28.3.34
"port": 8080, # 8080
"ssh_port": 22,
"2.4G-Radio": ["wiphy0", "wiphy2"],
"5G-Radio": ["wiphy1", "wiphy3"],
"AX-Radio": ["wiphy4", "wiphy5", "wiphy6", "wiphy7"],
"2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2"],
"5G-Radio": ["1.1.wiphy1", "1.1.wiphy3"],
"AX-Radio": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"],
"upstream": "1.1.eth2",
"upstream_subnet": "10.28.2.1/24",
"uplink": "1.1.eth3",
@@ -400,12 +383,12 @@ CONFIGURATION = {
}
}
}, # checked
"interop": {
"interop": {
"controller": {
'url': "https://wlan-portal-svc-nola-01.cicd.lab.wlan.tip.build", # API base url for the controller
'url': "https://wlan-portal-svc-nola-02.cicd.lab.wlan.tip.build", # API base url for the controller
'username': 'support@example.com',
'password': 'support',
'version': '1.1.0-SNAPSHOT',
'version': '19.07-SNAPSHOT',
'commit_date': '2021-06-01'
},
'access_point': [
@@ -414,12 +397,12 @@ CONFIGURATION = {
'mode': 'wifi5',
'serial': '68215fd2f78c',
'jumphost': True,
'ip': "localhost",
'ip': "10.28.3.102",
'username': "lanforge",
'password': "pumpkin77",
'port': 22,
'jumphost_tty': '/dev/ttyAP1',
'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/trunk/ecw5410-1.1.0.tar.gz"
'version': "https://tip-tip-wlan-cloud-docker-repo.jfrog.io/artifactory/tip-wlan-ap-firmware/ecw5410/dev/ecw5410-2021-07-28-pending-0ec23e8.tar.gz"
}
],
"traffic_generator": {
@@ -473,6 +456,7 @@ CONFIGURATION = {
}
}
RADIUS_SERVER_DATA = {
"ip": "10.10.10.72",
"port": 1812,
@@ -482,6 +466,15 @@ RADIUS_SERVER_DATA = {
"pk_password": "whatever"
}
RADIUS_ACCOUNTING_DATA = {
"ip": "10.10.10.72",
"port": 1812,
"secret": "testing123",
"user": "user",
"password": "password",
"pk_password": "whatever"
}
PASSPOINT_RADIUS_SERVER_DATA = {
"ip": "52.234.179.191",
"port": 11812,
@@ -557,6 +550,8 @@ PASSPOINT_PROFILE_INFO = {
}
TEST_CASES = {
"ap_upgrade": 2233,
"5g_wpa2_bridge": 2236,

View File

@@ -5,13 +5,20 @@ import datetime
import sys
import os
import time
import allure
import re
import logging
if "logs" not in os.listdir():
os.mkdir("logs/")
logging.basicConfig(level=logging.INFO, filename="logs/" + '{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
from _pytest.fixtures import SubRequest
from pyparsing import Optional
ALLURE_ENVIRONMENT_PROPERTIES_FILE = 'environment.properties'
ALLUREDIR_OPTION = '--alluredir'
# if "logs" not in os.listdir():
# os.mkdir("logs/")
# logging.basicConfig(level=logging.INFO, filename="logs/" + '{:%Y-%m-%d-%H-%M-%S}.log'.format(datetime.datetime.now()))
sys.path.append(
os.path.dirname(
os.path.realpath(__file__)
@@ -34,16 +41,23 @@ if 'py-json' not in sys.path:
sys.path.append('../py-scripts')
from apnos.apnos import APNOS
from controller.controller import Controller
from controller.ucentral_ctlr import UController
from controller.controller import FirmwareUtility
import pytest
from cv_test_manager import cv_test
from configuration import CONFIGURATION
from configuration import RADIUS_SERVER_DATA
from configuration import RADIUS_ACCOUNTING_DATA
from configuration import TEST_CASES
from testrails.testrail_api import APIClient
from testrails.reporting import Reporting
from lf_tools import ChamberView
from sta_connect2 import StaConnect2
from os import path
from typing import Any, Callable, Optional
from _pytest.fixtures import SubRequest
from pytest import fixture
def pytest_addoption(parser):
@@ -81,6 +95,14 @@ def pytest_addoption(parser):
help="skip updating firmware on the AP (useful for local testing)"
)
# change to Ucentral Ctlr
parser.addoption(
"--1.x",
action="store_true",
default=False,
help="Option to run Test Cases on 1.x SDK"
)
# change behaviour
parser.addoption(
"--force-upgrade",
@@ -148,15 +170,13 @@ Test session base fixture
@pytest.fixture(scope="session")
def test_cases():
"""Yields the test cases from configuration.py: will be depreciated"""
yield TEST_CASES
yield []
@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 : ")
yield var
@@ -185,10 +205,16 @@ def radius_info():
yield RADIUS_SERVER_DATA
@pytest.fixture(scope="session")
def radius_accounting_info():
"""yields the radius accounting information from lab info file"""
allure.attach(body=str(RADIUS_ACCOUNTING_DATA), name="Radius server Info: ")
yield RADIUS_ACCOUNTING_DATA
@pytest.fixture(scope="session")
def get_configuration(testbed, request):
"""yields the selected testbed information from lab info file (configuration.py)"""
allure.attach(body=str(testbed), name="Testbed Selected: ")
if request.config.getini("cloud_ctlr") != "0":
CONFIGURATION[testbed]["controller"]["url"] = request.config.getini("cloud_ctlr")
yield CONFIGURATION[testbed]
@@ -201,12 +227,17 @@ def get_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(
serial_number=i['serial']))
def get_equipment_id(request, setup_controller, testbed, get_configuration):
""""""
if request.config.getoption("1.x"):
equipment_id_list = []
for i in get_configuration['access_point']:
equipment_id_list.append(setup_controller.get_equipment_id(
serial_number=i['serial']))
else:
equipment_id_list = []
for i in get_configuration['access_point']:
equipment_id_list.append(i['serial'])
yield equipment_id_list
@@ -215,79 +246,102 @@ def instantiate_access_point(testbed, get_apnos, get_configuration):
"""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 :",
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
get_apnos(access_point_info, pwd="../libs/apnos/")
else:
allure.attach(name="Direct AP SSH : ",
body=access_point_info['ip'] + ":" + str(access_point_info["port"]))
pass
# Write a code to verify Access Point Connectivity
yield True
# Controller Fixture
@pytest.fixture(scope="session")
def setup_controller(request, get_configuration, instantiate_access_point):
def setup_controller(request, get_configuration, test_access_point, add_env_properties):
"""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: ")
if request.config.getoption("1.x"):
sdk_client = Controller(controller_data=get_configuration["controller"])
def teardown_controller():
print("\nTest session Completed")
allure.attach(body=str(get_configuration["controller"]), name="Controller Teardown: ")
sdk_client.disconnect_Controller()
def teardown_controller():
print("\nTest session Completed")
sdk_client.disconnect_Controller()
request.addfinalizer(teardown_controller)
else:
sdk_client = UController(controller_data=get_configuration["controller"])
def teardown_ucontroller():
print("\nTest session Completed")
sdk_client.logout()
try:
sdk_client.logout()
except Exception as e:
print(e)
request.addfinalizer(teardown_ucontroller)
request.addfinalizer(teardown_controller)
except Exception as e:
print(e)
allure.attach(body=str(e), name="Controller Instantiation Failed: ")
sdk_client = False
pytest.exit("unable to communicate to Controller" + str(e))
yield sdk_client
@pytest.fixture(scope="session")
def instantiate_firmware(request, setup_controller, get_configuration):
"""sets up firmware utility and yields the object for firmware upgrade"""
firmware_client_obj = []
if request.config.getoption("--1.x"):
firmware_client_obj = []
for access_point_info in get_configuration['access_point']:
version = access_point_info["version"]
if request.config.getini("build").__contains__("https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/"):
version = request.config.getini("build")
firmware_client = FirmwareUtility(sdk_client=setup_controller,
model=access_point_info["model"],
version_url=version)
firmware_client_obj.append(firmware_client)
yield firmware_client_obj
for access_point_info in get_configuration['access_point']:
version = access_point_info["version"]
if request.config.getini("build").__contains__("https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/"):
version = request.config.getini("build")
firmware_client = FirmwareUtility(sdk_client=setup_controller,
model=access_point_info["model"],
version_url=version)
firmware_client_obj.append(firmware_client)
yield firmware_client_obj
else:
# 2.x
pass
@pytest.fixture(scope="session")
def get_latest_firmware(instantiate_firmware):
def get_latest_firmware(request, 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)
if request.config.getoption("--1.x"):
fw_version_list = []
try:
yield fw_version_list
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)
fw_version_list = []
yield fw_version_list
else:
# 2.x
pass
@pytest.fixture(scope="session")
def upload_firmware(should_upload_firmware, instantiate_firmware):
def upload_firmware(request, 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(force_upload=should_upload_firmware)
firmware_id_list.append(firmware_id)
yield firmware_id_list
if request.config.getoption("--1.x"):
firmware_id_list = []
for i in range(0, len(instantiate_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
else:
# 2.x release
yield True
@pytest.fixture(scope="session")
@@ -295,85 +349,99 @@ def upgrade_firmware(request, instantiate_firmware, get_equipment_id, check_ap_f
should_upgrade_firmware, should_upload_firmware, get_apnos, get_configuration):
"""yields the status of upgrade of firmware. waits for 300 sec after each upgrade request"""
print(should_upgrade_firmware, should_upload_firmware)
status_list = []
active_fw_list = []
try:
for access_point in get_configuration['access_point']:
ap_ssh = get_apnos(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
if request.config.getoption("--1.x"):
status_list = []
active_fw_list = []
print(active_fw_list, get_latest_firmware)
if get_latest_firmware != active_fw_list:
if request.config.getoption("--skip-upgrade"):
status = "skip-upgrade"
status_list.append(status)
else:
for i in range(0, len(instantiate_firmware)):
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i], force_upload=True,
force_upgrade=should_upgrade_firmware)
allure.attach(name="Firmware Upgrade Request", body=str(status))
try:
for access_point in get_configuration['access_point']:
ap_ssh = get_apnos(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
active_fw_list = []
print(active_fw_list, get_latest_firmware)
if get_latest_firmware != active_fw_list:
if request.config.getoption("--skip-upgrade"):
status = "skip-upgrade"
status_list.append(status)
else:
for i in range(0, len(instantiate_firmware)):
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[i],
force_upload=should_upload_firmware,
force_upgrade=should_upgrade_firmware)
status_list.append(status)
else:
status = "skip-upgrade Version Already Available"
status_list.append(status)
yield status_list
else:
if should_upgrade_firmware:
for i in range(0, len(instantiate_firmware)):
status = instantiate_firmware[i].upgrade_fw(equipment_id=get_equipment_id[i],
force_upload=should_upload_firmware,
force_upgrade=should_upgrade_firmware)
allure.attach(name="Firmware Upgrade Request", body=str(status))
status_list.append(status)
else:
status = "skip-upgrade Version Already Available"
status_list.append(status)
yield status_list
# 2.x release
pass
@pytest.fixture(scope="session")
def check_ap_firmware_cloud(setup_controller, get_equipment_id):
def check_ap_firmware_cloud(request, 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
if request.config.getoption("--1.x"):
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
else:
# 2.x
pass
@pytest.fixture(scope="session")
def check_ap_firmware_ssh(get_configuration):
def check_ap_firmware_ssh(get_configuration, request):
"""yields the active version of firmware on ap"""
active_fw_list = []
try:
for access_point in get_configuration['access_point']:
ap_ssh = APNOS(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
if request.config.getoption("--1.x"):
active_fw_list = []
yield active_fw_list
try:
for access_point in get_configuration['access_point']:
ap_ssh = APNOS(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
active_fw_list = []
yield active_fw_list
else:
# 2.x
pass
@pytest.fixture(scope="session")
def setup_test_run(setup_controller, upgrade_firmware, get_configuration, get_equipment_id, get_latest_firmware,
def setup_test_run(setup_controller, request, upgrade_firmware, get_configuration,
get_equipment_id, get_latest_firmware,
get_apnos):
"""used to upgrade the firmware on AP and should be called on each test case on a module level"""
active_fw_list = []
try:
for access_point in get_configuration['access_point']:
ap_ssh = get_apnos(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
if request.config.getoption("--1.x"):
active_fw_list = []
print(active_fw_list, get_latest_firmware)
if active_fw_list == get_latest_firmware:
yield True
try:
for access_point in get_configuration['access_point']:
ap_ssh = get_apnos(access_point)
active_fw = ap_ssh.get_active_firmware()
active_fw_list.append(active_fw)
except Exception as e:
print(e)
active_fw_list = []
print(active_fw_list, get_latest_firmware)
if active_fw_list == get_latest_firmware:
yield True
else:
pytest.exit("AP is not Upgraded tp Target Firmware versions")
else:
pytest.exit("AP is not Upgraded tp Target Firmware versions")
# 2.x
pass
"""
@@ -429,30 +497,39 @@ 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))
for i in security:
if set(markers).__contains__(i):
security_dict[i] = True
else:
security_dict[i] = False
# print(security_dict)
allure.attach(body=str(security_dict), name="Test Cases Requires: ")
yield security_dict
# Will be availabe as a test case
@pytest.fixture(scope="function")
def test_access_point(testbed, get_apnos, get_configuration):
@pytest.fixture(scope="session")
def test_access_point(request, 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)
status = ap_ssh.get_manager_state()
if "ACTIVE" not in status:
time.sleep(30)
ap_ssh = APNOS(access_point_info)
if request.config.getoption("1.x"):
for access_point_info in get_configuration['access_point']:
ap_ssh = get_apnos(access_point_info)
status = ap_ssh.get_manager_state()
mgr_status.append(status)
if "ACTIVE" not in status:
time.sleep(30)
ap_ssh = APNOS(access_point_info)
status = ap_ssh.get_manager_state()
mgr_status.append(status)
else:
# for access_point_info in get_configuration['access_point']:
# ap_ssh = get_apnos(access_point_info)
# status = ap_ssh.get_manager_state()
# if "ACTIVE" not in status:
# time.sleep(30)
# ap_ssh = APNOS(access_point_info)
# status = ap_ssh.get_manager_state()
# mgr_status.append(status)
pass
yield mgr_status
@@ -514,63 +591,28 @@ def create_lanforge_chamberview_dut(get_configuration, testbed):
testbed=testbed, access_point_data=get_configuration["access_point"])
yield True
@pytest.fixture(scope="session")
def lf_tools(get_configuration, testbed):
""" Create a DUT on LANforge"""
obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
testbed=testbed, access_point_data=get_configuration["access_point"])
testbed=testbed, access_point_data=get_configuration["access_point"])
yield obj
@pytest.fixture(scope="module")
def create_vlan(request, testbed, get_configuration):
"""Create a vlan on lanforge"""
if request.param["mode"] == "VLAN":
vlan_list = list()
refactored_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"])
else:
pass
if vlan_list:
[refactored_vlan_list.append(x) for x in vlan_list if x not in refactored_vlan_list]
vlan_list = refactored_vlan_list
for i in range(len(vlan_list)):
if vlan_list[i] > 4095 or vlan_list[i] < 1:
vlan_list.pop(i)
@pytest.fixture(scope="session")
def lf_tools(get_configuration, testbed):
""" Create a DUT on LANforge"""
obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
testbed=testbed, access_point_data=get_configuration["access_point"])
yield obj
if not vlan_list:
vlan_list.append(100)
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:
chamberview_obj.raw_line.append(["profile_link " + upstream_resources + " Vlan 1 NA "
+ "NA " + upstream_port.split(".")[2] + ",AUTO -1 " + str(vlan)])
chamberview_obj.Chamber_View()
port_resource = upstream_resources.split(".")
yield vlan_list
else:
yield False
# try:
# ip = chamberview_obj.json_get("/port/" + port_resource[0] + "/" + port_resource[1] +
# "/" + upstream_port.split(".")[2] + "." + str(vlan))["interface"]["ip"]
# if ip:
# yield vlan_list, ip
# except Exception as e:
# print(e)
# yield False
# @pytest.fixture(scope="class")
# def create_vlan(request, testbed, get_configuration, lf_tools):
# """Create a vlan on lanforge"""
#
@pytest.fixture(scope="session")
@@ -586,6 +628,49 @@ def setup_influx(request, testbed, get_configuration):
}
yield influx_params
# Need for Perforce Mobile Device Execution
def pytest_sessionstart(session):
session.results = dict()
session.results = dict()
ALLURE_ENVIRONMENT_PROPERTIES_FILE = 'environment.properties'
ALLUREDIR_OPTION = '--alluredir'
@fixture(scope='session', autouse=True)
def add_allure_environment_property(request: SubRequest) -> Optional[Callable]:
environment_properties = dict()
def maker(key: str, value: Any):
environment_properties.update({key: value})
yield maker
alluredir = request.config.getoption(ALLUREDIR_OPTION)
if not alluredir or not os.path.isdir(alluredir) or not environment_properties:
return
allure_env_path = path.join(alluredir, ALLURE_ENVIRONMENT_PROPERTIES_FILE)
with open(allure_env_path, 'w') as _f:
data = '\n'.join([f'{variable}={value}' for variable, value in environment_properties.items()])
_f.write(data)
@fixture(scope='session')
def get_uc_ap_version(get_apnos, get_configuration):
version_list = []
for access_point_info in get_configuration['access_point']:
ap_ssh = get_apnos(access_point_info)
version = ap_ssh.get_ap_version_ucentral()
version_list.append(version)
yield version_list
@fixture(scope='session')
def add_env_properties(get_configuration, get_uc_ap_version, add_allure_environment_property: Callable) -> None:
add_allure_environment_property('Access-Point-Model', get_configuration["access_point"][0]["model"])
add_allure_environment_property('Access-Point-Firmware-Version', get_uc_ap_version[0].split("\n")[1])
add_allure_environment_property('Cloud-Controller-SDK-URL', get_configuration["controller"]["url"])

View File

@@ -0,0 +1,29 @@
"""
UCI Rest API Tests: Test Login, Logout API's
"""
import pytest
class TestUCIAUTHDEAUTH(object):
"""
pytest -m "uci_login or uci_logout" --ucentral
"""
@pytest.mark.uci_login
def test_uci_auth(self, setup_controller):
"""
pytest -m "uci_login" --ucentral
"""
print(setup_controller.login_resp)
assert setup_controller.login_resp.status_code == 200
@pytest.mark.uci_logout
def test_uci_deauth(self, setup_controller):
"""
pytest -m "uci_logout" --ucentral
"""
resp = setup_controller.logout()
print(resp)
assert resp.status_code == 200

View File

@@ -0,0 +1,29 @@
"""
UCI Rest API Tests: Test Devices API
"""
import pytest
class TestUCIAUTHDEAUTH(object):
"""
pytest -m "uci_login or uci_logout" --ucentral
"""
@pytest.mark.uci_login
def test_get_all_devices(self, setup_controller):
"""
pytest -m "uci_login" --ucentral
"""
print(setup_controller.login_resp)
assert setup_controller.login_resp.status_code == 200
@pytest.mark.uci_logout
def test_get_device_by_serial(self, setup_controller):
"""
pytest -m "uci_logout" --ucentral
"""
resp = setup_controller.logout()
print(resp)
assert resp.status_code == 200

View File

@@ -45,125 +45,53 @@ class TestSetupBridgeEnterpriseSuiteA(object):
@pytest.mark.twog
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 2.4G """
if setup_profiles['wpa_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.wpa_enterprise
@pytest.mark.fiveg
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 5G """
if setup_profiles['wpa_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa2_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 5G """
if setup_profiles['wpa2_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 2.4G """
if setup_profiles['wpa3_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_2g']
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 5G """
if setup_profiles['wpa3_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite A Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite A Enterprise """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -171,16 +99,7 @@ class TestSetupBridgeEnterpriseSuiteA(object):
test_cases):
""" VIF Config Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_enterprise_two = {
@@ -208,110 +127,48 @@ setup_params_enterprise_two = {
)
@pytest.mark.usefixtures("setup_profiles")
class TestSetupBridgeEnterpriseSuiteB(object):
""" Enterprise SSID Suite-B"""
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.twog
def test_setup_wpa_wpa2_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa_wpa2_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa_wpa2_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 5G """
if setup_profiles['wpa_wpa2_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.twog
def test_setup_wpa3_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA3 Enterprise Mixed SSID 2.4G """
if setup_profiles['wpa3_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_2g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise Mixed SSID 5G """
if setup_profiles['wpa3_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite B Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite B Enterprise """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" VIF State Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']

View File

@@ -49,17 +49,7 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation open 2.4G
pytest -m "setup and bridge and general and suiteA and open and twog"
"""
if setup_profiles['open_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['open_2g']
@pytest.mark.open
@pytest.mark.fiveg
@@ -67,16 +57,7 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation open 5G
pytest -m "setup and bridge and general and suiteA and open and fiveg"
"""
if setup_profiles['open_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['open_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -85,16 +66,7 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation wpa 2.4G
pytest -m "setup and bridge and general and suiteA and wpa and twog"
"""
if setup_profiles['wpa_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -103,16 +75,7 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation wpa 5G
pytest -m "setup and bridge and general and suiteA and wpa and fiveg"
"""
if setup_profiles['wpa_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -122,16 +85,7 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation wpa2_personal 2.4G
pytest -m "setup and bridge and general and suiteA and wpa2_personal and twog"
"""
if setup_profiles['wpa2_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -141,46 +95,19 @@ class TestSetupBridgeSuiteA(object):
""" SSID Profile Creation wpa2_personal 5G
pytest -m "setup and bridge and general and suiteA and wpa2_personal and fiveg"
"""
if setup_profiles['wpa2_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile SuiteA General """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vifc SuiteA General """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -188,16 +115,7 @@ class TestSetupBridgeSuiteA(object):
test_cases):
""" vifs SuiteA General """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_general_two = {
@@ -239,16 +157,7 @@ class TestBridgeModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 2.4G
pytest -m "setup and bridge and general and suiteB and wpa3_personal and twog"
"""
if setup_profiles['wpa3_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_2g']
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@@ -256,16 +165,8 @@ class TestBridgeModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 5G
pytest -m "setup and bridge and general and suiteB and wpa3_personal and fiveg"
"""
if setup_profiles['wpa3_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_5g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@@ -273,17 +174,7 @@ class TestBridgeModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal_mixed 2.4G
pytest -m "setup and bridge and general and suiteB and wpa3_personal_mixed and twog"
"""
if setup_profiles['wpa3_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_2g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@@ -292,16 +183,7 @@ class TestBridgeModeConnectivitySuiteB(object):
pytest -m "setup and bridge and general and suiteB and wpa3_personal_mixed and fiveg"
"""
if setup_profiles['wpa3_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_5g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@@ -311,16 +193,7 @@ class TestBridgeModeConnectivitySuiteB(object):
pytest -m "setup and bridge and general and suiteB and wpa_wpa2_personal_mixed and twog"
"""
if setup_profiles['wpa_wpa2_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@@ -330,57 +203,21 @@ class TestBridgeModeConnectivitySuiteB(object):
pytest -m "setup and bridge and general and suiteB and wpa_wpa2_personal_mixed and fiveg"
"""
if setup_profiles['wpa_wpa2_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Suite B """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_bridge"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vif config Suite B """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" vif state Suite B """
time.sleep(200)
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
assert setup_profiles['vifs']

View File

@@ -45,125 +45,53 @@ class TestSetupNATEnterpriseSuiteA(object):
@pytest.mark.twog
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 2.4G """
if setup_profiles['wpa_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.wpa_enterprise
@pytest.mark.fiveg
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 5G """
if setup_profiles['wpa_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa2_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 5G """
if setup_profiles['wpa2_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 2.4G """
if setup_profiles['wpa3_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_2g']
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 5G """
if setup_profiles['wpa3_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite A Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite A Enterprise """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -171,16 +99,7 @@ class TestSetupNATEnterpriseSuiteA(object):
test_cases):
""" VIF Config Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_enterprise_two = {
@@ -215,103 +134,40 @@ class TestSetupNATEnterpriseSuiteB(object):
@pytest.mark.twog
def test_setup_wpa_wpa2_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa_wpa2_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa_wpa2_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 5G """
if setup_profiles['wpa_wpa2_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.twog
def test_setup_wpa3_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA3 Enterprise Mixed SSID 2.4G """
if setup_profiles['wpa3_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_2g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise Mixed SSID 5G """
if setup_profiles['wpa3_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite B Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite B Enterprise """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" VIF State Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']

View File

@@ -49,17 +49,8 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation open 2.4G
pytest -m "setup and nat and general and suiteA and open and twog"
"""
assert setup_profiles['open_2g']
if setup_profiles['open_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_nat"],
status_id=5,
msg='Failed to create profile')
assert False
@pytest.mark.open
@pytest.mark.fiveg
@@ -67,16 +58,8 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation open 5G
pytest -m "setup and nat and general and suiteA and open and fiveg"
"""
if setup_profiles['open_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['open_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -85,16 +68,9 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation wpa 2.4G
pytest -m "setup and nat and general and suiteA and wpa and twog"
"""
if setup_profiles['wpa_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -103,16 +79,9 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation wpa 5G
pytest -m "setup and nat and general and suiteA and wpa and fiveg"
"""
if setup_profiles['wpa_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -122,16 +91,10 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation wpa2_personal 2.4G
pytest -m "setup and nat and general and suiteA and wpa2_personal and twog"
"""
if setup_profiles['wpa2_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -141,46 +104,23 @@ class TestSetupNATSuiteA(object):
""" SSID Profile Creation wpa2_personal 5G
pytest -m "setup and nat and general and suiteA and wpa2_personal and fiveg"
"""
if setup_profiles['wpa2_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile SuiteA General """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vifc SuiteA General """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -188,16 +128,7 @@ class TestSetupNATSuiteA(object):
test_cases):
""" vifs SuiteA General """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_general_two = {
@@ -239,16 +170,7 @@ class TestNATModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 2.4G
pytest -m "setup and nat and general and suiteB and wpa3_personal and twog"
"""
if setup_profiles['wpa3_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_2g']
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@@ -256,16 +178,7 @@ class TestNATModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 5G
pytest -m "setup and nat and general and suiteB and wpa3_personal and fiveg"
"""
if setup_profiles['wpa3_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_5g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@@ -273,17 +186,7 @@ class TestNATModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal_mixed 2.4G
pytest -m "setup and nat and general and suiteB and wpa3_personal_mixed and twog"
"""
if setup_profiles['wpa3_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_2g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@@ -292,16 +195,7 @@ class TestNATModeConnectivitySuiteB(object):
pytest -m "setup and nat and general and suiteB and wpa3_personal_mixed and fiveg"
"""
if setup_profiles['wpa3_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_5g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@@ -311,16 +205,7 @@ class TestNATModeConnectivitySuiteB(object):
pytest -m "setup and nat and general and suiteB and wpa_wpa2_personal_mixed and twog"
"""
if setup_profiles['wpa_wpa2_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@@ -330,57 +215,21 @@ class TestNATModeConnectivitySuiteB(object):
pytest -m "setup and nat and general and suiteB and wpa_wpa2_personal_mixed and fiveg"
"""
if setup_profiles['wpa_wpa2_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Suite B """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_nat"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vif config Suite B """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" vif state Suite B """
time.sleep(200)
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
assert setup_profiles['vifs']

View File

@@ -45,125 +45,55 @@ class TestSetupVLANEnterpriseSuiteA(object):
@pytest.mark.twog
def test_setup_wpa_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 2.4G """
if setup_profiles['wpa_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.wpa_enterprise
@pytest.mark.fiveg
def test_setup_wpa_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA Enterprise SSID 5G """
if setup_profiles['wpa_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
def test_setup_wpa2_enterprise_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa2_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
def test_setup_wpa2_enterprise_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA2 Enterprise SSID 5G """
if setup_profiles['wpa2_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_enterprise_5g']
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
def test_setup_wpa3_enterprise_2g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 2.4G """
if setup_profiles['wpa3_enterprise_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_2g']
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise SSID 5G """
if setup_profiles['wpa3_enterprise_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_eap_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite A Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite A Enterprise """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -171,16 +101,7 @@ class TestSetupVLANEnterpriseSuiteA(object):
test_cases):
""" VIF Config Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_enterprise_two = {
@@ -215,103 +136,40 @@ class TestSetupVLANEnterpriseSuiteB(object):
@pytest.mark.twog
def test_setup_wpa_wpa2_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 2.4G """
if setup_profiles['wpa_wpa2_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_wpa2_enterprise_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_2g']
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa_wpa2_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA WPA2 Enterprise SSID 5G """
if setup_profiles['wpa_wpa2_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_wpa2_enterprise_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_enterprise_mixed_5g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.twog
def test_setup_wpa3_enterprise_mixed_2g_ssid_profile(self, setup_profiles, update_report, test_cases):
""" WPA3 Enterprise Mixed SSID 2.4G """
if setup_profiles['wpa3_enterprise_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_enterprise_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_2g']
@pytest.mark.wpa3_enterprise_mixed
@pytest.mark.fiveg
def test_setup_wpa3_enterprise_mixed_5g_ssid_profile(self, setup_profiles, update_report,
test_cases):
""" WPA3 Enterprise Mixed SSID 5G """
if setup_profiles['wpa3_enterprise_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_enterprise_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_enterprise_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_enterprise_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile Suite B Enterprise """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" VIF Config Suite B Enterprise """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" VIF State Suite B Enterprise """
time.sleep(200)
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
assert setup_profiles['vifs']

View File

@@ -49,17 +49,8 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation open 2.4G
pytest -m "setup and vlan and general and suiteA and open and twog"
"""
assert setup_profiles['open_2g']
if setup_profiles['open_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_open_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
@pytest.mark.open
@pytest.mark.fiveg
@@ -67,16 +58,7 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation open 5G
pytest -m "setup and vlan and general and suiteA and open and fiveg"
"""
if setup_profiles['open_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['open_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_open_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['open_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -85,16 +67,7 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation wpa 2.4G
pytest -m "setup and vlan and general and suiteA and wpa and twog"
"""
if setup_profiles['wpa_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa
@@ -103,16 +76,7 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation wpa 5G
pytest -m "setup and vlan and general and suiteA and wpa and fiveg"
"""
if setup_profiles['wpa_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_5g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -122,16 +86,7 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation wpa2_personal 2.4G
pytest -m "setup and vlan and general and suiteA and wpa2_personal and twog"
"""
if setup_profiles['wpa2_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_2g']
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@@ -141,46 +96,19 @@ class TestSetupVLANSuiteA(object):
""" SSID Profile Creation wpa2_personal 5G
pytest -m "setup and vlan and general and suiteA and wpa2_personal and fiveg"
"""
if setup_profiles['wpa2_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa2_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa2_personal_5g']
@pytest.mark.sanity_light
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Profile SuiteA General """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
@pytest.mark.sanity_light
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vifc SuiteA General """
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
assert setup_profiles['vifc']
@pytest.mark.sanity_light
@allure.severity(allure.severity_level.BLOCKER)
@@ -188,16 +116,7 @@ class TestSetupVLANSuiteA(object):
test_cases):
""" vifs SuiteA General """
time.sleep(200)
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
assert setup_profiles['vifs']
setup_params_general_two = {
@@ -239,16 +158,7 @@ class TestVLANModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 2.4G
pytest -m "setup and vlan and general and suiteB and wpa3_personal and twog"
"""
if setup_profiles['wpa3_personal_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_2g']
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@@ -256,16 +166,7 @@ class TestVLANModeConnectivitySuiteB(object):
""" SSID Profile Creation wpa3_personal 5G
pytest -m "setup and vlan and general and suiteB and wpa3_personal and fiveg"
"""
if setup_profiles['wpa3_personal_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_5g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@@ -274,16 +175,7 @@ class TestVLANModeConnectivitySuiteB(object):
pytest -m "setup and vlan and general and suiteB and wpa3_personal_mixed and twog"
"""
if setup_profiles['wpa3_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa3_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_2g']
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@@ -292,16 +184,7 @@ class TestVLANModeConnectivitySuiteB(object):
pytest -m "setup and vlan and general and suiteB and wpa3_personal_mixed and fiveg"
"""
if setup_profiles['wpa3_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa3_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa3_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa3_personal_mixed_5g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@@ -311,16 +194,7 @@ class TestVLANModeConnectivitySuiteB(object):
pytest -m "setup and vlan and general and suiteB and wpa_wpa2_personal_mixed and twog"
"""
if setup_profiles['wpa_wpa2_personal_mixed_2g']:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
else:
update_report.update_testrail(case_id=test_cases["ssid_2g_wpa2_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_2g']
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@@ -330,57 +204,21 @@ class TestVLANModeConnectivitySuiteB(object):
pytest -m "setup and vlan and general and suiteB and wpa_wpa2_personal_mixed and fiveg"
"""
if setup_profiles['wpa_wpa2_personal_mixed_5g']:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
else:
update_report.update_testrail(case_id=test_cases["ssid_5g_wpa2_mixed_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['wpa_wpa2_personal_mixed_5g']
def test_setup_equipment_ap_profile(self, setup_profiles, update_report,
test_cases):
""" Equipment AP Suite B """
if setup_profiles['equipment_ap']:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=1,
msg='profile created successfully')
assert setup_profiles['equipment_ap']
else:
update_report.update_testrail(case_id=test_cases["ap_profile_vlan"],
status_id=5,
msg='Failed to create profile')
assert False
assert setup_profiles['equipment_ap']
def test_verify_vif_config(self, setup_profiles, update_report,
test_cases):
""" vif config Suite B """
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
assert setup_profiles['vifc']
@allure.severity(allure.severity_level.BLOCKER)
def test_verify_vif_state(self, setup_profiles, update_report,
test_cases):
""" vif state Suite B """
time.sleep(200)
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
assert setup_profiles['vifs']

File diff suppressed because it is too large Load Diff

View File

@@ -9,7 +9,7 @@ import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test,
pytest.mark.bridge, pytest.mark.usefixtures("setup_test_run")]
pytest.mark.bridge] # , pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "BRIDGE",
@@ -21,6 +21,7 @@ setup_params_general = {
"radius": False
}
@allure.suite("performance")
@allure.feature("BRIDGE MODE Dataplane Throughput Test")
@pytest.mark.parametrize(

View File

@@ -9,7 +9,7 @@ import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.dataplane_throughput_test,
pytest.mark.nat, pytest.mark.usefixtures("setup_test_run")]
pytest.mark.nat]
setup_params_general = {
"mode": "NAT",

View File

@@ -9,7 +9,7 @@ import pytest
import allure
pytestmark = [pytest.mark.performance,
pytest.mark.vlan, pytest.mark.usefixtures("setup_test_run")]
pytest.mark.vlan]
setup_params_general = {
"mode": "VLAN",

View File

@@ -1,6 +1,6 @@
"""
Dual Band Performance Test : NAT Mode
pytest -m "performance and dual_band_test and nat"
Dual Band Performance Test : BRIDGE Mode
pytest -m "performance and dual_band_test and BRIDGE"
"""
@@ -9,14 +9,14 @@ import os
import allure
import pytest
pytestmark = [pytest.mark.performance, pytest.mark.dual_band_test, pytest.mark.bridge,
pytest.mark.single_station_dual_band_throughput, pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.performance, pytest.mark.dual_band_test, pytest.mark.bridge, pytest.mark.sss,
pytest.mark.single_station_dual_band_throughput]# pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "NAT",
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2p_2g", "appliedRadios": ["2G", "5G"], "security_key": "something"}
{"ssid_name": "ssid_wpa2p_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something"}
]},
"rf": {},
"radius": False
@@ -33,9 +33,9 @@ setup_params_general = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestDualbandPerformanceNat(object):
class TestDualbandPerformanceBRIDGE(object):
"""
pytest -m "performance and dual_band_test and nat and wpa2_personal and twog and fiveg"
pytest -m "performance and dual_band_test and BRIDGE and wpa2_personal and twog and fiveg"
"""
@pytest.mark.wpa2_personal
@@ -64,7 +64,7 @@ class TestDualbandPerformanceNat(object):
pytest.xfail("SSID's NOT AVAILABLE IN VIF STATE")
dbpt_obj = lf_test.dualbandperformancetest(mode=mode, ssid_2G=ssid_2G, ssid_5G=ssid_5G,
instance_name="dbp_instance_wpa2p_nat_p",
instance_name="dbp_instance_wpa2p_BRIDGE_p",
vlan_id=vlan, dut_5g=dut_5g, dut_2g=dut_2g)
report_name = dbpt_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Dual Band Performance Test")

View File

@@ -16,7 +16,7 @@ setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2p_2g", "appliedRadios": ["2G", "5G"], "security_key": "something"}
{"ssid_name": "ssid_wpa2_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something"}
]},
"rf": {},
"radius": False

View File

@@ -12,11 +12,12 @@ import pytest
pytestmark = [pytest.mark.performance, pytest.mark.vlan]#,
# pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": "VLAN",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2p_2g", "appliedRadios": ["2G", "5G"], "security_key": "something"}
{"ssid_name": "ssid_wpa2_dual_band", "appliedRadios": ["2G", "5G"], "security_key": "something", "vlan": 100}
]},
"rf": {},
"radius": False

View File

@@ -1,14 +1,14 @@
"""
Performance Test: Wifi Capacity Test : Bridge Mode
pytest -m "wifi_capacity_test and bridge"
Performance Test: Wifi Capacity Test : BRIDGE Mode
pytest -m "wifi_capacity_test and BRIDGE"
"""
import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.wifi_capacity_test, pytest.mark.bridge]
pytestmark = [pytest.mark.performance, pytest.mark.bridge]
# """pytest.mark.usefixtures("setup_test_run")"""]
@@ -32,33 +32,37 @@ setup_params_general_dual_band = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.wpa2_personal
@pytest.mark.bridge
@pytest.mark.twog
@pytest.mark.fiveg
@pytest.mark.dual_band
class TestWifiCapacityBridgeModeDualBand(object):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge"
@pytest.mark.wpa2_personal
@pytest.mark.wifi_capacity_test
class TestWifiCapacityBRIDGEModeDualBand(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE"
"""
@pytest.mark.tcp_download
def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
def test_client_wpa2_BRIDGE_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="TCP-IPv4", duration="60000")
@@ -69,23 +73,25 @@ class TestWifiCapacityBridgeModeDualBand(object):
assert True
@pytest.mark.udp_download
def test_client_wpa2_bridge_udp_dl(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "BRIDGE"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="UDP-IPv4", duration="60000")
@@ -96,11 +102,11 @@ class TestWifiCapacityBridgeModeDualBand(object):
assert True
@pytest.mark.tcp_bidirectional
def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -111,8 +117,9 @@ class TestWifiCapacityBridgeModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000")
@@ -123,11 +130,11 @@ class TestWifiCapacityBridgeModeDualBand(object):
assert True
@pytest.mark.udp_bidirectional
def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -138,8 +145,9 @@ class TestWifiCapacityBridgeModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000")
@@ -172,18 +180,18 @@ setup_params_general_2G = {
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.fiveg_band
class TestWifiCapacityBridgeMode2G(object):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge"
@pytest.mark.twog_band
class TestWifiCapacityBRIDGEMode2G(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE"
"""
@pytest.mark.tcp_download
def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
def test_client_wpa2_BRIDGE_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -193,8 +201,9 @@ class TestWifiCapacityBridgeMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="TCP-IPv4", duration="60000")
@@ -205,11 +214,11 @@ class TestWifiCapacityBridgeMode2G(object):
assert True
@pytest.mark.udp_download
def test_client_wpa2_bridge_udp_dl(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -219,8 +228,9 @@ class TestWifiCapacityBridgeMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="UDP-IPv4", duration="60000")
@@ -231,11 +241,11 @@ class TestWifiCapacityBridgeMode2G(object):
assert True
@pytest.mark.tcp_bidirectional
def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -245,8 +255,9 @@ class TestWifiCapacityBridgeMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000")
@@ -257,11 +268,11 @@ class TestWifiCapacityBridgeMode2G(object):
assert True
@pytest.mark.udp_bidirectional
def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -271,8 +282,9 @@ class TestWifiCapacityBridgeMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000")
@@ -287,7 +299,7 @@ setup_params_general_5G = {
"mode": "BRIDGE",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"}
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["5G"], "security_key": "something"}
]
},
"rf": {},
@@ -306,17 +318,17 @@ setup_params_general_5G = {
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@pytest.mark.fiveg_band
class TestWifiCapacityBridgeMode5G(object):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge"
class TestWifiCapacityBRIDGEMode5G(object):
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE"
"""
@pytest.mark.tcp_download
def test_client_wpa2_bridge_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
def test_client_wpa2_BRIDGE_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -326,8 +338,9 @@ class TestWifiCapacityBridgeMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="TCP-IPv4", duration="60000")
@@ -338,11 +351,11 @@ class TestWifiCapacityBridgeMode5G(object):
assert True
@pytest.mark.udp_download
def test_client_wpa2_bridge_udp_dl(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -352,8 +365,9 @@ class TestWifiCapacityBridgeMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_dl", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="0", protocol="UDP-IPv4", duration="60000")
@@ -364,11 +378,11 @@ class TestWifiCapacityBridgeMode5G(object):
assert True
@pytest.mark.tcp_bidirectional
def test_client_wpa2_bridge_tcp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -378,8 +392,9 @@ class TestWifiCapacityBridgeMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_tcp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="TCP-IPv4", duration="60000")
@@ -390,11 +405,11 @@ class TestWifiCapacityBridgeMode5G(object):
assert True
@pytest.mark.udp_bidirectional
def test_client_wpa2_bridge_udp_bidirectional(self, get_vif_state, lf_tools,
def test_client_wpa2_BRIDGE_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test Bridge mode
pytest -m "wifi_capacity_test and bridge and wpa2_personal and twog"
""" Wifi Capacity Test BRIDGE mode
pytest -m "wifi_capacity_test and BRIDGE and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
@@ -404,8 +419,9 @@ class TestWifiCapacityBridgeMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_bridge_udp_bi", mode=mode, vlan_id=vlan,
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_BRIDGE_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000")

View File

@@ -8,7 +8,7 @@ import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.wifi_capacity_test, pytest.mark.nat]
pytestmark = [pytest.mark.performance, pytest.mark.nat]
# """pytest.mark.usefixtures("setup_test_run")"""]
@@ -36,7 +36,7 @@ setup_params_general_dual_band = {
@pytest.mark.twog
@pytest.mark.fiveg
@pytest.mark.dual_band
@pytest.mark.performance_release
@pytest.mark.wifi_capacity_test
class TestWifiCapacityNATModeDualBand(object):
""" Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and NAT"
@@ -58,6 +58,7 @@ class TestWifiCapacityNATModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -66,7 +67,6 @@ class TestWifiCapacityNATModeDualBand(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -86,6 +86,7 @@ class TestWifiCapacityNATModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -94,8 +95,6 @@ class TestWifiCapacityNATModeDualBand(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -115,6 +114,7 @@ class TestWifiCapacityNATModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -123,8 +123,6 @@ class TestWifiCapacityNATModeDualBand(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -144,6 +142,7 @@ class TestWifiCapacityNATModeDualBand(object):
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -152,8 +151,6 @@ class TestWifiCapacityNATModeDualBand(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -180,7 +177,7 @@ setup_params_general_2G = {
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.fiveg_band
@pytest.mark.twog_band
class TestWifiCapacityNATMode2G(object):
""" Wifi Capacity Test NAT mode
pytest -m "wifi_capacity_test and NAT"
@@ -201,6 +198,7 @@ class TestWifiCapacityNATMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -209,7 +207,6 @@ class TestWifiCapacityNATMode2G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -228,6 +225,7 @@ class TestWifiCapacityNATMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -236,8 +234,6 @@ class TestWifiCapacityNATMode2G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -256,6 +252,7 @@ class TestWifiCapacityNATMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -264,8 +261,6 @@ class TestWifiCapacityNATMode2G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -284,6 +279,7 @@ class TestWifiCapacityNATMode2G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="2G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -292,8 +288,6 @@ class TestWifiCapacityNATMode2G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -302,7 +296,7 @@ setup_params_general_5G = {
"mode": "NAT",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"}
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["5G"], "security_key": "something"}
]
},
"rf": {},
@@ -341,6 +335,7 @@ class TestWifiCapacityNATMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -349,8 +344,6 @@ class TestWifiCapacityNATMode5G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -369,6 +362,7 @@ class TestWifiCapacityNATMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_dl", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -377,8 +371,6 @@ class TestWifiCapacityNATMode5G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -397,6 +389,7 @@ class TestWifiCapacityNATMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_tcp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -405,8 +398,6 @@ class TestWifiCapacityNATMode5G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphs(report_name=report_name)
lf_tools.reset_scenario()
print("Test Completed... Cleaning up Stations")
assert True
@@ -425,6 +416,7 @@ class TestWifiCapacityNATMode5G(object):
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
lf_tools.add_stations(band="5G", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.add_stations(band="ax", num_stations="max", dut=lf_tools.dut_name, ssid_name=ssid_name)
lf_tools.Chamber_View()
wct_obj = lf_test.wifi_capacity(instance_name="test_client_wpa2_NAT_udp_bi", mode=mode, vlan_id=vlan,
download_rate="1Gbps",
@@ -432,8 +424,6 @@ class TestWifiCapacityNATMode5G(object):
report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
lf_tools.attach_report_graphss(report_name=report_name)
lf_tools.reset_scenario()
lf_tools.attach_report_graphs(report_name=report_name)
print("Test Completed... Cleaning up Stations")
assert True

View File

@@ -1,14 +1,14 @@
"""
Performance Test: Wifi Capacity Test : VLAN Mode
pytest -m "wifi_capacity_test and vlan"
pytest -m "wifi_capacity_test and VLAN"
"""
import os
import pytest
import allure
pytestmark = [pytest.mark.performance, pytest.mark.vlan]
pytestmark = [pytest.mark.performance, pytest.mark.VLAN]
# """pytest.mark.usefixtures("setup_test_run")"""]
@@ -43,15 +43,15 @@ class TestWifiCapacityVLANModeDualBand(object):
@pytest.mark.tcp_download
def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -70,15 +70,15 @@ class TestWifiCapacityVLANModeDualBand(object):
@pytest.mark.udp_download
def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -97,15 +97,15 @@ class TestWifiCapacityVLANModeDualBand(object):
@pytest.mark.tcp_bidirectional
def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -124,15 +124,15 @@ class TestWifiCapacityVLANModeDualBand(object):
@pytest.mark.udp_bidirectional
def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_dual_band["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -172,7 +172,7 @@ setup_params_general_2G = {
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.wpa2_personal
@pytest.mark.twog
@pytest.mark.fiveg_band
@pytest.mark.twog_band
class TestWifiCapacityVLANMode2G(object):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN"
@@ -180,15 +180,15 @@ class TestWifiCapacityVLANMode2G(object):
@pytest.mark.tcp_download
def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -206,15 +206,15 @@ class TestWifiCapacityVLANMode2G(object):
@pytest.mark.udp_download
def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -232,15 +232,15 @@ class TestWifiCapacityVLANMode2G(object):
@pytest.mark.tcp_bidirectional
def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -258,15 +258,15 @@ class TestWifiCapacityVLANMode2G(object):
@pytest.mark.udp_bidirectional
def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_2G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -287,7 +287,7 @@ setup_params_general_5G = {
"mode": "VLAN",
"ssid_modes": {
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is5GHz"], "security_key": "something"}
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["5G"], "security_key": "something"}
]
},
"rf": {},
@@ -313,15 +313,15 @@ class TestWifiCapacityVLANMode5G(object):
@pytest.mark.tcp_download
def test_client_wpa2_VLAN_tcp_dl(self, get_vif_state, lf_tools, setup_profiles,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -339,15 +339,15 @@ class TestWifiCapacityVLANMode5G(object):
@pytest.mark.udp_download
def test_client_wpa2_VLAN_udp_dl(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -365,15 +365,15 @@ class TestWifiCapacityVLANMode5G(object):
@pytest.mark.tcp_bidirectional
def test_client_wpa2_VLAN_tcp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -391,15 +391,15 @@ class TestWifiCapacityVLANMode5G(object):
@pytest.mark.udp_bidirectional
def test_client_wpa2_VLAN_udp_bidirectional(self, get_vif_state, lf_tools,
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
lf_test, station_names_twog, create_lanforge_chamberview_dut,
get_configuration):
""" Wifi Capacity Test VLAN mode
pytest -m "wifi_capacity_test and VLAN and wpa2_personal and twog"
"""
profile_data = setup_params_general_5G["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
mode = "VLAN"
vlan = 1
vlan = 100
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")

View File

@@ -1,13 +1,17 @@
"""
Client Connectivity Enterprise TTLS
pytest -m "client_connectivity and bridge and enterprise and ttls"
"""
import allure
import pytest
mode = "BRIDGE"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.sanity]
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.ucentral, pytest.mark.sanity]#, pytest.mark.usefixtures("setup_test_run")]
setup_params_enterprise = {
"mode": mode,
"mode": "BRIDGE",
"ssid_modes": {
"wpa_enterprise": [
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
@@ -24,6 +28,7 @@ setup_params_enterprise = {
}
@pytest.mark.suiteA
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_enterprise],
@@ -31,101 +36,81 @@ setup_params_enterprise = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestbridgeModeEnterpriseTTLSSuiteOne(object):
class TestBridgeModeEnterpriseTTLSSuiteA(object):
""" SuiteA Enterprise Test Cases
pytest -m "client_connectivity and bridge and enterprise and ttls and suiteA"
"""
@pytest.mark.wpa_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_enterprise_2g(self, get_vif_state,
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_enterprise and twog"
"""
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']
ieee80211w = 1
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, ieee80211w=ieee80211w,
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_eap_ttls_bridge"],
status_id=1,
msg='2G WPA Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa_eap_ttls_bridge"],
status_id=5,
msg='2G WPA Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
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):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_enterprise and fiveg"
"""
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
ssid_name = profile_data["ssid_name"]
security = "wpa"
extra_secu = ["wpa2"]
band = "fiveg"
mode = "BRIDGE"
band = "twog"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
pairwise = "CCMP"
group = "CCMP"
ieee80211w =1
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
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["5g_wpa_eap_ttls_bridge"],
status_id=1,
msg='5G WPA Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_bridge"],
status_id=5,
msg='5G WPA Enterprise Client Connectivity Failed - bridge mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa2_enterprise_2g(self, get_vif_state,
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa2_enterprise and twog"
"""
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']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -133,36 +118,28 @@ class TestbridgeModeEnterpriseTTLSSuiteOne(object):
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_eap_ttls_bridge"],
status_id=1,
msg='2G WPA2 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_eap_ttls_bridge"],
status_id=5,
msg='2G WPA2 Enterprise Client Connectivity Failed - bridge mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa2_enterprise_5g(self, get_vif_state,
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa2_enterprise and fiveg"
"""
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']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -171,97 +148,65 @@ class TestbridgeModeEnterpriseTTLSSuiteOne(object):
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["5g_wpa2_eap_ttls_bridge"],
status_id=1,
msg='5G WPA2 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_eap_ttls_bridge"],
status_id=5,
msg='5G WPA2 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa3_enterprise_2g(self, get_vif_state,
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise and twog"
"""
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"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt=key_mgmt,
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_wpa3_eap_ttls_bridge"],
status_id=1,
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_bridge"],
status_id=5,
msg='2G WPA3 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa3_enterprise_5g(self, get_vif_state,
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise and fiveg"
"""
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"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
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["5g_wpa3_eap_ttls_bridge"],
status_id=1,
msg='5G WPA3 Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_bridge"],
status_id=5,
msg='5G WPA3 Enterprise Client Connectivity Failed - bridge mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
setup_params_enterprise_two = {
"mode": mode,
"mode": "BRIDGE",
"ssid_modes": {
"wpa_wpa2_enterprise_mixed": [
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["2G"]},
@@ -275,7 +220,7 @@ setup_params_enterprise_two = {
}
@pytest.mark.enterprise
@pytest.mark.suiteB
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_enterprise_two],
@@ -283,18 +228,24 @@ setup_params_enterprise_two = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
""" SuiteA Enterprise Test Cases
pytest -m "client_connectivity and bridge and enterprise and ttls and suiteB"
"""
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_wpa2_enterprise_2g(self, get_vif_state,
station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_wpa2_enterprise_mixed and twog"
"""
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"]
@@ -308,31 +259,22 @@ class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
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_mixed_eap_ttls_wpa2_bridge"],
status_id=1,
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_bridge"],
status_id=5,
msg='2G WPA2 Mixed Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_enterprise_5g(self, get_vif_state,
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
update_report, test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa_wpa2_enterprise_mixed and fiveg"
"""
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
ssid_name = profile_data["ssid_name"]
security = "wpa"
extra_secu = ["wpa2"]
band = "fievg"
mode = "BRIDGE"
band = "twog"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
@@ -345,29 +287,20 @@ class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa2_mixed_eap_ttls_wpa2_bridge"],
status_id=1,
msg='5G WPA2 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_bridge"],
status_id=5,
msg='5G WPA2 Mixed 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,
station_names_twog, setup_profiles, get_lanforge_data, lf_test,
update_report, test_cases, radius_info, exit_on_fail):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise_mixed and twog"
"""
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"]
@@ -381,29 +314,21 @@ class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
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_wpa3_mixed_eap_ttls_wpa3_bridge"],
status_id=1,
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_bridge"],
status_id=5,
msg='2G WPA3 Mixed Enterprise 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, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,
station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
update_report, exit_on_fail,
test_cases, radius_info):
""" wpa enterprise 2g
pytest -m "client_connectivity and bridge and enterprise and ttls and wpa3_enterprise_mixed and fiveg"
"""
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"]
@@ -417,16 +342,4 @@ class TestbridgeModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa3_mixed_eap_ttls_wpa3_bridge"],
status_id=1,
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_bridge"],
status_id=5,
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - bridge mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes

View File

@@ -1,6 +1,6 @@
"""
Client Connectivity and tcp-udp Traffic Test: bridge Mode
Client Connectivity and tcp-udp Traffic Test: Bridge Mode
pytest -m "client_connectivity and bridge and general"
"""
@@ -8,30 +8,31 @@
import allure
import pytest
mode = "BRIDGE"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.general, pytest.mark.sanity,
pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.client_connectivity, pytest.mark.bridge, pytest.mark.general, pytest.mark.ucentral,
pytest.mark.sanity] # pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": mode,
"mode": "BRIDGE",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
"open": [{"ssid_name": "ssid_open_2g_br", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_open_5g_br", "appliedRadios": ["5G"],
"security_key": "something"}],
"wpa": [{"ssid_name": "ssid_wpa_2g_br", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g_br", "appliedRadios": ["5G"],
"security_key": "something"}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
{"ssid_name": "ssid_wpa2_2g_br", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g_br", "appliedRadios": ["5G"],
"security_key": "something"}]},
"rf": {},
"radius": False
}
@pytest.mark.uc_sanity
@pytest.mark.suiteA
@allure.feature("bridge MODE CLIENT CONNECTIVITY")
@pytest.mark.sudo
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general],
@@ -39,7 +40,7 @@ setup_params_general = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestbridgeModeConnectivitySuiteA(object):
class TestBridgeModeConnectivitySuiteA(object):
""" Client Connectivity SuiteA
pytest -m "client_connectivity and bridge and general and suiteA"
"""
@@ -47,8 +48,8 @@ class TestbridgeModeConnectivitySuiteA(object):
@pytest.mark.open
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report,
station_names_twog,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and open and twog"
@@ -57,8 +58,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -66,23 +69,13 @@ class TestbridgeModeConnectivitySuiteA(object):
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_open_bridge"],
status_id=1,
msg='2G Open Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_open_bridge"],
status_id=5,
msg='2G Open Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.open
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
def test_open_ssid_5g(self, get_vif_state, get_lanforge_data, lf_test, test_cases, station_names_fiveg,
update_report):
"""Client Connectivity open ssid 5G
pytest -m "client_connectivity and bridge and general and open and fiveg"
"""
@@ -90,9 +83,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -100,24 +94,13 @@ class TestbridgeModeConnectivitySuiteA(object):
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_open_bridge"],
status_id=1,
msg='5G Open Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_open_bridge"],
status_id=5,
msg='5G Open Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.twog
@allure.story('wpa 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
def test_wpa_ssid_2g(self, get_vif_state, get_lanforge_data, update_report,
lf_test, test_cases, station_names_twog):
"""Client Connectivity wpa ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa and twog"
@@ -126,9 +109,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -136,24 +120,14 @@ class TestbridgeModeConnectivitySuiteA(object):
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_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 result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.fiveg
@allure.story('wpa 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
def test_wpa_ssid_5g(self, get_vif_state, lf_test, update_report, test_cases, station_names_fiveg,
get_lanforge_data):
"""Client Connectivity wpa ssid 5G
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
"""
@@ -161,9 +135,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -171,24 +146,13 @@ class TestbridgeModeConnectivitySuiteA(object):
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_bridge"],
status_id=1,
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa_bridge"],
status_id=5,
msg='5G WPA Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.twog
@allure.story('wpa2_personal 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_lanforge_data, lf_test, update_report, test_cases,
station_names_twog):
"""Client Connectivity wpa2_personal ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa2_personal and twog"
@@ -197,9 +161,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -207,24 +172,14 @@ class TestbridgeModeConnectivitySuiteA(object):
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_bridge"],
status_id=1,
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_bridge"],
status_id=5,
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@allure.story('wpa2_personal 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_lanforge_data, update_report, test_cases,
station_names_fiveg,
lf_test):
"""Client Connectivity wpa2_personal ssid 5G
pytest -m "client_connectivity and bridge and general and wpa2_personal and fiveg"
@@ -233,9 +188,10 @@ class TestbridgeModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -243,21 +199,11 @@ class TestbridgeModeConnectivitySuiteA(object):
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_bridge"],
status_id=1,
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_bridge"],
status_id=5,
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
setup_params_general_two = {
"mode": mode,
"mode": "BRIDGE",
"ssid_modes": {
"wpa3_personal": [
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"},
@@ -286,7 +232,7 @@ setup_params_general_two = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestbridgeModeConnectivitySuiteB(object):
class TestBridgeModeConnectivitySuiteTwo(object):
""" Client Connectivity SuiteA
pytest -m "client_connectivity and bridge and suiteB"
"""
@@ -294,8 +240,8 @@ class TestbridgeModeConnectivitySuiteB(object):
@pytest.mark.wpa3_personal
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa3_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal and twog"
@@ -304,9 +250,10 @@ class TestbridgeModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -314,23 +261,15 @@ class TestbridgeModeConnectivitySuiteB(object):
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_wpa3_bridge"],
status_id=1,
msg='2G WPA3 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_bridge"],
status_id=5,
msg='2G WPA3 Client Connectivity Failed - bridge mode' + str(
passes))
if not result:
pytest.xfail("")
assert result
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
def test_wpa3_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
"""
@@ -338,9 +277,10 @@ class TestbridgeModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -348,23 +288,13 @@ class TestbridgeModeConnectivitySuiteB(object):
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_wpa3_bridge"],
status_id=1,
msg='5G WPA3 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_bridge"],
status_id=5,
msg='5G WPA3 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
@@ -374,9 +304,10 @@ class TestbridgeModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -384,23 +315,13 @@ class TestbridgeModeConnectivitySuiteB(object):
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_wpa3_mixed_wpa3_bridge"],
status_id=1,
msg='2G WPA3-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_wpa3_bridge"],
status_id=5,
msg='2G WPA3-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test,
test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and fiveg"
@@ -409,9 +330,10 @@ class TestbridgeModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -419,23 +341,13 @@ class TestbridgeModeConnectivitySuiteB(object):
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_wpa3_mixed_wpa3_bridge"],
status_id=1,
msg='5G WPA3-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_wpa3_bridge"],
status_id=5,
msg='5G WPA3-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
@@ -446,9 +358,10 @@ class TestbridgeModeConnectivitySuiteB(object):
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "BRIDGE"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -456,23 +369,12 @@ class TestbridgeModeConnectivitySuiteB(object):
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_mixed_wpa2_bridge"],
status_id=1,
msg='2G WPA2-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_wpa2_bridge"],
status_id=5,
msg='2G WPA2-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and fiveg"
@@ -482,29 +384,18 @@ class TestbridgeModeConnectivitySuiteB(object):
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "BRIDGE"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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["5g_wpa2_mixed_wpa2_bridge"],
status_id=1,
msg='5G WPA2-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_wpa2_bridge"],
status_id=5,
msg='5G WPA2-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
# WEP Security Feature not available
# setup_params_wep = {
# "mode": "BRIDGE",
@@ -538,7 +429,7 @@ class TestbridgeModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "BRIDGE"
# band = "twog"
# vlan = 1
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
@@ -566,7 +457,7 @@ class TestbridgeModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "BRIDGE"
# band = "twog"
# vlan = 1
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,

View File

@@ -1,14 +1,11 @@
import allure
import pytest
mode = "NAT"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.nat,
pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.sanity]
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.ucentral, pytest.mark.sanity] #pytest.mark.usefixtures("setup_test_run"),
setup_params_enterprise = {
"mode": mode,
"mode": "NAT",
"ssid_modes": {
"wpa_enterprise": [
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
@@ -36,97 +33,68 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
@pytest.mark.wpa_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_2g(self, get_vif_state,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']
ieee80211w = 1
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, ieee80211w=ieee80211w,
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_eap_ttls_nat"],
status_id=1,
msg='2G WPA Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa_eap_ttls_nat"],
status_id=5,
msg='2G WPA Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_5g(self, get_vif_state,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"]
band = "fiveg"
mode = "NAT"
band = "twog"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
pairwise = "CCMP"
group = "CCMP"
ieee80211w =1
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
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["5g_wpa_eap_ttls_nat"],
status_id=1,
msg='5G WPA Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_nat"],
status_id=5,
msg='5G WPA Enterprise Client Connectivity Failed - NAT mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_2g(self, get_vif_state,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']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -135,30 +103,65 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
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_eap_ttls_nat"],
status_id=1,
msg='2G WPA2 Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_eap_ttls_nat"],
status_id=5,
msg='2G WPA2 Enterprise Client Connectivity Failed - NAT mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_5g(self, get_vif_state, 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']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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)
assert passes
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
def test_wpa3_enterprise_2g(self, get_vif_state,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']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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)
assert passes
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_wpa3_enterprise_5g(self, get_vif_state,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"]
@@ -172,97 +175,11 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
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["5g_wpa2_eap_ttls_nat"],
status_id=1,
msg='5G WPA2 Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_eap_ttls_nat"],
status_id=5,
msg='5G WPA2 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_2g(self, get_vif_state,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"
band = "twog"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt=key_mgmt,
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_wpa3_eap_ttls_nat"],
status_id=1,
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_nat"],
status_id=5,
msg='2G WPA3 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_5g(self, get_vif_state,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"
band = "fiveg"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
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["5g_wpa3_eap_ttls_nat"],
status_id=1,
msg='5G WPA3 Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_nat"],
status_id=5,
msg='5G WPA3 Enterprise Client Connectivity Failed - NAT mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
setup_params_enterprise_two = {
"mode": mode,
"mode": "NAT",
"ssid_modes": {
"wpa_wpa2_enterprise_mixed": [
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["2G"]},
@@ -288,14 +205,13 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_wpa2_enterprise_2g(self, get_vif_state,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"]
@@ -309,31 +225,18 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
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_mixed_eap_ttls_wpa2_nat"],
status_id=1,
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_nat"],
status_id=5,
msg='2G WPA2 Mixed Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_enterprise_5g(self, get_vif_state,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"]
band = "fievg"
mode = "NAT"
band = "twog"
vlan = 1
ttls_passwd = radius_info["password"]
eap = "TTLS"
@@ -346,29 +249,16 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa2_mixed_eap_ttls_wpa2_nat"],
status_id=1,
msg='5G WPA2 Mixed Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_nat"],
status_id=5,
msg='5G WPA2 Mixed 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,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"]
@@ -382,28 +272,17 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
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_wpa3_mixed_eap_ttls_wpa3_nat"],
status_id=1,
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_nat"],
status_id=5,
msg='2G WPA3 Mixed Enterprise 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, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
update_report, exit_on_fail, test_cases, radius_info):
def test_wpa3_enterprise_mixed_5g(self, get_vif_state,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"]
@@ -417,16 +296,4 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa3_mixed_eap_ttls_wpa3_nat"],
status_id=1,
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_nat"],
status_id=5,
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - NAT mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes

View File

@@ -8,29 +8,30 @@
import allure
import pytest
mode = "NAT"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.nat, pytest.mark.general, pytest.mark.sanity,
pytest.mark.usefixtures("setup_test_run")]
pytest.mark.ucentral]
setup_params_general = {
"mode": mode,
"mode": "NAT",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"]}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
"open": [{"ssid_name": "ssid_open_2g_nat", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_open_5g_nat", "appliedRadios": ["5G"],
"security_key": "something"}],
"wpa": [{"ssid_name": "ssid_wpa_2g_nat", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g_nat", "appliedRadios": ["5G"],
"security_key": "something"}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
{"ssid_name": "ssid_wpa2_2g_nat", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g_nat", "appliedRadios": ["5G"],
"security_key": "something"}]},
"rf": {},
"radius": False
}
@pytest.mark.uc_sanity
@pytest.mark.suiteA
@pytest.mark.sanity_ucentral
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
@@ -47,18 +48,22 @@ class TestNATModeConnectivitySuiteA(object):
@pytest.mark.open
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report,
station_names_twog,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and nat and general and open and twog"
"""
global setup_params_general
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssid_name = profile_data["ssid_name"]
print(ssid_name)
security_key = "[BLANK]"
security = "open"
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -66,33 +71,24 @@ class TestNATModeConnectivitySuiteA(object):
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_open_nat"],
status_id=1,
msg='2G Open Client Connectivity Passed successfully - NAT mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_open_nat"],
status_id=5,
msg='2G Open Client Connectivity Failed - NAT mode' + str(
passes))
assert result
@pytest.mark.open
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
def test_open_ssid_5g(self, get_vif_state, get_lanforge_data, lf_test, test_cases, station_names_fiveg,
update_report):
"""Client Connectivity open ssid 5G
pytest -m "client_connectivity and bridge and general and open and fiveg"
pytest -m "client_connectivity and NAT and general and open and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -100,106 +96,79 @@ class TestNATModeConnectivitySuiteA(object):
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_open_nat"],
status_id=1,
msg='5G Open Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_open_nat"],
status_id=5,
msg='5G Open Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.twog
@allure.story('wpa 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
def test_wpa_ssid_2g(self, get_vif_state, get_lanforge_data, update_report,
lf_test, test_cases, station_names_twog):
"""Client Connectivity wpa ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa and twog"
pytest -m "client_connectivity and NAT and general and wpa and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_nat"],
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_nat"],
status_id=5,
msg='2G WPA Client Connectivity Failed - bridge mode' + str(
passes))
if not result:
pytest.xfail("ssid issue")
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.fiveg
@allure.story('wpa 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
def test_wpa_ssid_5g(self, get_vif_state, lf_test, update_report, test_cases, station_names_fiveg,
get_lanforge_data):
"""Client Connectivity wpa ssid 5G
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
pytest -m "client_connectivity and NAT and general and wpa and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_nat"],
status_id=1,
msg='5G WPA Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa_nat"],
status_id=5,
msg='5G WPA Client Connectivity Failed - bridge mode' + str(
passes))
if not result:
pytest.xfail("ssid issue")
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.twog
@allure.story('wpa2_personal 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_lanforge_data, lf_test, update_report, test_cases,
station_names_twog):
"""Client Connectivity wpa2_personal ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa2_personal and twog"
pytest -m "client_connectivity and NAT and general and wpa2_personal and twog"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -207,35 +176,26 @@ class TestNATModeConnectivitySuiteA(object):
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_nat"],
status_id=1,
msg='2G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_nat"],
status_id=5,
msg='2G WPA2 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@allure.story('wpa2_personal 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_lanforge_data, update_report, test_cases,
station_names_fiveg,
lf_test):
"""Client Connectivity wpa2_personal ssid 5G
pytest -m "client_connectivity and bridge and general and wpa2_personal and fiveg"
pytest -m "client_connectivity and NAT and general and wpa2_personal and fiveg"
"""
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -243,21 +203,11 @@ class TestNATModeConnectivitySuiteA(object):
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_nat"],
status_id=1,
msg='5G WPA2 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_nat"],
status_id=5,
msg='5G WPA2 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
setup_params_general_two = {
"mode": mode,
"mode": "NAT",
"ssid_modes": {
"wpa3_personal": [
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"},
@@ -278,7 +228,7 @@ setup_params_general_two = {
@pytest.mark.suiteB
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
'setup_profiles',
[setup_params_general_two],
@@ -288,25 +238,26 @@ setup_params_general_two = {
@pytest.mark.usefixtures("setup_profiles")
class TestNATModeConnectivitySuiteB(object):
""" Client Connectivity SuiteA
pytest -m "client_connectivity and bridge and suiteB"
pytest -m "client_connectivity and NAT and suiteB"
"""
@pytest.mark.wpa3_personal
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa3_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal and twog"
pytest -m "client_connectivity and NAT and general and wpa3_personal and twog"
"""
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -314,33 +265,24 @@ class TestNATModeConnectivitySuiteB(object):
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_wpa3_nat"],
status_id=1,
msg='2G WPA3 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_nat"],
status_id=5,
msg='2G WPA3 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
def test_wpa3_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
pytest -m "client_connectivity and NAT and general and wpa3_personal and fiveg"
"""
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -348,35 +290,26 @@ class TestNATModeConnectivitySuiteB(object):
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_wpa3_nat"],
status_id=1,
msg='5G WPA3 Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_nat"],
status_id=5,
msg='5G WPA3 Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and twog"
pytest -m "client_connectivity and NAT and general and wpa3_personal_mixed and twog"
"""
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -384,34 +317,25 @@ class TestNATModeConnectivitySuiteB(object):
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_wpa3_mixed_wpa3_nat"],
status_id=1,
msg='2G WPA3-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_wpa3_nat"],
status_id=5,
msg='2G WPA3-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test,
test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and fiveg"
pytest -m "client_connectivity and NAT and general and wpa3_personal_mixed and fiveg"
"""
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -419,36 +343,27 @@ class TestNATModeConnectivitySuiteB(object):
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_wpa3_mixed_wpa3_nat"],
status_id=1,
msg='5G WPA3-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_wpa3_nat"],
status_id=5,
msg='5G WPA3-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and twog"
pytest -m "client_connectivity and NAT and general and wpa_wpa2_personal_mixed and twog"
"""
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 = "wpa"
extra_secu = ["wpa2"]
mode = "NAT"
band = "twog"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -456,58 +371,37 @@ class TestNATModeConnectivitySuiteB(object):
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_mixed_wpa2_nat"],
status_id=1,
msg='2G WPA2-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_wpa2_nat"],
status_id=5,
msg='2G WPA2-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and bridge and general and wpa_wpa2_personal_mixed and fiveg"
pytest -m "client_connectivity and NAT and general and wpa_wpa2_personal_mixed and fiveg"
"""
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 = "wpa"
extra_secu = ["wpa2"]
mode = "NAT"
band = "fiveg"
vlan = 1
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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["5g_wpa2_mixed_wpa2_nat"],
status_id=1,
msg='5G WPA2-Mixed Client Connectivity Passed successfully - bridge mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_wpa2_nat"],
status_id=5,
msg='5G WPA2-Mixed Client Connectivity Failed - bridge mode' + str(
passes))
assert result
# WEP Security Feature not available
# setup_params_wep = {
# "mode": "BRIDGE",
# "mode": "NAT",
# "ssid_modes": {
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["2G"], "default_key_id": 1,
# "wep_key": 1234567890},
@@ -527,7 +421,7 @@ class TestNATModeConnectivitySuiteB(object):
# scope="class"
# )
# @pytest.mark.usefixtures("setup_profiles")
# class TestBridgeModeWEP(object):
# class TestNATModeWEP(object):
#
# @pytest.mark.wep
# @pytest.mark.twog
@@ -538,7 +432,7 @@ class TestNATModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "NAT"
# band = "twog"
# vlan = 1
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
@@ -548,12 +442,12 @@ class TestNATModeConnectivitySuiteB(object):
# if passes:
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
# status_id=1,
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
# 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 - bridge mode' + str(
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
# passes))
# assert passes
#
@@ -566,7 +460,7 @@ class TestNATModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "NAT"
# band = "twog"
# vlan = 1
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
@@ -576,11 +470,11 @@ class TestNATModeConnectivitySuiteB(object):
# if passes:
# update_report.update_testrail(case_id=test_cases["2g_wpa_nat"],
# status_id=1,
# msg='2G WPA Client Connectivity Passed successfully - bridge mode' + str(
# 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 - bridge mode' + str(
# msg='2G WPA Client Connectivity Failed - NAT mode' + str(
# passes))
# assert passes

View File

@@ -1,14 +1,11 @@
import allure
import pytest
mode = "VLAN"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.usefixtures("setup_test_run"), pytest.mark.vlan,
pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.sanity]
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.enterprise, pytest.mark.ttls,
pytest.mark.ucentral, pytest.mark.sanity] # pytest.mark.usefixtures("setup_test_run")
setup_params_enterprise = {
"mode": mode,
"mode": "VLAN",
"ssid_modes": {
"wpa_enterprise": [
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
@@ -32,108 +29,75 @@ setup_params_enterprise = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.parametrize(
'create_vlan',
[setup_params_enterprise],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("create_vlan")
class TestvlanModeEnterpriseTTLSSuiteOne(object):
class TestVLANModeEnterpriseTTLSSuiteOne(object):
@pytest.mark.wpa_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_enterprise_2g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
identity = radius_info['user']
ieee80211w = 1
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, ieee80211w=ieee80211w,
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_eap_ttls_vlan"],
status_id=1,
msg='2G WPA Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa_eap_ttls_vlan"],
status_id=5,
msg='2G WPA Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_enterprise_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_enterprise_5g(self, get_vif_state, 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"]
band = "fiveg"
mode = "VLAN"
band = "twog"
vlan = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
pairwise = "CCMP"
group = "CCMP"
ieee80211w =1
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security, extra_securities=extra_secu,
mode=mode, band=band, group=group, pairwise=pairwise, ieee80211w=ieee80211w,
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["5g_wpa_eap_ttls_vlan"],
status_id=1,
msg='5G WPA Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa_eap_ttls_vlan"],
status_id=5,
msg='5G WPA Enterprise Client Connectivity Failed - vlan mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa2_enterprise_2g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
identity = radius_info['user']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -142,30 +106,68 @@ class TestvlanModeEnterpriseTTLSSuiteOne(object):
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_eap_ttls_vlan"],
status_id=1,
msg='2G WPA2 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_eap_ttls_vlan"],
status_id=5,
msg='2G WPA2 Enterprise Client Connectivity Failed - vlan mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
@pytest.mark.uc_sanity
@pytest.mark.sanity_light
@pytest.mark.wpa2_enterprise
@pytest.mark.fiveg
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_enterprise_5g(self, get_vif_state, station_names_fiveg, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa2_enterprise_5g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
identity = radius_info['user']
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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)
assert passes
@pytest.mark.wpa3_enterprise
@pytest.mark.twog
def test_wpa3_enterprise_2g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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)
assert passes
@pytest.mark.wpa3_enterprise
@pytest.mark.fiveg
def test_wpa3_enterprise_5g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
@@ -179,104 +181,18 @@ class TestvlanModeEnterpriseTTLSSuiteOne(object):
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["5g_wpa2_eap_ttls_vlan"],
status_id=1,
msg='5G WPA2 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_eap_ttls_vlan"],
status_id=5,
msg='5G WPA2 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_2g(self, get_vif_state,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"
band = "twog"
vlan = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt=key_mgmt,
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_wpa3_eap_ttls_vlan"],
status_id=1,
msg='2G WPA3 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_eap_ttls_vlan"],
status_id=5,
msg='2G WPA3 Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_5g(self, get_vif_state,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"
band = "fiveg"
vlan = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
key_mgmt = "WPA-EAP-SHA256"
identity = radius_info['user']
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
passes = lf_test.EAP_Connect(ssid=ssid_name, security=security,
mode=mode, band=band, key_mgmt = "WPA-EAP-SHA256",
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["5g_wpa3_eap_ttls_vlan"],
status_id=1,
msg='5G WPA3 Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_eap_ttls_vlan"],
status_id=5,
msg='5G WPA3 Enterprise Client Connectivity Failed - vlan mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes
setup_params_enterprise_two = {
"mode": mode,
"mode": "VLAN",
"ssid_modes": {
"wpa_wpa2_enterprise_mixed": [
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_wpa_wpa2_eap_5g", "appliedRadios": ["5G"], "vlan": 100}],
{"ssid_name": "ssid_wpa_wpa2_eap_2g", "appliedRadios": ["2G"]},
{"ssid_name": "ssid_wpa_wpa2_eap_5g", "appliedRadios": ["5G"]}],
"wpa3_enterprise_mixed": [
{"ssid_name": "ssid_wpa3_mixed_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_wpa3_mixed_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]
{"ssid_name": "ssid_wpa3_mixed_eap_2g", "appliedRadios": ["2G"]},
{"ssid_name": "ssid_wpa3_mixed_eap_5g", "appliedRadios": ["5G"]}]
},
"rf": {},
"radius": True
@@ -291,25 +207,18 @@ setup_params_enterprise_two = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
@pytest.mark.parametrize(
'create_vlan',
[setup_params_enterprise],
indirect=True,
scope="class"
)
@pytest.mark.usefixtures("create_vlan")
class TestvlanModeEnterpriseTTLSSuiteTwo(object):
class TestVLANModeEnterpriseTTLSSuiteTwo(object):
@pytest.mark.wpa_wpa2_enterprise_mixed
@pytest.mark.twog
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
@@ -323,31 +232,19 @@ class TestvlanModeEnterpriseTTLSSuiteTwo(object):
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_mixed_eap_ttls_wpa2_vlan"],
status_id=1,
msg='2G WPA2 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_eap_ttls_wpa2_vlan"],
status_id=5,
msg='2G WPA2 Mixed Enterprise 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_enterprise_mixed_5g(self, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, 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"]
band = "fievg"
mode = "VLAN"
band = "twog"
vlan = 100
ttls_passwd = radius_info["password"]
eap = "TTLS"
@@ -360,29 +257,17 @@ class TestvlanModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa2_mixed_eap_ttls_wpa2_vlan"],
status_id=1,
msg='5G WPA2 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_eap_ttls_wpa2_vlan"],
status_id=5,
msg='5G WPA2 Mixed 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
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_enterprise_mixed_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
@@ -396,29 +281,18 @@ class TestvlanModeEnterpriseTTLSSuiteTwo(object):
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_wpa3_mixed_eap_ttls_wpa3_vlan"],
status_id=1,
msg='2G WPA3 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_eap_ttls_wpa3_vlan"],
status_id=5,
msg='2G WPA3 Mixed Enterprise 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, get_vif_state,station_names_fiveg, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, 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 = 100
ttls_passwd = radius_info["password"]
@@ -432,16 +306,4 @@ class TestvlanModeEnterpriseTTLSSuiteTwo(object):
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["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
status_id=1,
msg='5G WPA3 Mixed Enterprise Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_eap_ttls_wpa3_vlan"],
status_id=5,
msg='5G WPA3 Mixed Enterprise Client Connectivity Failed - vlan mode' + str(
passes))
if exit_on_fail:
pytest.exit("Test Case Failed")
assert passes

View File

@@ -1,35 +1,34 @@
"""
Client Connectivity and tcp-udp Traffic Test: bridge Mode
pytest -m "client_connectivity and bridge and general"
Client Connectivity and tcp-udp Traffic Test: vlan Mode
pytest -m "client_connectivity and vlan and general"
"""
import allure
import pytest
mode = "VLAN"
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.general, pytest.mark.sanity,
pytest.mark.usefixtures("setup_test_run")]
pytestmark = [pytest.mark.client_connectivity, pytest.mark.vlan, pytest.mark.general, pytest.mark.ucentral,
pytest.mark.sanity] # pytest.mark.usefixtures("setup_test_run")]
setup_params_general = {
"mode": mode,
"mode": "VLAN",
"ssid_modes": {
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"], "vlan": 100},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"], "vlan": 100}],
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
"security_key": "something"}],
"open": [{"ssid_name": "ssid_open_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_open_5g_vlan", "appliedRadios": ["5G"], "security_key": "something", "vlan": 100}],
"wpa": [{"ssid_name": "ssid_wpa_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
"security_key": "something"}]},
{"ssid_name": "ssid_wpa2_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa2_5g_vlan", "appliedRadios": ["5G"],
"security_key": "something", "vlan": 100}]},
"rf": {},
"radius": False
}
@pytest.mark.uc_sanity
@pytest.mark.suiteA
@allure.feature("vlan MODE CLIENT CONNECTIVITY")
@pytest.mark.parametrize(
@@ -47,8 +46,8 @@ class TestvlanModeConnectivitySuiteA(object):
@pytest.mark.open
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report, station_names_twog,
def test_open_ssid_2g(self, get_vif_state, setup_profiles, get_lanforge_data, lf_test, update_report,
station_names_twog,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and vlan and general and open and twog"
@@ -57,32 +56,23 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_open_vlan"],
status_id=1,
msg='2G Open Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_open_vlan"],
status_id=5,
msg='2G Open Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.open
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_open_ssid_5g(self, get_vif_state,get_lanforge_data, lf_test, test_cases, station_names_fiveg, update_report):
def test_open_ssid_5g(self, get_vif_state, get_lanforge_data, lf_test, test_cases, station_names_fiveg,
update_report):
"""Client Connectivity open ssid 5G
pytest -m "client_connectivity and vlan and general and open and fiveg"
"""
@@ -90,9 +80,10 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = "[BLANK]"
security = "open"
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -100,24 +91,13 @@ class TestvlanModeConnectivitySuiteA(object):
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_open_vlan"],
status_id=1,
msg='5G Open Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_open_vlan"],
status_id=5,
msg='5G Open Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.twog
@allure.story('wpa 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_2g(self, get_vif_state,get_lanforge_data, update_report,
def test_wpa_ssid_2g(self, get_vif_state, get_lanforge_data, update_report,
lf_test, test_cases, station_names_twog):
"""Client Connectivity wpa ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa and twog"
@@ -126,9 +106,10 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -136,24 +117,14 @@ class TestvlanModeConnectivitySuiteA(object):
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"],
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 result
@pytest.mark.sanity_light
@pytest.mark.wpa
@pytest.mark.fiveg
@allure.story('wpa 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_ssid_5g(self, get_vif_state,lf_test, update_report, test_cases, station_names_fiveg, get_lanforge_data):
def test_wpa_ssid_5g(self, get_vif_state, lf_test, update_report, test_cases, station_names_fiveg,
get_lanforge_data):
"""Client Connectivity wpa ssid 5G
pytest -m "client_connectivity and vlan and general and wpa and fiveg"
"""
@@ -161,9 +132,10 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa"
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -171,24 +143,13 @@ class TestvlanModeConnectivitySuiteA(object):
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"],
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"],
status_id=5,
msg='5G WPA Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.twog
@allure.story('wpa2_personal 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_2g(self, get_vif_state,get_lanforge_data, lf_test, update_report, test_cases,
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_lanforge_data, lf_test, update_report, test_cases,
station_names_twog):
"""Client Connectivity wpa2_personal ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa2_personal and twog"
@@ -197,9 +158,10 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -207,24 +169,14 @@ class TestvlanModeConnectivitySuiteA(object):
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"],
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"],
status_id=5,
msg='2G WPA2 Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.sanity_light
@pytest.mark.wpa2_personal
@pytest.mark.fiveg
@allure.story('wpa2_personal 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa2_personal_ssid_5g(self, get_vif_state,get_lanforge_data, update_report, test_cases, station_names_fiveg,
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_lanforge_data, update_report, test_cases,
station_names_fiveg,
lf_test):
"""Client Connectivity wpa2_personal ssid 5G
pytest -m "client_connectivity and vlan and general and wpa2_personal and fiveg"
@@ -233,9 +185,10 @@ class TestvlanModeConnectivitySuiteA(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa2"
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -243,34 +196,24 @@ class TestvlanModeConnectivitySuiteA(object):
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"],
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"],
status_id=5,
msg='5G WPA2 Client Connectivity Failed - vlan mode' + str(
passes))
assert result
setup_params_general_two = {
"mode": mode,
"mode": "VLAN",
"ssid_modes": {
"wpa3_personal": [
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"],
"security_key": "something"}],
"security_key": "something", "vlan": 100}],
"wpa3_personal_mixed": [
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"],
"security_key": "something"}],
"security_key": "something", "vlan": 100}],
"wpa_wpa2_personal_mixed": [
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"},
{"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
{"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"],
"security_key": "something"}]
"security_key": "something", "vlan": 100}]
},
"rf": {},
"radius": False
@@ -286,16 +229,17 @@ setup_params_general_two = {
scope="class"
)
@pytest.mark.usefixtures("setup_profiles")
class TestvlanModeConnectivitySuiteB(object):
class TestvlanModeConnectivitySuiteTwo(object):
""" Client Connectivity SuiteA
pytest -m "client_connectivity and vlan and suiteB"
"""
@pytest.mark.uc_sanity
@pytest.mark.wpa3_personal
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test, update_report,
def test_wpa3_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data, lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa3_personal and twog"
@@ -304,9 +248,10 @@ class TestvlanModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -314,23 +259,14 @@ class TestvlanModeConnectivitySuiteB(object):
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_wpa3_vlan"],
status_id=1,
msg='2G WPA3 Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_vlan"],
status_id=5,
msg='2G WPA3 Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.uc_sanity
@pytest.mark.wpa3_personal
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases, update_report):
def test_wpa3_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa3_personal and fiveg"
"""
@@ -338,33 +274,24 @@ class TestvlanModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_wpa3_vlan"],
status_id=1,
msg='5G WPA3 Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_vlan"],
status_id=5,
msg='5G WPA3 Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.uc_sanity
@pytest.mark.wpa3_personal_mixed
@pytest.mark.twog
@allure.story('open 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
@@ -374,33 +301,24 @@ class TestvlanModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_wpa3_mixed_wpa3_vlan"],
status_id=1,
msg='2G WPA3-Mixed Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa3_mixed_wpa3_vlan"],
status_id=5,
msg='2G WPA3-Mixed Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.uc_sanity
@pytest.mark.wpa3_personal_mixed
@pytest.mark.fiveg
@allure.story('open 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test,
test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa3_personal_mixed and fiveg"
@@ -409,33 +327,24 @@ class TestvlanModeConnectivitySuiteB(object):
ssid_name = profile_data["ssid_name"]
security_key = profile_data["security_key"]
security = "wpa3"
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_wpa3_mixed_wpa3_vlan"],
status_id=1,
msg='5G WPA3-Mixed Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa3_mixed_wpa3_vlan"],
status_id=5,
msg='5G WPA3-Mixed Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.uc_sanity
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.twog
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state,station_names_twog, setup_profiles, get_lanforge_data, lf_test,
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, station_names_twog, setup_profiles, get_lanforge_data,
lf_test,
update_report,
test_cases):
"""Client Connectivity open ssid 2.4G
@@ -446,33 +355,23 @@ class TestvlanModeConnectivitySuiteB(object):
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "VLAN"
band = "twog"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
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_wpa2_mixed_wpa2_vlan"],
status_id=1,
msg='2G WPA2-Mixed Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["2g_wpa2_mixed_wpa2_vlan"],
status_id=5,
msg='2G WPA2-Mixed Client Connectivity Failed - vlan mode' + str(
passes))
assert result
@pytest.mark.uc_sanity
@pytest.mark.wpa_wpa2_personal_mixed
@pytest.mark.fiveg
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
@allure.severity(allure.severity_level.CRITICAL)
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state,station_names_fiveg, get_lanforge_data, lf_test, test_cases,
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, station_names_fiveg, get_lanforge_data, lf_test, test_cases,
update_report):
"""Client Connectivity open ssid 2.4G
pytest -m "client_connectivity and vlan and general and wpa_wpa2_personal_mixed and fiveg"
@@ -482,9 +381,10 @@ class TestvlanModeConnectivitySuiteB(object):
security_key = profile_data["security_key"]
security = "wpa"
extra_secu = ["wpa2"]
mode = "VLAN"
band = "fiveg"
vlan = 100
get_vif_state.append(ssid_name)
if ssid_name not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
@@ -492,22 +392,11 @@ class TestvlanModeConnectivitySuiteB(object):
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_mixed_wpa2_vlan"],
status_id=1,
msg='5G WPA2-Mixed Client Connectivity Passed successfully - vlan mode' + str(
passes))
else:
update_report.update_testrail(case_id=test_cases["5g_wpa2_mixed_wpa2_vlan"],
status_id=5,
msg='5G WPA2-Mixed Client Connectivity Failed - vlan mode' + str(
passes))
assert result
# WEP Security Feature not available
# setup_params_wep = {
# "mode": "vlan",
# "mode": "VLAN",
# "ssid_modes": {
# "wep": [ {"ssid_name": "ssid_wep_2g", "appliedRadios": ["2G"], "default_key_id": 1,
# "wep_key": 1234567890},
@@ -538,7 +427,7 @@ class TestvlanModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "VLAN"
# band = "twog"
# vlan = 100
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,
@@ -566,7 +455,7 @@ class TestvlanModeConnectivitySuiteB(object):
# wep_key = "[BLANK]"
# security = "open"
# extra_secu = []
#
# mode = "VLAN"
# band = "twog"
# vlan = 100
# passes, result = lf_test.Client_Connectivity(ssid=ssid_name, security=security,

View File

@@ -25,6 +25,8 @@ setup_params_general = {
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
@@ -54,7 +56,6 @@ class TestAcessPointConnection(object):
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
@@ -158,4 +159,57 @@ class TestAcessPointConnection(object):
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.open
def test_AccessPointConnection_2g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.open
def test_AccessPointConnection_5g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)

View File

@@ -13,16 +13,20 @@ from selenium.common.exceptions import NoSuchElementException
import sys
import allure
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ToggleAirplaneMode]
if 'perfecto_libs' not in sys.path:
sys.path.append(f'../libs/perfecto_libs')
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ToggleAirplaneMode]
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp
setup_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": [
@@ -43,14 +47,69 @@ setup_params_general = {
@pytest.mark.usefixtures("setup_profiles")
class TestToggleAirplaneModeAndroid(object):
@pytest.mark.open
@pytest.mark.fiveg
def test_ToogleAirplaneMode_5g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.open
@pytest.mark.twog
def test_ToogleAirplaneMode_2g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
#Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ToogleAirplaneMode_5g_WPA2_Personal(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -71,12 +130,13 @@ class TestToggleAirplaneModeAndroid(object):
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ToogleAirplaneMode_2g_WPA2_Personal(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
def test_ToogleAirplaneMode_2g_WPA2_Personal(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -97,12 +157,13 @@ class TestToggleAirplaneModeAndroid(object):
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ToogleAirplaneMode_5g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
def test_ToogleAirplaneMode_5g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -123,12 +184,13 @@ class TestToggleAirplaneModeAndroid(object):
@pytest.mark.twog
@pytest.mark.wpa
def test_ToogleAirplaneMode_2g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
def test_ToogleAirplaneMode_2g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))

View File

@@ -23,6 +23,8 @@ from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDo
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": [
@@ -42,15 +44,16 @@ setup_params_general = {
@pytest.mark.usefixtures("setup_profiles")
class TestPassPointConnection(object):
@pytest.mark.open
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_PassPointConnection_5g_WPA2_Personal(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
def test_ToogleAirplaneMode_5g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -58,7 +61,63 @@ class TestPassPointConnection(object):
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.open
@pytest.mark.twog
def test_ToogleAirplaneMode_2g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_PassPointConnection_5g_WPA2_Personal(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
#Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
@@ -75,11 +134,12 @@ class TestPassPointConnection(object):
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_PassPointConnection_2g_WPA2_Personal(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -104,11 +164,12 @@ class TestPassPointConnection(object):
@pytest.mark.fiveg
@pytest.mark.wpa
def test_PassPointConnection_5g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -133,11 +194,12 @@ class TestPassPointConnection(object):
@pytest.mark.twog
@pytest.mark.wpa
def test_PassPointConnection_2g_WPA(self, request, get_vif_state, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))

View File

@@ -23,6 +23,8 @@ from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_WifiMod
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": [
@@ -43,14 +45,72 @@ setup_params_general = {
@pytest.mark.usefixtures("setup_profiles")
class TestToggleWifiMode(object):
@pytest.mark.open
@pytest.mark.fiveg
def test_ToogleAirplaneMode_5g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.open
@pytest.mark.twog
def test_ToogleAirplaneMode_2g_OPEN(self, request, get_vif_state, get_ToggleAirplaneMode_data,
setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_ToggleAirplaneMode_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa2_personal
def test_ToogleWifiMode_5g_WPA2_Personal(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
def test_ToogleWifiMode_5g_WPA2_Personal(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -65,18 +125,19 @@ class TestToggleWifiMode(object):
#Toggle Wifi Mode
Toggle_WifiMode_android(request, setup_perfectoMobile_android, ssidName, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa2_personal
def test_ToogleWifiMode_2g_WPA2_Personal(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -98,11 +159,12 @@ class TestToggleWifiMode(object):
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ToogleWifiMode_5g_WPA(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -123,12 +185,13 @@ class TestToggleWifiMode(object):
@pytest.mark.twog
@pytest.mark.wpa
def test_ToogleWifiMode_2g_WPA(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
def test_ToogleWifiMode_2g_WPA(self, request, get_vif_state, get_ToggleWifiMode_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))

View File

@@ -18,13 +18,16 @@ if 'perfecto_libs' not in sys.path:
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.ClientConnectivity]
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp
from android_lib import closeApp, set_APconnMobileDevice_android, verifyUploadDownloadSpeed_android,\
Toggle_AirplaneMode_android, ForgetWifiConnection, openApp
setup_params_general = {
"mode": "NAT",
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"wpa2_personal": [
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}]},
@@ -50,7 +53,7 @@ class TestNatMode(object):
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -68,7 +71,7 @@ class TestNatMode(object):
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa2_personal
@@ -77,7 +80,7 @@ class TestNatMode(object):
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -96,8 +99,6 @@ class TestNatMode(object):
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.wpa
def test_ClientConnectivity_2g_WPA(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
@@ -105,7 +106,7 @@ class TestNatMode(object):
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -123,7 +124,8 @@ class TestNatMode(object):
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.wpa
def test_ClientConnectivity_5g_WPA(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
@@ -131,7 +133,7 @@ class TestNatMode(object):
ssidName = profile_data["ssid_name"]
ssidPassword = profile_data["security_key"]
print ("SSID_NAME: " + ssidName)
#print ("SSID_PASS: " + ssidPassword)
print ("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
@@ -149,3 +151,57 @@ class TestNatMode(object):
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnectivity_2g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnectivity_5g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_android):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_android[1]
driver = setup_perfectoMobile_android[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_android(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
# Toggle AirplaneMode
assert Toggle_AirplaneMode_android(request, setup_perfectoMobile_android, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)

View File

@@ -703,18 +703,21 @@ def pytest_sessionfinish(session, exitstatus):
TotalExecutedCount = failed_amount + passed_amount + skipped_amount
print('\n------------------------------------')
print('Perfecto TestCase Execution Summary')
print('Interop Perfecto TestCase Execution Summary')
print('------------------------------------')
print('Total TestCase Executed: ' + str(TotalExecutedCount))
print('Total Passed: ' + str(passed_amount))
print('Total Failed: ' + str(failed_amount))
print('Total Skipped: ' + str(skipped_amount) + "\n")
for index in range(len(testCaseNameList)):
print(str(index+1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index]))
print(" ReportURL: " + str(testCaseReportURL[index]))
print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n")
try:
for index in range(len(testCaseNameList)):
print(str(index+1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index]))
print(" ReportURL: " + str(testCaseReportURL[index]))
print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n")
except Exception as e:
print('No Interop Test Cases Executed')
print('------------------------------------------------------------------\n\n\n\n')
@pytest.fixture(scope="function")

View File

@@ -98,7 +98,7 @@ class TestAccessPointConnectivety(object):
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
#Need An ip To ping
wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData)
wifi_ip = get_WifiIPAddress_iOS(request, setup_perfectoMobile_iOS, connData, ssidName)
#Open Ping Application
openApp(connData["bundleId-iOS-Ping"], setup_perfectoMobile_iOS)

View File

@@ -199,7 +199,7 @@ class TestOpenRoamingBridge(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_2g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
@@ -262,7 +262,7 @@ class TestOpenRoamingBridge(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_5g_BRIDGE(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:

View File

@@ -209,7 +209,7 @@ class TestOpenRoamingNAT(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_2g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and twog"
@@ -283,7 +283,7 @@ class TestOpenRoamingNAT(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_5g_NAT(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
"""
EAP Passpoint BRIDGE Mode
pytest -m "interop_iOS and eap_passpoint and bridge and wpa2_only_eap and fiveg"

View File

@@ -199,7 +199,7 @@ class TestOpenRoamingBridgeVLAN(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_2g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_2g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_2g']['vif_config']
if result:
@@ -262,7 +262,7 @@ class TestOpenRoamingBridgeVLAN(object):
scope="function"
)
@pytest.mark.usefixtures("push_ap_profile")
def test_wpa2_only_eap_5g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
def test_OpenRoaming_wpa2_only_eap_5g_VLAN(self, passpoint_profile_info, push_ap_profile, request, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
result = push_ap_profile['ssid_wpa2_only_eap_passpoint_5g']['vif_config']
if result:

View File

@@ -25,9 +25,12 @@ setup_params_general = {
"ssid_modes": {
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],"security_key": "something"}],
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
"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
}
@@ -148,4 +151,58 @@ class TestNatMode(object):
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
#ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.twog
@pytest.mark.open
def test_ClientConnectivity_2g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][0]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
# Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)
@pytest.mark.fiveg
@pytest.mark.open
def test_ClientConnectivity_5g_OPEN(self, request, get_vif_state, get_APToMobileDevice_data, setup_perfectoMobile_iOS):
profile_data = setup_params_general["ssid_modes"]["open"][1]
ssidName = profile_data["ssid_name"]
ssidPassword = "[BLANK]"
print("SSID_NAME: " + ssidName)
print("SSID_PASS: " + ssidPassword)
if ssidName not in get_vif_state:
allure.attach(name="retest,vif state ssid not available:", body=str(get_vif_state))
pytest.xfail("SSID NOT AVAILABLE IN VIF STATE")
report = setup_perfectoMobile_iOS[1]
driver = setup_perfectoMobile_iOS[0]
connData = get_APToMobileDevice_data
# Set Wifi/AP Mode
set_APconnMobileDevice_iOS(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
# Verify Upload download Speed from device Selection
verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
# ForgetWifi
ForgetWifiConnection(request, setup_perfectoMobile_iOS, ssidName, connData)

View File

@@ -5,7 +5,7 @@
import allure
import pytest
pytestmark = [pytest.mark.usefixtures("setup_test_run"), pytest.mark.test_resources, pytest.mark.sanity,
pytestmark = [pytest.mark.test_resources, pytest.mark.sanity,
pytest.mark.sanity_55]
@@ -63,3 +63,4 @@ class TestResources(object):
pytest.exit("LANforgeGUI-5.4.3 is not available")
assert traffic_generator_connectivity