mirror of
https://github.com/Telecominfraproject/wlan-testing.git
synced 2025-11-03 04:18:15 +00:00
Merge branch 'master' into WIFI-4951
This commit is contained in:
56
.github/actions/allure-report-to-s3/action.yml
vendored
Normal file
56
.github/actions/allure-report-to-s3/action.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
name: upload report to S3
|
||||
description: upload an Allure report to AWS S3 and update the latest reference
|
||||
|
||||
inputs:
|
||||
test_type:
|
||||
description: test type of the report
|
||||
required: true
|
||||
testbed:
|
||||
description: testbed the report is about
|
||||
required: true
|
||||
report_path:
|
||||
description: path to the Allure report folder
|
||||
required: true
|
||||
s3_access_key_id:
|
||||
description: AWS access key ID to access S3 bucket
|
||||
required: true
|
||||
s3_access_key_secret:
|
||||
description: AWS access key secret to access S3 bucket
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: install AWS cli
|
||||
uses: unfor19/install-aws-cli-action@v1
|
||||
|
||||
- name: upload report to AWS S3
|
||||
env:
|
||||
AWS_S3_BUCKET_NAME: openwifi-allure-reports
|
||||
AWS_ACCOUNT_ID: "289708231103"
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3_access_key_id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3_access_key_secret }}
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
shell: bash
|
||||
run: aws s3 cp --acl public-read --recursive ${{ inputs.report_path }} s3://${AWS_S3_BUCKET_NAME}/${{ inputs.test_type }}/${{ inputs.testbed }}/${{ github.run_number }}
|
||||
|
||||
- name: update reference to latest report
|
||||
env:
|
||||
AWS_S3_BUCKET_NAME: openwifi-allure-reports
|
||||
AWS_ACCOUNT_ID: "289708231103"
|
||||
AWS_ACCESS_KEY_ID: ${{ inputs.s3_access_key_id }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ inputs.s3_access_key_secret }}
|
||||
AWS_DEFAULT_REGION: us-east-1
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
shell: bash
|
||||
run: |
|
||||
cat <<EOF > index.html
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; url=../${{ github.run_number }}/" />
|
||||
</head>
|
||||
</html>
|
||||
EOF
|
||||
|
||||
aws s3 cp --acl public-read index.html s3://${AWS_S3_BUCKET_NAME}/${{ inputs.test_type }}/${{ inputs.testbed }}/latest/index.html
|
||||
45
.github/actions/build-and-push-docker/action.yml
vendored
Normal file
45
.github/actions/build-and-push-docker/action.yml
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
name: build and push Docker image
|
||||
description: build and push the wlan-testing Docker image
|
||||
|
||||
inputs:
|
||||
registry:
|
||||
description: the registry to push to
|
||||
required: true
|
||||
registry_user:
|
||||
description: the user to authenticate against the registry
|
||||
required: true
|
||||
registry_password:
|
||||
description: the password to authenticate against the registry
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Checkout Testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Checkout LANforge scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-lanforge-scripts
|
||||
repository: Telecominfraproject/wlan-lanforge-scripts
|
||||
|
||||
- name: import LANforge scripts
|
||||
shell: bash
|
||||
working-directory: wlan-testing
|
||||
run: ./sync_repos.bash
|
||||
|
||||
- name: docker login
|
||||
shell: bash
|
||||
run: docker login ${{ inputs.registry }} -u ${{ inputs.registry_user }} -p ${{ inputs.registry_password }}
|
||||
|
||||
- name: build docker image
|
||||
working-directory: wlan-testing
|
||||
shell: bash
|
||||
run: docker build -t ${{ inputs.registry }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile .
|
||||
|
||||
- name: push docker image
|
||||
shell: bash
|
||||
run: docker push ${{ inputs.registry }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
17
.github/actions/cleanup-docker/action.yml
vendored
Normal file
17
.github/actions/cleanup-docker/action.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: build and push Docker image
|
||||
description: build and push the wlan-testing Docker image
|
||||
|
||||
inputs:
|
||||
registry_user:
|
||||
description: the user to authenticate against the registry
|
||||
required: true
|
||||
registry_password:
|
||||
description: the password to authenticate against the registry
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: cleanup Docker image
|
||||
shell: bash
|
||||
run: curl -u ${{ inputs.registry_user }}:${{ inputs.registry_password }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"
|
||||
284
.github/workflows/advanced.yml
vendored
Normal file
284
.github/workflows/advanced.yml
vendored
Normal file
@@ -0,0 +1,284 @@
|
||||
name: advanced testing
|
||||
|
||||
env:
|
||||
ALLURE_CLI_VERSION: 2.14.0
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '30 20 * * *'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: build and push Docker image
|
||||
uses: ./.github/actions/build-and-push-docker
|
||||
with:
|
||||
registry: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
registry_user: wlan-testing-cicd
|
||||
registry_password: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
|
||||
test:
|
||||
runs-on: [ self-hosted, small ]
|
||||
needs: [ build ]
|
||||
env:
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-2
|
||||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
testbed:
|
||||
- advanced-01
|
||||
- advanced-02
|
||||
|
||||
steps:
|
||||
- name: install aws CLI tool
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
- name: install kubectl
|
||||
run: |
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::advanced-ci-${{ github.run_number }}"
|
||||
|
||||
- name: prepare namespace
|
||||
id: namespace
|
||||
run: |
|
||||
NAMESPACE="testing-${{ github.run_number }}-${{ matrix.testbed }}"
|
||||
kubectl create ns $NAMESPACE
|
||||
kubectl config set-context --current --namespace=$NAMESPACE
|
||||
echo "::set-output name=name::${NAMESPACE}"
|
||||
|
||||
- name: create configuration.py secret
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run tests
|
||||
run: |
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "advance" -s -vvv --testbed=${{ matrix.testbed }} --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
exit \$ret
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: configuration
|
||||
secret:
|
||||
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 --timeout=600s
|
||||
kubectl logs -f $podname &
|
||||
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
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: upload Allure results as artifact
|
||||
if: ${{ always() }}
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-results-${{ matrix.testbed }}
|
||||
path: allure-results
|
||||
|
||||
- name: cleanup
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
|
||||
|
||||
|
||||
report:
|
||||
needs: [ test ]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
testbed:
|
||||
- advanced-01
|
||||
- advanced-02
|
||||
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-${{ matrix.testbed }}
|
||||
path: allure-results
|
||||
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: get reports branch
|
||||
uses: actions/checkout@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: reports
|
||||
|
||||
- name: copy history into results
|
||||
run: |
|
||||
if [ -e "reports/advanced/${{ matrix.testbed }}/latest" ] ; then
|
||||
cp -r reports/advanced/${{ matrix.testbed }}/latest/history/ allure-results/history
|
||||
fi
|
||||
|
||||
- name: add report metadata
|
||||
run: |
|
||||
cat << EOF >> allure-results/environment.properties
|
||||
Testbed=${{ matrix.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 allure-results
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report-${{ matrix.testbed }}
|
||||
path: allure-report
|
||||
|
||||
# doing this to be able to aggregate multiple reports together later on
|
||||
- name: copy results into report
|
||||
run: |
|
||||
mkdir -p allure-report/results
|
||||
cp -r allure-results/* allure-report/results
|
||||
|
||||
- name: copy new report
|
||||
run: |
|
||||
mkdir -p reports/advanced/${{ matrix.testbed }}
|
||||
cp -Tr allure-report reports/advanced/${{ matrix.testbed }}/${{ github.run_number }}
|
||||
|
||||
- name: update latest symlink
|
||||
working-directory: reports/advanced/${{ matrix.testbed }}
|
||||
run: ln -fns ${{ github.run_number }} latest
|
||||
|
||||
- name: generate new index.html
|
||||
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
|
||||
|
||||
- name: commit reports update
|
||||
working-directory: reports
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add .
|
||||
git commit -m "Automated deployment: $(date -u)"
|
||||
|
||||
- name: push
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
- name: upload to S3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ./wlan-testing/.github/actions/allure-report-to-s3
|
||||
with:
|
||||
test_type: advanced
|
||||
testbed: ${{ matrix.testbed }}
|
||||
report_path: allure-report
|
||||
s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }}
|
||||
s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
cleanup:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: cleanup Docker image
|
||||
uses: ./.github/actions/cleanup-docker
|
||||
with:
|
||||
registry_user: wlan-testing-cicd
|
||||
registry_password: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
67
.github/workflows/get_redirector_url.yml
vendored
Normal file
67
.github/workflows/get_redirector_url.yml
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
name: Get testbeds current redirector urls
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
testbeds:
|
||||
default: 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08'
|
||||
description: 'Testbed(s) to test'
|
||||
required: false
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
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,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' }}"
|
||||
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}}"
|
||||
|
||||
get-redirector-url:
|
||||
needs: [ generate-matrix ]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
path: wlan-testing
|
||||
|
||||
- name: checkout pki cert scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
path: wlan-pki-cert-scripts
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y python3-pip
|
||||
pip install paramiko scp
|
||||
|
||||
- name: create configuration.py file
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
|
||||
- name: Get redirector URL
|
||||
env:
|
||||
DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
|
||||
run: |
|
||||
for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3)
|
||||
do
|
||||
./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id
|
||||
echo "Exit code - $?"
|
||||
done
|
||||
34
.github/workflows/interop.yml
vendored
34
.github/workflows/interop.yml
vendored
@@ -119,17 +119,27 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "${{ steps.marker.outputs.expression }}" -s -vvv --testbed=interop-03 -o 'jobName=Github-Interop-${{ matrix.test_type }}' -o 'jobNumber=${{ github.run_number }}' --alluredir=/tmp/allure-results
|
||||
pytest -m "${{ steps.marker.outputs.expression }}" -s -vvv --testbed=interop-03 -o 'jobName=Github-Interop-${{ matrix.test_type }}' -o 'jobNumber=${{ github.run_number }}' --alluredir=/tmp/allure-results --skip-lanforge
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
@@ -139,6 +149,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
@@ -168,12 +184,6 @@ jobs:
|
||||
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
|
||||
@@ -281,6 +291,16 @@ jobs:
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
- name: upload to S3
|
||||
if: github.ref == 'refs/heads/master' && needs.test.outputs.additional_markers == ''
|
||||
uses: ./wlan-testing/.github/actions/allure-report-to-s3
|
||||
with:
|
||||
test_type: interop
|
||||
testbed: interop
|
||||
report_path: allure-report
|
||||
s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }}
|
||||
s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
cleanup:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
17
.github/workflows/manual.yml
vendored
17
.github/workflows/manual.yml
vendored
@@ -115,6 +115,7 @@ jobs:
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run tests
|
||||
@@ -126,10 +127,20 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
@@ -146,6 +157,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
|
||||
600
.github/workflows/ow_docker-compose.yml
vendored
Normal file
600
.github/workflows/ow_docker-compose.yml
vendored
Normal file
@@ -0,0 +1,600 @@
|
||||
name: 2.x testing with Docker Compose deployment
|
||||
env:
|
||||
# thirdparties
|
||||
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
DOCKER_USER_NAME: wlan-testing-cicd
|
||||
DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
# AWS credentials
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-2
|
||||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
|
||||
ALLURE_CLI_VERSION: 2.14.0
|
||||
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [openwifi-sdk-pr]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
testbeds:
|
||||
default: 'basic-05'
|
||||
description: 'Testbed(s) to test'
|
||||
required: false
|
||||
marker_expression:
|
||||
default: 'sdk_restapi'
|
||||
description: 'Markers expression that will be passed to the pytest command.'
|
||||
required: false
|
||||
owgw_version:
|
||||
default: 'master'
|
||||
description: 'OpenWIFI Gateway version to be deployed.'
|
||||
required: false
|
||||
owgwui_version:
|
||||
default: 'main'
|
||||
description: 'OpenWIFI Web UI version to be deployed.'
|
||||
required: false
|
||||
owsec_version:
|
||||
default: 'main'
|
||||
description: 'OpenWIFI Security version to be deployed.'
|
||||
required: false
|
||||
owfms_version:
|
||||
default: 'main'
|
||||
description: 'OpenWIFI Firmware version to be deployed.'
|
||||
required: false
|
||||
owprov_version:
|
||||
default: 'main'
|
||||
description: 'OpenWIFI Provisioning version to be deployed.'
|
||||
required: false
|
||||
owprovui_version:
|
||||
default: 'main'
|
||||
description: 'OpenWIFI Provisioning Web UI version to be deployed.'
|
||||
required: false
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout needed repositories
|
||||
- name: Checkout Testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Checkout LANforge scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-lanforge-scripts
|
||||
repository: Telecominfraproject/wlan-lanforge-scripts
|
||||
|
||||
- name: import LANforge scripts
|
||||
working-directory: wlan-testing
|
||||
run: ./sync_repos.bash
|
||||
|
||||
# build and push docker image
|
||||
- name: docker login
|
||||
run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }}
|
||||
- name: build docker image
|
||||
working-directory: wlan-testing
|
||||
run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile .
|
||||
- name: push docker image
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
|
||||
deploy-controller:
|
||||
name: Deploy OpenWIFI Cloud SDK
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
gateway_url: ${{ steps.gateway_url.outputs.value }}
|
||||
sec_url: ${{ steps.sec_url.outputs.value }}
|
||||
namespace: ${{ steps.namespace.outputs.value }}
|
||||
steps:
|
||||
- name: Checkout wlan-testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
# build and push docker-compose-deployment image
|
||||
# - name: docker login
|
||||
# run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }}
|
||||
# - name: build docker image
|
||||
# working-directory: wlan-testing/docker-compose/openwifi
|
||||
# run: docker build -t ${{ env.DOCKER_SERVER }}/docker-compose-deployment:${{ github.run_id }} .
|
||||
# - name: push docker image
|
||||
# run: docker push ${{ env.DOCKER_SERVER }}/docker-compose-deployment:${{ github.run_id }}
|
||||
#
|
||||
- name: Prepare certificates from secrets
|
||||
working-directory: wlan-testing/docker-compose/openwifi
|
||||
run: |
|
||||
echo "${{ secrets.DIGICERT_CERT }}" | base64 -d > websocket-cert.pem
|
||||
echo "${{ secrets.DIGICERT_KEY }}" | base64 -d > websocket-key.pem
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Set namespace output
|
||||
id: namespace
|
||||
run: echo "::set-output name=value::ow-docker-compose-${{ github.run_id }}"
|
||||
|
||||
- name: Set gateway URL output
|
||||
id: gateway_url
|
||||
run: echo "::set-output name=value::ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Set sec service URL output
|
||||
id: sec_url
|
||||
run: echo "::set-output name=value::ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Create Kubernetes namespace and secret
|
||||
working-directory: wlan-testing/docker-compose/openwifi
|
||||
run: |
|
||||
kubectl create ns ow-docker-compose-${{ github.run_id }}
|
||||
kubectl create secret generic tip-cicd-wildcard-certs --from-file=websocket-cert.pem=websocket-cert.pem --from-file=websocket-key.pem=websocket-key.pem -n ow-docker-compose-${{ github.run_id }}
|
||||
|
||||
- name: Deploy OpenWIFI Cloud SDK
|
||||
working-directory: wlan-testing/docker-compose/openwifi
|
||||
env:
|
||||
RTTY_TOKEN: ${{ secrets.RTTY_TOKEN }}
|
||||
OWSEC_AUTHENTICATION_DEFAULT_USERNAME: ${{ secrets.UCENTRALGW_AUTH_USERNAME }}
|
||||
OWSEC_AUTHENTICATION_DEFAULT_PASSWORD: ${{ secrets.UCENTRALGW_AUTH_PASSWORD }}
|
||||
OWFMS_S3_SECRET: ${{ secrets.UCENTRALFMS_S3_SECRET }}
|
||||
OWFMS_S3_KEY: ${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
run: |
|
||||
cat <<EOF | kubectl create -f - -n ow-docker-compose-${{ github.run_id }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ow-docker-compose-${{ github.run_id }}
|
||||
annotations:
|
||||
service.beta.kubernetes.io/aws-load-balancer-type: "nlb-ip"
|
||||
service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
|
||||
external-dns.alpha.kubernetes.io/hostname: ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build
|
||||
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: "16002,16003,443,16001,16004,16005,8443,5912,5913"
|
||||
labels:
|
||||
app: ow-docker-compose-${{ github.run_id }}
|
||||
spec:
|
||||
selector:
|
||||
app: ow-docker-compose-${{ github.run_id }}
|
||||
type: LoadBalancer
|
||||
ports:
|
||||
- name: owgw-websocket
|
||||
port: 15002
|
||||
targetPort: 15002
|
||||
protocol: TCP
|
||||
- name: owgw-restapi
|
||||
port: 16002
|
||||
targetPort: 16002
|
||||
protocol: TCP
|
||||
- name: owgw-alivecheck
|
||||
port: 16102
|
||||
targetPort: 16102
|
||||
protocol: TCP
|
||||
- name: owgw-fileupload
|
||||
port: 16003
|
||||
targetPort: 16003
|
||||
protocol: TCP
|
||||
- name: owgw-ui-http
|
||||
port: 80
|
||||
targetPort: 80
|
||||
protocol: TCP
|
||||
- name: owgw-ui-https
|
||||
port: 443
|
||||
targetPort: 443
|
||||
- name: owsec-restapi
|
||||
port: 16001
|
||||
targetPort: 16001
|
||||
protocol: TCP
|
||||
- name: owsec-alivecheck
|
||||
port: 16101
|
||||
targetPort: 16101
|
||||
- name: owfms-restapi
|
||||
port: 16004
|
||||
targetPort: 16004
|
||||
protocol: TCP
|
||||
- name: owfms-alivecheck
|
||||
port: 16104
|
||||
targetPort: 16104
|
||||
- name: owprov-restapi
|
||||
port: 16005
|
||||
targetPort: 16005
|
||||
protocol: TCP
|
||||
- name: owprov-alivecheck
|
||||
port: 16105
|
||||
targetPort: 16105
|
||||
- name: owprov-ui-http
|
||||
port: 8080
|
||||
targetPort: 8080
|
||||
protocol: TCP
|
||||
- name: owprov-ui-https
|
||||
port: 8443
|
||||
targetPort: 8443
|
||||
- name: rttys-dev
|
||||
port: 5912
|
||||
targetPort: 5912
|
||||
protocol: TCP
|
||||
- name: rttys-user
|
||||
port: 5913
|
||||
targetPort: 5913
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: ow-docker-compose-${{ github.run_id }}
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
labels:
|
||||
app: ow-docker-compose-${{ github.run_id }}
|
||||
spec:
|
||||
volumes:
|
||||
- name: client-certs
|
||||
emptyDir: {}
|
||||
- name: deploy-repo
|
||||
emptyDir: {}
|
||||
- name: tip-cicd-wildcard-certs
|
||||
secret:
|
||||
secretName: tip-cicd-wildcard-certs
|
||||
containers:
|
||||
- name: docker-daemon
|
||||
image: docker:dind
|
||||
env:
|
||||
- name: DOCKER_TLS_CERTDIR
|
||||
value: "/certs"
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
- name: client-certs
|
||||
mountPath: /certs/client
|
||||
- name: deploy-repo
|
||||
mountPath: /wlan-cloud-ucentral-deploy
|
||||
|
||||
- name: docker-compose-deployment
|
||||
image: docker/compose:latest
|
||||
command: ["/bin/sh", "-c"]
|
||||
args: ["apk add git; wget https://raw.githubusercontent.com/Telecominfraproject/wlan-testing/master/docker-compose/openwifi/deploy.sh; chmod +x deploy.sh; sh deploy.sh"]
|
||||
env:
|
||||
- name: DOCKER_TLS_VERIFY
|
||||
value: "true"
|
||||
- name: DOCKER_HOST
|
||||
value: "127.0.0.1:2376"
|
||||
- name: DOCKER_CERT_PATH
|
||||
value: "/certs/client"
|
||||
- name: OWGW_TAG
|
||||
value: "${{ github.event.inputs.owgw_version || github.event.client_payload.owgw_tag }}"
|
||||
- name: OWGWUI_TAG
|
||||
value: "${{ github.event.inputs.owgwui_version || github.event.client_payload.owgwui_tag }}"
|
||||
- name: OWSEC_TAG
|
||||
value: "${{ github.event.inputs.owsec_version || github.event.client_payload.owsec_tag }}"
|
||||
- name: OWFMS_TAG
|
||||
value: "${{ github.event.inputs.owfms_version || github.event.client_payload.owfms_tag }}"
|
||||
- name: OWPROV_TAG
|
||||
value: "${{ github.event.inputs.owprov_version || github.event.client_payload.owprov_tag }}"
|
||||
- name: OWPROVUI_TAG
|
||||
value: "${{ github.event.inputs.owprovui_version || github.event.client_payload.owprovui_tag }}"
|
||||
- name: INTERNAL_OWGW_HOSTNAME
|
||||
value: "owgw.wlan.local"
|
||||
- name: INTERNAL_OWSEC_HOSTNAME
|
||||
value: "owsec.wlan.local"
|
||||
- name: INTERNAL_OWFMS_HOSTNAME
|
||||
value: "owfms.wlan.local"
|
||||
- name: INTERNAL_OWPROV_HOSTNAME
|
||||
value: "owprov.wlan.local"
|
||||
- name: DEPLOY_VERSION
|
||||
value: "main"
|
||||
- name: SYSTEM_URI_UI
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
- name: DEFAULT_UCENTRALSEC_URL
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16001"
|
||||
- name: RTTY_TOKEN
|
||||
value: "$RTTY_TOKEN"
|
||||
- name: OWGW_FILEUPLOADER_HOST_NAME
|
||||
value: "ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
- name: OWGW_FILEUPLOADER_URI
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16003"
|
||||
- name: OWGW_SYSTEM_URI_PRIVATE
|
||||
value: "https://owgw.wlan.local:17002"
|
||||
- name: OWGW_SYSTEM_URI_PUBLIC
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16002"
|
||||
- name: OWGW_RTTY_SERVER
|
||||
value: "ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
- name: OWSEC_AUTHENTICATION_DEFAULT_USERNAME
|
||||
value: "$OWSEC_AUTHENTICATION_DEFAULT_USERNAME"
|
||||
- name: OWSEC_AUTHENTICATION_DEFAULT_PASSWORD
|
||||
value: "$OWSEC_AUTHENTICATION_DEFAULT_PASSWORD"
|
||||
- name: OWSEC_SYSTEM_URI_PRIVATE
|
||||
value: "https://owsec.wlan.local:17001"
|
||||
- name: OWSEC_SYSTEM_URI_PUBLIC
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16001"
|
||||
- name: OWFMS_SYSTEM_URI_PRIVATE
|
||||
value: "https://owfms.wlan.local:17004"
|
||||
- name: OWFMS_SYSTEM_URI_PUBLIC
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16004"
|
||||
- name: OWFMS_S3_SECRET
|
||||
value: "$OWFMS_S3_SECRET"
|
||||
- name: OWFMS_S3_KEY
|
||||
value: "$OWFMS_S3_KEY"
|
||||
- name: OWPROV_SYSTEM_URI_PRIVATE
|
||||
value: "https://owprov.wlan.local:17005"
|
||||
- name: OWPROV_SYSTEM_URI_PUBLIC
|
||||
value: "https://ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16005"
|
||||
- name: WEBSOCKET_CERT
|
||||
value: "/tip-cicd-wildcard-certs/websocket-cert.pem"
|
||||
- name: WEBSOCKET_KEY
|
||||
value: "/tip-cicd-wildcard-certs/websocket-key.pem"
|
||||
volumeMounts:
|
||||
- name: client-certs
|
||||
mountPath: /certs/client
|
||||
- name: deploy-repo
|
||||
mountPath: /wlan-cloud-ucentral-deploy
|
||||
- name: tip-cicd-wildcard-certs
|
||||
readOnly: true
|
||||
mountPath: "/tip-cicd-wildcard-certs"
|
||||
EOF
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl get pods --namespace ow-docker-compose-${{ github.run_id }}
|
||||
kubectl get services --namespace ow-docker-compose-${{ github.run_id }}
|
||||
- name: Describe pods on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe pods --namespace ow-docker-compose-${{ github.run_id }}
|
||||
- name: Describe services on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe services --namespace ow-docker-compose-${{ github.run_id }}
|
||||
|
||||
- name: Change password and check if deployment is ready using clustersysteminfo image
|
||||
env:
|
||||
OWSEC: "ow-docker-compose-${{ github.run_id }}.cicd.lab.wlan.tip.build:16001"
|
||||
OWSEC_DEFAULT_USERNAME: ${{ secrets.OWSEC_DEFAULT_USERNAME }}
|
||||
OWSEC_DEFAULT_PASSWORD: ${{ secrets.OWSEC_DEFAULT_PASSWORD }}
|
||||
OWSEC_NEW_PASSWORD: ${{ secrets.OWSEC_NEW_PASSWORD }}
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e OWSEC \
|
||||
-e OWSEC_DEFAULT_USERNAME \
|
||||
-e OWSEC_DEFAULT_PASSWORD \
|
||||
-e OWSEC_NEW_PASSWORD \
|
||||
tip-tip-wlan-cloud-ucentral.jfrog.io/clustersysteminfo:main
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build, deploy-controller ]
|
||||
steps:
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::testing-${{ github.run_number }}"
|
||||
|
||||
- name: prepare namespace
|
||||
id: namespace
|
||||
run: |
|
||||
NAMESPACE="testing-${{ github.run_id }}"
|
||||
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
|
||||
sed -i -r "s/'url': ('|\").*('|\")/'url': 'https:\/\/${{ needs.deploy-controller.outputs.sec_url }}:16001'/" configuration.py
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
cat configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run tests
|
||||
run: |
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "${{ github.event.inputs.marker_expression || 'sdk_restapi' }}" -s -vvv --testbed="${{ github.event.inputs.testbeds || 'basic-05' }}" --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
exit \$ret
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: configuration
|
||||
secret:
|
||||
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 --timeout=600s
|
||||
kubectl logs -f $podname &
|
||||
#sleep 30 # wait for the pod to come up
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
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-${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
path: allure-results
|
||||
|
||||
- name: cleanup
|
||||
if: always()
|
||||
run: |
|
||||
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
|
||||
|
||||
report:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test ]
|
||||
if: always()
|
||||
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-${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
path: allure-results
|
||||
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: get reports branch
|
||||
uses: actions/checkout@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: reports
|
||||
|
||||
- name: copy history into results
|
||||
run: |
|
||||
if [ -e "reports/docker-compose/${{ github.event.inputs.marker_expression || 'sdk_restapi' }}/${{ github.event.inputs.testbeds || 'basic-05' }} /latest" ] ; then
|
||||
cp -r reports/docker-compose/${{ github.event.inputs.marker_expression || 'sdk_restapi' }}/${{ github.event.inputs.testbeds || 'basic-05' }}/latest/history/ allure-results/history
|
||||
fi
|
||||
|
||||
- name: add report metadata
|
||||
run: |
|
||||
cat << EOF >> allure-results/environment.properties
|
||||
Testbed=${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
|
||||
CiRun.Id=${{ github.run_id }}
|
||||
CiRun.Number=${{ github.run_number }}
|
||||
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
|
||||
EOF
|
||||
|
||||
- name: generate Allure report
|
||||
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report-${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
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
|
||||
|
||||
- name: copy new report
|
||||
run: |
|
||||
mkdir -p reports/docker-compose/${{ github.event.inputs.marker_expression || 'sdk_restapi' }}/${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
cp -Tr allure-report reports/docker-compose/${{ github.event.inputs.marker_expression || 'sdk_restapi' }}/${{ github.event.inputs.testbeds || 'basic-05' }}/${{ github.run_number }}
|
||||
|
||||
- name: update latest symlink
|
||||
working-directory: reports/docker-compose/${{ github.event.inputs.marker_expression || 'sdk_restapi' }}/${{ github.event.inputs.testbeds || 'basic-05' }}
|
||||
run: ln -fns ${{ github.run_number }} latest
|
||||
|
||||
- name: generate new index.html
|
||||
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
|
||||
|
||||
- name: commit reports update
|
||||
working-directory: reports
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "Automated deployment: $(date -u)"
|
||||
|
||||
- name: push
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
delete-docker-image:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: cleanup Docker image
|
||||
run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"
|
||||
|
||||
# - name: cleanup docker-compose-deployment image
|
||||
# run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/docker-compose-deployment/${{ github.run_id }}"
|
||||
|
||||
destroy-controller:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Checkout wlan-testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Delete namespace
|
||||
run: kubectl delete ns --ignore-not-found=true "ow-docker-compose-${{ github.run_id }}"
|
||||
28
.github/workflows/performance.yml
vendored
28
.github/workflows/performance.yml
vendored
@@ -113,6 +113,7 @@ jobs:
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run perf tests
|
||||
@@ -124,10 +125,20 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
@@ -144,6 +155,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
@@ -275,6 +292,7 @@ jobs:
|
||||
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
|
||||
@@ -283,6 +301,16 @@ jobs:
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
- name: upload to S3
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ./wlan-testing/.github/actions/allure-report-to-s3
|
||||
with:
|
||||
test_type: performance
|
||||
testbed: ${{ needs.test.outputs.testbed }}
|
||||
report_path: allure-report
|
||||
s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }}
|
||||
s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
cleanup:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
561
.github/workflows/quali-basic-manual.yml
vendored
Normal file
561
.github/workflows/quali-basic-manual.yml
vendored
Normal file
@@ -0,0 +1,561 @@
|
||||
name: manual pytest execution against basic lab
|
||||
env:
|
||||
# thirdparties
|
||||
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
DOCKER_USER_NAME: wlan-testing-cicd
|
||||
DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
# AWS credentials
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-2
|
||||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
|
||||
# Cloud SDK certs
|
||||
CACERT: ${{ secrets.CACERT }}
|
||||
CAKEY: ${{ secrets.CAKEY }}
|
||||
ALLURE_CLI_VERSION: 2.14.0
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
openwifi_revision:
|
||||
required: true
|
||||
default: 'main'
|
||||
description: 'revision of the Open Wifi Helm chart'
|
||||
openwifi_gw_revision:
|
||||
required: true
|
||||
default: 'master'
|
||||
description: 'revision of the Open Wifi gateway service'
|
||||
openwifi_sec_revision:
|
||||
required: true
|
||||
default: 'main'
|
||||
description: 'revision of the Open Wifi security service'
|
||||
openwifi_fms_revision:
|
||||
required: true
|
||||
default: 'main'
|
||||
description: 'revision of the Open Wifi fms service'
|
||||
openwifi_ui_revision:
|
||||
required: true
|
||||
default: 'main'
|
||||
description: 'revision of the Open Wifi UI'
|
||||
ap_model:
|
||||
description: 'AP model to test, one of edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4'
|
||||
required: true
|
||||
firmware:
|
||||
default: 'next-latest'
|
||||
description: 'Target firmware version to be specified <branch>-<commit | latest>'
|
||||
required: false
|
||||
marker_expression:
|
||||
description: "marker expression that will be passed to pytest's -m"
|
||||
required: true
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout needed repositories
|
||||
- name: Checkout Testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Checkout LANforge scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-lanforge-scripts
|
||||
repository: Telecominfraproject/wlan-lanforge-scripts
|
||||
|
||||
- name: import LANforge scripts
|
||||
working-directory: wlan-testing
|
||||
run: ./sync_repos.bash
|
||||
|
||||
# build and push docker image
|
||||
- name: docker login
|
||||
run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }}
|
||||
- name: build docker image
|
||||
working-directory: wlan-testing
|
||||
run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile .
|
||||
- name: push docker image
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
|
||||
test:
|
||||
runs-on: [ self-hosted, small ]
|
||||
needs: [ build ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.8'
|
||||
|
||||
- name: install dependencies
|
||||
run: pip install -r .quali/requirements.txt
|
||||
|
||||
- name: start reservation
|
||||
id: start
|
||||
env:
|
||||
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
|
||||
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}
|
||||
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
|
||||
run: |
|
||||
RES_ID=$(python .quali/start_reservation.py --openwifi-version "${{ github.event.inputs.openwifi_revision }}" --openwifi-gw-version "${{ github.event.inputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ github.event.inputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ github.event.inputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ github.event.inputs.openwifi_ui_revision }}" --ap-model "${{ github.event.inputs.ap_model }}")
|
||||
echo ::set-output name=res_id::"$RES_ID"
|
||||
|
||||
- name: set reservation identifier
|
||||
id: reservation
|
||||
run: echo ::set-output name=identifier::$(echo ${{ steps.start.outputs.res_id }} | cut -d "-" -f 1)
|
||||
|
||||
- name: install JRE
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y default-jre
|
||||
|
||||
- name: install aws CLI tool
|
||||
run: |
|
||||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
||||
unzip awscliv2.zip
|
||||
sudo ./aws/install
|
||||
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: install kubectl
|
||||
run: |
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
|
||||
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::manual-${{ github.run_id }}"
|
||||
|
||||
- name: prepare namespace
|
||||
id: namespace
|
||||
run: |
|
||||
NAMESPACE="testing-${{ github.run_id }}"
|
||||
kubectl create ns $NAMESPACE
|
||||
kubectl config set-context --current --namespace=$NAMESPACE
|
||||
echo "::set-output name=name::${NAMESPACE}"
|
||||
|
||||
- name: prepare configuration
|
||||
env:
|
||||
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
|
||||
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}
|
||||
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
Customer = ""
|
||||
server = ""
|
||||
CONFIGURATION = {
|
||||
"basic": $(python .quali/get_configuration.py ${{ steps.start.outputs.res_id }})
|
||||
}
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "10.10.1.221",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "user",
|
||||
"password": "password",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
RADIUS_ACCOUNTING_DATA = {
|
||||
"ip": "10.10.1.221",
|
||||
"port": 1813,
|
||||
"secret": "testing123",
|
||||
"user": "user",
|
||||
"password": "password",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
PASSPOINT_RADIUS_SERVER_DATA = {
|
||||
"ip": "52.234.179.191",
|
||||
"port": 11812,
|
||||
"secret": "yeababy20!",
|
||||
"user": "nolaradius",
|
||||
"password": "nolastart",
|
||||
"pk_password": "whatever"
|
||||
}
|
||||
|
||||
PASSPOINT_RADIUS_ACCOUNTING_SERVER_DATA = {
|
||||
"ip": "52.234.179.191",
|
||||
"port": 11813,
|
||||
"secret": "yeababy20!"
|
||||
}
|
||||
|
||||
PASSPOINT_PROVIDER_INFO = {
|
||||
"mcc": None,
|
||||
"mnc": None,
|
||||
"network": None,
|
||||
"nai_realms": {
|
||||
"domain": "oss.ameriband.com",
|
||||
"encoding": 0,
|
||||
"eap_map": {"EAP-TTLS with username/password": ["Credential Type:username/password",
|
||||
"Non-EAP Inner Authentication Type:MSCHAPV2"]}
|
||||
},
|
||||
"osu_nai_standalone": "anonymous@ameriband.com",
|
||||
"osu_nai_shared": "anonymous@ameriband.com",
|
||||
"roaming_oi": []
|
||||
}
|
||||
|
||||
PASSPOINT_OPERATOR_INFO = {
|
||||
"osen": "Disabled",
|
||||
"domain_name_list": ["telecominfraproject.atlassian.net"],
|
||||
"operator_names": [
|
||||
{"locale": "eng", "name": "Default friendly passpoint_operator name"},
|
||||
{"locale": "fra", "name": "Nom de l'opérateur convivial par défaut"}
|
||||
]
|
||||
}
|
||||
|
||||
PASSPOINT_VENUE_INFO = {
|
||||
"venue_type": {"group": "Business", "type": "Police Station"},
|
||||
"venue_names": [
|
||||
{"locale": "eng", "name": "Example passpoint_venue", "url": "http://www.example.com/info-eng"},
|
||||
{"locale": "fra", "name": "Exemple de lieu", "url": "http://www.example.com/info-fra"}
|
||||
]
|
||||
}
|
||||
|
||||
PASSPOINT_PROFILE_INFO = {
|
||||
"profile_download_url_ios": "https://onboard.almondlabs.net/ttls/AmeriBand-Profile.mobileconfig",
|
||||
"profile_download_url_android": "https://onboard.almondlabs.net/ttls/androidconfig.cfg",
|
||||
"profile_name_on_device": "AmeriBand",
|
||||
"radius_configuration": {
|
||||
"user_defined_nas_id": "FB001AP001",
|
||||
"operator_id": "AmeribandTIP",
|
||||
"radius_acounting_service_interval": 60
|
||||
},
|
||||
"interworking_hs2dot0": "Enabled",
|
||||
"hessid": None,
|
||||
"access_network": {
|
||||
"Access Network Type": "Free Public Network",
|
||||
"Authentication Type": "Acceptance of Terms & Conditions",
|
||||
"Emergency Services Reachable": "Enabled",
|
||||
"Unauthenticated Emergency Service": "Disabled",
|
||||
},
|
||||
"ip_connectivity": {
|
||||
"Internet Connectivity": "Enabled",
|
||||
"IP Address Type": "Public IPv4 Address Available",
|
||||
"Connection Capability": [{"status": "open", "protocol": "TCP", "port": 8888}],
|
||||
"ANQP Domain ID": 1234,
|
||||
"GAS Address 3 Behaviour": "P2P Spec Workaround From Request",
|
||||
"Disable DGAF": False
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASES = {
|
||||
"ap_upgrade": 2233,
|
||||
"5g_wpa2_bridge": 2236,
|
||||
"2g_wpa2_bridge": 2237,
|
||||
"5g_wpa_bridge": 2419,
|
||||
"2g_wpa_bridge": 2420,
|
||||
"2g_wpa_nat": 4323,
|
||||
"5g_wpa_nat": 4324,
|
||||
"2g_wpa2_nat": 4325,
|
||||
"5g_wpa2_nat": 4326,
|
||||
"2g_wpa2_eap_ttls_bridge": 5214,
|
||||
"5g_wpa2_eap_ttls_bridge": 5215,
|
||||
"2g_wpa2_eap_ttls_nat": 5216,
|
||||
"5g_wpa2_eap_ttls_nat": 5217,
|
||||
"cloud_connection": 5222,
|
||||
"cloud_fw": 5247,
|
||||
"5g_wpa2_vlan": 5248,
|
||||
"5g_wpa_vlan": 5249,
|
||||
"5g_wpa2_eap_ttls_vlan": 5250,
|
||||
"2g_wpa2_vlan": 5251,
|
||||
"2g_wpa_vlan": 5252,
|
||||
"2g_wpa2_eap_ttls_vlan": 5253,
|
||||
"cloud_ver": 5540,
|
||||
"bridge_vifc": 5541,
|
||||
"nat_vifc": 5542,
|
||||
"vlan_vifc": 5543,
|
||||
"bridge_vifs": 5544,
|
||||
"nat_vifs": 5545,
|
||||
"vlan_vifs": 5546,
|
||||
"upgrade_api": 5547,
|
||||
"create_fw": 5548,
|
||||
"ap_profile_bridge": 5641,
|
||||
"ap_profile_nat": 5642,
|
||||
"ap_profile_vlan": 5643,
|
||||
"ssid_2g_wpa2_eap_bridge": 5644,
|
||||
"ssid_2g_wpa2_bridge": 5645,
|
||||
"ssid_2g_wpa_bridge": 5646,
|
||||
"ssid_5g_wpa2_eap_bridge": 5647,
|
||||
"ssid_5g_wpa2_bridge": 5648,
|
||||
"ssid_5g_wpa_bridge": 5649,
|
||||
"ssid_2g_wpa2_eap_nat": 5650,
|
||||
"ssid_2g_wpa2_nat": 5651,
|
||||
"ssid_2g_wpa_nat": 5652,
|
||||
"ssid_5g_wpa2_eap_nat": 5653,
|
||||
"ssid_5g_wpa2_nat": 5654,
|
||||
"ssid_5g_wpa_nat": 5655,
|
||||
"ssid_2g_wpa2_eap_vlan": 5656,
|
||||
"ssid_2g_wpa2_vlan": 5657,
|
||||
"ssid_2g_wpa_vlan": 5658,
|
||||
"ssid_5g_wpa2_eap_vlan": 5659,
|
||||
"ssid_5g_wpa2_vlan": 5660,
|
||||
"ssid_5g_wpa_vlan": 5661,
|
||||
"radius_profile": 5808,
|
||||
"bridge_ssid_update": 8742,
|
||||
"nat_ssid_update": 8743,
|
||||
"vlan_ssid_update": 8744,
|
||||
"2g_wpa3_bridge": 9740,
|
||||
"5g_wpa3_bridge": 9741,
|
||||
"ssid_2g_wpa3_bridge": 9742,
|
||||
"ssid_5g_wpa3_bridge": 9743,
|
||||
"ssid_2g_wpa3_nat": 9744,
|
||||
"ssid_5g_wpa3_nat": 9745,
|
||||
"ssid_2g_wpa3_vlan": 9746,
|
||||
"ssid_5g_wpa3_vlan": 9747,
|
||||
"2g_wpa3_nat": 9748,
|
||||
"5g_wpa3_nat": 9749,
|
||||
"2g_wpa3_vlan": 9750,
|
||||
"5g_wpa3_vlan": 9751,
|
||||
"ssid_2g_wpa3_eap_bridge": 9752,
|
||||
"ssid_5g_wpa3_eap_bridge": 9753,
|
||||
"2g_wpa3_eap_ttls_bridge": 9754,
|
||||
"5g_wpa3_eap_ttls_bridge": 9755,
|
||||
"ssid_2g_wpa3_eap_nat": 9756,
|
||||
"ssid_5g_wpa3_eap_nat": 9757,
|
||||
"ssid_2g_wpa3_eap_vlan": 9758,
|
||||
"ssid_5g_wpa3_eap_vlan": 9759,
|
||||
"2g_wpa3_eap_ttls_nat": 9760,
|
||||
"5g_wpa3_eap_ttls_nat": 9761,
|
||||
"2g_wpa3_eap_ttls_vlan": 9762,
|
||||
"5g_wpa3_eap_ttls_vlan": 9763,
|
||||
"ssid_2g_wpa3_mixed_bridge": 9764,
|
||||
"ssid_5g_wpa3_mixed_bridge": 9765,
|
||||
"2g_wpa3_mixed_eap_ttls_wpa3_bridge": 9766,
|
||||
"2g_wpa3_mixed_wpa3_bridge": 9767,
|
||||
"5g_wpa3_mixed_eap_ttls_wpa3_bridge": 9768,
|
||||
"5g_wpa3_mixed_wpa3_bridge": 9769,
|
||||
"ssid_2g_wpa3_mixed_nat": 9770,
|
||||
"ssid_5g_wpa3_mixed_nat": 9771,
|
||||
"ssid_2g_wpa3_mixed_vlan": 9772,
|
||||
"ssid_5g_wpa3_mixed_vlan": 9773,
|
||||
# "2g_wpa3_mixed_wpa2_nat": 9774,
|
||||
"2g_wpa3_mixed_wpa3_nat": 9775,
|
||||
# "5g_wpa3_mixed_wpa2_nat": 9776,
|
||||
"5g_wpa3_mixed_wpa3_nat": 9777,
|
||||
# "2g_wpa3_mixed_wpa2_vlan": 9778,
|
||||
"2g_wpa3_mixed_wpa3_vlan": 9779,
|
||||
# "5g_wpa3_mixed_wpa2_vlan": 9780,
|
||||
"5g_wpa3_mixed_wpa3_vlan": 9781,
|
||||
"ssid_2g_wpa3_enterprise_mixed_bridge": 9782,
|
||||
"ssid_5g_wpa3_enterprise_mixed_bridge": 9783,
|
||||
"2g_wpa2_mixed_eap_wpa2_bridge": 9784,
|
||||
"2g_wpa3_mixed_eap_wpa3_bridge": 9785,
|
||||
"5g_wpa3_mixed_eap_wpa2_bridge": 9786,
|
||||
"5g_wpa3_mixed_eap_wpa3_bridge": 9787,
|
||||
"ssid_2g_wpa3_enterprise_mixed_nat": 9788,
|
||||
"ssid_5g_wpa3_enterprise_mixed_nat": 9789,
|
||||
"2g_wpa3_mixed_eap_wpa2_nat": 9790,
|
||||
"2g_wpa3_mixed_eap_ttls_wpa3_nat": 9791,
|
||||
"5g_wpa3_mixed_eap_wpa2_nat": 9792,
|
||||
"5g_wpa3_mixed_eap_ttls_wpa3_nat": 9793,
|
||||
"ssid_2g_wpa3_enterprise_mixed_vlan": 9794,
|
||||
"ssid_5g_wpa3_enterprise_mixed_vlan": 9795,
|
||||
"2g_wpa3_mixed_eap_wpa2_vlan": 9796,
|
||||
"2g_wpa3_mixed_eap_ttls_wpa3_vlan": 9797,
|
||||
"5g_wpa3_mixed_eap_wpa2_vlan": 9798,
|
||||
"5g_wpa3_mixed_eap_ttls_wpa3_vlan": 9799,
|
||||
"ssid_2g_open_bridge": 9805,
|
||||
"ssid_5g_open_bridge": 9806,
|
||||
"ssid_2g_open_nat": 9807,
|
||||
"ssid_5g_open_nat": 9808,
|
||||
"ssid_2g_open_vlan": 9809,
|
||||
"ssid_5g_open_vlan": 9810,
|
||||
"ssid_2g_wpa2_mixed_bridge": 9811,
|
||||
"ssid_5g_wpa2_mixed_bridge": 9812,
|
||||
"ssid_2g_wpa2_mixed_nat": 9813,
|
||||
"ssid_5g_wpa2_mixed_nat": 9814,
|
||||
"ssid_2g_wpa2_mixed_vlan": 9815,
|
||||
"ssid_5g_wpa2_mixed_vlan": 9817,
|
||||
"ssid_2g_wpa_wpa2_enterprise_mixed_bridge": 9818,
|
||||
"ssid_5g_wpa_wpa2_enterprise_mixed_bridge": 9819,
|
||||
"ssid_2g_wpa_wpa2_enterprise_mixed_nat": 9820,
|
||||
"ssid_5g_wpa_wpa2_enterprise_mixed_nat": 9821,
|
||||
"ssid_2g_wpa_wpa2_enterprise_mixed_vlan": 9822,
|
||||
"ssid_5g_wpa_wpa2_enterprise_mixed_vlan": 9823,
|
||||
"ssid_2g_wpa_eap_bridge": 9824,
|
||||
"ssid_5g_wpa_eap_bridge": 9825,
|
||||
# "ssid_2g_wpa2_eap_bridge": 9824,
|
||||
# "ssid_5g_wpa2_eap_bridge": 9825,
|
||||
"ssid_2g_wpa_eap_nat": 9826,
|
||||
"ssid_5g_wpa_eap_nat": 9827,
|
||||
"ssid_2g_wpa_eap_vlan": 9828,
|
||||
"ssid_5g_wpa_eap_vlan": 9829,
|
||||
# "ap_update_bridge": 9856,
|
||||
# "ap_update_nat": 9857,
|
||||
# "ap_update_vlan": 9858,
|
||||
# "bridge_vifc_update": 9859,
|
||||
# "nat_vifc_update": 9860,
|
||||
# "vlan_vifc_update": 9861,
|
||||
# "bridge_vifs_update": 9862,
|
||||
# "nat_vifs_update": 9863,
|
||||
# "vlan_vifs_update": 9864,
|
||||
"2g_wpa_eap_ttls_bridge": 9867,
|
||||
"5g_wpa_eap_ttls_bridge": 9768,
|
||||
"2g_wpa_eap_ttls_nat": 9869,
|
||||
"5g_wpa_eap_ttls_nat": 9770,
|
||||
"2g_wpa_eap_ttls_vlan": 9871,
|
||||
"5g_wpa_eap_ttls_vlan": 9872,
|
||||
# "2g_wpa2_mixed_eap_wpa_bridge": 9873,
|
||||
"2g_wpa2_mixed_eap_ttls_wpa2_bridge": 9874,
|
||||
# "5g_wpa2_mixed_eap_wpa_bridge": 9875,
|
||||
"5g_wpa2_mixed_eap_ttls_wpa2_bridge": 9876,
|
||||
# "2g_wpa2_mixed_eap_wpa_nat": 9877,
|
||||
"2g_wpa2_mixed_eap_ttls_wpa2_nat": 9878,
|
||||
# "5g_wpa2_mixed_eap_wpa_nat": 9879,
|
||||
"5g_wpa2_mixed_eap_ttls_wpa2_nat": 9880,
|
||||
# "2g_wpa2_mixed_eap_wpa_vlan": 9881,
|
||||
"2g_wpa2_mixed_eap_ttls_wpa2_vlan": 9882,
|
||||
# "5g_wpa2_mixed_eap_wpa_vlan": 9883,
|
||||
"5g_wpa2_mixed_eap_ttls_wpa2_vlan": 9884,
|
||||
# "2g_wpa2_mixed_wpa_bridge": 9885,
|
||||
"2g_wpa2_mixed_wpa2_bridge": 9886,
|
||||
# "5g_wpa2_mixed_wpa_bridge": 9887,
|
||||
"5g_wpa2_mixed_wpa2_bridge": 9888,
|
||||
# "2g_wpa2_mixed_wpa_nat": 9889,
|
||||
"2g_wpa2_mixed_wpa2_nat": 9890,
|
||||
# "5g_wpa2_mixed_wpa_nat": 9891,
|
||||
"5g_wpa2_mixed_wpa2_nat": 9892,
|
||||
# "2g_wpa2_mixed_wpa_vlan": 9893,
|
||||
"2g_wpa2_mixed_wpa2_vlan": 9894,
|
||||
# "5g_wpa2_mixed_wpa_vlan": 9895,
|
||||
"5g_wpa2_mixed_wpa2_vlan": 9896,
|
||||
"2g_open_bridge": 2234,
|
||||
"5g_open_bridge": 2235,
|
||||
"2g_open_nat": 4321,
|
||||
"5g_open_nat": 4322,
|
||||
"2g_open_vlan": 9897,
|
||||
"5g_open_vlan": 9898
|
||||
}
|
||||
EOF
|
||||
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run tests
|
||||
run: |
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
HOSTS="sec-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build"
|
||||
for HOST in \$HOSTS; do
|
||||
HOST_ENTRY=""
|
||||
until [[ ! -z "\$HOST_ENTRY" ]]; do sleep 1; HOST_ENTRY=\$(getent hosts \$HOST); done;
|
||||
echo "\$HOST_ENTRY" >> /etc/hosts
|
||||
echo "DNS record for \$HOST resolved successfully!"
|
||||
done
|
||||
|
||||
cd tests
|
||||
pytest -m "${{ github.event.inputs.marker_expression }}" -s -vvv --testbed="basic" -o firmware="${{ github.event.inputs.firmware }}" --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
exit \$ret
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: configuration
|
||||
secret:
|
||||
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 --timeout=600s
|
||||
kubectl logs -f $podname &
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
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: upload Allure results as artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-results
|
||||
path: allure-results
|
||||
|
||||
- name: generate Allure report
|
||||
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate allure-results
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report
|
||||
path: allure-report
|
||||
|
||||
- name: cleanup
|
||||
if: always()
|
||||
run: |
|
||||
kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true
|
||||
|
||||
- name: stop reservation
|
||||
if: always()
|
||||
run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
|
||||
env:
|
||||
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
|
||||
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}
|
||||
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
|
||||
|
||||
cleanup:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: cleanup Docker image
|
||||
run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"
|
||||
192
.github/workflows/quali.yml
vendored
192
.github/workflows/quali.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Quali example pipeline
|
||||
name: Quali sanity pipeline
|
||||
|
||||
env:
|
||||
# thirdparties
|
||||
@@ -41,13 +41,18 @@ on:
|
||||
description: 'revision of the Open Wifi UI'
|
||||
ap_models:
|
||||
required: true
|
||||
#default: 'EC420,EAP101,ECW5211,ECW5410'
|
||||
default: 'EC420,ECW5211'
|
||||
default: 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4'
|
||||
description: 'the AP models to test'
|
||||
ap_version:
|
||||
required: true
|
||||
default: 'latest'
|
||||
description: 'revision of firmware to flash on AP, <branch>-<commit> | latest'
|
||||
default: 'next-latest'
|
||||
description: 'revision of firmware to flash on AP, <branch>-<commit>'
|
||||
marker_expression:
|
||||
required: true
|
||||
default: 'uc_sanity'
|
||||
description: 'Marker expression to select tests to execute'
|
||||
schedule:
|
||||
- cron: '30 20 * * *'
|
||||
|
||||
jobs:
|
||||
vars:
|
||||
@@ -60,18 +65,20 @@ jobs:
|
||||
openwifi_ui_revision: ${{ steps.vars.outputs.ui}}
|
||||
ap_models: ${{ steps.vars.outputs.ap_models}}
|
||||
ap_version: ${{ steps.vars.outputs.ap_version}}
|
||||
marker_expression: ${{ steps.vars.outputs.marker_expression }}
|
||||
|
||||
steps:
|
||||
- name: set variables
|
||||
id: vars
|
||||
run: |
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'main' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'master' }}")
|
||||
echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'main' }}")
|
||||
echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'main' }}")
|
||||
echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'main' }}")
|
||||
echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'EC420,EAP101,ECW5211,ECW5410' }}")
|
||||
echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'latest' }}")
|
||||
echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'v2.4.0-RC3' }}")
|
||||
echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'v2.4.0-RC2' }}")
|
||||
echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4' }}")
|
||||
echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'next-latest' }}")
|
||||
echo ::set-output name=marker_expression::$(echo "${{ github.event.inputs.marker_expression || 'uc_sanity' }}")
|
||||
|
||||
generate-matrix:
|
||||
name: generate AP model matrix
|
||||
@@ -124,7 +131,7 @@ jobs:
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
env:
|
||||
CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build
|
||||
CLOUDSHELL_USER: admin
|
||||
CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }}
|
||||
CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }}
|
||||
|
||||
steps:
|
||||
@@ -139,10 +146,13 @@ jobs:
|
||||
|
||||
- name: start reservation
|
||||
id: start
|
||||
run: echo ::set-output name=res_id::$(python .quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --openwifi-gw-version "${{ needs.vars.outputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ needs.vars.outputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ needs.vars.outputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ needs.vars.outputs.openwifi_ui_revision }}" --ap-model "${{ matrix.ap_model }}")
|
||||
run: |
|
||||
RES_ID=$(python .quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --openwifi-gw-version "${{ needs.vars.outputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ needs.vars.outputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ needs.vars.outputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ needs.vars.outputs.openwifi_ui_revision }}" --ap-model "${{ matrix.ap_model }}")
|
||||
echo ::set-output name=res_id::"$RES_ID"
|
||||
|
||||
- name: wait for DNS to propagate
|
||||
run: sleep 300
|
||||
- name: set reservation identifier
|
||||
id: reservation
|
||||
run: echo ::set-output name=identifier::$(echo ${{ steps.start.outputs.res_id }} | cut -d "-" -f 1)
|
||||
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
@@ -174,7 +184,7 @@ jobs:
|
||||
}
|
||||
|
||||
RADIUS_SERVER_DATA = {
|
||||
"ip": "10.10.10.72",
|
||||
"ip": "10.10.1.221",
|
||||
"port": 1812,
|
||||
"secret": "testing123",
|
||||
"user": "user",
|
||||
@@ -183,8 +193,8 @@ jobs:
|
||||
}
|
||||
|
||||
RADIUS_ACCOUNTING_DATA = {
|
||||
"ip": "10.10.10.72",
|
||||
"port": 1812,
|
||||
"ip": "10.10.1.221",
|
||||
"port": 1813,
|
||||
"secret": "testing123",
|
||||
"user": "user",
|
||||
"password": "password",
|
||||
@@ -455,6 +465,8 @@ jobs:
|
||||
}
|
||||
EOF
|
||||
|
||||
cat configuration.py
|
||||
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: run tests
|
||||
@@ -466,18 +478,37 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
HOSTS="sec-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.identifier }}.cicd.lab.wlan.tip.build"
|
||||
for HOST in \$HOSTS; do
|
||||
HOST_ENTRY=""
|
||||
until [[ ! -z "\$HOST_ENTRY" ]]; do sleep 1; HOST_ENTRY=\$(getent hosts \$HOST); done;
|
||||
echo "\$HOST_ENTRY" >> /etc/hosts
|
||||
echo "DNS record for \$HOST resolved successfully!"
|
||||
done
|
||||
|
||||
cat /etc/hosts
|
||||
|
||||
cd tests
|
||||
#pytest -m "uc_sanity" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}"
|
||||
pytest -m "sdk_restapi" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}"
|
||||
pytest -m "${{ needs.vars.outputs.marker_expression }}" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}"
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
@@ -487,6 +518,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
@@ -515,11 +552,27 @@ jobs:
|
||||
kubectl logs -f $podname >/dev/null 2>&1
|
||||
exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}")
|
||||
|
||||
- name: show gw logs
|
||||
if: failure()
|
||||
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owgw
|
||||
|
||||
- name: show fms logs
|
||||
if: failure()
|
||||
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owfms
|
||||
|
||||
- name: show prov logs
|
||||
if: failure()
|
||||
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owprov
|
||||
|
||||
- name: show sec logs
|
||||
if: failure()
|
||||
run: kubectl -n openwifi-${{ steps.reservation.outputs.identifier }} logs deployment/owsec
|
||||
|
||||
- name: upload Allure results as artifact
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-results
|
||||
name: allure-results-${{ matrix.ap_model }}
|
||||
path: allure-results
|
||||
|
||||
- name: cleanup
|
||||
@@ -531,6 +584,101 @@ jobs:
|
||||
if: always()
|
||||
run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }}
|
||||
|
||||
report:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ test, vars, generate-matrix ]
|
||||
if: always()
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
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.ap_model }}
|
||||
path: allure-results
|
||||
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: get reports branch
|
||||
uses: actions/checkout@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: reports
|
||||
|
||||
- name: copy history into results
|
||||
run: |
|
||||
if [ -e "reports/sanity/${{ matrix.ap_model }}/latest" ] ; then
|
||||
cp -r reports/sanity/${{ matrix.ap_model }}/latest/history/ allure-results/history
|
||||
fi
|
||||
- name: add report metadata
|
||||
run: |
|
||||
cat << EOF >> allure-results/environment.properties
|
||||
Ap.Model=${{ matrix.ap_model }}
|
||||
Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD)
|
||||
CiRun.Id=${{ github.run_id }}
|
||||
CiRun.Number=${{ github.run_number }}
|
||||
CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
|
||||
EOF
|
||||
- name: generate Allure report
|
||||
run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report-${{ matrix.ap_model }}
|
||||
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
|
||||
|
||||
- name: copy new report
|
||||
run: |
|
||||
mkdir -p reports/sanity/${{ matrix.ap_model }}
|
||||
cp -Tr allure-report reports/sanity/${{ matrix.ap_model }}/${{ github.run_number }}
|
||||
|
||||
- name: update latest symlink
|
||||
working-directory: reports/sanity/${{ matrix.ap_model }}
|
||||
run: ln -fns ${{ github.run_number }} latest
|
||||
|
||||
- name: generate new index.html
|
||||
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
|
||||
|
||||
- name: commit reports update
|
||||
working-directory: reports
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "Automated deployment: $(date -u)"
|
||||
|
||||
- name: push
|
||||
if: github.ref == 'refs/heads/master' && needs.vars.outputs.marker_expression == 'uc_sanity'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
- name: upload to S3
|
||||
if: github.ref == 'refs/heads/master' && needs.vars.outputs.marker_expression == 'uc_sanity'
|
||||
uses: ./wlan-testing/.github/actions/allure-report-to-s3
|
||||
with:
|
||||
test_type: sanity
|
||||
testbed: ${{ matrix.ap_model }}
|
||||
report_path: allure-report
|
||||
s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }}
|
||||
s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }}
|
||||
|
||||
cleanup:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -93,6 +93,7 @@ jobs:
|
||||
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
export CERT_LOCATION=cert.pem
|
||||
export KEY_LOCATION=key.pem
|
||||
export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }}
|
||||
./deploy.sh
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
|
||||
17
.github/workflows/uc_interop.yml
vendored
17
.github/workflows/uc_interop.yml
vendored
@@ -91,6 +91,7 @@ jobs:
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
|
||||
- name: calculate marker expression
|
||||
@@ -119,10 +120,20 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
@@ -139,6 +150,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
|
||||
242
.github/workflows/uc_sanity.yml
vendored
242
.github/workflows/uc_sanity.yml
vendored
@@ -31,8 +31,6 @@ on:
|
||||
default: 'uc_sanity'
|
||||
description: 'Markers expression that will be passed to the pytest command.'
|
||||
required: false
|
||||
schedule:
|
||||
- cron: '30 20 * * *'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -67,85 +65,6 @@ jobs:
|
||||
- name: push docker image
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
|
||||
deploy-controller:
|
||||
name: Deploy OpenWIFI Cloud SDK
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
gateway_url: ${{ steps.gateway_url.outputs.value }}
|
||||
sec_url: ${{ steps.sec_url.outputs.value }}
|
||||
namespace: ${{ steps.namespace.outputs.value }}
|
||||
steps:
|
||||
- name: Checkout repo with Helm values
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Prepare certificates from secrets
|
||||
working-directory: wlan-testing/helm/ucentral
|
||||
run: |
|
||||
echo "${{ secrets.DIGICERT_CERT }}" | base64 -d > cert.pem
|
||||
echo "${{ secrets.DIGICERT_KEY }}" | base64 -d > key.pem
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Set namespace output
|
||||
id: namespace
|
||||
run: echo "::set-output name=value::openwifi-${{ github.run_id }}"
|
||||
|
||||
- name: Set gateway URL output
|
||||
id: gateway_url
|
||||
run: echo "::set-output name=value::gw-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Set sec service URL output
|
||||
id: sec_url
|
||||
run: echo "::set-output name=value::sec-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Deploy OpenWIFI Cloud SDK
|
||||
working-directory: wlan-testing/helm/ucentral
|
||||
run: |
|
||||
export NAMESPACE=${{ github.run_id }}
|
||||
export DEPLOY_METHOD=git
|
||||
export CHART_VERSION=v2.2.0-RC1
|
||||
export OWGW_VERSION=v2.2.0-RC1
|
||||
export OWGWUI_VERSION=v2.2.0-RC1
|
||||
export OWSEC_VERSION=v2.2.0-RC1
|
||||
export OWFMS_VERSION=v2.2.0-RC1
|
||||
export OWPROV_VERSION=main
|
||||
export OWPROVUI_VERSION=main
|
||||
export VALUES_FILE_LOCATION=values.ucentral-qa.yaml
|
||||
export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }}
|
||||
export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }}
|
||||
export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }}
|
||||
export OWFMS_S3_SECRET=${{ secrets.UCENTRALFMS_S3_SECRET }}
|
||||
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
export CERT_LOCATION=cert.pem
|
||||
export KEY_LOCATION=key.pem
|
||||
./deploy.sh
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl get pods --namespace openwifi-${{ github.run_id }}
|
||||
kubectl get services --namespace openwifi-${{ github.run_id }}
|
||||
kubectl get persistentvolumeclaims --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe pods on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe pods --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe services on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe services --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe persistentvolumeclaims on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe persistentvolumeclaims --namespace openwifi-${{ github.run_id }}
|
||||
|
||||
- name: wait for DNS to propagate
|
||||
run: sleep 900
|
||||
|
||||
generate-matrix:
|
||||
name: generate testbed matrix
|
||||
runs-on: ubuntu-latest
|
||||
@@ -160,70 +79,9 @@ jobs:
|
||||
TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})')
|
||||
echo "::set-output name=matrix::{\"include\":${TESTBEDS}}"
|
||||
|
||||
set-redirector-url:
|
||||
needs: [ deploy-controller, generate-matrix ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
path: wlan-testing
|
||||
ref: WIFI-3620
|
||||
|
||||
- name: checkout pki cert scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
path: wlan-pki-cert-scripts
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y python3-pip
|
||||
pip install paramiko scp allure-pytest
|
||||
|
||||
- name: create configuration.py file
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
|
||||
- name: set redirector URL
|
||||
env:
|
||||
DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
|
||||
run: |
|
||||
for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3)
|
||||
do
|
||||
./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id "${{ needs.deploy-controller.outputs.gateway_url }}"
|
||||
done
|
||||
|
||||
- name: factory reset APs
|
||||
run: |
|
||||
set -x
|
||||
AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3)
|
||||
for index in $(seq 0 $AP_LEN)
|
||||
do
|
||||
HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3)
|
||||
JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3)
|
||||
TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3)
|
||||
PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3)
|
||||
USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3)
|
||||
PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3)
|
||||
|
||||
cd wlan-testing/tools
|
||||
python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r"
|
||||
cd ../..
|
||||
done
|
||||
|
||||
- name: wait for APs to come up again
|
||||
run: sleep 300
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build, generate-matrix, deploy-controller, set-redirector-url ]
|
||||
needs: [ build, generate-matrix ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
@@ -251,8 +109,7 @@ jobs:
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
sed -i -r "s/'url': ('|\").*('|\")/'url': 'https:\/\/${{ needs.deploy-controller.outputs.sec_url }}:16001'/" configuration.py
|
||||
cat configuration.py
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
- name: run sanity tests
|
||||
run: |
|
||||
@@ -263,10 +120,20 @@ jobs:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
@@ -283,6 +150,12 @@ jobs:
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
@@ -297,7 +170,7 @@ jobs:
|
||||
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 --timeout=600s
|
||||
kubectl logs -f $podname &
|
||||
#sleep 30 # wait for the pod to come up
|
||||
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
@@ -423,80 +296,3 @@ jobs:
|
||||
steps:
|
||||
- name: cleanup Docker image
|
||||
run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"
|
||||
|
||||
destroy-controller:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Checkout repo with Helm values
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Delete namespace
|
||||
run: kubectl delete ns --ignore-not-found=true "openwifi-${{ github.run_id }}"
|
||||
|
||||
reset-redirector-url:
|
||||
needs: [ test, generate-matrix ]
|
||||
if: always()
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
path: wlan-testing
|
||||
ref: WIFI-3620
|
||||
|
||||
- name: checkout pki cert scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
path: wlan-pki-cert-scripts
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip install paramiko scp allure-pytest
|
||||
|
||||
- name: create configuration.py file
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
|
||||
- name: reset redirector URL
|
||||
env:
|
||||
DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
|
||||
run: |
|
||||
for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3)
|
||||
do
|
||||
./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id gw-qa01.cicd.lab.wlan.tip.build
|
||||
done
|
||||
|
||||
- name: factory reset APs
|
||||
run: |
|
||||
AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3)
|
||||
for index in $(seq 0 $AP_LEN)
|
||||
do
|
||||
HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3)
|
||||
JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3)
|
||||
TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3)
|
||||
PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3)
|
||||
USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3)
|
||||
PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3)
|
||||
|
||||
cd wlan-testing/tools
|
||||
python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r"
|
||||
cd ../..
|
||||
done
|
||||
|
||||
- name: wait for APs to come up again
|
||||
run: sleep 300
|
||||
|
||||
524
.github/workflows/uc_sanity_dynamic.yml
vendored
Normal file
524
.github/workflows/uc_sanity_dynamic.yml
vendored
Normal file
@@ -0,0 +1,524 @@
|
||||
name: 2.x sanity testing in dynamic environment
|
||||
env:
|
||||
# thirdparties
|
||||
DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io
|
||||
DOCKER_USER_NAME: wlan-testing-cicd
|
||||
DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }}
|
||||
# AWS credentials
|
||||
AWS_EKS_NAME: tip-wlan-main
|
||||
AWS_DEFAULT_OUTPUT: json
|
||||
AWS_DEFAULT_REGION: us-east-2
|
||||
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }}
|
||||
# Cloud SDK certs
|
||||
CACERT: ${{ secrets.CACERT }}
|
||||
CAKEY: ${{ secrets.CAKEY }}
|
||||
ALLURE_CLI_VERSION: 2.14.0
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
testbeds:
|
||||
default: 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08'
|
||||
description: 'Testbed(s) to test'
|
||||
required: false
|
||||
marker_expression:
|
||||
default: 'uc_sanity'
|
||||
description: 'Markers expression that will be passed to the pytest command.'
|
||||
required: false
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# checkout needed repositories
|
||||
- name: Checkout Testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Checkout LANforge scripts
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-lanforge-scripts
|
||||
repository: Telecominfraproject/wlan-lanforge-scripts
|
||||
|
||||
- name: import LANforge scripts
|
||||
working-directory: wlan-testing
|
||||
run: ./sync_repos.bash
|
||||
|
||||
# build and push docker image
|
||||
- name: docker login
|
||||
run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }}
|
||||
- name: build docker image
|
||||
working-directory: wlan-testing
|
||||
run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile .
|
||||
- name: push docker image
|
||||
run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
|
||||
deploy-controller:
|
||||
name: Deploy OpenWIFI Cloud SDK
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
gateway_url: ${{ steps.gateway_url.outputs.value }}
|
||||
sec_url: ${{ steps.sec_url.outputs.value }}
|
||||
namespace: ${{ steps.namespace.outputs.value }}
|
||||
steps:
|
||||
- name: Checkout repo with Helm values
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Prepare certificates from secrets
|
||||
working-directory: wlan-testing/helm/ucentral
|
||||
run: |
|
||||
echo "${{ secrets.DIGICERT_CERT }}" | base64 -d > cert.pem
|
||||
echo "${{ secrets.DIGICERT_KEY }}" | base64 -d > key.pem
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Set namespace output
|
||||
id: namespace
|
||||
run: echo "::set-output name=value::openwifi-${{ github.run_id }}"
|
||||
|
||||
- name: Set gateway URL output
|
||||
id: gateway_url
|
||||
run: echo "::set-output name=value::gw-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Set sec service URL output
|
||||
id: sec_url
|
||||
run: echo "::set-output name=value::sec-${{ github.run_id }}.cicd.lab.wlan.tip.build"
|
||||
|
||||
- name: Deploy OpenWIFI Cloud SDK
|
||||
working-directory: wlan-testing/helm/ucentral
|
||||
run: |
|
||||
export NAMESPACE=${{ github.run_id }}
|
||||
export DEPLOY_METHOD=git
|
||||
export CHART_VERSION=main
|
||||
export OWGW_VERSION=master
|
||||
export OWGWUI_VERSION=main
|
||||
export OWSEC_VERSION=main
|
||||
export OWFMS_VERSION=main
|
||||
export OWPROV_VERSION=main
|
||||
export OWPROVUI_VERSION=main
|
||||
export VALUES_FILE_LOCATION=values.ucentral-qa.yaml
|
||||
export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }}
|
||||
export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }}
|
||||
export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }}
|
||||
export OWFMS_S3_SECRET=${{ secrets.UCENTRALFMS_S3_SECRET }}
|
||||
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
export CERT_LOCATION=cert.pem
|
||||
export KEY_LOCATION=key.pem
|
||||
export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }}
|
||||
./deploy.sh
|
||||
|
||||
- name: wait for DNS to propagate
|
||||
run: sleep 300
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl get pods --namespace openwifi-${{ github.run_id }}
|
||||
kubectl get services --namespace openwifi-${{ github.run_id }}
|
||||
kubectl get persistentvolumeclaims --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe pods on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe pods --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe services on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe services --namespace openwifi-${{ github.run_id }}
|
||||
- name: Describe persistentvolumeclaims on deployment failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl describe persistentvolumeclaims --namespace openwifi-${{ github.run_id }}
|
||||
|
||||
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,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' }}"
|
||||
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}}"
|
||||
|
||||
set-redirector-url:
|
||||
needs: [ deploy-controller, generate-matrix ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
path: wlan-testing
|
||||
ref: WIFI-3620
|
||||
|
||||
- name: checkout pki cert scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
path: wlan-pki-cert-scripts
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get install -y python3-pip
|
||||
pip install paramiko scp allure-pytest
|
||||
|
||||
- name: create configuration.py file
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
|
||||
- name: set redirector URL
|
||||
env:
|
||||
DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
|
||||
run: |
|
||||
for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3)
|
||||
do
|
||||
./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id "${{ needs.deploy-controller.outputs.gateway_url }}"
|
||||
current_redirector=$(./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id)
|
||||
if [[ "$current_redirector" != "${{ needs.deploy-controller.outputs.gateway_url }}" ]]; then
|
||||
echo "Current redirector in DigiCert ($current_redirector) is different from the required one (${{ needs.deploy-controller.outputs.gateway_url }})"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: factory reset APs
|
||||
run: |
|
||||
set -x
|
||||
AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3)
|
||||
for index in $(seq 0 $AP_LEN)
|
||||
do
|
||||
HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3)
|
||||
JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3)
|
||||
TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3)
|
||||
PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3)
|
||||
USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3)
|
||||
PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3)
|
||||
|
||||
cd wlan-testing/tools
|
||||
python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r"
|
||||
cd ../..
|
||||
done
|
||||
|
||||
- name: wait for APs to come up again
|
||||
run: sleep 300
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build, generate-matrix, deploy-controller, set-redirector-url ]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- name: get EKS access credentials
|
||||
run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: install Allure CLI tool
|
||||
run: |
|
||||
wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz
|
||||
- name: set job name
|
||||
id: job
|
||||
run: echo "::set-output name=name::testing-${{ github.run_number }}"
|
||||
|
||||
- name: prepare namespace
|
||||
id: namespace
|
||||
run: |
|
||||
NAMESPACE="testing-${{ github.run_id }}-${{ matrix.testbed }}"
|
||||
kubectl create ns $NAMESPACE
|
||||
kubectl config set-context --current --namespace=$NAMESPACE
|
||||
echo "::set-output name=name::${NAMESPACE}"
|
||||
- name: create configuration.py secret
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
sed -i -r "s/'url': ('|\").*('|\")/'url': 'https:\/\/${{ needs.deploy-controller.outputs.sec_url }}:16001'/" configuration.py
|
||||
sed -i -r "s/'password': ('|\")openwifi('|\")/'password': '"${{ secrets.OWSEC_NEW_PASSWORD }}"'/" configuration.py
|
||||
cat configuration.py
|
||||
kubectl create secret generic configuration --from-file=configuration=./configuration.py
|
||||
- name: run sanity tests
|
||||
run: |
|
||||
cat <<EOF | kubectl apply -f -
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: "${{ steps.job.outputs.name }}"
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
spec:
|
||||
containers:
|
||||
- name: tests
|
||||
image: ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }}
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -x
|
||||
- -c
|
||||
- |
|
||||
cd tests
|
||||
pytest -m "${{ github.event.inputs.marker_expression || 'uc_sanity' }}" -s -vvv --testbed="${{ matrix.testbed }}" --alluredir=/tmp/allure-results
|
||||
ret=\$?
|
||||
# sleep some time to be able to download the Allure results
|
||||
sleep 60
|
||||
exit \$ret
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: "/wlan-testing/tests/configuration.py"
|
||||
subPath: configuration
|
||||
readOnly: true
|
||||
nodeSelector:
|
||||
env: tests
|
||||
tolerations:
|
||||
- key: "tests"
|
||||
operator: "Exists"
|
||||
effect: "NoSchedule"
|
||||
imagePullSecrets:
|
||||
- name: tip-docker-registry-key
|
||||
restartPolicy: Never
|
||||
volumes:
|
||||
- name: configuration
|
||||
secret:
|
||||
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 --timeout=600s
|
||||
kubectl logs -f $podname &
|
||||
#sleep 30 # wait for the pod to come up
|
||||
until [ -s test_everything.xml ]
|
||||
do
|
||||
sleep 10
|
||||
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 }}
|
||||
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 ]
|
||||
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-${{ matrix.testbed }}
|
||||
path: allure-results
|
||||
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: get reports branch
|
||||
uses: actions/checkout@v2
|
||||
continue-on-error: true
|
||||
with:
|
||||
ref: gh-pages
|
||||
path: reports
|
||||
|
||||
- name: copy history into results
|
||||
run: |
|
||||
if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then
|
||||
cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history
|
||||
fi
|
||||
|
||||
- name: add report metadata
|
||||
run: |
|
||||
cat << EOF >> allure-results/environment.properties
|
||||
Testbed=${{ matrix.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
|
||||
|
||||
- name: upload Allure report as artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: allure-report-${{ matrix.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
|
||||
|
||||
- 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 }}
|
||||
run: ln -fns ${{ github.run_number }} latest
|
||||
|
||||
- name: generate new index.html
|
||||
run: python wlan-testing/.github/tools/generate_directory_index.py -r reports
|
||||
|
||||
- name: commit reports update
|
||||
working-directory: reports
|
||||
run: |
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -m "Automated deployment: $(date -u)"
|
||||
|
||||
- name: push
|
||||
if: github.ref == 'refs/heads/master'
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: gh-pages
|
||||
directory: reports
|
||||
|
||||
delete-docker-image:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: cleanup Docker image
|
||||
run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}"
|
||||
|
||||
destroy-controller:
|
||||
needs: [ test ]
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
- name: Checkout repo with Helm values
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: wlan-testing
|
||||
|
||||
- name: Fetch kubeconfig
|
||||
run: |
|
||||
aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }}
|
||||
|
||||
- name: Delete namespace
|
||||
run: kubectl delete ns --ignore-not-found=true "openwifi-${{ github.run_id }}"
|
||||
|
||||
reset-redirector-url:
|
||||
needs: [ test, generate-matrix ]
|
||||
if: always()
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }}
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: checkout testing repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-testing
|
||||
path: wlan-testing
|
||||
ref: WIFI-3620
|
||||
|
||||
- name: checkout pki cert scripts repo
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: Telecominfraproject/wlan-pki-cert-scripts
|
||||
path: wlan-pki-cert-scripts
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
pip install paramiko scp allure-pytest
|
||||
|
||||
- name: create configuration.py file
|
||||
run: |
|
||||
cat << EOF > configuration.py
|
||||
${{ secrets.LAB_CONFIGURATION }}
|
||||
EOF
|
||||
|
||||
- name: reset redirector URL
|
||||
env:
|
||||
DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }}
|
||||
run: |
|
||||
for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3)
|
||||
do
|
||||
./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id gw-qa01.cicd.lab.wlan.tip.build
|
||||
current_redirector=$(./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id)
|
||||
if [[ "$current_redirector" != "gw-qa01.cicd.lab.wlan.tip.build" ]]; then
|
||||
echo "Current redirector in DigiCert ($current_redirector) is different from the required one (gw-qa01.cicd.lab.wlan.tip.build)"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: factory reset APs
|
||||
run: |
|
||||
AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3)
|
||||
for index in $(seq 0 $AP_LEN)
|
||||
do
|
||||
HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3)
|
||||
JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3)
|
||||
TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3)
|
||||
PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3)
|
||||
USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3)
|
||||
PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3)
|
||||
|
||||
cd wlan-testing/tools
|
||||
python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r"
|
||||
cd ../..
|
||||
done
|
||||
|
||||
- name: wait for APs to come up again
|
||||
run: sleep 300
|
||||
11
.github/workflows/ucentralgw-dev-deployment.yaml
vendored
11
.github/workflows/ucentralgw-dev-deployment.yaml
vendored
@@ -31,12 +31,12 @@ env:
|
||||
{
|
||||
"namespace": "dev01",
|
||||
"deploy_method": "git",
|
||||
"chart_version": "main",
|
||||
"owgw_version": "master",
|
||||
"owsec_version": "main",
|
||||
"owfms_version": "main",
|
||||
"chart_version": "v2.4.0-RC3",
|
||||
"owgw_version": "v2.4.0-RC3",
|
||||
"owsec_version": "v2.4.0-RC2",
|
||||
"owfms_version": "v2.4.0-RC2",
|
||||
"owprov_version": "main",
|
||||
"owgwui_version": "main",
|
||||
"owgwui_version": "v2.4.0-RC2",
|
||||
"owprovui_version": "main"
|
||||
}
|
||||
]'
|
||||
@@ -100,6 +100,7 @@ jobs:
|
||||
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
export CERT_LOCATION=cert.pem
|
||||
export KEY_LOCATION=key.pem
|
||||
export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }}
|
||||
./deploy.sh
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
|
||||
11
.github/workflows/ucentralgw-qa-deployment.yaml
vendored
11
.github/workflows/ucentralgw-qa-deployment.yaml
vendored
@@ -31,12 +31,12 @@ env:
|
||||
{
|
||||
"namespace": "qa01",
|
||||
"deploy_method": "git",
|
||||
"chart_version": "main",
|
||||
"owgw_version": "master",
|
||||
"owsec_version": "main",
|
||||
"owfms_version": "main",
|
||||
"chart_version": "v2.4.0-RC3",
|
||||
"owgw_version": "v2.4.0-RC3",
|
||||
"owsec_version": "v2.4.0-RC2",
|
||||
"owfms_version": "v2.4.0-RC2",
|
||||
"owprov_version": "main",
|
||||
"owgwui_version": "main",
|
||||
"owgwui_version": "v2.4.0-RC2",
|
||||
"owprovui_version": "main"
|
||||
}
|
||||
]'
|
||||
@@ -100,6 +100,7 @@ jobs:
|
||||
export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }}
|
||||
export CERT_LOCATION=cert.pem
|
||||
export KEY_LOCATION=key.pem
|
||||
export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }}
|
||||
./deploy.sh
|
||||
|
||||
- name: Show resource state on deployment failure
|
||||
|
||||
2
.github/workflows/update-badges.yml
vendored
2
.github/workflows/update-badges.yml
vendored
@@ -48,7 +48,7 @@ jobs:
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add .
|
||||
git commit -m "Updating test count badges: $(date -u)"
|
||||
git diff-index --quiet HEAD || git commit -m "Updating test count badges: $(date -u)"
|
||||
|
||||
- name: push changes
|
||||
uses: ad-m/github-push-action@v0.6.0
|
||||
|
||||
@@ -3,7 +3,7 @@ import time
|
||||
|
||||
from cloudshell.api.cloudshell_api import CloudShellAPISession
|
||||
|
||||
TIMEOUT=1200
|
||||
TIMEOUT=3600
|
||||
|
||||
def get_session() -> CloudShellAPISession:
|
||||
url = os.environ['CLOUDSHELL_URL']
|
||||
|
||||
@@ -5,6 +5,17 @@ from cloudshell.api.cloudshell_api import UpdateTopologyGlobalInputsRequest, Upd
|
||||
|
||||
from common import get_session
|
||||
|
||||
def get_attribute_value(cloudshell_session, attribute):
|
||||
if attribute.Type == 'Boolean':
|
||||
return True if attribute.Value == 'True' else False
|
||||
elif attribute.Type == 'Numeric':
|
||||
return int(attribute.Value)
|
||||
elif attribute.Type == 'Password':
|
||||
return cloudshell_session.DecryptPassword(attribute.Value).Value
|
||||
else:
|
||||
return attribute.Value
|
||||
|
||||
|
||||
def main():
|
||||
session = get_session()
|
||||
res_id = sys.argv[1]
|
||||
@@ -26,7 +37,7 @@ def main():
|
||||
config['controller']['url'] = f'https://sec-{res_id.split("-")[0]}.cicd.lab.wlan.tip.build:16001'
|
||||
config['controller']['username'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.User')
|
||||
#config['controller']['password'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.Password')
|
||||
config['controller']['password'] = 'openwifi'
|
||||
config['controller']['password'] = 'OpenWifi%123'
|
||||
|
||||
for resource in resources_in_reservation:
|
||||
if resource.ResourceModelName == 'ApV2':
|
||||
@@ -38,14 +49,7 @@ def main():
|
||||
key = 'username' if key == 'uname' else key
|
||||
key = 'password' if key == 'passkey' else key
|
||||
|
||||
if attribute.Type == 'Boolean':
|
||||
value = True if attribute.Value == 'True' else False
|
||||
elif attribute.Type == 'Numeric':
|
||||
value = int(attribute.Value)
|
||||
else:
|
||||
value = attribute.Value
|
||||
|
||||
ap_config[key] = value
|
||||
ap_config[key] = get_attribute_value(session, attribute)
|
||||
|
||||
config['access_point'].append(ap_config)
|
||||
|
||||
@@ -55,14 +59,7 @@ def main():
|
||||
for attribute in details.ResourceAttributes:
|
||||
key = attribute.Name.replace(f"{resource.ResourceModelName}.", '')
|
||||
|
||||
if attribute.Type == 'Boolean':
|
||||
value = True if attribute.Value == 'True' else False
|
||||
elif attribute.Type == 'Numeric':
|
||||
value = int(attribute.Value)
|
||||
else:
|
||||
value = attribute.Value
|
||||
|
||||
tf_config[key] = value
|
||||
tf_config[key] = get_attribute_value(session, attribute)
|
||||
|
||||
config['traffic_generator'] = {
|
||||
'name': 'lanforge',
|
||||
|
||||
4
docker-compose/openwifi/Dockerfile
Normal file
4
docker-compose/openwifi/Dockerfile
Normal file
@@ -0,0 +1,4 @@
|
||||
FROM docker/compose:latest
|
||||
RUN apk add git
|
||||
COPY deploy.sh deploy.sh
|
||||
ENTRYPOINT ["./deploy.sh"]
|
||||
126
docker-compose/openwifi/deploy.sh
Executable file
126
docker-compose/openwifi/deploy.sh
Executable file
@@ -0,0 +1,126 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Usage function
|
||||
usage () {
|
||||
echo;
|
||||
echo "This script is intended for OpenWifi deployment using Docker Compose (https://github.com/Telecominfraproject/wlan-cloud-ucentral-deploy/tree/main/docker-compose) in a Kubernetes pod";
|
||||
echo;
|
||||
echo "Required environment variables:"
|
||||
echo;
|
||||
echo "- DEPLOY_VERSION - version of the wlan-cloud-ucentral-deploy repo to be used";
|
||||
echo;
|
||||
echo "- DEFAULT_UCENTRALSEC_URL - public URL of the OWSec service"
|
||||
echo "- SYSTEM_URI_UI - public URL of the OWGW-UI service"
|
||||
echo "- RTTY_TOKEN - token to be used for rttys and OWGW for remote tty sessions"
|
||||
echo;
|
||||
echo "- INTERNAL_OWGW_HOSTNAME - OWGW microservice hostname for Docker internal communication"
|
||||
echo "- INTERNAL_OWSEC_HOSTNAME - OWSec microservice hostname for Docker internal communication"
|
||||
echo "- INTERNAL_OWFMS_HOSTNAME - OWFms microservice hostname for Docker internal communication"
|
||||
echo "- INTERNAL_OWPROV_HOSTNAME - OWProv microservice hostname for Docker internal communication"
|
||||
echo;
|
||||
echo "- OWGW_FILEUPLOADER_HOST_NAME - hostname to be used for OWGW fileupload";
|
||||
echo "- OWGW_FILEUPLOADER_URI - URL to be used for OWGW fileupload";
|
||||
echo "- OWGW_SYSTEM_URI_PRIVATE - private URL to be used for OWGW";
|
||||
echo "- OWGW_SYSTEM_URI_PUBLIC - public URL to be used for OWGW";
|
||||
echo "- OWGW_RTTY_SERVER - public hostname of the RTTY server";
|
||||
echo "- OWGW_RTTY_TOKEN - token to be used for rttys and OWGW for remote tty sessions";
|
||||
echo;
|
||||
echo "- OWSEC_SYSTEM_URI_PRIVATE - private URL to be used for OWSec";
|
||||
echo "- OWSEC_SYSTEM_URI_PUBLIC - public URL to be used for OWSec";
|
||||
echo "- OWSEC_AUTHENTICATION_DEFAULT_USERNAME - username to be used for requests to OWSec";
|
||||
echo "- OWSEC_AUTHENTICATION_DEFAULT_PASSWORD - hashed password for OWSec (details on this may be found in https://github.com/Telecominfraproject/wlan-cloud-ucentralsec/#authenticationdefaultpassword)";
|
||||
echo;
|
||||
echo "- OWFMS_SYSTEM_URI_PRIVATE - private URL to be used for OWFms";
|
||||
echo "- OWFMS_SYSTEM_URI_PUBLIC - public URL to be used for OWFms";
|
||||
echo "- OWFMS_S3_SECRET - secret key that is used for OWFms access to firmwares S3 bucket";
|
||||
echo "- OWFMS_S3_KEY - access key that is used for OWFms access to firmwares S3 bucket";
|
||||
echo;
|
||||
echo "- OWPROV_SYSTEM_URI_PRIVATE - private URL to be used for OWProv";
|
||||
echo "- OWPROV_SYSTEM_URI_PUBLIC - public URL to be used for OWProv";
|
||||
echo;
|
||||
echo "- WEBSOCKET_CERT - path to the websocket certificate";
|
||||
echo "- WEBSOCKET_KEY - path to the websocket key";
|
||||
}
|
||||
|
||||
# Check if required environment variables were passed
|
||||
## Deployment specifics
|
||||
[ -z ${DEPLOY_VERSION+x} ] && echo "DEPLOY_VERSION is unset" && usage && exit 1
|
||||
## Configuration variables applying to multiple microservices
|
||||
[ -z ${DEFAULT_UCENTRALSEC_URL+x} ] && echo "DEFAULT_UCENTRALSEC_URL is unset" && usage && exit 1
|
||||
[ -z ${SYSTEM_URI_UI+x} ] && echo "SYSTEM_URI_UI is unset" && usage && exit 1
|
||||
[ -z ${RTTY_TOKEN+x} ] && echo "RTTY_TOKEN is unset" && usage && exit 1
|
||||
## Internal microservice hostnames
|
||||
[ -z ${INTERNAL_OWGW_HOSTNAME+x} ] && echo "INTERNAL_OWGW_HOSTNAME is unset" && usage && exit 1
|
||||
[ -z ${INTERNAL_OWSEC_HOSTNAME+x} ] && echo "INTERNAL_OWSEC_HOSTNAME is unset" && usage && exit 1
|
||||
[ -z ${INTERNAL_OWFMS_HOSTNAME+x} ] && echo "INTERNAL_OWFMS_HOSTNAME is unset" && usage && exit 1
|
||||
[ -z ${INTERNAL_OWPROV_HOSTNAME+x} ] && echo "INTERNAL_OWPROV_HOSTNAME is unset" && usage && exit 1
|
||||
## OWGW configuration variables
|
||||
[ -z ${OWGW_FILEUPLOADER_HOST_NAME+x} ] && echo "OWGW_FILEUPLOADER_HOST_NAME is unset" && usage && exit 1
|
||||
[ -z ${OWGW_FILEUPLOADER_URI+x} ] && echo "OWGW_FILEUPLOADER_URI is unset" && usage && exit 1
|
||||
[ -z ${OWGW_SYSTEM_URI_PRIVATE+x} ] && echo "OWGW_SYSTEM_URI_PRIVATE is unset" && usage && exit 1
|
||||
[ -z ${OWGW_SYSTEM_URI_PUBLIC+x} ] && echo "OWGW_SYSTEM_URI_PUBLIC is unset" && usage && exit 1
|
||||
[ -z ${OWGW_RTTY_SERVER+x} ] && echo "OWGW_RTTY_SERVER is unset" && usage && exit 1
|
||||
## OWSec configuration variables
|
||||
[ -z ${OWSEC_AUTHENTICATION_DEFAULT_USERNAME+x} ] && echo "OWSEC_AUTHENTICATION_DEFAULT_USERNAME is unset" && usage && exit 1
|
||||
[ -z ${OWSEC_AUTHENTICATION_DEFAULT_PASSWORD+x} ] && echo "OWSEC_AUTHENTICATION_DEFAULT_PASSWORD is unset" && usage && exit 1
|
||||
[ -z ${OWSEC_SYSTEM_URI_PRIVATE+x} ] && echo "OWSEC_SYSTEM_URI_PRIVATE is unset" && usage && exit 1
|
||||
[ -z ${OWSEC_SYSTEM_URI_PUBLIC+x} ] && echo "OWSEC_SYSTEM_URI_PUBLIC is unset" && usage && exit 1
|
||||
## OWFms configuration variables
|
||||
[ -z ${OWFMS_SYSTEM_URI_PRIVATE+x} ] && echo "OWFMS_SYSTEM_URI_PRIVATE is unset" && usage && exit 1
|
||||
[ -z ${OWFMS_SYSTEM_URI_PUBLIC+x} ] && echo "OWFMS_SYSTEM_URI_PUBLIC is unset" && usage && exit 1
|
||||
[ -z ${OWFMS_S3_SECRET+x} ] && echo "OWFMS_S3_SECRET is unset" && usage && exit 1
|
||||
[ -z ${OWFMS_S3_KEY+x} ] && echo "OWFMS_S3_KEY is unset" && usage && exit 1
|
||||
## OWProv configuration variables
|
||||
[ -z ${OWPROV_SYSTEM_URI_PRIVATE+x} ] && echo "OWPROV_SYSTEM_URI_PRIVATE is unset" && usage && exit 1
|
||||
[ -z ${OWPROV_SYSTEM_URI_PUBLIC+x} ] && echo "OWPROV_SYSTEM_URI_PUBLIC is unset" && usage && exit 1
|
||||
## cert related variables
|
||||
[ -z ${WEBSOCKET_CERT+x} ] && echo "WEBSOCKET_CERT is unset" && usage && exit 1
|
||||
[ -z ${WEBSOCKET_KEY+x} ] && echo "WEBSOCKET_KEY is unset" && usage && exit 1
|
||||
|
||||
# Clone repo and copy certificates
|
||||
mkdir wlan-cloud-ucentral-deploy-tmp
|
||||
git clone --branch $DEPLOY_VERSION https://github.com/Telecominfraproject/wlan-cloud-ucentral-deploy.git /wlan-cloud-ucentral-deploy-tmp
|
||||
mv -f /wlan-cloud-ucentral-deploy-tmp/* /wlan-cloud-ucentral-deploy/ && rm -r wlan-cloud-ucentral-deploy-tmp
|
||||
cd wlan-cloud-ucentral-deploy/docker-compose
|
||||
|
||||
# Search and replace variable values in env files
|
||||
sed -i "s~\(^INTERNAL_OWGW_HOSTNAME=\).*~\1$INTERNAL_OWGW_HOSTNAME~" .env
|
||||
sed -i "s~\(^INTERNAL_OWSEC_HOSTNAME=\).*~\1$INTERNAL_OWSEC_HOSTNAME~" .env
|
||||
sed -i "s~\(^INTERNAL_OWFMS_HOSTNAME=\).*~\1$INTERNAL_OWFMS_HOSTNAME~" .env
|
||||
sed -i "s~\(^INTERNAL_OWPROV_HOSTNAME=\).*~\1$INTERNAL_OWPROV_HOSTNAME~" .env
|
||||
|
||||
sed -i "s~\(^FILEUPLOADER_HOST_NAME=\).*~\1$OWGW_FILEUPLOADER_HOST_NAME~" owgw.env
|
||||
sed -i "s~\(^FILEUPLOADER_URI=\).*~\1$OWGW_FILEUPLOADER_URI~" owgw.env
|
||||
sed -i "s~\(^SYSTEM_URI_PRIVATE=\).*~\1$OWGW_SYSTEM_URI_PRIVATE~" owgw.env
|
||||
sed -i "s~\(^SYSTEM_URI_PUBLIC=\).*~\1$OWGW_SYSTEM_URI_PUBLIC~" owgw.env
|
||||
sed -i "s~\(^SYSTEM_URI_UI=\).*~\1$SYSTEM_URI_UI~" owgw.env
|
||||
sed -i "s~\(^RTTY_SERVER=\).*~\1$OWGW_RTTY_SERVER~" owgw.env
|
||||
sed -i "s~.*RTTY_TOKEN=.*~RTTY_TOKEN=$RTTY_TOKEN~" owgw.env
|
||||
|
||||
sed -i "s~\(^DEFAULT_UCENTRALSEC_URL=\).*~\1$DEFAULT_UCENTRALSEC_URL~" owgw-ui.env
|
||||
|
||||
sed -i "s~.*AUTHENTICATION_DEFAULT_USERNAME=.*~AUTHENTICATION_DEFAULT_USERNAME=$OWSEC_AUTHENTICATION_DEFAULT_USERNAME~" owsec.env
|
||||
sed -i "s~.*AUTHENTICATION_DEFAULT_PASSWORD=.*~AUTHENTICATION_DEFAULT_PASSWORD=$OWSEC_AUTHENTICATION_DEFAULT_PASSWORD~" owsec.env
|
||||
sed -i "s~\(^SYSTEM_URI_PRIVATE=\).*~\1$OWSEC_SYSTEM_URI_PRIVATE~" owsec.env
|
||||
sed -i "s~\(^SYSTEM_URI_PUBLIC=\).*~\1$OWSEC_SYSTEM_URI_PUBLIC~" owsec.env
|
||||
sed -i "s~\(^SYSTEM_URI_UI=\).*~\1$SYSTEM_URI_UI~" owsec.env
|
||||
|
||||
sed -i "s~\(^SYSTEM_URI_PRIVATE=\).*~\1$OWFMS_SYSTEM_URI_PRIVATE~" owfms.env
|
||||
sed -i "s~\(^SYSTEM_URI_PUBLIC=\).*~\1$OWFMS_SYSTEM_URI_PUBLIC~" owfms.env
|
||||
sed -i "s~\(^SYSTEM_URI_UI=\).*~\1$SYSTEM_URI_UI~" owfms.env
|
||||
sed -i "s~\(^S3_SECRET=\).*~\1$OWFMS_S3_SECRET~" owfms.env
|
||||
sed -i "s~\(^S3_KEY=\).*~\1$OWFMS_S3_KEY~" owfms.env
|
||||
|
||||
sed -i "s~\(^SYSTEM_URI_PRIVATE=\).*~\1$OWPROV_SYSTEM_URI_PRIVATE~" owprov.env
|
||||
sed -i "s~\(^SYSTEM_URI_PUBLIC=\).*~\1$OWPROV_SYSTEM_URI_PUBLIC~" owprov.env
|
||||
sed -i "s~\(^SYSTEM_URI_UI=\).*~\1$SYSTEM_URI_UI~" owprov.env
|
||||
|
||||
sed -i "s~\(^DEFAULT_UCENTRALSEC_URL=\).*~\1$DEFAULT_UCENTRALSEC_URL~" owprov-ui.env
|
||||
|
||||
sed -i "s~\(^token:\).*~\1 $RTTY_TOKEN~" rttys/rttys.conf
|
||||
|
||||
# Run the deployment and attach to logs
|
||||
cat $WEBSOCKET_CERT > certs/websocket-cert.pem
|
||||
cat $WEBSOCKET_KEY > certs/websocket-key.pem
|
||||
exec docker-compose up --attach-dependencies
|
||||
@@ -25,6 +25,7 @@ usage () {
|
||||
echo "- OWGW_AUTH_PASSWORD - hashed password for OpenWIFI Security (details on this may be found in https://github.com/Telecominfraproject/wlan-cloud-ucentralsec/#authenticationdefaultpassword)";
|
||||
echo "- OWFMS_S3_SECRET - secret key that is used for OpenWIFI Firmware access to firmwares S3 bucket";
|
||||
echo "- OWFMS_S3_KEY - access key that is used for OpenWIFI Firmware access to firmwares S3 bucket";
|
||||
echo "- OWSEC_NEW_PASSWORD - password that should be set to default user instead of default password from properties";
|
||||
echo "- CERT_LOCATION - path to certificate in PEM format that will be used for securing all endpoint in all services";
|
||||
echo "- KEY_LOCATION - path to private key in PEM format that will be used for securing all endpoint in all services";
|
||||
}
|
||||
@@ -48,6 +49,7 @@ usage () {
|
||||
[ -z ${OWGW_AUTH_PASSWORD+x} ] && echo "OWGW_AUTH_PASSWORD is unset" && usage && exit 1
|
||||
[ -z ${OWFMS_S3_SECRET+x} ] && echo "OWFMS_S3_SECRET is unset" && usage && exit 1
|
||||
[ -z ${OWFMS_S3_KEY+x} ] && echo "OWFMS_S3_KEY is unset" && usage && exit 1
|
||||
[ -z ${OWSEC_NEW_PASSWORD+x} ] && echo "OWSEC_NEW_PASSWORD is unset" && usage && exit 1
|
||||
[ -z ${CERT_LOCATION+x} ] && echo "CERT_LOCATION is unset" && usage && exit 1
|
||||
[ -z ${KEY_LOCATION+x} ] && echo "KEY_LOCATION is unset" && usage && exit 1
|
||||
|
||||
@@ -90,7 +92,7 @@ else
|
||||
fi
|
||||
|
||||
# Run the deployment
|
||||
helm upgrade --install --create-namespace --wait --timeout 20m \
|
||||
helm upgrade --install --create-namespace --wait --timeout 60m \
|
||||
--namespace openwifi-${NAMESPACE} \
|
||||
-f $VALUES_FILE_LOCATION \
|
||||
--set owgw.configProperties."rtty\.token"=${RTTY_TOKEN} \
|
||||
@@ -127,6 +129,8 @@ helm upgrade --install --create-namespace --wait --timeout 20m \
|
||||
--set owprovui.ingresses.default.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=provui-${NAMESPACE}.cicd.lab.wlan.tip.build \
|
||||
--set owprovui.ingresses.default.hosts={provui-${NAMESPACE}.cicd.lab.wlan.tip.build} \
|
||||
--set owprovui.public_env_variables.DEFAULT_UCENTRALSEC_URL=https://sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \
|
||||
--set clustersysteminfo.public_env_variables.OWSEC=sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \
|
||||
--set clustersysteminfo.secret_env_variables.OWSEC_NEW_PASSWORD=${OWSEC_NEW_PASSWORD} \
|
||||
--set-file owgw.certs."restapi-cert\.pem"=$CERT_LOCATION \
|
||||
--set-file owgw.certs."restapi-key\.pem"=$KEY_LOCATION \
|
||||
--set-file owgw.certs."websocket-cert\.pem"=$CERT_LOCATION \
|
||||
|
||||
@@ -9,6 +9,7 @@ owgw:
|
||||
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: "16002,16003,17002"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
configProperties:
|
||||
# -> Public part
|
||||
@@ -19,8 +20,28 @@ owgw:
|
||||
storage.type.postgresql.host: owgw-pgsql
|
||||
storage.type.postgresql.database: owgw
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
|
||||
securityContext:
|
||||
sysctls:
|
||||
- name: net.ipv4.tcp_keepalive_intvl
|
||||
value: "5"
|
||||
- name: net.ipv4.tcp_keepalive_probes
|
||||
value: "2"
|
||||
- name: net.ipv4.tcp_keepalive_time
|
||||
value: "45"
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
podSecurityPolicy:
|
||||
enabled: true
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -68,9 +89,18 @@ owsec:
|
||||
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: "16001,17001"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 15Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -110,6 +140,18 @@ rttys:
|
||||
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: "5912,5913"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 15Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
owgwui:
|
||||
services:
|
||||
@@ -126,6 +168,7 @@ owgwui:
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}'
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
paths:
|
||||
- path: /*
|
||||
serviceName: owgwui
|
||||
@@ -134,6 +177,17 @@ owgwui:
|
||||
public_env_variables:
|
||||
ALLOW_UCENTRALSEC_CHANGE: false
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
owfms:
|
||||
services:
|
||||
owfms:
|
||||
@@ -145,9 +199,18 @@ owfms:
|
||||
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"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
limits:
|
||||
cpu: 50m
|
||||
memory: 80Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -185,9 +248,18 @@ owprov:
|
||||
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: "16005,17005"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 20Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -229,6 +301,7 @@ owprovui:
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}'
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
paths:
|
||||
- path: /*
|
||||
serviceName: owprovui
|
||||
@@ -237,7 +310,20 @@ owprovui:
|
||||
public_env_variables:
|
||||
ALLOW_UCENTRALSEC_CHANGE: false
|
||||
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 10m
|
||||
# memory: 30m
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 100m
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
kafka:
|
||||
commonAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
heapOpts: -Xmx512m -Xms512m
|
||||
resources:
|
||||
requests:
|
||||
@@ -245,8 +331,14 @@ kafka:
|
||||
memory: 512Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 700Mi
|
||||
memory: 1Gi
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 45
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 60
|
||||
zookeeper:
|
||||
commonAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
heapSize: 256
|
||||
resources:
|
||||
requests:
|
||||
@@ -255,3 +347,6 @@ kafka:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 384Mi
|
||||
|
||||
clustersysteminfo:
|
||||
enabled: true
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
owgw:
|
||||
# https://telecominfraproject.atlassian.net/browse/WIFI-5840
|
||||
checks:
|
||||
owgw:
|
||||
readiness:
|
||||
exec:
|
||||
command: ["true"]
|
||||
|
||||
services:
|
||||
owgw:
|
||||
type: LoadBalancer
|
||||
@@ -9,15 +16,36 @@ owgw:
|
||||
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: "16002,16003,17002"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
configProperties:
|
||||
# -> Public part
|
||||
# File uploader
|
||||
# rtty
|
||||
rtty.enabled: "true"
|
||||
rtty.enabled: ["true"]
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
|
||||
securityContext:
|
||||
sysctls:
|
||||
- name: net.ipv4.tcp_keepalive_intvl
|
||||
value: "5"
|
||||
- name: net.ipv4.tcp_keepalive_probes
|
||||
value: "2"
|
||||
- name: net.ipv4.tcp_keepalive_time
|
||||
value: "45"
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
podSecurityPolicy:
|
||||
enabled: true
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -45,6 +73,13 @@ owgw:
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
owsec:
|
||||
# https://telecominfraproject.atlassian.net/browse/WIFI-5840
|
||||
checks:
|
||||
owsec:
|
||||
readiness:
|
||||
exec:
|
||||
command: ["true"]
|
||||
|
||||
services:
|
||||
owsec:
|
||||
type: LoadBalancer
|
||||
@@ -55,9 +90,18 @@ owsec:
|
||||
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: "16001,17001"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 15Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -97,6 +141,18 @@ rttys:
|
||||
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: "5912,5913"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 15Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
owgwui:
|
||||
services:
|
||||
@@ -113,6 +169,7 @@ owgwui:
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}'
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
paths:
|
||||
- path: /*
|
||||
serviceName: owgwui
|
||||
@@ -121,7 +178,25 @@ owgwui:
|
||||
public_env_variables:
|
||||
ALLOW_UCENTRALSEC_CHANGE: false
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
limits:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
owfms:
|
||||
# https://telecominfraproject.atlassian.net/browse/WIFI-5840
|
||||
checks:
|
||||
owfms:
|
||||
readiness:
|
||||
exec:
|
||||
command: ["true"]
|
||||
|
||||
services:
|
||||
owfms:
|
||||
type: LoadBalancer
|
||||
@@ -132,9 +207,18 @@ owfms:
|
||||
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"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 30Mi
|
||||
limits:
|
||||
cpu: 50m
|
||||
memory: 80Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -162,6 +246,12 @@ owfms:
|
||||
-----END CERTIFICATE-----
|
||||
|
||||
owprov:
|
||||
checks:
|
||||
owprov:
|
||||
readiness:
|
||||
exec:
|
||||
command: ["true"]
|
||||
|
||||
services:
|
||||
owprov:
|
||||
type: LoadBalancer
|
||||
@@ -172,9 +262,18 @@ owprov:
|
||||
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: "16005,17005"
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
|
||||
public_env_variables:
|
||||
READINESS_METHOD: systeminfo
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 20Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
certs:
|
||||
restapi-ca.pem: |
|
||||
@@ -216,6 +315,7 @@ owprovui:
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
|
||||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}'
|
||||
external-dns.alpha.kubernetes.io/ttl: "60"
|
||||
paths:
|
||||
- path: /*
|
||||
serviceName: owprovui
|
||||
@@ -224,7 +324,20 @@ owprovui:
|
||||
public_env_variables:
|
||||
ALLOW_UCENTRALSEC_CHANGE: false
|
||||
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 10m
|
||||
# memory: 30m
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 100m
|
||||
|
||||
podAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
|
||||
kafka:
|
||||
commonAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
heapOpts: -Xmx512m -Xms512m
|
||||
resources:
|
||||
requests:
|
||||
@@ -238,6 +351,8 @@ kafka:
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 60
|
||||
zookeeper:
|
||||
commonAnnotations:
|
||||
cluster-autoscaler.kubernetes.io/safe-to-evict: "false"
|
||||
heapSize: 256
|
||||
resources:
|
||||
requests:
|
||||
@@ -246,3 +361,6 @@ kafka:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 384Mi
|
||||
|
||||
clustersysteminfo:
|
||||
enabled: true
|
||||
|
||||
@@ -337,7 +337,10 @@ class APNOS:
|
||||
active = output.decode('utf-8').splitlines()[4].split(":")[1].replace(" ", "").replace(",", "")
|
||||
client.close()
|
||||
except Exception as e:
|
||||
pytest.exit("ubus call ucentral status: error" + output)
|
||||
if output.__contains__(b'"connected":'):
|
||||
pass
|
||||
else:
|
||||
pytest.exit("ubus call ucentral status: error" + str(output))
|
||||
print(e)
|
||||
connected, latest, active = "Error", "Error", "Error"
|
||||
return connected, latest, active
|
||||
@@ -579,6 +582,24 @@ class APNOS:
|
||||
pass
|
||||
return vlan_list
|
||||
|
||||
def get_ap_uci_show_ucentral(self):
|
||||
try:
|
||||
client = self.ssh_cli_connect()
|
||||
cmd = "uci show ucentral"
|
||||
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()
|
||||
status = output.decode('utf-8').splitlines()
|
||||
for i in status:
|
||||
if i.startswith("ucentral.config.server="):
|
||||
status = i.split("=")[1]
|
||||
client.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
status = "Error"
|
||||
return status
|
||||
|
||||
if __name__ == '__main__':
|
||||
obj = {
|
||||
|
||||
@@ -66,7 +66,7 @@ class ConfigureController:
|
||||
|
||||
class Controller(ConfigureController):
|
||||
"""
|
||||
constructor for cloud_controller_tests library : can be used from pytest framework
|
||||
constructor for cloud_controller_tests library
|
||||
"""
|
||||
|
||||
def __init__(self, controller_data=None, customer_id=None):
|
||||
@@ -275,8 +275,7 @@ class Controller(ConfigureController):
|
||||
|
||||
class ProfileUtility:
|
||||
"""
|
||||
constructor for Access Point Utility library : can be used from pytest framework
|
||||
to control Access Points
|
||||
constructor for Access Point Utility library
|
||||
"""
|
||||
|
||||
def __init__(self, sdk_client=None, controller_data=None, customer_id=None):
|
||||
|
||||
@@ -227,7 +227,7 @@ class FMSUtils:
|
||||
devices = self.get_device_set()
|
||||
model_name = ""
|
||||
for device in devices['deviceTypes']:
|
||||
if str(device).__contains__(model):
|
||||
if str(device).__eq__(model):
|
||||
model_name = device
|
||||
return model_name
|
||||
|
||||
|
||||
@@ -22,12 +22,13 @@ for folder in 'py-json', 'py-scripts':
|
||||
sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../tools')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
from sta_connect2 import StaConnect2
|
||||
import time
|
||||
import string
|
||||
import random
|
||||
|
||||
from scp_util import SCP_File
|
||||
S = 12
|
||||
# from eap_connect import EAPConnect
|
||||
from test_ipv4_ttls import TTLSTest
|
||||
@@ -41,6 +42,8 @@ from lf_ap_auto_test import ApAutoTest
|
||||
from csv_to_influx import CSVtoInflux
|
||||
from influx2 import RecordInflux
|
||||
from lf_multipsk import MultiPsk
|
||||
from lf_rvr_test import RvrTest
|
||||
from attenuator_serial import AttenuatorSerial
|
||||
|
||||
|
||||
class RunTest:
|
||||
@@ -48,6 +51,7 @@ class RunTest:
|
||||
def __init__(self, lanforge_data=None, local_report_path="../reports/", influx_params=None, debug=False):
|
||||
self.lanforge_ip = lanforge_data["ip"]
|
||||
self.lanforge_port = lanforge_data["port"]
|
||||
self.lanforge_ssh_port = lanforge_data["ssh_port"]
|
||||
self.twog_radios = lanforge_data["2.4G-Radio"]
|
||||
self.fiveg_radios = lanforge_data["5G-Radio"]
|
||||
self.ax_radios = lanforge_data["AX-Radio"]
|
||||
@@ -127,6 +131,13 @@ class RunTest:
|
||||
print("test result: " + result)
|
||||
pytest.exit("Test Failed: Debug True")
|
||||
self.staConnect.cleanup()
|
||||
supplicqant = "/home/lanforge/wifi/wpa_supplicant_log_" + self.staConnect.radio.split(".")[2] + ".txt"
|
||||
obj = SCP_File(ip=self.lanforge_ip, port=self.lanforge_ssh_port, username="root", password="lanforge",
|
||||
remote_path=supplicqant,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="wpa_supplicant_log_" + self.staConnect.radio.split(".")[2] + ".txt",
|
||||
name="supplicant_log")
|
||||
for result in run_results:
|
||||
print("test result: " + result)
|
||||
result = True
|
||||
@@ -213,6 +224,13 @@ class RunTest:
|
||||
# print(e)
|
||||
|
||||
self.eap_connect.stop()
|
||||
supplicqant = "/home/lanforge/wifi/wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt"
|
||||
obj = SCP_File(ip=self.lanforge_ip, port=self.lanforge_ssh_port, username="root", password="lanforge",
|
||||
remote_path=supplicqant,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt",
|
||||
name="supplicant_log")
|
||||
if not self.eap_connect.passes():
|
||||
if self.debug:
|
||||
print("test result: " + self.eap_connect.passes())
|
||||
@@ -683,7 +701,7 @@ class RunTest:
|
||||
else:
|
||||
return False
|
||||
|
||||
def Multi_Sta_Thpt(self, ssid_5G="[BLANK]", ssid_2G="[BLANK]", mode="BRIDGE", vlan_id=100, dut_name="TIP",
|
||||
def multi_sta_thpt(self, ssid_5G="[BLANK]", ssid_2G="[BLANK]", mode="BRIDGE", vlan_id=100, dut_name="TIP",
|
||||
raw_line=[], instance_name="test_demo", dut_5g="", dut_2g=""):
|
||||
|
||||
inst_name = instance_name.split('_')[0]
|
||||
@@ -741,12 +759,24 @@ class RunTest:
|
||||
self.msthpt_obj.setup()
|
||||
self.msthpt_obj.run()
|
||||
report_name = self.msthpt_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()
|
||||
influx = CSVtoInflux(influx_host=self.influx_params["influx_host"],
|
||||
influx_port=self.influx_params["influx_port"],
|
||||
influx_org=self.influx_params["influx_org"],
|
||||
influx_token=self.influx_params["influx_token"],
|
||||
influx_bucket=self.influx_params["influx_bucket"],
|
||||
path=report_name)
|
||||
|
||||
influx.glob()
|
||||
return self.msthpt_obj
|
||||
|
||||
def attenuator_serial(self):
|
||||
self.obj = AttenuatorSerial(
|
||||
lfclient_host=self.lanforge_ip,
|
||||
lfclient_port=self.lanforge_port
|
||||
)
|
||||
val = self.obj.show()
|
||||
return val
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
influx_host = "influx.cicd.lab.wlan.tip.build"
|
||||
@@ -763,7 +793,7 @@ if __name__ == '__main__':
|
||||
"influx_tag": ["basic-03", "ec420"],
|
||||
}
|
||||
lanforge_data = {
|
||||
"ip": "192.168.200.80",
|
||||
"ip": "192.168.200.10",
|
||||
"port": 8080,
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["wiphy0"],
|
||||
@@ -777,8 +807,20 @@ if __name__ == '__main__':
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
obj = RunTest(lanforge_data=lanforge_data, debug=False, influx_params=influx_params)
|
||||
obj.Client_Connect(ssid="ssid_wpa_5g_br", passkey="something", security="wpa", station_name=['sta0000'])
|
||||
obj.dataplane(station_name=["sta0000"])
|
||||
upstream = lanforge_data['upstream']
|
||||
data = obj.staConnect.json_get("/port/all")
|
||||
for i in data["interfaces"]:
|
||||
if list(i.keys())[0] == "1.1.eth1.10":
|
||||
print(i)
|
||||
# print(dict(list(data['interfaces'])).keys())
|
||||
# print(obj.staConnect.json_get("/port/" + upstream.split(".")[0] +
|
||||
# "/" + upstream.split(".")[1] +
|
||||
# "/" + upstream.split(".")[2] + "/" + "10"))
|
||||
# print("/port/" + upstream.split(".")[0] +
|
||||
# "/" + upstream.split(".")[1] +
|
||||
# "/" + upstream.split(".")[2] + "/" + "100")
|
||||
# obj.Client_Connect(ssid="ssid_wpa_5g_br", passkey="something", security="wpa", station_name=['sta0000'])
|
||||
# obj.dataplane(station_name=["sta0000"])
|
||||
# a = obj.staConnect.json_get("/events/since/")
|
||||
# print(a)
|
||||
# print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip"))
|
||||
|
||||
@@ -18,7 +18,7 @@ sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity")
|
||||
sys.path.append(f'../libs')
|
||||
sys.path.append(f'../libs/lanforge/')
|
||||
import allure
|
||||
|
||||
from sta_connect2 import StaConnect2
|
||||
from create_chamberview import CreateChamberview
|
||||
from create_chamberview_dut import DUT
|
||||
import time
|
||||
@@ -88,6 +88,7 @@ class ChamberView:
|
||||
self.exit_on_error = False
|
||||
self.dut_idx_mapping = {}
|
||||
self.ssid_list = []
|
||||
self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug)
|
||||
self.raw_line = [
|
||||
["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".")
|
||||
[2] + ",AUTO -1 NA"],
|
||||
@@ -148,6 +149,13 @@ class ChamberView:
|
||||
return self.CreateChamberview, self.scenario_name
|
||||
|
||||
def add_vlan(self, vlan_ids=[]):
|
||||
data = self.staConnect.json_get("/port/all")
|
||||
flag = 0
|
||||
for vlans in vlan_ids:
|
||||
for i in data["interfaces"]:
|
||||
if list(i.keys())[0] != self.upstream_port + "." + str(vlans):
|
||||
flag = 1
|
||||
if flag == 1:
|
||||
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)])
|
||||
@@ -281,7 +289,8 @@ class ChamberView:
|
||||
if df.empty == True:
|
||||
return "empty"
|
||||
else:
|
||||
return df
|
||||
result = df.to_string(index=False)
|
||||
return result
|
||||
|
||||
def attach_report_graphs(self, report_name=None, pdf_name="WIFI Capacity Test PDF Report"):
|
||||
relevant_path = "../reports/" + report_name + "/"
|
||||
|
||||
55
libs/lanforge/scp_util.py
Executable file
55
libs/lanforge/scp_util.py
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
|
||||
import paramiko
|
||||
from scp import SCPClient
|
||||
|
||||
|
||||
class SCP_File:
|
||||
def __init__(self, ip="localhost", port=22, username="lanforge", password="lanforge", remote_path="/home/lanforge/",
|
||||
local_path="."):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.remote_path = remote_path
|
||||
self.local_path = local_path
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def pull_file(self):
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.load_system_host_keys()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(hostname=self.ip, username=self.username, password=self.password, port=self.port, allow_agent=False,
|
||||
look_for_keys=False)
|
||||
# ssh.close()
|
||||
|
||||
with SCPClient(ssh.get_transport()) as scp:
|
||||
scp.get(remote_path=self.remote_path, local_path=self.local_path, recursive=True)
|
||||
scp.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--password', type=str, help='--password to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--remote_path', type=str, help='--password to the given username',
|
||||
default="/home/lanforge/lf_kinstall.pl")
|
||||
parser.add_argument('--local_path', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default=".")
|
||||
args = parser.parse_args()
|
||||
lf_tools = SCP_File(ip=args.host, port=args.port,
|
||||
username=args.username, password=args.password,
|
||||
remote_path=args.remote_path, local_path=args.local_path)
|
||||
lf_tools.pull_file()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -51,6 +51,7 @@ def closeApp(appName, setup_perfectoMobile):
|
||||
setup_perfectoMobile[1].step_start("Closing App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
setup_perfectoMobile[0].execute_script('mobile:application:close', params)
|
||||
print("Closed App")
|
||||
|
||||
def scrollDown(setup_perfectoMobile):
|
||||
print("Scroll Down")
|
||||
@@ -584,7 +585,7 @@ def verifyUploadDownloadSpeed_android(request, setup_perfectoMobile, get_APToMob
|
||||
driver.switch_to.context('WEBVIEW_1')
|
||||
|
||||
try:
|
||||
print("Launching Safari")
|
||||
print("Launching Chrome")
|
||||
report.step_start("Google Home Page")
|
||||
driver.get(connData["webURL"])
|
||||
print("Enter Search Text")
|
||||
@@ -2686,6 +2687,639 @@ def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile,
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
#--------------------CAPTIVE PORTAL Android-----------------------------------------
|
||||
def captive_portal_and(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("-------------------------------------")
|
||||
print("Verifying Wifi Connection Details....")
|
||||
#allure.attach(name= body=str("\n-------------------------------------"))
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
ssid_with_internet = False
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
contexts = driver.contexts
|
||||
driver.switch_to.context(contexts[0])
|
||||
|
||||
# Open Settings Application
|
||||
openApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
deviceModelName = getDeviceModelName(setup_perfectoMobile)
|
||||
print("Selected Device Model: " + deviceModelName)
|
||||
#allure.attach(name= body=str("\Selected Device Model: " + deviceModelName))
|
||||
if deviceModelName != ("Pixel 4"):
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
|
||||
|
||||
# -----------------To Open Connections page-----------------------
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Click Connections")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Connections']")
|
||||
connElement.click()
|
||||
|
||||
|
||||
# ---------------------Open WIFI page-------------------------------
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
print("Clicking WIFI")
|
||||
wifiElement = driver.find_element_by_xpath("//*[@text='Wi-Fi']")
|
||||
wifiElement.click()
|
||||
|
||||
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_text_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
print("get_switch_text: ",get_switch_text)
|
||||
print("Find wifi switch")
|
||||
try: #To Turn on Wi-Fi Switch
|
||||
if get_switch_text == "Off":
|
||||
# driver.implicitly_wait(3)
|
||||
get_switch_element = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
if get_switch_text == "On":
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_text']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
except:
|
||||
pass
|
||||
print("Sleeping for: ", i)
|
||||
time.sleep(i)
|
||||
pass
|
||||
if get_switch_text == "Off":
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
else:
|
||||
print("Switch is already On")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
print("Couldn't turn on WIFI switch")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
|
||||
#---------------------This is to Forget current connected SSID-------------------------------
|
||||
try: #To deal with already connected SSID
|
||||
check_if_no_internet_popup(driver)
|
||||
network_category = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/connected_network_category']")
|
||||
try: #To forget exhisting ssid
|
||||
print("To forget ssid")
|
||||
check_if_no_internet_popup(driver)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/forget_button']//*[@resource-id='com.android.settings:id/icon']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
print("Couldn't get into additional details")
|
||||
except:
|
||||
print("No Connected SSIDS")
|
||||
#----------------------This is to Forget current connected SSID--------------------------------
|
||||
|
||||
|
||||
print("Searching for Wifi: " + WifiName)
|
||||
#allure.attach(name= body=str("Searching for Wifi: " + WifiName))
|
||||
time.sleep(2)
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
ssid_found = False
|
||||
available_ssids = False
|
||||
# This is To get all available ssids
|
||||
# ------------------------------------------------------
|
||||
try:
|
||||
for check_for_all_ssids in range(2):
|
||||
available_ssids = get_all_available_ssids(driver)
|
||||
try:
|
||||
if WifiName not in available_ssids:
|
||||
scrollDown(setup_perfectoMobile)
|
||||
time.sleep(2)
|
||||
else:
|
||||
ssid_found = True
|
||||
print(WifiName + " : Found in Device")
|
||||
#allure.attach(name= body=str(WifiName + " : Found in Device"))
|
||||
break
|
||||
except:
|
||||
print("1538")
|
||||
pass
|
||||
if not ssid_found:
|
||||
print("could not found" + WifiName + " in device")
|
||||
#allure.attach(name= body=str("could not found" + WifiName + " in device"))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
#Selecting WIFI
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
print("Click wifi")
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
#allure.attach(name= body=str("Selecting Wifi: " + WifiName))
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
#allure.attach(name= body=str("Exception on Selecting Wifi Network. Please check wifi Name or signal"))
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
|
||||
#Set password if Needed
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
time.sleep(2)
|
||||
check_if_no_internet_popup(driver)
|
||||
report.step_start("Set Wifi Password")
|
||||
print("Enter Wifi password")
|
||||
wifi_password_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/edittext']")
|
||||
wifi_password_element.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Password Page Not Loaded, password May be cached in the System")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
|
||||
#Click on connect button
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Connect Button")
|
||||
print("Click Connect Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Connect']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print("Connect Button Not Enabled...Verify if Password is set properly ")
|
||||
check_if_no_internet_popup(driver)
|
||||
#---------------------Clicking on ssid for captive portal login--------
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
except NoSuchElementException:
|
||||
print("Not connected to Captive portal Ssid.. ")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Accept Terms Button")
|
||||
print("Click Accept Terms Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Accept Terms of Service']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Accept terms button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Continue Button")
|
||||
print("Click Continue Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Continue']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Continue button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Last Terms if needed")
|
||||
print("Click Last Terms if needed")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Done']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't find the last terms page")
|
||||
|
||||
#Verify if WiFi is connected
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='android:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
#allure.attach(name= body=str("Wifi Successfully Connected"))
|
||||
# time.sleep(5)
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected without internet']/parent::*/android.widget.TextView[@text='"
|
||||
+ WifiName + "']")))
|
||||
print("Wifi Successfully Connected without internet")
|
||||
#allure.attach(name= body=str("Wifi Successfully Connected without internet"))
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 60).until(EC.presence_of_element_located((
|
||||
MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
#allure.attach(name=body=str("Wifi Successfully Connected"))
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + WifiName)
|
||||
#allure.attach(name=body=str("Wifi Connection Error: " + WifiName))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
# Get into Additional Details
|
||||
# To Get an IP Address
|
||||
# To Forget connection
|
||||
# To turn off auto. connect
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
print("Into additional details")
|
||||
time.sleep(2)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/layout_details']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='com.android.settings:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='android:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
print("IP address element not found")
|
||||
# allure.attach(name= body=str("IP address element not found"))
|
||||
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
driver.implicitly_wait(3)
|
||||
time.sleep(2)
|
||||
auto_reconnect_off = driver.find("//*[@resource-id='android:id/switch_widget']")
|
||||
auto_reconnect_off_text = auto_reconnect_off.text
|
||||
if auto_reconnect_off_text != "Off":
|
||||
auto_reconnect_off.click()
|
||||
print("Auto reconnect turning off")
|
||||
else:
|
||||
print("Auto reconnect is already off")
|
||||
except:
|
||||
print("Couldn't find auto reconnect element")
|
||||
except:
|
||||
print("Couldn't get into Additional settings")
|
||||
except NoSuchElementException:
|
||||
print("No Switch element found")
|
||||
#allure.attach(name= body=str("No Switch element found"))
|
||||
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Couldn't find wifi Button")
|
||||
#allure.attach(name= body=str("Couldn't find wifi Button"))
|
||||
# ------------------Open WIFI page----------------------------------
|
||||
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
#allure.attach(name= body=str("Exception: Verify Xpath - Update/check Xpath for Click Connections"))
|
||||
# -----------------To Open Connections page---------------------------
|
||||
# --------------------Pixel 4 code---------------------------
|
||||
else:
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
|
||||
# -----------------To Open Connections page-----------------------
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Click Network & internet in pixel4")
|
||||
connElement = driver.find_element_by_xpath("//*[@text='Network & internet']")
|
||||
connElement.click()
|
||||
|
||||
# ---------------------Open WIFI page-------------------------------
|
||||
try:
|
||||
report.step_start("Clicking Wi-Fi")
|
||||
print("Clicking WIFI")
|
||||
time.sleep(3)
|
||||
wifiElement = WebDriverWait(driver, 10).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='Wi‑Fi']")))
|
||||
wifiElement.click()
|
||||
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
driver.implicitly_wait(1)
|
||||
report.step_start("Turn on WIFi Switch if already OFF")
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='android:id/icon']")
|
||||
get_switch_text = get_switch_text_element.click()
|
||||
if get_switch_text is not None:
|
||||
switch_text = "Off"
|
||||
else:
|
||||
switch_text = "On"
|
||||
|
||||
print("get_switch_text: ", switch_text)
|
||||
print("Find wifi switch")
|
||||
try: # To Turn on Wi-Fi Switch
|
||||
if switch_text == "Off":
|
||||
# driver.implicitly_wait(3)
|
||||
get_switch_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/switch_widget']")
|
||||
driver.implicitly_wait(1)
|
||||
get_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
if switch_text == "On":
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_switch_text_element = driver.find_element_by_xpath(
|
||||
"//*[@text='Add network']")
|
||||
get_switch_text = get_switch_text_element.text
|
||||
if get_switch_text == "Add network":
|
||||
switch_text = "On"
|
||||
else:
|
||||
switch_text = "Off"
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath")
|
||||
# Scroll Down
|
||||
scrollDown(setup_perfectoMobile)
|
||||
print("Sleeping for: ", i)
|
||||
time.sleep(i)
|
||||
pass
|
||||
if switch_text == "Off":
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
else:
|
||||
print("Switch is already On")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
print("Couldn't turn on WIFI switch")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
|
||||
# ---------------------This is to Forget current connected SSID-------------------------------
|
||||
try: # To deal with already connected SSID
|
||||
check_if_no_internet_popup(driver)
|
||||
network_category = driver.find_element_by_xpath("//*[@text='Connected']")
|
||||
try: # To forget existing ssid
|
||||
print("To forget ssid")
|
||||
report.step_start("To forget ssid")
|
||||
check_if_no_internet_popup(driver)
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/settings_button_no_background']")
|
||||
additional_details_element.click()
|
||||
except:
|
||||
print("Couldn't get into additional details")
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
forget_ssid = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/button1']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
except:
|
||||
print("Couldn't forget ssid")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
except:
|
||||
print("No Connected SSIDS")
|
||||
# ----------------------This is to Forget current connected SSID--------------------------------
|
||||
|
||||
# time.sleep(2)
|
||||
# print("Selecting Wifi: " + WifiName)
|
||||
# ssid_found = False
|
||||
# available_ssids = False
|
||||
# This is To get all available ssids
|
||||
# ------------------------------------------------------
|
||||
# try:
|
||||
# for check_for_all_ssids in range(2):
|
||||
# available_ssids = WifiName
|
||||
# try:
|
||||
# if WifiName not in available_ssids:
|
||||
# scrollDown(setup_perfectoMobile)
|
||||
# time.sleep(2)
|
||||
# else:
|
||||
# ssid_found = True
|
||||
# print(WifiName + " : Found in Device")
|
||||
# # allure.attach(name= body=str(WifiName + " : Found in Device"))
|
||||
# break
|
||||
# except:
|
||||
# print("1538")
|
||||
# pass
|
||||
# if not ssid_found:
|
||||
# print("could not found" + WifiName + " in device")
|
||||
# # allure.attach(name= body=str("could not found" + WifiName + " in device"))
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ssid_with_internet
|
||||
# except:
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ssid_with_internet
|
||||
# # -------------------------------------------------------
|
||||
|
||||
# Selecting WIFI
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
print("Click wifi")
|
||||
wifi_selection_element = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifi_selection_element.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
# allure.attach(name= body=str("Selecting Wifi: " + WifiName))
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network")
|
||||
# allure.attach(name= body=str("Exception on Selecting Wifi Network. Please check wifi Name or signal"))
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
# Set password if Needed
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
report.step_start("Set Wifi Password")
|
||||
print("Entering password")
|
||||
wifiPasswordElement = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/password']")
|
||||
wifiPasswordElement.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Password Page Not Loaded, password May be cached in the System")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Click on connect button
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Click Connect Button")
|
||||
joinBTNElement = driver.find_element_by_xpath("//*[@text='Connect']")
|
||||
joinBTNElement.click()
|
||||
except NoSuchElementException:
|
||||
print("Connect Button Not Enabled...Verify if Password is set properly ")
|
||||
check_if_no_internet_popup(driver)
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Selecting Wifi: " + WifiName)
|
||||
wifiSelectionElement = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@text='" + WifiName + "']")))
|
||||
wifiSelectionElement.click()
|
||||
check_if_no_internet_popup(driver)
|
||||
except Exception as e:
|
||||
print("Exception on Selecting Wifi Network. Please check wifi Name or signal")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Accept Terms Button")
|
||||
print("Click Accept Terms Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Accept Terms of Service']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Accept terms button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Continue Button")
|
||||
print("Click Continue Button")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Continue']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't press Continue button")
|
||||
try:
|
||||
time.sleep(2)
|
||||
report.step_start("Click Last Terms if needed")
|
||||
print("Click Last Terms if needed")
|
||||
join_btn_element = driver.find_element_by_xpath("//*[@text='Done']")
|
||||
join_btn_element.click()
|
||||
except NoSuchElementException:
|
||||
print(" Couldn't find the last terms page")
|
||||
|
||||
# Verify if WiFi is connected
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='android:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
# time.sleep(5)
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
check_if_no_internet_popup(driver)
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 35).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected without internet']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
print("Wifi Successfully Connected without internet")
|
||||
check_if_no_internet_popup(driver)
|
||||
except:
|
||||
try:
|
||||
report.step_start("Verify if Wifi is Connected")
|
||||
WifiInternetErrMsg = WebDriverWait(driver, 60).until(
|
||||
EC.presence_of_element_located((
|
||||
MobileBy.XPATH,
|
||||
"//*[@resource-id='com.android.settings:id/summary' and @text='Connected']/parent::*/android.widget.TextView[@text='" + WifiName + "']")))
|
||||
ssid_with_internet = True
|
||||
print("Wifi Successfully Connected")
|
||||
except NoSuchElementException:
|
||||
print("Wifi Connection Error: " + WifiName)
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ssid_with_internet
|
||||
# -------------------------------------------------------
|
||||
|
||||
# Get into Additional Details
|
||||
# To Get an IP Address
|
||||
# To Forget connection
|
||||
# To turn off auto. connect
|
||||
# -------------------------------------------------------
|
||||
try:
|
||||
print("Into additional details")
|
||||
time.sleep(5)
|
||||
report.step_start("Going for ip address")
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/settings_button_no_background']")
|
||||
additional_details_element.click()
|
||||
print("Entered ssid")
|
||||
try:
|
||||
time.sleep(10)
|
||||
print("clicking Advanced")
|
||||
report.step_start("clicking Advanced")
|
||||
advanced_element = driver.find_element_by_xpath("//*[@text='Advanced']")
|
||||
advanced_element.click()
|
||||
print("clicked Advanced")
|
||||
# print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(5)
|
||||
print("clicking Advanced2")
|
||||
advanced_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/recycler_view']/android.widget.FrameLayout[2]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]")
|
||||
advanced_element.click()
|
||||
# print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
try:
|
||||
time.sleep(5)
|
||||
print("clicking Advanced2")
|
||||
advanced_element = driver.find_element_by_xpath(
|
||||
"//*[@resource-id='com.android.settings:id/recycler_view']/android.widget.LinearLayout[5]/android.widget.LinearLayout[1]/android.widget.ImageView[1]")
|
||||
advanced_element.click()
|
||||
except:
|
||||
print("No advanced options")
|
||||
# allure.attach(name= body=str("IP address element not found"))
|
||||
|
||||
# closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
# return ip_address_element_text, ssid_with_internet
|
||||
# Scroll Down
|
||||
scrollDown(setup_perfectoMobile)
|
||||
try:
|
||||
time.sleep(2)
|
||||
ip_address_element = driver.find_element_by_xpath(
|
||||
"//*[@text='IP address']/parent::*/android.widget.TextView[@resource-id='android:id/summary']")
|
||||
ip_address_element_text = ip_address_element.text
|
||||
print("Device IP address is :", ip_address_element_text)
|
||||
except:
|
||||
print("IP address element not found")
|
||||
except:
|
||||
print("Couldn't get into Additional settings")
|
||||
# -------------------------------------------------------
|
||||
except:
|
||||
print("No Switch element found")
|
||||
# ---------------------To Turn on WIFi Switch if already OFF-------------------------------
|
||||
|
||||
except:
|
||||
print("Couldn't find wifi Button")
|
||||
# ------------------Open WIFI page----------------------------------
|
||||
|
||||
except:
|
||||
print("Exception: Verify Xpath - Update/check Xpath for Click Connections")
|
||||
# -----------------To Open Connections page---------------------------
|
||||
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
return ip_address_element_text, ssid_with_internet
|
||||
|
||||
|
||||
def close_driver(driver):
|
||||
driver.close()
|
||||
@@ -2752,3 +3386,4 @@ def expressWifi(request, WifiName, setup_perfectoMobile, connData):
|
||||
print("Exception Verify Results")
|
||||
closeApp(connData["appPackage-android"], setup_perfectoMobile)
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import allure
|
||||
|
||||
|
||||
def openApp(appName, setup_perfectoMobile):
|
||||
# print("Refreshing App: " + appName)
|
||||
setup_perfectoMobile[1].step_start("Opening App: " + appName)
|
||||
params = {'identifier': appName}
|
||||
# Open/Close/Open Action is performed to ensure the app is back to its Original Settings
|
||||
@@ -52,7 +51,6 @@ def closeApp(appName, setup_perfectoMobile):
|
||||
|
||||
|
||||
def rebootPhone(setup_perfectoMobile):
|
||||
# print("Closing App.." + appName)
|
||||
setup_perfectoMobile[1].step_start("Rebooting Phone...")
|
||||
params = {}
|
||||
setup_perfectoMobile[0].execute_script('mobile:handset:reboot', params)
|
||||
@@ -80,7 +78,7 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
|
||||
|
||||
print(WifiNameSSID)
|
||||
report.step_start("Set Wifi Network to " + WifiNameSSID)
|
||||
# Open Settings Application
|
||||
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
@@ -90,13 +88,12 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
|
||||
Wifi_AP_Name = element.text
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - UpdateXpath")
|
||||
# NEED to fail if Wifi AP NAME isn't in the approved list AKA 5g & 2g.
|
||||
# print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
# print("Wifi Name Matches - Already Connected To: " + WifiName)
|
||||
|
||||
|
||||
if Wifi_AP_Name.__eq__(WifiNameSSID):
|
||||
print("Wifi Name Matches - Already Connected To: " + Wifi_AP_Name)
|
||||
|
||||
|
||||
#Verify if Ap is connected with Wifi
|
||||
report.step_start("Verify Wifi Connection Status..")
|
||||
#print("Click Wifi Connection..")
|
||||
@@ -112,7 +109,7 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
|
||||
reportFlag = False
|
||||
assert reportFlag
|
||||
|
||||
# Check AP Internet Error Msg
|
||||
|
||||
print("Checking Internet Connection Error..")
|
||||
report.step_start("Checking Internet Connection Error..")
|
||||
|
||||
@@ -125,7 +122,7 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo
|
||||
|
||||
else:
|
||||
print("Selecting Wifi: " + WifiNameSSID)
|
||||
# consoleOutput+=str(WifiName)+ "\n"
|
||||
|
||||
report.step_start("Selecting Wifi...: " + WifiNameSSID)
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element.click()
|
||||
@@ -194,13 +191,13 @@ def Toggle_AirplaneMode_iOS(request, setup_perfectoMobile, connData):
|
||||
currentResult = False
|
||||
print("Cellular Mode Not in Airplane Mode: ERROR")
|
||||
|
||||
# Set Airplane Mode Back
|
||||
|
||||
AirplaneMode.click()
|
||||
except NoSuchElementException:
|
||||
currentResult = False
|
||||
print("Airplane Wifi Button not loaded...")
|
||||
|
||||
# Verify No Sim Card Installed Msg Popup
|
||||
|
||||
report.step_start("Verify No Sim Card Installed Msg Popup")
|
||||
print("Verify No Sim Card Installed Msg Popup..")
|
||||
try:
|
||||
@@ -208,7 +205,7 @@ def Toggle_AirplaneMode_iOS(request, setup_perfectoMobile, connData):
|
||||
except NoSuchElementException:
|
||||
print("No Sim Card AlertMsg")
|
||||
|
||||
# Click ok on No Sim Card Msg Popup
|
||||
|
||||
print("Click ok on No Sim Card Msg Popup..")
|
||||
report.step_start("Click ok on No Sim Card Msg Popup")
|
||||
try:
|
||||
@@ -237,9 +234,10 @@ def verify_APconnMobileDevice_iOS(request, WifiName, setup_perfectoMobile, connD
|
||||
try:
|
||||
print("Get Connected Wifi Name")
|
||||
report.step_start("Get Connected Wifi Name")
|
||||
element = WebDriverWait(driver, 45).until(EC.presence_of_element_located(
|
||||
(MobileBy.XPATH, "//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")))
|
||||
|
||||
element = WebDriverWait(driver, 45).until(EC.presence_of_element_located((MobileBy.XPATH, "//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")))
|
||||
#element = driver.find_element_by_xpath("")
|
||||
|
||||
element.click()
|
||||
|
||||
except Exception as e:
|
||||
@@ -249,18 +247,14 @@ def verify_APconnMobileDevice_iOS(request, WifiName, setup_perfectoMobile, connD
|
||||
reportFlag = False
|
||||
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)))
|
||||
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)
|
||||
@@ -299,7 +293,7 @@ def ForgetWifiConnection(request, setup_perfectoMobile, wifiName, connData):
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
# print("Verifying Connected Wifi Connection")
|
||||
|
||||
report.step_start("Verifying Existing Connected Wifi Connection")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
Wifi_AP_Name = element.text
|
||||
@@ -381,7 +375,7 @@ def Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData):
|
||||
except NoSuchElementException:
|
||||
print("Wifi Radio Button Not Disabled...")
|
||||
|
||||
# Set Airplane Mode Back
|
||||
|
||||
WifiDissconnected.click()
|
||||
print("Wifi Radio Button Toggled to Enabled")
|
||||
except NoSuchElementException:
|
||||
@@ -389,13 +383,17 @@ def Toggle_WifiMode_iOS(request, setup_perfectoMobile, connData):
|
||||
|
||||
|
||||
def get_WifiIPAddress_iOS(request, setup_perfectoMobile, connData, wifiName):
|
||||
print("\n------------------------------------")
|
||||
print("Get Wifi IP Address IOS")
|
||||
print("--------------------------------------")
|
||||
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
# print("Verifying Connected Wifi Connection")
|
||||
|
||||
report.step_start("Loading Wifi Page")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']/XCUIElementTypeStaticText[2]")
|
||||
element.click()
|
||||
@@ -405,7 +403,7 @@ def get_WifiIPAddress_iOS(request, setup_perfectoMobile, connData, wifiName):
|
||||
report.step_start("Wifi Page")
|
||||
WifiXpath = "//*[@label='selected']/parent::*/parent::*/XCUIElementTypeStaticText[@label='" + wifiName + "']"
|
||||
elementWifName = driver.find_element_by_xpath(WifiXpath)
|
||||
# Check AP Internet Error Msg
|
||||
|
||||
print("Checking Internet Connection Error...")
|
||||
report.step_start("Checking Internet Connection Error..")
|
||||
|
||||
@@ -415,14 +413,17 @@ def get_WifiIPAddress_iOS(request, setup_perfectoMobile, connData, wifiName):
|
||||
print("Wifi Connected without any errors: " + wifiName)
|
||||
|
||||
try:
|
||||
|
||||
WifiInternetInfo=driver.find_element_by_xpath("(//XCUIElementTypeButton[@label='More Info'])[1]")
|
||||
|
||||
WifiInternetInfo.click()
|
||||
except NoSuchElementException:
|
||||
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||
|
||||
try:
|
||||
WifiIPaddress = driver.find_element_by_xpath(
|
||||
"(//*[@label='Router']/parent::*/XCUIElementTypeStaticText)[2]").text
|
||||
|
||||
WifiIPaddress= driver.find_element_by_xpath("(//*[@label='Router']/parent::*/XCUIElementTypeStaticText)[2]").text
|
||||
|
||||
return WifiIPaddress
|
||||
except NoSuchElementException:
|
||||
print("Wifi-AP Connected Successfully: " + wifiName)
|
||||
@@ -462,25 +463,27 @@ def ping_deftapps_iOS(setup_perfectoMobile, AP_IPaddress):
|
||||
print("Verifying Packet Loss..")
|
||||
try:
|
||||
element5 = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='0']")
|
||||
# assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
|
||||
except NoSuchElementException:
|
||||
print("No Packet Loss Detected 1st Attempt")
|
||||
|
||||
report.step_start("Verifying Packet Sent..")
|
||||
print("Verifying Packet Sent..")
|
||||
try:
|
||||
packetSent = driver.find_element_by_xpath(
|
||||
"//XCUIElementTypeStaticText[@label='Sent']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
|
||||
packetSent = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='Sent']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
#assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
|
||||
except NoSuchElementException:
|
||||
print("-------Exception: Packet Sent Error, check object ID")
|
||||
|
||||
report.step_start("Verifying Packet Received..")
|
||||
print("Verifying Packet Received..")
|
||||
try:
|
||||
packetReceived = driver.find_element_by_xpath(
|
||||
"//XCUIElementTypeStaticText[@label='Received']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
|
||||
packetReceived = driver.find_element_by_xpath("//XCUIElementTypeStaticText[@label='Received']/parent::*/XCUIElementTypeStaticText[2]").text
|
||||
#assertEqual(element5.text, "0", "Packet Loss Exist, Please Check Device")
|
||||
|
||||
except NoSuchElementException:
|
||||
print("-------Exception: Packet Sent Error, check object ID")
|
||||
|
||||
@@ -490,8 +493,9 @@ def ping_deftapps_iOS(setup_perfectoMobile, AP_IPaddress):
|
||||
print("Verifying No route to host Error Msg....")
|
||||
report.step_start("Verifying No route to host Error Msg..")
|
||||
try:
|
||||
element7 = driver.find_element_by_xpath(
|
||||
"(//XCUIElementTypeStaticText[@label='Sendto: No route to host'])[2]")
|
||||
|
||||
element7 = driver.find_element_by_xpath("(//XCUIElementTypeStaticText[@label='Sendto: No route to host'])[2]")
|
||||
|
||||
print("Packet Loss Detected on AP!!!!!: " + AP_IPaddress)
|
||||
# self.assertNotEqual(element7.text, "Sendto: No route to host", "Packet Loss Exist, Please Check Device AP: " + Wifi_AP_Name)
|
||||
except NoSuchElementException:
|
||||
@@ -516,12 +520,15 @@ def tearDown(setup_perfectoMobile):
|
||||
driver.close()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To close --")
|
||||
|
||||
print (e)
|
||||
|
||||
finally:
|
||||
try:
|
||||
driver.quit()
|
||||
except Exception as e:
|
||||
print(" -- Exception Not Able To Quit --")
|
||||
|
||||
print (e)
|
||||
|
||||
|
||||
@@ -627,7 +634,7 @@ def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfect
|
||||
except TimeoutException:
|
||||
print("no alert")
|
||||
|
||||
# Open Settings Application
|
||||
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
@@ -666,8 +673,9 @@ def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfect
|
||||
try:
|
||||
print("Verify Profile Installed")
|
||||
report.step_start("Verify Profile Installed")
|
||||
elelSearch2 = WebDriverWait(driver, 30).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Profile Installed']")))
|
||||
|
||||
elelSearch2 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Profile Installed']")))
|
||||
|
||||
elelSearch2.click()
|
||||
except Exception as e:
|
||||
print("Profile Installed Message Error")
|
||||
@@ -700,6 +708,8 @@ def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfect
|
||||
# openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
|
||||
|
||||
|
||||
# try:
|
||||
# print("Verifying OpenRoaming Connected Wifi")
|
||||
# time.sleep(3)
|
||||
@@ -714,6 +724,12 @@ def downloadInstallOpenRoamingProfile(request, profileDownloadURL, setup_perfect
|
||||
# request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
# assert False
|
||||
|
||||
# except Exception as e:
|
||||
# OpenRoamingWifiName = "None"
|
||||
# print("Wifi Not Connected to OpenRoaming Profile: ")
|
||||
# request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
# assert False
|
||||
|
||||
|
||||
# try:
|
||||
# report.step_start("Verify Wifi Connected Status")
|
||||
@@ -766,9 +782,11 @@ def ForgetProfileWifiConnection(request, setup_perfectoMobile, installedProfileS
|
||||
|
||||
if Wifi_AP_Name.__eq__("Not Connected"):
|
||||
print("Not Connected to any wifi")
|
||||
|
||||
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
elif Wifi_AP_Name.__eq__("None"):
|
||||
#deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
|
||||
print("Not Connected to any wifi Network/None")
|
||||
elif Wifi_AP_Name.__eq__(installedProfileSSID):
|
||||
deleteOpenRoamingInstalledProfile(request, installedProfileSSID, setup_perfectoMobile, connData)
|
||||
@@ -881,7 +899,7 @@ def deleteOpenRoamingInstalledProfile(request, profileName, setup_perfectoMobile
|
||||
# To get an IP address
|
||||
def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("Select Wifi/Get IP Address IOS Connection")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
@@ -1153,6 +1171,10 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa
|
||||
|
||||
# //XCUIElementTypeOther[2]/XCUIElementTypeOther[1]/XCUIElementTypeStaticText
|
||||
def get_all_available_ssids(driver):
|
||||
print("\n----------------------------")
|
||||
print("Get All Available SSID")
|
||||
print("------------------------------")
|
||||
|
||||
active_ssid_list = []
|
||||
try:
|
||||
time.sleep(8)
|
||||
@@ -1171,7 +1193,7 @@ def get_all_available_ssids(driver):
|
||||
# Connect to WIFI
|
||||
def wifi_connect(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("Select Wifi Connect Connection")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
@@ -1441,7 +1463,7 @@ def expressWifi(request, setup_perfectoMobile, connData):
|
||||
# To disconnect and forget network
|
||||
def wifi_disconnect_and_forget(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("Wifi Disconnect and Forget Connection")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
@@ -1592,7 +1614,7 @@ def wifi_disconnect_and_forget(request, WifiName, WifiPass, setup_perfectoMobile
|
||||
# To get an IP address
|
||||
def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("Get IP Address Enterprise IOS Connection")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
@@ -1894,7 +1916,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM
|
||||
|
||||
def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("Select Wifi/AccessPoint Connection")
|
||||
print("Wifi Connect Enterprise Connection")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
@@ -2104,4 +2126,263 @@ def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile,
|
||||
# --------------------- close app-------------------------------
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
return is_internet
|
||||
|
||||
# ---------------------close app-------------------------------
|
||||
|
||||
#Captive Portal
|
||||
def captive_portal_ios(request, WifiName, WifiPass, setup_perfectoMobile, connData):
|
||||
print("\n-------------------------------------")
|
||||
print("CaptivePortal Connection IOS")
|
||||
print("-------------------------------------")
|
||||
|
||||
reportFlag = True
|
||||
is_internet = False
|
||||
ip_address_element_text = False
|
||||
|
||||
print("Verifying Wifi/AP Connection Details....")
|
||||
report = setup_perfectoMobile[1]
|
||||
driver = setup_perfectoMobile[0]
|
||||
|
||||
report.step_start("Switching Driver Context")
|
||||
print("Switching Context to Native")
|
||||
driver.switch_to.context('NATIVE_APP')
|
||||
# driver.switch_to.context(contexts[0])
|
||||
|
||||
report.step_start("Set Wifi Network to " + WifiName)
|
||||
# Open Settings Application
|
||||
openApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
|
||||
try:
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
try:
|
||||
print("Verifying Connected Wifi Connection")
|
||||
report.step_start("Loading Wifi Page")
|
||||
element = driver.find_element_by_xpath("//XCUIElementTypeCell[@name='Wi-Fi']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Verify Xpath - unable to click on Wifi")
|
||||
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
try:
|
||||
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
|
||||
get_wifi_switch_element_text = get_wifi_switch_element.text
|
||||
try:
|
||||
if get_wifi_switch_element_text == "0" or get_wifi_switch_element_text == 0:
|
||||
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']")
|
||||
driver.implicitly_wait(1)
|
||||
get_wifi_switch_element.click()
|
||||
driver.implicitly_wait(1)
|
||||
i = 0
|
||||
for i in range(5):
|
||||
try:
|
||||
get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='1']")
|
||||
get_wifi_switch_element_text = get_wifi_switch_element.text
|
||||
except:
|
||||
print("switch is OFF")
|
||||
|
||||
if get_wifi_switch_element_text == "1" or get_wifi_switch_element_text == 1:
|
||||
print("WIFI Switch is ON")
|
||||
break
|
||||
else:
|
||||
try:
|
||||
get_wifi_switch_element = driver.find_element_by_xpath(
|
||||
"//*[@label='Wi-Fi' and @value='0']")
|
||||
get_wifi_switch_element_text = get_wifi_switch_element.text
|
||||
except:
|
||||
print("WIFi switch is ON")
|
||||
if (get_wifi_switch_element_text == "0" or get_wifi_switch_element_text == 0):
|
||||
print("switch is still OFF")
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
#return is_internet
|
||||
else:
|
||||
print("Switch is Still OFF")
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
#return is_internet
|
||||
except:
|
||||
print("No switch element found")
|
||||
except:
|
||||
print("get_wifi_switch_element is ON")
|
||||
# --------------------To Turn on WIFi Switch if already OFF--------------------------------
|
||||
|
||||
except:
|
||||
print("Cannot find WIFI element")
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
#return is_internet
|
||||
|
||||
# ---------------------This is to Forget current connected SSID-------------------------------
|
||||
|
||||
try:
|
||||
print("getting in to Additional details")
|
||||
additional_details_element = driver.find_element_by_xpath(
|
||||
"//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']")
|
||||
additional_details_element.click()
|
||||
try:
|
||||
print("Forget Connected Network")
|
||||
forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']")
|
||||
forget_ssid.click()
|
||||
print("Forget old ssid")
|
||||
try:
|
||||
report.step_start("Forget SSID popup1")
|
||||
forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']")
|
||||
forget_ssid_popup.click()
|
||||
|
||||
print("**alert** Forget SSID popup killed **alert**")
|
||||
except:
|
||||
print("Forget SSID popup not found")
|
||||
except:
|
||||
print("couldn't find forget ssid element")
|
||||
except:
|
||||
print("No connected SSID")
|
||||
|
||||
# ---------------------This is to Forget current connected SSID-------------------------------
|
||||
|
||||
# ---------------------To get all available SSID-------------------------------
|
||||
print("Searching for Wifi: " + WifiName)
|
||||
# allure.attach(name= body=str("Searching for Wifi: " + WifiName))
|
||||
time.sleep(2)
|
||||
print("Selecting Wifi: " + WifiName)
|
||||
ssid_found = False
|
||||
available_ssids = False
|
||||
|
||||
try:
|
||||
for check_for_all_ssids in range(2):
|
||||
available_ssids = get_all_available_ssids(driver)
|
||||
try:
|
||||
if WifiName not in available_ssids:
|
||||
scrollDown(setup_perfectoMobile)
|
||||
time.sleep(2)
|
||||
else:
|
||||
ssid_found = True
|
||||
print(WifiName + " : Found in Device")
|
||||
# allure.attach(name= body=str(WifiName + " : Found in Device"))
|
||||
break
|
||||
except:
|
||||
pass
|
||||
|
||||
if not ssid_found:
|
||||
print("could not found " + WifiName + " in device")
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
return is_internet
|
||||
except:
|
||||
pass
|
||||
# ---------------------To get all available SSID-------------------------------
|
||||
|
||||
# ---------------------This is to Select SSID-------------------------------
|
||||
try:
|
||||
wifiSelectionElement = WebDriverWait(driver, 30).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']")))
|
||||
wifiSelectionElement.click()
|
||||
print("Selecting SSID")
|
||||
except Exception as e:
|
||||
print("couldn't connect to " + WifiName)
|
||||
request.config.cache.set(key="SelectingWifiFailed", value=str(e))
|
||||
closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
return is_internet
|
||||
# ---------------------This is to Select SSID-------------------------------
|
||||
|
||||
# ---------------------Set Password-------------------------------
|
||||
try:
|
||||
wifiPassword = driver.find_element_by_xpath("//*[@label='Password']")
|
||||
wifiPassword.send_keys(WifiPass)
|
||||
except NoSuchElementException:
|
||||
print("Enter Password Page Not Loaded")
|
||||
# ---------------------Set Password-------------------------------
|
||||
|
||||
# ---------------------Click on join-------------------------------
|
||||
try:
|
||||
joinBTN = driver.find_element_by_xpath("//*[@label='Join']")
|
||||
joinBTN.click()
|
||||
except Exception as e:
|
||||
print("Join Button Not Enabled...Password may not be needed")
|
||||
# ---------------------Click on join-------------------------------
|
||||
|
||||
try:
|
||||
time.sleep(4)
|
||||
driver.implicitly_wait(4)
|
||||
try:
|
||||
time.sleep(8)
|
||||
driver.implicitly_wait(2)
|
||||
print("Acceptiong terms and Services")
|
||||
report.step_start("loading Terms Page")
|
||||
element = driver.find_element_by_xpath("//*[@label='Accept Terms of Service']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Accept Terms of Service Button Not Found")
|
||||
reportFlag = False
|
||||
assert reportFlag
|
||||
try:
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
print("Continue to connect the services")
|
||||
report.step_start("Continiue Terms and Services Page")
|
||||
element = driver.find_element_by_xpath("//*[@label='Continue']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Continue to connect Terms of Service Button Not Found")
|
||||
try:
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
print("Continue to the services")
|
||||
report.step_start("Continue to use captive portal services")
|
||||
element = driver.find_element_by_xpath("//*[@label='Continue']")
|
||||
element.click()
|
||||
except NoSuchElementException:
|
||||
print("Exception: Continue to use captive portal services not found")
|
||||
try:
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
print("Final Result Page")
|
||||
report.step_start("Final Confirmation Page for Captive Portal Login")
|
||||
time.sleep(2)
|
||||
driver.implicitly_wait(2)
|
||||
element = driver.find_element_by_xpath("//*[@label='Done']")
|
||||
element.click()
|
||||
# if element == driver.find_element_by_xpath("//XCUIElementTypeOther[@label='Success']"):
|
||||
# element1 = driver.find_element_by_xpath("//*[@label='Done']")
|
||||
# element1.click()
|
||||
# else:
|
||||
# print("Failed to log in to captive portal")
|
||||
except NoSuchElementException:
|
||||
print("Exception: final Page for Captive Portal Not Found")
|
||||
|
||||
|
||||
except NoSuchElementException:
|
||||
print("No Splash Page Found")
|
||||
|
||||
|
||||
# ---------------------Additional INFO-------------------------------
|
||||
try:
|
||||
time.sleep(4)
|
||||
print("Selecting SSID: ",WifiName)
|
||||
report.step_start("Selecting SSID")
|
||||
additional_details_element = WebDriverWait(driver, 30).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH,
|
||||
"//*[@label='"+ WifiName+"']")))
|
||||
# //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']
|
||||
additional_details_element.click()
|
||||
|
||||
try:
|
||||
print("Checking IP address")
|
||||
# (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2]
|
||||
ip_address_element_text = driver.find_element_by_xpath("(//*[@label='IP Address']/parent::*/XCUIElementTypeStaticText)[2]").text
|
||||
print("ip_address_element_text: ", ip_address_element_text)
|
||||
# is_internet=True
|
||||
except Exception as e:
|
||||
print("IP Address not Found")
|
||||
request.config.cache.set(key="select IP failed", value=str(e))
|
||||
try:
|
||||
WifiInternetErrMsg2 = WebDriverWait(driver, 30).until(
|
||||
EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']")))
|
||||
except Exception as e:
|
||||
is_internet = True
|
||||
print("No Wifi-AP Error Internet Error: " + WifiName)
|
||||
except Exception as e:
|
||||
request.config.cache.set(key="select additional info failed", value=str(e))
|
||||
# ---------------------Additional INFO-------------------------------
|
||||
|
||||
# --------------------- close app-------------------------------
|
||||
#closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile)
|
||||
return ip_address_element_text, is_internet
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
allure-pytest
|
||||
Appium-Python-Client
|
||||
Appium-Python-Client==1.2.0
|
||||
bs4
|
||||
influxdb
|
||||
influxdb-client
|
||||
|
||||
@@ -343,7 +343,7 @@ CONFIGURATION = {
|
||||
}
|
||||
}
|
||||
}, # checked
|
||||
"advanced-02": {
|
||||
"advanced-01": {
|
||||
"controller": {
|
||||
'url':'https://sec-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
|
||||
'username': "tip@ucentral.com",
|
||||
@@ -353,7 +353,7 @@ CONFIGURATION = {
|
||||
{
|
||||
'model': 'eap102',
|
||||
'mode': 'wifi6',
|
||||
'serial': '903cb39d6958',
|
||||
'serial': '903cb3bd7335',
|
||||
'jumphost': True,
|
||||
'ip': "10.28.3.102", # 10.28.3.103
|
||||
'username': "lanforge",
|
||||
@@ -366,13 +366,52 @@ CONFIGURATION = {
|
||||
"traffic_generator": {
|
||||
"name": "lanforge",
|
||||
"details": {
|
||||
"ip": "10.28.3.26",
|
||||
"ip": "10.28.3.24",
|
||||
"port": 8080, # 8080
|
||||
"ssh_port": 22,
|
||||
"2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2","1.1.wiphy4"],
|
||||
"5G-Radio": ["1.1.wiphy1", "1.1.wiphy3", "1.1.wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth2",
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
"5G-Station-Name": "wlan0",
|
||||
"AX-Station-Name": "ax"
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
"advanced-02": {
|
||||
"controller": {
|
||||
'url':'https://sec-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller
|
||||
'username': "tip@ucentral.com",
|
||||
'password': 'openwifi',
|
||||
},
|
||||
'access_point': [
|
||||
{
|
||||
'model': 'eap102',
|
||||
'mode': 'wifi6',
|
||||
'serial': '903cb39d6958',
|
||||
'jumphost': True,
|
||||
'ip': "10.28.3.102", # 10.28.3.102
|
||||
'username': "lanforge",
|
||||
'password': "pumpkin77",
|
||||
'port': 8803, # 22
|
||||
'jumphost_tty': '/dev/ttyAP3',
|
||||
'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": "10.28.3.26", # 10.28.3.26
|
||||
"port": 8802, # 8080
|
||||
"ssh_port": 8804,
|
||||
"2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2","1.1.wiphy4"],
|
||||
"5G-Radio": ["1.1.wiphy1", "1.1.wiphy3", "1.1.wiphy5"],
|
||||
"AX-Radio": [],
|
||||
"upstream": "1.1.eth1",
|
||||
"upstream_subnet": "10.28.2.1/24",
|
||||
"uplink": "1.1.eth3",
|
||||
"2.4G-Station-Name": "wlan0",
|
||||
|
||||
@@ -42,7 +42,6 @@ from LANforge.LFUtils import *
|
||||
if 'py-json' not in sys.path:
|
||||
sys.path.append('../py-scripts')
|
||||
from apnos.apnos import APNOS
|
||||
from controller.controller_1x.controller import Controller
|
||||
from controller.controller_1x.controller import FirmwareUtility
|
||||
import pytest
|
||||
from lanforge.lf_tests import RunTest
|
||||
@@ -50,11 +49,10 @@ from cv_test_manager import cv_test
|
||||
from configuration import CONFIGURATION
|
||||
from configuration import RADIUS_SERVER_DATA
|
||||
from configuration import RADIUS_ACCOUNTING_DATA
|
||||
|
||||
from lanforge.scp_util import SCP_File
|
||||
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
|
||||
|
||||
@@ -97,6 +95,13 @@ def pytest_addoption(parser):
|
||||
help="skip updating firmware on the AP (useful for local testing)"
|
||||
)
|
||||
|
||||
parser.addoption(
|
||||
"--skip-lanforge",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="skip to do any interactions on lanforge (to be used in case of interop)"
|
||||
)
|
||||
|
||||
# change behaviour
|
||||
parser.addoption(
|
||||
"--exit-on-fail",
|
||||
@@ -259,6 +264,16 @@ def get_sdk_version(fixtures_ver):
|
||||
version = fixtures_ver.get_sdk_version()
|
||||
yield version
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def get_uci_show(fixtures_ver, get_apnos, get_configuration):
|
||||
uci_show = fixtures_ver.get_uci_show(get_apnos, get_configuration)
|
||||
yield uci_show
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def skip_lf(request):
|
||||
yield request.config.getoption("--skip-lanforge")
|
||||
|
||||
|
||||
# Controller Fixture
|
||||
@pytest.fixture(scope="session")
|
||||
@@ -512,6 +527,12 @@ def test_access_point(fixtures_ver, request, get_configuration, get_apnos):
|
||||
yield status
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def test_ap_connection_status(fixtures_ver, request, get_configuration, get_apnos):
|
||||
"""used to check the manager status of AP, should be used as a setup to verify if ap can reach cloud"""
|
||||
connection, redirector_value = fixtures_ver.get_ap_status_logs(get_configuration, get_apnos)
|
||||
yield connection, redirector_value
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def traffic_generator_connectivity(testbed, get_configuration):
|
||||
"""Verify if traffic generator is reachable"""
|
||||
@@ -542,26 +563,33 @@ def traffic_generator_connectivity(testbed, get_configuration):
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def create_lanforge_chamberview_dut(lf_tools):
|
||||
def create_lanforge_chamberview_dut(lf_tools, skip_lf):
|
||||
dut_name = ""
|
||||
if not skip_lf:
|
||||
dut_object, dut_name = lf_tools.Create_Dut()
|
||||
return dut_name
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_tools(get_configuration, testbed):
|
||||
def lf_tools(get_configuration, testbed, skip_lf):
|
||||
""" Create a DUT on LANforge"""
|
||||
if not skip_lf:
|
||||
obj = ChamberView(lanforge_data=get_configuration["traffic_generator"]["details"],
|
||||
testbed=testbed, access_point_data=get_configuration["access_point"])
|
||||
|
||||
else:
|
||||
obj = False
|
||||
yield obj
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def lf_test(get_configuration, setup_influx, request):
|
||||
def lf_test(get_configuration, setup_influx, request, skip_lf):
|
||||
if not skip_lf:
|
||||
if request.config.getoption("--exit-on-fail"):
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx, debug=True)
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx,
|
||||
debug=True)
|
||||
if request.config.getoption("--exit-on-fail") is False:
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx, debug=False)
|
||||
obj = RunTest(lanforge_data=get_configuration['traffic_generator']['details'], influx_params=setup_influx,
|
||||
debug=False)
|
||||
yield obj
|
||||
|
||||
|
||||
@@ -660,3 +688,25 @@ def get_ap_logs(request, get_apnos, get_configuration):
|
||||
pass
|
||||
|
||||
request.addfinalizer(collect_logs)
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def get_lf_logs(request, get_apnos, get_configuration):
|
||||
ip = get_configuration["traffic_generator"]["details"]["ip"]
|
||||
port = get_configuration["traffic_generator"]["details"]["ssh_port"]
|
||||
|
||||
def collect_logs_lf():
|
||||
log_0 = "/home/lanforge/lanforge_log_0.txt"
|
||||
log_1 = "/home/lanforge/lanforge_log_1.txt"
|
||||
obj = SCP_File(ip=ip, port=port, username="root", password="lanforge", remote_path=log_0,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="lanforge_log_0.txt",
|
||||
name="lanforge_log_0")
|
||||
obj = SCP_File(ip=ip, port=port, username="root", password="lanforge", remote_path=log_1,
|
||||
local_path=".")
|
||||
obj.pull_file()
|
||||
allure.attach.file(source="lanforge_log_1.txt",
|
||||
name="lanforge_log_1")
|
||||
|
||||
request.addfinalizer(collect_logs_lf)
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
UCentral Gateway Services Rest API Tests
|
||||
|
||||
"""
|
||||
|
||||
import string
|
||||
import random
|
||||
|
||||
import pytest
|
||||
import json
|
||||
import allure
|
||||
@@ -126,22 +130,26 @@ class TestUcentralGatewayService(object):
|
||||
print(devices)
|
||||
|
||||
@pytest.mark.sdk_restapi
|
||||
def test_gwservice_createdevice(self, setup_controller):
|
||||
def test_gwservice_createdevice(self, setup_controller, testbed):
|
||||
"""
|
||||
Test the create device endpoint
|
||||
WIFI-3453
|
||||
"""
|
||||
|
||||
payload = {'serialNumber': 'deadbeef0011',
|
||||
device_mac = "02:00:00:%02x:%02x:%02x" % (random.randint(0, 255),
|
||||
random.randint(0, 255),
|
||||
random.randint(0, 255))
|
||||
device_name = device_mac.replace(":", "")
|
||||
# device_name = "deadbeef0011" + testbed.replace("-","")
|
||||
payload = {'serialNumber': device_name,
|
||||
'UUID': '123456',
|
||||
'configuration': self.configuration,
|
||||
'deviceType': 'AP',
|
||||
'location': '',
|
||||
'macAddress': 'DE:AD:BE:EF:00:11',
|
||||
'macAddress': device_mac,
|
||||
'manufacturer': 'Testing',
|
||||
'owner': ''}
|
||||
print(json.dumps(payload))
|
||||
resp = setup_controller.request("gw", "device/deadbeef0011", "POST", None, json.dumps(payload))
|
||||
resp = setup_controller.request("gw", "device/" + device_name, "POST", None, json.dumps(payload))
|
||||
allure.attach(name="response: ", body=str(resp.json()))
|
||||
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
|
||||
allure.attach(name="gw create devices", body=body)
|
||||
@@ -150,13 +158,13 @@ class TestUcentralGatewayService(object):
|
||||
devices = json.loads(resp.text)
|
||||
print(devices)
|
||||
|
||||
resp = setup_controller.request("gw", "device/deadbeef0011", "GET", None, None)
|
||||
resp = setup_controller.request("gw", "device/" + device_name, "GET", None, None)
|
||||
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
|
||||
allure.attach(name="gw create device verify", body=body)
|
||||
if resp.status_code != 200:
|
||||
assert False
|
||||
|
||||
resp = setup_controller.request("gw", "device/deadbeef0011", "DELETE", None, None)
|
||||
resp = setup_controller.request("gw", "device/" + device_name, "DELETE", None, None)
|
||||
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
|
||||
allure.attach(name="gw create device delete", body=body)
|
||||
if resp.status_code != 200:
|
||||
|
||||
0
tests/e2e/advanced/rate_vs_orientation/__init__.py
Normal file
0
tests/e2e/advanced/rate_vs_orientation/__init__.py
Normal file
@@ -0,0 +1,71 @@
|
||||
import os
|
||||
import time
|
||||
import pytest
|
||||
import allure
|
||||
import os.path
|
||||
|
||||
pytestmark = [pytest.mark.advance, pytest.mark.ratevsorientation, pytest.mark.bridge]
|
||||
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
|
||||
]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
@allure.feature("BRIDGE MODE RATE VS ORIENTATION")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestRatevsOrientationBridge(object):
|
||||
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5431", name="WIFI-5431")
|
||||
def test_client_wpa2_personal_5g_11ac(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
|
||||
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 = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: 80'], ['spatial_streams: 2'], ['attenuator: ' + str(ser_no[0])],
|
||||
['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..800'], ['attenuations2: 0..+50..800'],['chamber: DUT-Chamber'], ['tt_deg: 0..+30..359']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="ORIENTATION_RVR_BRIDGE_11_AC",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -8,33 +8,22 @@
|
||||
"""
|
||||
import os
|
||||
import time
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
import os.path
|
||||
import csv
|
||||
import pandas as pd
|
||||
|
||||
pytestmark = [pytest.mark.ratevsrange, pytest.mark.bridge ,pytest.mark.usefixtures("setup_test_run")]
|
||||
pytestmark = [pytest.mark.advance, pytest.mark.ratevsrange, pytest.mark.bridge]
|
||||
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {
|
||||
"is5GHz": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzL": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzU": {"channelBandwidth": "is20MHz"}
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
|
||||
]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@@ -52,8 +41,8 @@ class TestRatevsRangeBridge(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11b
|
||||
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2495", name="WIFI-2495")
|
||||
def test_client_wpa2_personal_2g_11b(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
@@ -68,55 +57,47 @@ class TestRatevsRangeBridge(object):
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="BRIDGE_RVR_11B",
|
||||
instance_name="MODEBRIDGE_RVR_11B_TWOG_modified",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
print("report name ", report_name)
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
print("entries",entries)
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
|
||||
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# if str(kpi_val) == "empty":
|
||||
# print("kpi is empty, station did not got ip, Test failed")
|
||||
# allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
# assert False
|
||||
# else:
|
||||
# print("Test passed successfully")
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11g
|
||||
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2496", name="WIFI-2496")
|
||||
def test_client_wpa2_personal_2g_11g(self,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
@@ -132,44 +113,25 @@ class TestRatevsRangeBridge(object):
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types: TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="BRIDGE_RVR_11G",
|
||||
instance_name="MODEBRIDGE_RVR_11G_TWOG_modified",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
script_dir = os.path.dirname(__file__) # Script directory
|
||||
print(script_dir)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
@@ -177,7 +139,8 @@ class TestRatevsRangeBridge(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11a
|
||||
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2497", name="WIFI-2497")
|
||||
def test_client_wpa2_personal_5g_11a(self,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration,lf_tools):
|
||||
"""
|
||||
@@ -193,42 +156,25 @@ class TestRatevsRangeBridge(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="BRIDGE_RVR_11A",
|
||||
instance_name="MODEBRIDGE_RVR_11A_FIVEG_modified",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=['numeric-score'], dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
@@ -236,7 +182,8 @@ class TestRatevsRangeBridge(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11an
|
||||
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2498", name="WIFI-2498")
|
||||
def test_client_wpa2_personal_5g_11an(self,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
@@ -252,42 +199,26 @@ class TestRatevsRangeBridge(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="BRIDGE_RVR_11AN",
|
||||
instance_name="MODEBRIDGE_RVR_11AN_FIVEG_modified",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
@@ -296,8 +227,8 @@ class TestRatevsRangeBridge(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11ac
|
||||
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2499", name="WIFI-2499")
|
||||
def test_client_wpa2_personal_5g_11ac(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
@@ -312,42 +243,27 @@ class TestRatevsRangeBridge(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'] ,['attenuator2: 1.1.3059'], ['attenuations: 0..+50..950'],['attenuations2: 0..+50..950']]
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..950'],['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="BRIDGE_RVR_11AC",
|
||||
instance_name="MODEBRIDGE_RVR_11AC_FIVEG_modified",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
"""
|
||||
|
||||
Advanced Test: Rate v/s Range test under various combinations: NAT Mode
|
||||
pytest -m "throughput_benchmark_test and nat" -s -vvv --skip-testrail --testbed=basic-01
|
||||
pytest -m "ratevsrange and NAT " -s -vvv --skip-testrail --testbed=basic-01 --alluredir=../allure_reports
|
||||
--> allure serve ../allure_reports/
|
||||
|
||||
|
||||
"""
|
||||
@@ -10,31 +11,26 @@ import time
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
import os.path
|
||||
import csv
|
||||
import pandas as pd
|
||||
|
||||
pytestmark = [pytest.mark.ratevsrange, pytest.mark.nat ,pytest.mark.usefixtures("setup_test_run")]
|
||||
# pytestmark = [pytest.mark.advance, pytest.mark.ratevsrange, pytest.mark.nat]
|
||||
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {
|
||||
"is5GHz": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzL": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzU": {"channelBandwidth": "is20MHz"}
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
|
||||
]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@allure.feature("NAT MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
@@ -42,18 +38,17 @@ setup_params_general = {
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.Mhz20
|
||||
class TestRatevsRangeNat(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11b
|
||||
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2495", name="WIFI-2495")
|
||||
def test_client_wpa2_personal_2g_11b(self, lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and nat and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
pytest -m "ratevsrange and client11b" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2495
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
@@ -64,24 +59,25 @@ class TestRatevsRangeNat(object):
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
val = [['modes: 802.11b'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="NAT_RVR_11B",
|
||||
instance_name="NAT_RVR_11B_TWOG",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
print("report name ", report_name)
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
print("entries",entries)
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
@@ -89,10 +85,19 @@ class TestRatevsRangeNat(object):
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
|
||||
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
@@ -101,12 +106,13 @@ class TestRatevsRangeNat(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11g
|
||||
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2496", name="WIFI-2496")
|
||||
def test_client_wpa2_personal_2g_11g(self,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and nat and client11g" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
pytest -m "ratevsrange and NAT and client11g" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2496
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
@@ -117,25 +123,22 @@ class TestRatevsRangeNat(object):
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11G'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
val = [['modes: 802.11g'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="NAT_RVR_11G",
|
||||
instance_name="NAT_RVR_11G_TWOG",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
@@ -145,8 +148,16 @@ class TestRatevsRangeNat(object):
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
script_dir = os.path.dirname(__file__) # Script directory
|
||||
print(script_dir)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
@@ -155,12 +166,13 @@ class TestRatevsRangeNat(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11a
|
||||
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2497", name="WIFI-2497")
|
||||
def test_client_wpa2_personal_5g_11a(self,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration,lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and nat and client11a" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
pytest -m "ratevsrange and NAT and client11a" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2497
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
@@ -171,25 +183,22 @@ class TestRatevsRangeNat(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
val = [['modes: 802.11a'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="NAT_RVR_11A",
|
||||
instance_name="NAT_RVR_11A_FIVEG",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
@@ -199,8 +208,14 @@ class TestRatevsRangeNat(object):
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=['numeric-score'], dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
@@ -209,12 +224,13 @@ class TestRatevsRangeNat(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11an
|
||||
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2498", name="WIFI-2498")
|
||||
def test_client_wpa2_personal_5g_11an(self,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and nat and client11an" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
pytest -m "ratevsrange and NAT and client11an" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2498
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
@@ -225,25 +241,23 @@ class TestRatevsRangeNat(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
val = [['modes: 802.11an'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="NAT_RVR_11AN",
|
||||
instance_name="NAT_RVR_11AN_FIVEG",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
@@ -255,6 +269,12 @@ class TestRatevsRangeNat(object):
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
@@ -264,12 +284,12 @@ class TestRatevsRangeNat(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11ac
|
||||
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2499", name="WIFI-2499")
|
||||
def test_client_wpa2_personal_5g_11ac(self, lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and nat and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
pytest -m "ratevsrange and NAT and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2499
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
@@ -280,25 +300,23 @@ class TestRatevsRangeNat(object):
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
val = [['modes: 802.11an-AC'], ['pkts: 60;142;256;512;1024;MTU;4000;9000'], ['directions: DUT Transmit;DUT Receive'], ['traffic_types:UDP;TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'] ,['attenuator2: 1.1.3059'], ['attenuations: 0..+50..950'],['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="NAT_RVR_11AC",
|
||||
instance_name="NAT_RVR_11AC_FIVEG",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Rate vs Range Test")
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
@@ -310,6 +328,12 @@ class TestRatevsRangeNat(object):
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
if str(kpi_val) == "empty":
|
||||
print("kpi is empty, station did not got ip, Test failed")
|
||||
allure.attach(name="Kpi Data", body="station did not got ip Test failed.")
|
||||
assert False
|
||||
else:
|
||||
print("Test passed successfully")
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
|
||||
@@ -1,314 +1,314 @@
|
||||
"""
|
||||
|
||||
Advanced Test: Rate v/s Range test under various combinations: VLAN Mode
|
||||
pytest -m "throughput_benchmark_test and vlan" -s -vvv --skip-testrail --testbed=basic-01
|
||||
|
||||
|
||||
"""
|
||||
import os
|
||||
import time
|
||||
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.ratevsrange, pytest.mark.vlan ,pytest.mark.usefixtures("setup_test_run")]
|
||||
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
{"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
"wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}],
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
"security_key": "something"}]},
|
||||
"rf": {
|
||||
"is5GHz": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzL": {"channelBandwidth": "is20MHz"},
|
||||
"is5GHzU": {"channelBandwidth": "is20MHz"}
|
||||
},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
@pytest.mark.Mhz20
|
||||
class TestRatevsRangeVlan(object):
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11b
|
||||
def test_client_wpa2_personal_2g_11b(self, get_vif_state,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and vlan and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2495
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="VLAN_RVR_11B",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.client11g
|
||||
def test_client_wpa2_personal_2g_11g(self, get_vif_state,
|
||||
lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and vlan and client11g" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2496
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "twog"
|
||||
vlan = 100
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
instance_name="VLAN_RVR_11G",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11a
|
||||
def test_client_wpa2_personal_5g_11a(self, get_vif_state,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and vlan and client11a" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2497
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="VLAN_RVR_11A",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11an
|
||||
def test_client_wpa2_personal_5g_11an(self, get_vif_state,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration,lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and vlan and client11an" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2498
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 100
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="VLAN_RVR_11AN",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@pytest.mark.performance_advanced
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.client11ac
|
||||
def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
|
||||
lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration, lf_tools):
|
||||
"""
|
||||
|
||||
pytest -m "ratevsrange and vlan and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
jira- wifi-2499
|
||||
"""
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssid_name = profile_data["ssid_name"]
|
||||
security_key = profile_data["security_key"]
|
||||
security = "wpa2"
|
||||
mode = "VLAN"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
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")
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
print("station", station)
|
||||
|
||||
val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
|
||||
if station:
|
||||
time.sleep(3)
|
||||
rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="VLAN_RVR_11AC",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
pdf = False
|
||||
for i in entries:
|
||||
if ".pdf" in i:
|
||||
pdf = i
|
||||
if pdf:
|
||||
allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
print(str(kpi_val))
|
||||
allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
# """
|
||||
#
|
||||
# Advanced Test: Rate v/s Range test under various combinations: VLAN Mode
|
||||
# pytest -m "throughput_benchmark_test and vlan" -s -vvv --skip-testrail --testbed=basic-01
|
||||
#
|
||||
#
|
||||
# """
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# import pytest
|
||||
# import allure
|
||||
#
|
||||
# pytestmark = [pytest.mark.ratevsrange, pytest.mark.vlan ,pytest.mark.usefixtures("setup_test_run")]
|
||||
#
|
||||
#
|
||||
# setup_params_general = {
|
||||
# "mode": "VLAN",
|
||||
# "ssid_modes": {
|
||||
# "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["is2dot4GHz"]},
|
||||
# {"ssid_name": "ssid_open_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"]}],
|
||||
# "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
# {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "security_key": "something"}],
|
||||
# "wpa2_personal": [
|
||||
# {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["is2dot4GHz"], "security_key": "something"},
|
||||
# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["is5GHzU", "is5GHz", "is5GHzL"],
|
||||
# "security_key": "something"}]},
|
||||
# "rf": {
|
||||
# "is5GHz": {"channelBandwidth": "is20MHz"},
|
||||
# "is5GHzL": {"channelBandwidth": "is20MHz"},
|
||||
# "is5GHzU": {"channelBandwidth": "is20MHz"}
|
||||
# },
|
||||
# "radius": False
|
||||
# }
|
||||
#
|
||||
# @allure.feature("BRIDGE MODE CLIENT CONNECTIVITY")
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_general],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
# @pytest.mark.usefixtures("setup_profiles")
|
||||
# @pytest.mark.Mhz20
|
||||
# class TestRatevsRangeVlan(object):
|
||||
#
|
||||
# @pytest.mark.wpa2_personal
|
||||
# @pytest.mark.twog
|
||||
# @pytest.mark.client11b
|
||||
# def test_client_wpa2_personal_2g_11b(self, get_vif_state,
|
||||
# lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
# get_configuration, lf_tools):
|
||||
# """
|
||||
#
|
||||
# pytest -m "ratevsrange and vlan and 11bclient" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
# jira- wifi-2495
|
||||
# """
|
||||
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# dut_name = create_lanforge_chamberview_dut
|
||||
# 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")
|
||||
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
# print("station", station)
|
||||
#
|
||||
# val = [['modes: 802.11b'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
# if station:
|
||||
# time.sleep(3)
|
||||
# rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
# instance_name="VLAN_RVR_11B",
|
||||
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
# report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
# entries = os.listdir("../reports/" + report_name + '/')
|
||||
# pdf = False
|
||||
# for i in entries:
|
||||
# if ".pdf" in i:
|
||||
# pdf = i
|
||||
# if pdf:
|
||||
# allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
# name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
# print("Test Completed... Cleaning up Stations")
|
||||
# lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
# assert station
|
||||
# else:
|
||||
# assert False
|
||||
#
|
||||
# @pytest.mark.wpa2_personal
|
||||
# @pytest.mark.twog
|
||||
# @pytest.mark.client11g
|
||||
# def test_client_wpa2_personal_2g_11g(self, get_vif_state,
|
||||
# lf_test, station_names_twog, create_lanforge_chamberview_dut,
|
||||
# get_configuration, lf_tools):
|
||||
# """
|
||||
#
|
||||
# pytest -m "ratevsrange and vlan and client11g" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
# jira- wifi-2496
|
||||
# """
|
||||
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "twog"
|
||||
# vlan = 100
|
||||
# dut_name = create_lanforge_chamberview_dut
|
||||
# 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")
|
||||
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# station_name=station_names_twog, vlan_id=vlan)
|
||||
# print("station", station)
|
||||
#
|
||||
# val = [['modes: 802.11g'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
#
|
||||
# if station:
|
||||
# time.sleep(3)
|
||||
# rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode,
|
||||
# instance_name="VLAN_RVR_11G",
|
||||
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
# report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
# entries = os.listdir("../reports/" + report_name + '/')
|
||||
# pdf = False
|
||||
# for i in entries:
|
||||
# if ".pdf" in i:
|
||||
# pdf = i
|
||||
# if pdf:
|
||||
# allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
# name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
# print("Test Completed... Cleaning up Stations")
|
||||
# lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
# assert station
|
||||
# else:
|
||||
# assert False
|
||||
#
|
||||
# @pytest.mark.wpa2_personal
|
||||
# @pytest.mark.fiveg
|
||||
# @pytest.mark.client11a
|
||||
# def test_client_wpa2_personal_5g_11a(self, get_vif_state,
|
||||
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
# get_configuration, lf_tools):
|
||||
# """
|
||||
#
|
||||
# pytest -m "ratevsrange and vlan and client11a" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
# jira- wifi-2497
|
||||
# """
|
||||
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 100
|
||||
# dut_name = create_lanforge_chamberview_dut
|
||||
# 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")
|
||||
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
# print("station", station)
|
||||
#
|
||||
# val = [['modes: 802.11a'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
# if station:
|
||||
# time.sleep(3)
|
||||
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
# instance_name="VLAN_RVR_11A",
|
||||
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
# report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
# entries = os.listdir("../reports/" + report_name + '/')
|
||||
# pdf = False
|
||||
# for i in entries:
|
||||
# if ".pdf" in i:
|
||||
# pdf = i
|
||||
# if pdf:
|
||||
# allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
# name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
# print("Test Completed... Cleaning up Stations")
|
||||
# lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
# assert station
|
||||
# else:
|
||||
# assert False
|
||||
#
|
||||
# @pytest.mark.wpa2_personal
|
||||
# @pytest.mark.fiveg
|
||||
# @pytest.mark.client11an
|
||||
# def test_client_wpa2_personal_5g_11an(self, get_vif_state,
|
||||
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
# get_configuration,lf_tools):
|
||||
# """
|
||||
#
|
||||
# pytest -m "ratevsrange and vlan and client11an" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
# jira- wifi-2498
|
||||
# """
|
||||
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 100
|
||||
# dut_name = create_lanforge_chamberview_dut
|
||||
# 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")
|
||||
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
# print("station", station)
|
||||
#
|
||||
# val = [['modes: 802.11an'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
# if station:
|
||||
# time.sleep(3)
|
||||
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
# instance_name="VLAN_RVR_11AN",
|
||||
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
# report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
# entries = os.listdir("../reports/" + report_name + '/')
|
||||
# pdf = False
|
||||
# for i in entries:
|
||||
# if ".pdf" in i:
|
||||
# pdf = i
|
||||
# if pdf:
|
||||
# allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
# name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
# print("Test Completed... Cleaning up Stations")
|
||||
# lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
# assert station
|
||||
# else:
|
||||
# assert False
|
||||
#
|
||||
# @pytest.mark.performance_advanced
|
||||
# @pytest.mark.wpa2_personal
|
||||
# @pytest.mark.fiveg
|
||||
# @pytest.mark.client11ac
|
||||
# def test_client_wpa2_personal_5g_11ac(self, get_vif_state,
|
||||
# lf_test, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
# get_configuration, lf_tools):
|
||||
# """
|
||||
#
|
||||
# pytest -m "ratevsrange and vlan and client11ac" -s -vvv --skip-testrail --testbed=advanced-02
|
||||
# jira- wifi-2499
|
||||
# """
|
||||
# profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
# ssid_name = profile_data["ssid_name"]
|
||||
# security_key = profile_data["security_key"]
|
||||
# security = "wpa2"
|
||||
# mode = "VLAN"
|
||||
# band = "fiveg"
|
||||
# vlan = 1
|
||||
# dut_name = create_lanforge_chamberview_dut
|
||||
# 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")
|
||||
# station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
# passkey=security_key, mode=mode, band=band,
|
||||
# station_name=station_names_fiveg, vlan_id=vlan)
|
||||
# print("station", station)
|
||||
#
|
||||
# val = [['modes: 802.11an-AC'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:TCP'],
|
||||
# ['bandw_options: AUTO'], ['spatial_streams: AUTO'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'],
|
||||
# ['attenuations: 0..+50..950'], ['attenuations2: 0..+50..950']]
|
||||
#
|
||||
# if station:
|
||||
# time.sleep(3)
|
||||
# rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode,
|
||||
# instance_name="VLAN_RVR_11AC",
|
||||
# vlan_id=vlan, dut_name=dut_name, raw_lines=val)
|
||||
# report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
# entries = os.listdir("../reports/" + report_name + '/')
|
||||
# pdf = False
|
||||
# for i in entries:
|
||||
# if ".pdf" in i:
|
||||
# pdf = i
|
||||
# if pdf:
|
||||
# allure.attach.file(source="../reports/" + report_name + "/" + pdf,
|
||||
# name=get_configuration["access_point"][0]["model"] + "ratevsrange")
|
||||
# print("Test Completed... Cleaning up Stations")
|
||||
# lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
# kpi_val = lf_tools.read_kpi_file(column_name=None, dir_name=report_name)
|
||||
# print(str(kpi_val))
|
||||
# allure.attach(name="Kpi Data", body=str(kpi_val))
|
||||
# assert station
|
||||
# else:
|
||||
# assert False
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
"""
|
||||
|
||||
Performance Test: Receiver Sensitivity Test: bridge Mode
|
||||
pytest -m "rxsensitivity and bridge"
|
||||
|
||||
"""
|
||||
import os
|
||||
import pytest
|
||||
import allure
|
||||
|
||||
pytestmark = [pytest.mark.advance, pytest.mark.rxsensitivity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa2_personal": [
|
||||
{"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"}
|
||||
]
|
||||
},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
@allure.feature("BRIDGE MODE RECEIVER SENSITIVITY TEST")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestRxSensitivityBridge(object):
|
||||
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2445", name="WIFI-2445")
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.all_mcs
|
||||
def test_client_wpa2_personal_bridge_all_mcs_5g(self, lf_test, lf_tools, station_names_fiveg, create_lanforge_chamberview_dut,
|
||||
get_configuration):
|
||||
"""
|
||||
Receiver Sensitivity Bridge Mode
|
||||
"""
|
||||
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 = "BRIDGE"
|
||||
band = "fiveg"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
raw_lines = [['txo_preamble: VHT'],
|
||||
['txo_mcs: 0 CCK, OFDM, HT, VHT;1 CCK, OFDM, HT, VHT;2 CCK, OFDM, HT, VHT;3 CCK, OFDM, HT, VHT;'
|
||||
'4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT;8 VHT;9 VHT'],
|
||||
['spatial_streams: 2'], ['bandw_options: 80'], ['txo_sgi: OFF'],
|
||||
['txo_retries: No Retry'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..800'], ['attenuations2: 0..+50..800'],
|
||||
["show_3s: 1"], ['txo_txpower: 17'],
|
||||
["show_ll_graphs: 1"], ["show_log: 1"]]
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_fiveg, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
obj = lf_test.rx_sensitivity(station_name=station_names_fiveg, mode=mode,
|
||||
instance_name="RECEIVER_SENSITIVITY_BRIDGE_5G",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines)
|
||||
report_name = obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Receiver sensitivity test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_fiveg)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2445", name="WIFI-2445")
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.all_mcs
|
||||
def test_client_wpa2_personal_bridge_all_mcs_2g(self, lf_test, lf_tools, station_names_twog,
|
||||
create_lanforge_chamberview_dut,
|
||||
get_configuration):
|
||||
"""
|
||||
Receiver Sensitivity Bridge Mode
|
||||
"""
|
||||
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 = "BRIDGE"
|
||||
band = "twog"
|
||||
vlan = 1
|
||||
dut_name = create_lanforge_chamberview_dut
|
||||
ser_no = lf_test.attenuator_serial()
|
||||
print(ser_no)
|
||||
raw_lines = [['txo_preamble: VHT'],
|
||||
['txo_mcs: 0 CCK, OFDM, HT, VHT;1 CCK, OFDM, HT, VHT;2 CCK, OFDM, HT, VHT;3 CCK, OFDM, HT, VHT;'
|
||||
'4 OFDM, HT, VHT;5 OFDM, HT, VHT;6 OFDM, HT, VHT;7 OFDM, HT, VHT;8 VHT;9 VHT'],
|
||||
['spatial_streams: 2'], ['bandw_options: 80'], ['txo_sgi: OFF'],
|
||||
['txo_retries: No Retry'], ['attenuator: ' + str(ser_no[0])], ['attenuator2: ' + str(ser_no[1])],
|
||||
['attenuations: 0..+50..800'], ['attenuations2: 0..+50..800'],
|
||||
["show_3s: 1"], ['txo_txpower: 17'],
|
||||
["show_ll_graphs: 1"], ["show_log: 1"]]
|
||||
|
||||
station = lf_test.Client_Connect(ssid=ssid_name, security=security,
|
||||
passkey=security_key, mode=mode, band=band,
|
||||
station_name=station_names_twog, vlan_id=vlan)
|
||||
|
||||
if station:
|
||||
obj = lf_test.rx_sensitivity(station_name=station_names_twog, mode=mode,
|
||||
instance_name="RECEIVER_SENSITIVITY_BRIDGE_2G",
|
||||
vlan_id=vlan, dut_name=dut_name, raw_lines=raw_lines)
|
||||
report_name = obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1]
|
||||
entries = os.listdir("../reports/" + report_name + '/')
|
||||
lf_tools.attach_report_graphs(report_name=report_name, pdf_name="Receiver sensitivity test")
|
||||
print("Test Completed... Cleaning up Stations")
|
||||
lf_test.Client_disconnect(station_name=station_names_twog)
|
||||
assert station
|
||||
else:
|
||||
assert False
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,10 +47,9 @@ def create_lanforge_chamberview_dut(lf_tools):
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver,
|
||||
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, reset_scenario_lf,
|
||||
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
|
||||
lf_tools.reset_scenario()
|
||||
param = dict(request.param)
|
||||
|
||||
# VLAN Setup
|
||||
@@ -72,6 +71,7 @@ def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtur
|
||||
if vlan_list[i] > 4095 or vlan_list[i] < 1:
|
||||
vlan_list.pop(i)
|
||||
if request.param["mode"] == "VLAN":
|
||||
lf_tools.reset_scenario()
|
||||
lf_tools.add_vlan(vlan_ids=vlan_list)
|
||||
|
||||
# call this, if 1.x
|
||||
@@ -84,8 +84,6 @@ def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtur
|
||||
yield return_var
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def station_names_twog(request, get_configuration):
|
||||
station_names = []
|
||||
@@ -101,6 +99,7 @@ def station_names_fiveg(request, get_configuration):
|
||||
station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i))
|
||||
yield station_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def station_names_ax(request, get_configuration):
|
||||
station_names = []
|
||||
@@ -108,6 +107,7 @@ def station_names_ax(request, get_configuration):
|
||||
station_names.append(get_configuration["traffic_generator"]["details"]["AX-Station-Name"] + "0" + str(i))
|
||||
yield station_names
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def num_stations(request):
|
||||
num_sta = int(request.config.getini("num_stations"))
|
||||
@@ -131,3 +131,14 @@ def get_vlan_list(get_apnos, get_configuration):
|
||||
vlan_list = list(ap_ssh.get_vlan())
|
||||
vlan_list.sort()
|
||||
yield vlan_list
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def reset_scenario_lf(request, lf_tools):
|
||||
lf_tools.reset_scenario()
|
||||
|
||||
def teardown_session():
|
||||
lf_tools.reset_scenario()
|
||||
|
||||
request.addfinalizer(teardown_session)
|
||||
yield ""
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -46,7 +46,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -73,7 +73,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, station_names_fiveg, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 5g
|
||||
@@ -98,7 +98,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -126,7 +126,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -154,7 +154,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -181,7 +181,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -239,7 +239,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -267,7 +267,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -295,7 +295,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
""" wpa enterprise 2g
|
||||
@@ -322,7 +322,7 @@ class TestBridgeModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
|
||||
@@ -50,7 +50,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2809", name="JIRA LINK")
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, setup_profiles, lf_test, update_report,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs, setup_profiles, lf_test,
|
||||
update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -76,7 +77,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, test_cases, station_names_fiveg,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, test_cases, station_names_fiveg, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and open and fiveg"
|
||||
@@ -103,7 +104,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-2801", name="JIRA LINK")
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report,
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report, get_lf_logs,
|
||||
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"
|
||||
@@ -129,7 +130,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, update_report, test_cases, station_names_fiveg):
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, lf_test, update_report, get_lf_logs,
|
||||
test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa and fiveg"
|
||||
"""
|
||||
@@ -154,7 +156,8 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, lf_test, update_report, test_cases,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
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"
|
||||
@@ -181,7 +184,7 @@ class TestBridgeModeConnectivitySuiteA(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
station_names_fiveg, get_lf_logs,
|
||||
lf_test):
|
||||
"""Client Connectivity wpa2_personal ssid 5G
|
||||
pytest -m "client_connectivity and bridge and general and wpa2_personal and fiveg"
|
||||
@@ -270,7 +273,8 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg,
|
||||
lf_test, test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal and fiveg"
|
||||
@@ -296,7 +300,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs, station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -323,7 +327,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and bridge and general and wpa3_personal_mixed and fiveg"
|
||||
@@ -349,7 +353,7 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -376,7 +380,8 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, lf_test, test_cases,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, station_names_fiveg, get_lf_logs,
|
||||
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"
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
@@ -59,7 +59,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
@@ -85,7 +85,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
@@ -111,7 +111,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
@@ -136,7 +136,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
@@ -160,7 +160,7 @@ class TestNATModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state,station_names_fiveg, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
@@ -210,7 +210,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test, update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][0]
|
||||
@@ -235,7 +235,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa_wpa2_enterprise_mixed"][1]
|
||||
@@ -260,7 +260,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
profile_data = setup_params_enterprise_two["ssid_modes"]["wpa3_enterprise_mixed"][0]
|
||||
@@ -284,7 +284,7 @@ class TestNATModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report, exit_on_fail,
|
||||
test_cases, radius_info):
|
||||
|
||||
@@ -48,7 +48,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
@@ -77,7 +77,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, test_cases, station_names_fiveg,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
@@ -104,7 +104,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report,
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs, update_report, get_lf_logs,
|
||||
lf_test, test_cases, station_names_twog):
|
||||
"""Client Connectivity wpa ssid 2.4G
|
||||
pytest -m "client_connectivity and NAT and general and wpa and twog"
|
||||
@@ -129,7 +129,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and NAT and general and wpa and fiveg"
|
||||
@@ -155,7 +155,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -182,7 +182,7 @@ class TestNATModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
lf_test):
|
||||
@@ -245,7 +245,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -272,7 +272,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -300,7 +300,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -326,7 +326,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
update_report):
|
||||
@@ -353,7 +353,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
update_report,
|
||||
@@ -382,7 +382,7 @@ class TestNATModeConnectivitySuiteB(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -60,7 +60,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -87,7 +87,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -114,7 +114,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
@pytest.mark.sanity_light
|
||||
@pytest.mark.wpa2_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -140,7 +140,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -165,7 +165,7 @@ class TestVLANModeEnterpriseTTLSSuiteOne(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -216,7 +216,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa_wpa2_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_enterprise_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases, radius_info, exit_on_fail):
|
||||
@@ -244,7 +244,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa_wpa2_enterprise_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
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"]
|
||||
@@ -268,7 +268,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.twog
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
update_report, test_cases, radius_info, exit_on_fail):
|
||||
@@ -293,7 +293,7 @@ class TestVLANModeEnterpriseTTLSSuiteTwo(object):
|
||||
|
||||
@pytest.mark.wpa3_enterprise_mixed
|
||||
@pytest.mark.fiveg
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_enterprise_mixed_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, setup_profiles,
|
||||
lf_test,
|
||||
update_report, exit_on_fail,
|
||||
|
||||
@@ -46,7 +46,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
setup_profiles, lf_test, update_report,
|
||||
station_names_twog,
|
||||
test_cases):
|
||||
@@ -72,7 +72,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.open
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_open_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, test_cases, station_names_fiveg,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 5G
|
||||
@@ -100,7 +100,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa 2.4 GHZ Band')
|
||||
def test_wpa_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
update_report,
|
||||
update_report, get_lf_logs,
|
||||
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,7 +126,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa 5 GHZ Band')
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases, station_names_fiveg):
|
||||
"""Client Connectivity wpa ssid 5G
|
||||
pytest -m "client_connectivity and vlan and general and wpa and fiveg"
|
||||
@@ -152,7 +152,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa2_personal 2.4 GHZ Band')
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
lf_test, update_report, test_cases,
|
||||
station_names_twog):
|
||||
"""Client Connectivity wpa2_personal ssid 2.4G
|
||||
@@ -179,7 +179,7 @@ class TestvlanModeConnectivitySuiteA(object):
|
||||
@pytest.mark.wpa2_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa2_personal 5 GHZ Band')
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
update_report, test_cases,
|
||||
station_names_fiveg,
|
||||
lf_test):
|
||||
@@ -243,7 +243,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_2g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_twog, setup_profiles, lf_test,
|
||||
update_report,
|
||||
test_cases):
|
||||
@@ -271,7 +271,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa3_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -299,7 +299,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -327,7 +327,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
station_names_fiveg, lf_test,
|
||||
test_cases,
|
||||
test_cases, get_lf_logs,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
pytest -m "client_connectivity and vlan and general and wpa3_personal_mixed and fiveg"
|
||||
@@ -354,7 +354,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, get_vif_state, get_ap_logs,
|
||||
station_names_twog, setup_profiles,
|
||||
lf_test,
|
||||
lf_test, get_lf_logs,
|
||||
update_report,
|
||||
test_cases):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
@@ -381,7 +381,7 @@ class TestvlanModeConnectivitySuiteTwo(object):
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs,
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, get_vif_state, get_ap_logs, get_lf_logs,
|
||||
station_names_fiveg, lf_test, test_cases,
|
||||
update_report):
|
||||
"""Client Connectivity open ssid 2.4G
|
||||
|
||||
0
tests/e2e/interOp/captive_portal/__init__.py
Normal file
0
tests/e2e/interOp/captive_portal/__init__.py
Normal file
@@ -0,0 +1,276 @@
|
||||
from logging import exception
|
||||
import io
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp, \
|
||||
get_ip_address_and, verifyUploadDownloadSpeed_android, wifi_connect, wifi_disconnect_and_forget, captive_portal_and
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.captive_portal
|
||||
,pytest.mark.interop_uc_sanity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "captive_open_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "captive_open_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa": [{"ssid_name": "captive_wpa_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa2_personal": [{"ssid_name": "captive_wpa2_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa2_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "captive_wpa3_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa3_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.suite(suite_name="interop sanity")
|
||||
@allure.sub_suite(sub_suite_name="Bridge Mode Captive Portal : Suite-A")
|
||||
@pytest.mark.InteropsuiteA
|
||||
@allure.feature("BRIDGE MODE CAPTIVE PORTAL")
|
||||
@pytest.mark.parametrize(
|
||||
'setup_profiles',
|
||||
[setup_params_general],
|
||||
indirect=True,
|
||||
scope="class"
|
||||
)
|
||||
@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeCaptivePortalSuiteOneBridge(object):
|
||||
""" Captive Portal SuiteA
|
||||
pytest -m "captive portal and bridge and InteropsuiteA"
|
||||
"""
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5178", name="WIFI-5178")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_2g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5141", name="WIFI-5141")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_5g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5180", name="WIFI-5180")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_2g_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5144", name="WIFI-5144")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_5g_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5184", name="WIFI-5184")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5147", name="WIFI-5147")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_and(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@@ -0,0 +1,350 @@
|
||||
from logging import exception
|
||||
import io
|
||||
import unittest
|
||||
import warnings
|
||||
from perfecto.test import TestResultFactory
|
||||
import pytest
|
||||
import sys
|
||||
import time
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
from selenium.webdriver.common.by import By
|
||||
from appium import webdriver
|
||||
from selenium.common.exceptions import NoSuchElementException
|
||||
|
||||
import sys
|
||||
import allure
|
||||
|
||||
if 'perfecto_libs' not in sys.path:
|
||||
sys.path.append(f'../libs/perfecto_libs')
|
||||
|
||||
from iOS_lib import closeApp, openApp, get_WifiIPAddress_iOS, ForgetWifiConnection, ping_deftapps_iOS, \
|
||||
Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown,\
|
||||
verifyUploadDownloadSpeediOS, get_ip_address_ios, captive_portal_ios, wifi_connect, wifi_disconnect_and_forget
|
||||
|
||||
pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios,
|
||||
pytest.mark.captive_portal, pytest.mark.interop_uc_sanity, pytest.mark.bridge]
|
||||
|
||||
setup_params_general = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"open": [{"ssid_name": "captive_open_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "captive_open_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa": [{"ssid_name": "captive_wpa_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa2": [{"ssid_name": "captive_wpa2_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive2_wpa_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}],
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "captive_wpa3_2g", "appliedRadios": ["2G"], "security_key": "lanforge"},
|
||||
{"ssid_name": "captive_wpa3_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "lanforge"}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
|
||||
|
||||
@allure.suite(suite_name="interop sanity")
|
||||
@allure.sub_suite(sub_suite_name="Bridge Mode Captive Portal : Suite-A")
|
||||
@pytest.mark.InteropsuiteA
|
||||
@allure.feature("BRIDGE MODE CAPTIVE PORTAL")
|
||||
# @pytest.mark.parametrize(
|
||||
# 'setup_profiles',
|
||||
# [setup_params_general],
|
||||
# indirect=True,
|
||||
# scope="class"
|
||||
# )
|
||||
#@pytest.mark.usefixtures("setup_profiles")
|
||||
class TestBridgeModeCaptivePortalSuiteOneBridge(object):
|
||||
""" Captive Portal SuiteA
|
||||
pytest -m "captive portal and bridge and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5179", name="WIFI-5179")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_2g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5146", name="WIFI-5146")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_Captive_Portal_Open_5g_BRIDGE(self, request, get_vif_state, get_ap_logs, 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)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5182", name="WIFI-5182")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_2g_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5149", name="WIFI-5149")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_Captive_Portal_WPA_5g_Bridge(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5186", name="WIFI-5186")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5153", name="WIFI-5153")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_Captive_Portal_WPA2_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5130", name="WIFI-5130")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_Captive_Portal_WPA3_2g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5140", name="WIFI-5140")
|
||||
@pytest.mark.sg123
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_Captive_Portal_WPA3_5g_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_APToMobileDevice_data,
|
||||
setup_perfectoMobile_iOS):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
print("SSID_PASS: " + ssidPassword)
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = captive_portal_ios(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@@ -10,6 +10,7 @@ from perfecto import (PerfectoExecutionContext, PerfectoReportiumClient, TestCon
|
||||
import pytest
|
||||
import logging
|
||||
import re
|
||||
import allure
|
||||
|
||||
sys.path.append(
|
||||
os.path.dirname(
|
||||
@@ -195,12 +196,13 @@ def setup_vlan():
|
||||
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver,
|
||||
def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, skip_lf,
|
||||
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
|
||||
lf_tools.reset_scenario()
|
||||
param = dict(request.param)
|
||||
|
||||
param = dict(request.param)
|
||||
if not skip_lf:
|
||||
lf_tools.reset_scenario()
|
||||
# VLAN Setup
|
||||
if request.param["mode"] == "VLAN":
|
||||
|
||||
@@ -227,7 +229,7 @@ def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtur
|
||||
instantiate_profile,
|
||||
get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos,
|
||||
radius_accounting_info)
|
||||
radius_accounting_info, skip_lf=skip_lf)
|
||||
yield return_var
|
||||
|
||||
|
||||
@@ -256,8 +258,12 @@ def failure_tracking_fixture(request):
|
||||
yield tests_failed_during_module
|
||||
|
||||
|
||||
|
||||
empty_get_vif_state_list = []
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def get_vif_state(get_apnos, get_configuration, request, lf_tools):
|
||||
def get_vif_state(get_apnos, get_configuration, request, lf_tools, skip_lf):
|
||||
if not skip_lf:
|
||||
if request.config.getoption("1.x"):
|
||||
ap_ssh = get_apnos(get_configuration['access_point'][0], pwd="../libs/apnos/", sdk="1.x")
|
||||
vif_state = list(ap_ssh.get_vif_state_ssids())
|
||||
@@ -265,7 +271,8 @@ def get_vif_state(get_apnos, get_configuration, request, lf_tools):
|
||||
yield vif_state
|
||||
else:
|
||||
yield lf_tools.ssid_list
|
||||
|
||||
else:
|
||||
yield empty_get_vif_state_list
|
||||
|
||||
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
||||
def pytest_runtest_makereport(item, call):
|
||||
@@ -423,10 +430,26 @@ def setup_perfectoMobile_android(request):
|
||||
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||
reportClient(reporting_client)
|
||||
|
||||
try:
|
||||
params = {'property': 'model'}
|
||||
deviceModel = driver.execute_script('mobile:handset:info', params)
|
||||
except:
|
||||
pass
|
||||
|
||||
def teardown():
|
||||
try:
|
||||
print("\n---------- Tear Down ----------")
|
||||
try:
|
||||
params = {'property': 'model'}
|
||||
deviceModel = driver.execute_script('mobile:handset:info', params)
|
||||
allure.dynamic.link(
|
||||
str(reporting_client.report_url()),
|
||||
name=str(deviceModel))
|
||||
except:
|
||||
print("fail to attach video link")
|
||||
|
||||
print('Report-Url: ' + reporting_client.report_url())
|
||||
|
||||
print("----------------------------------------------------------\n\n\n\n")
|
||||
driver.close()
|
||||
except Exception as e:
|
||||
@@ -573,11 +596,22 @@ def setup_perfectoMobile_iOS(request):
|
||||
reporting_client = PerfectoReportiumClient(perfecto_execution_context)
|
||||
reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
|
||||
reportClient(reporting_client)
|
||||
try:
|
||||
params = {'property': 'model'}
|
||||
deviceModel = driver.execute_script('mobile:handset:info', params)
|
||||
except:
|
||||
pass
|
||||
|
||||
def teardown():
|
||||
try:
|
||||
print("\n---------- Tear Down ----------")
|
||||
print('Report-Url: ' + reporting_client.report_url())
|
||||
try:
|
||||
allure.dynamic.link(
|
||||
str(reporting_client.report_url()),
|
||||
name=str(deviceModel))
|
||||
except:
|
||||
print("fail to attach video link")
|
||||
print("----------------------------------------------------------\n\n\n\n")
|
||||
driver.close()
|
||||
except Exception as e:
|
||||
|
||||
@@ -24,6 +24,9 @@ from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_Airplan
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
@@ -53,7 +56,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4836", name="WIFI-4836")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnect_5g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
def test_ClientConnect_5g_WPA2_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
@@ -90,7 +93,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4835", name="WIFI-4835")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnect_2g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
def test_ClientConnect_2g_WPA2_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
@@ -128,7 +131,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4838", name="WIFI-4838")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnect_5g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
def test_ClientConnect_5g_WPA3_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
@@ -166,7 +169,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4837", name="WIFI-4837")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnect_2g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
def test_ClientConnect_2g_WPA3_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
@@ -200,3 +203,79 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4840", name="WIFI-4840")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_5g_WPA_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4839", name="WIFI-4839")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_2g_WPA_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
@@ -53,9 +53,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
pytest -m "client_connect and bridge and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4570", name="WIFI-4570")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnect_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -86,9 +88,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4569", name="WIFI-4569")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnect_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_WPA2_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -119,9 +123,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4568", name="WIFI-4568")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnect_5g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_WPA_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -153,9 +159,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4567", name="WIFI-4567")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnect_2g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_WPA_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -187,9 +195,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4566", name="WIFI-4566")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_ClientConnect_5g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_Open_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -227,9 +237,11 @@ class TestBridgeModeConnectSuiteOne(object):
|
||||
#ForgetWifi
|
||||
# ForgetWifiConnection(request, setup_perfectoMobile_android, ssidName, connData)
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4565", name="WIFI-4565")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_ClientConnect_2g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_Open_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -301,10 +313,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connect and bridge and InteropsuiteB"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4572", name="WIFI-4572")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_ClientConnect_5g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa3_personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -336,9 +349,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4571", name="WIFI-4571")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_ClientConnect_2g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa3_personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -370,9 +385,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4574", name="WIFI-4574")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
def test_ClientConnect_5g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa3_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -404,9 +421,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4573", name="WIFI-4573")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
def test_ClientConnect_2g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa3_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -438,9 +457,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4576", name="WIFI-4576")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
def test_ClientConnect_5g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -472,10 +493,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4575", name="WIFI-4575")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
def test_ClientConnect_2g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -207,3 +210,80 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4693", name="WIFI-4693")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnect_5g_WPA_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4692", name="WIFI-4692")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_2g_WPA_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@@ -25,6 +25,9 @@ from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_Airplan
|
||||
setup_params_enterprise = {
|
||||
"mode": "BRIDGE",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
@@ -54,7 +57,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4665", name="WIFI-4665")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnectivity_5g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
def test_ClientConnectivity_5g_WPA2_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][1]
|
||||
@@ -94,7 +97,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4664", name="WIFI-4664")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_enterprise
|
||||
def test_ClientConnectivity_2g_WPA2_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
def test_ClientConnectivity_2g_WPA2_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa2_enterprise"][0]
|
||||
@@ -135,7 +138,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4667", name="WIFI-4667")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnectivity_5g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
def test_ClientConnectivity_5g_WPA3_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][1]
|
||||
@@ -176,7 +179,7 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4666", name="WIFI-4666")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_enterprise
|
||||
def test_ClientConnectivity_2g_WPA3_enterprise(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
def test_ClientConnectivity_2g_WPA3_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa3_enterprise"][0]
|
||||
@@ -213,3 +216,85 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4669", name="WIFI-4669")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_5g_WPA_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
# Set Wifi/AP Mode
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4668", name="WIFI-4668")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_2g_WPA_enterprise_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
# Set Wifi/AP Mode
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@@ -53,10 +53,11 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connectivity and bridge and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4584", name="WIFI-4584")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_WPA2_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -92,9 +93,11 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4582", name="WIFI-4582")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_WPA2_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -130,9 +133,11 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4580", name="WIFI-4580")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_5g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_WPA_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -168,9 +173,11 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4579", name="WIFI-4579")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_2g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_WPA_Personal_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -206,9 +213,11 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4578", name="WIFI-4578")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_ClientConnectivity_5g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_Open_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -244,10 +253,12 @@ class TestBridgeModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4577", name="WIFI-4577")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
@pytest.mark.test_ClientConnectivity_2g_Open_and
|
||||
def test_ClientConnectivity_2g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_Open_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -323,11 +334,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
""" Client Connect SuiteB
|
||||
pytest -m "client_connect and bridge and InteropsuiteB"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4587", name="WIFI-4587")
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_2g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -363,10 +375,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4588", name="WIFI-4588")
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_5g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -402,10 +416,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4589", name="WIFI-4589")
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_mixed_2g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -441,10 +457,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4590", name="WIFI-4590")
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_mixed_5g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -480,10 +498,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4591", name="WIFI-4591")
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa_wpa2_personal_2g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -519,10 +539,12 @@ class TestBridgeModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4592", name="WIFI-4592")
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa_wpa2_personal_5g_Bridge(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -221,3 +224,86 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4613", name="WIFI-4613")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnectivity_5g_WPA_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword,setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4612", name="WIFI-4612")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_2g_WPA_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@@ -24,6 +24,9 @@ from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_Airplan
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
@@ -200,3 +203,79 @@ class TestNatModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4827", name="WIFI-4827")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_5g_WPA_enterprise_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4826", name="WIFI-4826")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_2g_WPA_enterprise_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data,
|
||||
setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
@@ -52,10 +52,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connect and nat and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4510", name="WIFI-4510")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnect_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_WPA2_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -86,9 +87,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4509", name="WIFI-4509")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnect_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_WPA2_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -120,9 +123,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4507", name="WIFI-4507")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnect_5g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_WPA_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -154,9 +159,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4505", name="WIFI-4505")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnect_2g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_WPA_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -188,9 +195,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4504", name="WIFI-4504")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_ClientConnect_5g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_Open_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -222,10 +231,11 @@ class TestNatModeConnectSuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4503", name="WIFI-4503")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_ClientConnect_2g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_Open_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -297,10 +307,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connect and nat and InteropsuiteB"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4516", name="WIFI-4516")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_ClientConnect_5g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa3_personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -332,9 +343,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4515", name="WIFI-4515")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal
|
||||
def test_ClientConnect_2g_wpa3_personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa3_personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -366,9 +379,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4521", name="WIFI-4521")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
def test_ClientConnect_5g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa3_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -400,9 +415,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4519", name="WIFI-4519")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
def test_ClientConnect_2g_wpa3_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa3_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -434,9 +451,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4524", name="WIFI-4524")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
def test_ClientConnect_5g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_5g_wpa_wpa2_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -468,10 +487,11 @@ class TestBridgeModeConnectSuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4523", name="WIFI-4523")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
def test_ClientConnect_2g_wpa_wpa2_personal_mixed(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnect_2g_wpa_wpa2_personal_mixed_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -207,3 +210,80 @@ class TestNatModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4699", name="WIFI-4699")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnect_5g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and nat and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4698", name="WIFI-4698")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_2g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@@ -25,6 +25,9 @@ from android_lib import closeApp, set_APconnMobileDevice_android, Toggle_Airplan
|
||||
setup_params_enterprise = {
|
||||
"mode": "NAT",
|
||||
"ssid_modes": {
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa2_enterprise": [
|
||||
{"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
@@ -213,3 +216,85 @@ class TestNatModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4677", name="WIFI-4677")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_5g_WPA_enterprise_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
# Set Wifi/AP Mode
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4676", name="WIFI-4676")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_2g_WPA_enterprise_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_android, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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
|
||||
|
||||
ip, is_internet = get_ip_address_eap_and(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android,
|
||||
connData)
|
||||
# Set Wifi/AP Mode
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_android, connData)
|
||||
assert verifyUploadDownloadSpeed_android(request, setup_perfectoMobile_android, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData)
|
||||
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
@@ -53,10 +53,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
""" Client Connect SuiteA
|
||||
pytest -m "client_connectivity and nat and InteropsuiteA"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4536", name="WIFI-4536")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_5g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_WPA2_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -92,9 +93,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4535", name="WIFI-4535")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa2_personal
|
||||
def test_ClientConnectivity_2g_WPA2_Personal(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_WPA2_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -130,9 +133,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4534", name="WIFI-4534")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_5g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_WPA_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -168,9 +173,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4533", name="WIFI-4533")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa
|
||||
def test_ClientConnectivity_2g_WPA(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_WPA_Personal_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["wpa"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -206,9 +213,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4531", name="WIFI-4531")
|
||||
@pytest.mark.fiveg
|
||||
@pytest.mark.open
|
||||
def test_ClientConnectivity_5g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_5g_Open_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -244,9 +253,11 @@ class TestNatModeConnectivitySuiteOne(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4530", name="WIFI-4530")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.open
|
||||
def test_ClientConnectivity_2g_Open(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_ClientConnectivity_2g_Open_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general["ssid_modes"]["open"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -322,11 +333,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
""" Client Connectivity SuiteB
|
||||
pytest -m "client_connectivity and nat and InteropsuiteB"
|
||||
"""
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4539", name="WIFI-4539")
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_2g_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -362,10 +374,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4540", name="WIFI-4540")
|
||||
@pytest.mark.wpa3_personal
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_5g_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -401,10 +415,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4541", name="WIFI-4541")
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('open 2.4 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_mixed_2g_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -440,10 +456,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4542", name="WIFI-4542")
|
||||
@pytest.mark.wpa3_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('open 5 GHZ Band')
|
||||
def test_wpa3_personal_mixed_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa3_personal_mixed_5g(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -479,10 +497,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4543", name="WIFI-4543")
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.twog
|
||||
@allure.story('wpa wpa2 personal mixed 2.4 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_2g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa_wpa2_personal_2g_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
@@ -518,10 +538,12 @@ class TestNatModeConnectivitySuiteTwo(object):
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4544", name="WIFI-4544")
|
||||
@pytest.mark.wpa_wpa2_personal_mixed
|
||||
@pytest.mark.fiveg
|
||||
@allure.story('wpa wpa2 personal mixed 5 GHZ Band')
|
||||
def test_wpa_wpa2_personal_ssid_5g(self, request, get_vif_state, get_ap_logs, get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
def test_wpa_wpa2_personal_5g_Nat(self, request, get_vif_state, get_ap_logs,
|
||||
get_ToggleAirplaneMode_data, setup_perfectoMobile_android):
|
||||
|
||||
profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"]}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -222,3 +225,87 @@ class TestNatModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4719", name="WIFI-4719")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnectivity_5g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and nat and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4718", name="WIFI-4718")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_2g_WPA_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -207,3 +210,80 @@ class TestBridgeModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4706", name="WIFI-4706")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnect_5g_WPA_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS,
|
||||
connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4705", name="WIFI-4705")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnect_2g_WPA_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if ip:
|
||||
if is_internet:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "without internet")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
assert True
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("Device is Unable to connect"))
|
||||
assert False
|
||||
|
||||
@@ -27,14 +27,14 @@ pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.m
|
||||
setup_params_general = {
|
||||
"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", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"], "security_key": "something", "vlan": 100}],
|
||||
"open": [{"ssid_name": "ssid_open_2g_vlan", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_open_5g_vlan", "appliedRadios": ["5G"], "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", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 100}]},
|
||||
{"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", "vlan": 100}]},
|
||||
"rf": {},
|
||||
"radius": False
|
||||
}
|
||||
@@ -265,16 +265,16 @@ setup_params_general_two = {
|
||||
"mode": "VLAN",
|
||||
"ssid_modes": {
|
||||
"wpa3_personal": [
|
||||
{"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"],
|
||||
{"ssid_name": "ssid_wpa3_p_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_p_5g_vlan", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 100}],
|
||||
"wpa3_personal_mixed": [
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"],
|
||||
{"ssid_name": "ssid_wpa3_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_p_m_5g_vlan", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 100}],
|
||||
"wpa_wpa2_personal_mixed": [
|
||||
{"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"],
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_2g_vlan", "appliedRadios": ["2G"], "security_key": "something", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa_wpa2_p_m_5g_vlan", "appliedRadios": ["5G"],
|
||||
"security_key": "something", "vlan": 100}]
|
||||
},
|
||||
"rf": {},
|
||||
|
||||
@@ -32,7 +32,10 @@ setup_params_enterprise = {
|
||||
{"ssid_name": "ssid_wpa2_eap_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"wpa3_enterprise": [
|
||||
{"ssid_name": "ssid_wpa3_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]},
|
||||
{"ssid_name": "ssid_wpa3_eap_5g", "appliedRadios": ["5G"], "vlan": 100}],
|
||||
"wpa_enterprise": [
|
||||
{"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"], "vlan": 100}]},
|
||||
|
||||
"rf": {},
|
||||
"radius": True
|
||||
@@ -221,3 +224,86 @@ class TestVlanModeEnterpriseTTLSSuiteA(object):
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4831", name="WIFI-4831")
|
||||
@pytest.mark.wpa_enterprise
|
||||
@pytest.mark.fiveg
|
||||
def test_ClientConnectivity_5g_WPA_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
""" wpa enterprise 5g
|
||||
pytest -m "client_connect and vlan and enterprise and ttls and wpa_enterprise and fiveg"
|
||||
"""
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][1]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword,setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-4830", name="WIFI-4830")
|
||||
@pytest.mark.twog
|
||||
@pytest.mark.wpa_enterprise
|
||||
def test_ClientConnectivity_2g_WPA_Eap_Vlan(self, request, get_vif_state, get_ToggleAirplaneMode_data
|
||||
, setup_perfectoMobile_iOS, radius_info, get_ap_logs):
|
||||
|
||||
profile_data = setup_params_enterprise["ssid_modes"]["wpa_enterprise"][0]
|
||||
ssidName = profile_data["ssid_name"]
|
||||
ssidPassword = ["BLANK"]
|
||||
# ssidPassword = profile_data["security_key"]
|
||||
print("SSID_NAME: " + ssidName)
|
||||
# print ("SSID_PASS: " + ssidPassword)
|
||||
ttls_passwd = radius_info["password"]
|
||||
identity = radius_info['user']
|
||||
get_vif_state.append(ssidName)
|
||||
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_ToggleAirplaneMode_data
|
||||
|
||||
# Set Wifi/AP Mode
|
||||
ip, is_internet = get_ip_address_eap_ios(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
|
||||
if is_internet:
|
||||
if ip:
|
||||
text_body = ("connected to " + ssidName + " (" + ip + ") " + "with internet")
|
||||
else:
|
||||
text_body = ("connected to " + ssidName + "with Internet, couldn't get IP address")
|
||||
print(text_body)
|
||||
allure.attach(name="Connection Status: ", body=str(text_body))
|
||||
|
||||
wifi_connect_eap(request, ssidName, identity, ttls_passwd, setup_perfectoMobile_iOS, connData)
|
||||
assert verifyUploadDownloadSpeediOS(request, setup_perfectoMobile_iOS, connData)
|
||||
wifi_disconnect_and_forget(request, ssidName, ssidPassword, setup_perfectoMobile_iOS, connData)
|
||||
else:
|
||||
allure.attach(name="Connection Status: ", body=str("No Internet access"))
|
||||
assert False
|
||||
|
||||
@@ -27,14 +27,14 @@ pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.ios, pytest.m
|
||||
setup_params_general = {
|
||||
"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", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"],
|
||||
"open": [{"ssid_name": "ssid_open_2g_vlan", "appliedRadios": ["2G"], "vlan": 100},
|
||||
{"ssid_name": "ssid_open_5g_vlan", "appliedRadios": ["5G"], "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", "vlan": 100},
|
||||
{"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"],
|
||||
{"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
|
||||
|
||||
@@ -85,7 +85,7 @@ class Fixtures_1x:
|
||||
|
||||
def setup_profiles(self, request, param, setup_controller, testbed, get_equipment_ref, instantiate_profile,
|
||||
get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
|
||||
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info, skip_lf=False):
|
||||
|
||||
instantiate_profile = instantiate_profile(sdk_client=setup_controller)
|
||||
vlan_id, mode = 0, 0
|
||||
|
||||
@@ -318,13 +318,47 @@ class Fixtures_2x:
|
||||
version_list.append(version)
|
||||
return version_list
|
||||
|
||||
def get_uci_show(self, get_apnos, get_configuration):
|
||||
version_list = []
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info)
|
||||
connectivity_data = ap_ssh.run_generic_command(cmd="uci show ucentral.config.server")
|
||||
# connectivity_data.pop(0)
|
||||
# connectivity_data.pop(1)
|
||||
break
|
||||
# version_list.append(connectivity_data)
|
||||
return connectivity_data[1]
|
||||
|
||||
def get_ap_status_logs(self, get_configuration, get_apnos):
|
||||
connected = 0
|
||||
redirector_data = None
|
||||
for access_point_info in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(access_point_info, sdk="2.x")
|
||||
# for i in range(15):
|
||||
connectivity_data = ap_ssh.run_generic_command(cmd="ubus call ucentral status")
|
||||
if "disconnected" in str(connectivity_data):
|
||||
print("AP in disconnected state, sleeping for 30 sec")
|
||||
# time.sleep(30)
|
||||
connected = 0
|
||||
# # if i == 10:
|
||||
# print("rebooting AP")
|
||||
# ap_ssh.reboot()
|
||||
# print("sleep for 300 sec")
|
||||
# time.sleep(300)
|
||||
else:
|
||||
connected = 1
|
||||
|
||||
redirector_data = ap_ssh.run_generic_command(cmd="cat /etc/ucentral/redirector.json")
|
||||
return connected, redirector_data
|
||||
|
||||
def get_sdk_version(self):
|
||||
version = self.controller_obj.get_sdk_version()
|
||||
return version
|
||||
|
||||
def setup_profiles(self, request, param, setup_controller, testbed, get_equipment_ref,
|
||||
instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools,
|
||||
get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info):
|
||||
get_security_flags, get_configuration, radius_info, get_apnos,
|
||||
radius_accounting_info, skip_lf=False):
|
||||
|
||||
instantiate_profile_obj = instantiate_profile(sdk_client=setup_controller)
|
||||
print(1, instantiate_profile_obj.sdk_client)
|
||||
@@ -666,6 +700,7 @@ class Fixtures_2x:
|
||||
]
|
||||
ssid_data.append(ssid)
|
||||
lf_tools.ssid_list.append(ssid_info_sdk[interface][0])
|
||||
if not skip_lf:
|
||||
lf_tools.dut_idx_mapping = idx_mapping
|
||||
lf_tools.update_ssid(ssid_data=ssid_data)
|
||||
except Exception as e:
|
||||
|
||||
@@ -52,7 +52,7 @@ reportTags=TestTag
|
||||
|
||||
# iOS Device Capabilities
|
||||
#manufacturer-iOS=Apple
|
||||
model-iOS=iPhone-12
|
||||
model-iOS=iPhone-11
|
||||
bundleId-iOS=com.apple.Preferences
|
||||
platformName-iOS=iOS
|
||||
#default iOS settings app
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
"""
|
||||
Test Case Module: Testing Basic Connectivity with Resources
|
||||
"""
|
||||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
import requests
|
||||
import json
|
||||
|
||||
pytestmark = [pytest.mark.test_resources, pytest.mark.sanity, pytest.mark.uc_sanity,
|
||||
pytest.mark.sanity_55]
|
||||
@@ -17,26 +19,133 @@ class TestResources(object):
|
||||
@pytest.mark.test_cloud_controller
|
||||
@pytest.mark.uc_sanity
|
||||
@allure.testcase(name="test_controller_connectivity", url="")
|
||||
def test_controller_connectivity(self, setup_controller):
|
||||
def test_controller_connectivity(self, setup_controller, get_configuration):
|
||||
"""Test case to verify cloud Controller Connectivity"""
|
||||
|
||||
login_response_json = setup_controller.login_resp.json()
|
||||
response_code = setup_controller.login_resp.status_code
|
||||
allure.attach(name="Login Response Code", body=str(response_code))
|
||||
allure.attach(name="Login Response JSON",
|
||||
body=str(login_response_json),
|
||||
attachment_type=allure.attachment_type.JSON)
|
||||
version = setup_controller.get_sdk_version()
|
||||
print(version)
|
||||
assert response_code == 200
|
||||
request_url = setup_controller.login_resp.request.url
|
||||
print("Login_Request_URL: ", str(request_url))
|
||||
allure.attach(name="Login_Request_URL: ", body=str(request_url))
|
||||
print("response_code: ", response_code)
|
||||
allure.attach(name="Login Response Code: ", body=str(response_code))
|
||||
print("login_response_json: ", login_response_json)
|
||||
allure.attach(name="Login Response JSON: ", body=str(setup_controller.login_resp.json()))
|
||||
if response_code != 200:
|
||||
pytest.exit(
|
||||
"exiting from pytest, login response is no 200: " + str(setup_controller.login_resp.status_code))
|
||||
|
||||
gw_system_info = setup_controller.get_system_gw()
|
||||
request_url = gw_system_info.request.url
|
||||
allure.attach(name="get_system_gw_request: ", body=str(request_url))
|
||||
gw_system_status = gw_system_info.status_code
|
||||
gw_system_status_json = gw_system_info.json()
|
||||
print("gw_status_check response from gateway: ", gw_system_status)
|
||||
allure.attach(name="gw_status_check response from gateway: ", body=str(gw_system_status) +
|
||||
str(gw_system_status_json))
|
||||
if gw_system_status != 200:
|
||||
allure.attach(name="Login_Request_URL: ", body=str(request_url))
|
||||
pytest.exit("gw_status_check response from gateway: " + str(gw_system_status))
|
||||
|
||||
fms_system_info = setup_controller.get_system_fms()
|
||||
request_url = fms_system_info.request.url
|
||||
allure.attach(name="get_system_fms_request: ", body=str(request_url))
|
||||
fms_system_status = fms_system_info.status_code
|
||||
fms_system_status_json = fms_system_info.json()
|
||||
print("fms_status_check response from fms: ", fms_system_status)
|
||||
allure.attach(name="fms_status_check response from fms:", body=str(fms_system_status) +
|
||||
str(fms_system_status_json))
|
||||
if fms_system_status != 200:
|
||||
pytest.exit("fms_status_check response from fms: " + str(fms_system_status))
|
||||
|
||||
# if gw_status_check != 200:
|
||||
# for i in range(10):
|
||||
# if setup_controller.get_system_gw().status_code != 200 and i < 9:
|
||||
# print("sleeping for 30 sec, gw service is down with response not equals to 200")
|
||||
# time.sleep(30)
|
||||
# elif setup_controller.get_system_gw().status_code != 200 and i == 9:
|
||||
# pytest.exit("GW service is not up yet, exiting from pytest")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# if fms_status_check != 200:
|
||||
# for i in range(10):
|
||||
# if setup_controller.get_system_fms().status_code != 200 and i < 9:
|
||||
# print("sleeping for 30 sec, fms service is down with response not equals to 200")
|
||||
# time.sleep(30)
|
||||
# elif setup_controller.get_system_fms().status_code != 200 and i == 9:
|
||||
# pytest.exit("fms service is not up yet, exiting from pytest")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# available_device_list = []
|
||||
# devices = setup_controller.get_devices()
|
||||
# number_devices = len(devices["devices"])
|
||||
# for i in range(number_devices):
|
||||
# available_device_list.append(devices["devices"][i]["serialNumber"])
|
||||
# print("available_device_list: ", available_device_list)
|
||||
#
|
||||
# if get_configuration["access_point"][0]["serial"] not in available_device_list:
|
||||
# for i in range(10):
|
||||
# available_device_list = []
|
||||
# devices = setup_controller.get_devices()
|
||||
# number_devices = len(devices["devices"])
|
||||
# for i in range(number_devices):
|
||||
# available_device_list.append(devices["devices"][i]["serialNumber"])
|
||||
# print(available_device_list)
|
||||
#
|
||||
# if get_configuration["access_point"][0]["serial"] not in available_device_list and i < 9:
|
||||
# print("unable to find device on UI, Sleeping for 30 sec")
|
||||
# time.sleep(30)
|
||||
# elif get_configuration["access_point"][0]["serial"] not in available_device_list and i == 9:
|
||||
# pytest.exit("Device" + get_configuration["access_point"][0]["serial"] + "not found on UI")
|
||||
# else:
|
||||
# break
|
||||
#
|
||||
# for ap in get_configuration['access_point']:
|
||||
#
|
||||
# ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
|
||||
# uci_show_ucentral = ap_ssh.run_generic_command("uci show ucentral")
|
||||
# print(uci_show_ucentral)
|
||||
# print("AP is pointing to: ", ap_ssh.get_ap_uci_show_ucentral())
|
||||
# expected_sdk = str(get_configuration["controller"]['url'].replace("https://sec", "\'gw").replace(":16001","\'"))
|
||||
# if ap_ssh.get_ap_uci_show_ucentral() != expected_sdk:
|
||||
# for i in range(10):
|
||||
# ucentral_show = str(ap_ssh.get_ap_uci_show_ucentral().strip())
|
||||
# print("AP pointing to: ", ucentral_show)
|
||||
# print("AP should point to: ", expected_sdk)
|
||||
#
|
||||
# if ucentral_show != expected_sdk and i < 9:
|
||||
# print("AP is not pointing to right SDK, retry after 30 sec")
|
||||
# time.sleep(30)
|
||||
# elif ucentral_show != expected_sdk and i == 9:
|
||||
# assert False
|
||||
# pytest.exit("AP is not pointing to right SDK")
|
||||
# else:
|
||||
# break
|
||||
|
||||
assert True
|
||||
|
||||
@pytest.mark.test_access_points_connectivity
|
||||
@allure.testcase(name="test_access_points_connectivity", url="")
|
||||
def test_access_points_connectivity(self, test_access_point, fixtures_ver):
|
||||
def test_access_points_connectivity(self, setup_controller, get_uci_show, test_access_point, get_configuration,
|
||||
test_ap_connection_status, fixtures_ver):
|
||||
"""Test case to verify Access Points Connectivity"""
|
||||
data = []
|
||||
for status in test_access_point:
|
||||
data.append(status[0])
|
||||
connection, redirector = test_ap_connection_status
|
||||
allure.attach(name="AP - Cloud connectivity info", body=str(fixtures_ver.ubus_connection))
|
||||
print("test_ap_connection_status: ", connection, redirector)
|
||||
expected_sdk = str(get_configuration["controller"]['url'].replace("https://sec", "\'gw").replace(":16001", "\'"))
|
||||
print("Expected SDK: ", expected_sdk)
|
||||
allure.attach(name="Exoected SDK: ", body=str(expected_sdk))
|
||||
print("SDK On AP: ", str(get_uci_show.split("=")[1]))
|
||||
allure.attach(name="SDK Pointed by AP: ", body=str(get_uci_show.split("=")[1]))
|
||||
if expected_sdk not in get_uci_show:
|
||||
pytest.exit("AP has invalid Redirector")
|
||||
if test_ap_connection_status[0] == 0:
|
||||
pytest.exit("AP in Disconnected State")
|
||||
assert False not in data
|
||||
|
||||
@pytest.mark.traffic_generator_connectivity
|
||||
@@ -52,7 +161,7 @@ class TestResources(object):
|
||||
class TestFMS(object):
|
||||
|
||||
@pytest.mark.get_firmware_list
|
||||
def test_fms_version_list(self, fixtures_ver, get_configuration):
|
||||
def test_fms_version_list(self, fixtures_ver, get_configuration, get_ap_logs):
|
||||
PASS = []
|
||||
for ap in get_configuration['access_point']:
|
||||
# get the latest branch
|
||||
@@ -135,18 +244,21 @@ class TestFMS(object):
|
||||
assert False not in PASS
|
||||
|
||||
@pytest.mark.firmware_upgrade
|
||||
def test_firmware_upgrade_request(self, firmware_upgrade):
|
||||
def test_firmware_upgrade_request(self, firmware_upgrade, get_ap_logs, test_ap_connection_status):
|
||||
for update in firmware_upgrade:
|
||||
allure.attach(name='serial: ' + update[0], body="")
|
||||
if test_ap_connection_status[0] == 0:
|
||||
assert False
|
||||
pytest.exit("AP in Disconnected State")
|
||||
assert True
|
||||
|
||||
@pytest.mark.test_firmware_ap
|
||||
def test_firmware_upgrade_status_AP(self, firmware_upgrade):
|
||||
def test_firmware_upgrade_status_AP(self, firmware_upgrade, get_ap_logs):
|
||||
allure.attach(name="firmware Upgrade Status:", body="")
|
||||
assert True
|
||||
|
||||
@pytest.mark.test_firmware_gw
|
||||
def test_firmware_upgrade_status_gateway(self, get_apnos, get_configuration, setup_controller):
|
||||
def test_firmware_upgrade_status_gateway(self, get_apnos, get_configuration, setup_controller, get_ap_logs):
|
||||
status = []
|
||||
for ap in get_configuration['access_point']:
|
||||
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
#!/usr/bin/python3.9
|
||||
"""
|
||||
|
||||
lf_tools : Tools for LANforge
|
||||
reboot, run_cmd, etc
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action reboot
|
||||
./lf_tools --host 10.28.3.8 --port 22 --username root --password lanforge --action run_cmd --cmd ls
|
||||
|
||||
"""
|
||||
import argparse
|
||||
import paramiko
|
||||
|
||||
|
||||
class LFTools:
|
||||
|
||||
def __init__(self, host="", port=22, username="root", password="lanforge"):
|
||||
self.host = host
|
||||
self.port = port
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def ssh_cli_connect(self):
|
||||
client = paramiko.SSHClient()
|
||||
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
print("Connecting to LANforge: %s@%s:%s" % (
|
||||
self.username, self.host, self.port))
|
||||
client.connect(self.host, username=self.username, password=self.password,
|
||||
port=self.port, timeout=10, allow_agent=False, banner_timeout=200)
|
||||
|
||||
return client
|
||||
|
||||
def run_cmd(self, cmd):
|
||||
client = self.ssh_cli_connect()
|
||||
stdin, stdout, stderr = client.exec_command(cmd)
|
||||
output = "Output: " + str(stdout.read())
|
||||
error = "Error: " + str(stderr.read())
|
||||
client.close()
|
||||
return output, error
|
||||
|
||||
def run_action(self, action, cmd):
|
||||
if action == "reboot":
|
||||
output, error = self.run_cmd("reboot")
|
||||
print(output, error)
|
||||
elif action == "run_cmd":
|
||||
output, error = self.run_cmd(cmd)
|
||||
print(output, error)
|
||||
else:
|
||||
print("Invalid Action")
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="root")
|
||||
parser.add_argument('--password', type=str, help='--password to the given username', default="lanforge")
|
||||
parser.add_argument('--action', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default="run_cmd")
|
||||
parser.add_argument('--cmd', type=str, help='--cmd : used when action is "run_cmd"', default="pwd")
|
||||
args = parser.parse_args()
|
||||
lf_tools = LFTools(host=args.host, port=args.port, username=args.username, password=args.password)
|
||||
lf_tools.run_action(args.action, args.cmd)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
55
tools/scp_util.py
Executable file
55
tools/scp_util.py
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
|
||||
import paramiko
|
||||
from scp import SCPClient
|
||||
|
||||
|
||||
class SCP_File:
|
||||
def __init__(self, ip="localhost", port=22, username="lanforge", password="lanforge", remote_path="/home/lanforge/",
|
||||
local_path="."):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.remote_path = remote_path
|
||||
self.local_path = local_path
|
||||
self.username = username
|
||||
self.password = password
|
||||
|
||||
def pull_file(self):
|
||||
ssh = paramiko.SSHClient()
|
||||
ssh.load_system_host_keys()
|
||||
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
||||
ssh.connect(hostname=self.ip, username=self.username, password=self.password, port=self.port, allow_agent=False,
|
||||
look_for_keys=False)
|
||||
# ssh.close()
|
||||
|
||||
with SCPClient(ssh.get_transport()) as scp:
|
||||
scp.get(remote_path=self.remote_path, local_path=self.local_path, recursive=True)
|
||||
scp.close()
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog="lf_utils",
|
||||
formatter_class=argparse.RawTextHelpFormatter,
|
||||
allow_abbrev=True,
|
||||
epilog="About lf_tools.py",
|
||||
description="Tools for LANforge System")
|
||||
parser.add_argument('--host', type=str, help=' --host : IP Address f LANforge System', default="localhost")
|
||||
parser.add_argument('--port', type=int, help='--passwd of dut', default=22)
|
||||
parser.add_argument('--username', type=str, help='--username to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--password', type=str, help='--password to use on LANforge', default="lanforge")
|
||||
parser.add_argument('--remote_path', type=str, help='--password to the given username',
|
||||
default="/home/lanforge/lf_kinstall.pl")
|
||||
parser.add_argument('--local_path', type=str, help='--action to perform'
|
||||
'reboot | run_cmd', default=".")
|
||||
args = parser.parse_args()
|
||||
lf_tools = SCP_File(ip=args.host, port=args.port,
|
||||
username=args.username, password=args.password,
|
||||
remote_path=args.remote_path, local_path=args.local_path)
|
||||
lf_tools.pull_file()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user