diff --git a/.github/actions/generate-allure-report/action.yml b/.github/actions/generate-allure-report/action.yml index c382c6e06..8fc087831 100644 --- a/.github/actions/generate-allure-report/action.yml +++ b/.github/actions/generate-allure-report/action.yml @@ -57,9 +57,6 @@ runs: cat << EOF >> "${{ inputs.results_path }}/environment.properties" Tests.CommitId=${{ github.sha }} - 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 diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index b1e28f0d1..20d3d4972 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -50,6 +50,8 @@ runs: - name: run tests shell: bash run: | + set -x + cat </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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: upload Allure results as artifact if: ${{ always() }} diff --git a/.github/workflows/advanced.yml b/.github/workflows/advanced.yml index 25992f431..7e27e83f2 100644 --- a/.github/workflows/advanced.yml +++ b/.github/workflows/advanced.yml @@ -104,7 +104,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | cd tests @@ -151,7 +150,9 @@ jobs: 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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: upload Allure results as artifact if: ${{ always() }} diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index d1f6c46a4..66baba7c2 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -38,7 +38,7 @@ jobs: test-galaxy-s9: runs-on: ubuntu-latest needs: [ build ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -50,7 +50,7 @@ jobs: with: namespace: interop-${{ github.run_id }}-galaxy-s9 testbed: interop-01 - marker_expression: "interop_uc_sanity and client_connect and android" + marker_expression: "interop_uc_sanity and client_connect and android and not wpa3_personal" configuration: "${{ secrets.LAB_CONFIGURATION }}" testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} additional_args: "-o model-android='Galaxy S9' -o 'jobName=Github-Interop-galaxy-s9' -o 'jobNumber=${{ github.run_number }}' --skip-lanforge" @@ -59,7 +59,7 @@ jobs: test-iphone-12: runs-on: ubuntu-latest needs: [ test-galaxy-s9 ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -80,7 +80,7 @@ jobs: test-pixel-4: runs-on: ubuntu-latest needs: [ test-iphone-12 ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -102,7 +102,7 @@ jobs: test-galaxy-s10: runs-on: ubuntu-latest needs: [ build ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -123,7 +123,7 @@ jobs: test-iphone-7: runs-on: ubuntu-latest needs: [ test-galaxy-s10 ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -144,7 +144,7 @@ jobs: test-iphone-11: runs-on: ubuntu-latest needs: [ test-iphone-7 ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: test-galaxy-s20: runs-on: ubuntu-latest needs: [ build ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: test-iphone-xr: runs-on: ubuntu-latest needs: [ test-galaxy-s20 ] - continue-on-error: true + if: always() steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 32907d0b6..e3f82bf66 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -72,6 +72,7 @@ jobs: test: runs-on: [ self-hosted, small ] needs: [ build ] + timeout-minutes: 1440 steps: - name: install JRE @@ -143,7 +144,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | cd tests @@ -187,7 +187,9 @@ jobs: 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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: upload Allure results as artifact if: always() diff --git a/.github/workflows/ow_docker-compose.yml b/.github/workflows/ow_docker-compose.yml index c423f5010..ae680d63e 100644 --- a/.github/workflows/ow_docker-compose.yml +++ b/.github/workflows/ow_docker-compose.yml @@ -385,7 +385,6 @@ jobs: 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 @@ -413,7 +412,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | cd tests @@ -458,7 +456,9 @@ jobs: 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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: print logs if: always() diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 077e5f4fd..8d4fd5401 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -114,7 +114,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | cd tests @@ -159,7 +158,9 @@ jobs: 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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: print logs if: always() diff --git a/.github/workflows/quali-advanced.yml b/.github/workflows/quali-advanced.yml index 9e33bb3c1..53928e182 100644 --- a/.github/workflows/quali-advanced.yml +++ b/.github/workflows/quali-advanced.yml @@ -12,7 +12,7 @@ on: description: 'revision of the Open Wifi Helm chart' ap_models: required: true - default: 'EAP102,cig_wf194c' + default: 'edgecore_eap102,cig_wf194c4' description: 'the AP models to test' ap_version: required: true @@ -43,7 +43,7 @@ jobs: id: vars run: | echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'main' }}") - echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'EAP102,cig_wf194c' }}") + echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'edgecore_eap102,cig_wf194c4' }}") 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 || 'advance' }}") @@ -117,7 +117,7 @@ jobs: - name: start reservation run: | - python wlan-testing/.quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --ap-model "${{ matrix.ap_model }}" --blueprint "Advance Lab" + python wlan-testing/.quali/start_reservation.py --global-inputs '{"Chart Version":"${{ needs.vars.outputs.openwifi_revision }}","AP Model":"${{ matrix.ap_model }}"}' --reservation-duration 720 "Advance Lab" - name: set reservation outputs if: always() @@ -267,8 +267,6 @@ jobs: } EOF - cat configuration.py - kubectl create secret generic configuration --from-file=configuration=./configuration.py - name: run tests @@ -296,7 +294,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | HOSTS="sec-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build" @@ -352,7 +349,9 @@ jobs: 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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: show gw logs if: failure() diff --git a/.github/workflows/quali-basic-manual.yml b/.github/workflows/quali-basic-manual.yml index fd7cf9dc1..118c5dfda 100644 --- a/.github/workflows/quali-basic-manual.yml +++ b/.github/workflows/quali-basic-manual.yml @@ -23,22 +23,6 @@ on: 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 @@ -86,6 +70,7 @@ jobs: test: runs-on: [ self-hosted, small ] needs: [ build ] + timeout-minutes: 1440 steps: - uses: actions/checkout@v2 @@ -103,7 +88,7 @@ jobs: CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} run: | - 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 }}" + python .quali/start_reservation.py --global-inputs '{"Chart Version":"${{ github.event.inputs.openwifi_revision }}","AP Model":"${{ github.event.inputs.ap_model }}"}' "Basic Lab" - name: set reservation outputs if: always() @@ -283,7 +268,6 @@ jobs: cpu: "250m" command: - /bin/bash - - -x - -c - | HOSTS="sec-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build gw-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build fms-${{ steps.reservation.outputs.namespace }}.cicd.lab.wlan.tip.build" diff --git a/.github/workflows/quali.yml b/.github/workflows/quali.yml index b8ce3025b..076f6fab2 100644 --- a/.github/workflows/quali.yml +++ b/.github/workflows/quali.yml @@ -20,22 +20,6 @@ on: 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_models: required: true default: 'edgecore_ecw5410,edgecore_eap101,tp-link_ec420-g1,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c,hfcl_ion4' @@ -48,6 +32,11 @@ on: required: true default: 'uc_sanity' description: 'Marker expression to select tests to execute' + use_qa01: + type: boolean + required: true + default: 'true' + description: 'Use openwifi-qa01 instead of dynamic cloud controller' schedule: - cron: '30 20 * * *' @@ -56,26 +45,20 @@ jobs: runs-on: ubuntu-latest outputs: openwifi_revision: ${{ steps.vars.outputs.openwifi}} - openwifi_gw_revision: ${{ steps.vars.outputs.gw}} - openwifi_sec_revision: ${{ steps.vars.outputs.sec}} - openwifi_fms_revision: ${{ steps.vars.outputs.fms}} - 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 }} + use_qa01: ${{ steps.vars.outputs.use_qa01 }} steps: - name: set variables id: vars run: | - 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=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'main' }}") 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' }}") + echo ::set-output name=use_qa01::$(echo "${{ github.event.inputs.use_qa01 || 'true' }}") generate-matrix: name: generate AP model matrix @@ -126,14 +109,24 @@ jobs: - name: start reservation run: | - 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 }}" + if [ ${{ needs.vars.outputs.use_qa01 }} == 'true' ] + then + python .quali/start_reservation.py --global-inputs '{"Chart Version":"${{ needs.vars.outputs.openwifi_revision }}","AP Model":"${{ matrix.ap_model }}","Optional Existing SDK Namespace":"qa01"}' "Basic Lab" + else + python .quali/start_reservation.py --global-inputs '{"Chart Version":"${{ needs.vars.outputs.openwifi_revision }}","AP Model":"${{ matrix.ap_model }}"}' "Basic Lab" + fi - name: set reservation outputs if: always() id: reservation run: | echo ::set-output name=identifier::"$(cat ./reservation_id.txt)" - echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)" + if [ ${{ needs.vars.outputs.use_qa01 }} == 'true' ] + then + echo ::set-output name=namespace::"qa01" + else + echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)" + fi - name: get EKS access credentials run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} @@ -183,6 +176,24 @@ jobs: "password": "password", "pk_password": "whatever" } + + DYNAMIC_VLAN_RADIUS_SERVER_DATA = { + "ip": "3.20.165.131", + "port": 1812, + "secret": "testing123", + "user": "user", + "password": "password", + "pk_password": "whatever" + } + + DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = { + "ip": "3.20.165.131", + "port": 1813, + "secret": "testing123", + "user": "user", + "password": "password", + "pk_password": "whatever" + } PASSPOINT_RADIUS_SERVER_DATA = { "ip": "52.234.179.191", @@ -276,12 +287,19 @@ jobs: } EOF - cat configuration.py + + # fix wrong configuration value from Quali + if [ ${{ needs.vars.outputs.use_qa01 }} == 'true' ] + then + sed -i "s/https:\/\/sec-.*\.cicd\.lab\.wlan\.tip\.build/https:\/\/sec-qa01.cicd.lab.wlan.tip.build/g" configuration.py + fi kubectl create secret generic configuration --from-file=configuration=./configuration.py - name: run tests run: | + set -x + cat </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}") + + until [[ ! -z "$EXIT_CODE" ]]; do EXIT_CODE=$(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}"); sleep 1; done; + exit $EXIT_CODE - name: show gw logs if: failure() diff --git a/.github/workflows/uc_loadsim.yml b/.github/workflows/uc_loadsim.yml index 8705d2604..bdaf882bc 100644 --- a/.github/workflows/uc_loadsim.yml +++ b/.github/workflows/uc_loadsim.yml @@ -23,10 +23,6 @@ defaults: jobs: loadsim: 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 Testing repo uses: actions/checkout@v2 @@ -42,19 +38,19 @@ jobs: NAMESPACE="ls-${{ github.run_number }}" kubectl create ns $NAMESPACE kubectl config set-context --current --namespace=$NAMESPACE - echo "::set-output name=name::${NAMESPACE}" + echo "::set-output name=namespace::${NAMESPACE}" - name: Set gateway URL output - id: gateway_url - run: echo "::set-output name=name::gw-${{ steps.namespace.outputs.name }}.cicd.lab.wlan.tip.build" + id: gateway + run: echo "::set-output name=url::gw-${{ steps.namespace.outputs.namespace }}.cicd.lab.wlan.tip.build" - name: Set sec service URL output - id: sec_url - run: echo "::set-output name=value::sec-${{ steps.namespace.outputs.name }}.cicd.lab.wlan.tip.build" + id: sec + run: echo "::set-output name=url::sec-${{ steps.namespace.outputs.namespace }}.cicd.lab.wlan.tip.build" - name: Set ls service URL output - id: ls_url - run: echo "::set-output name=value::ls-${{ steps.namespace.outputs.name }}.cicd.lab.wlan.tip.build" + id: ls + run: echo "::set-output name=url::ls-${{ steps.namespace.outputs.namespace }}.cicd.lab.wlan.tip.build" - name: Prepare certificates from secrets working-directory: wlan-testing/helm/ucentral @@ -67,7 +63,7 @@ jobs: - name: Deploy CloudSDK instance with load simulator working-directory: wlan-testing/helm/ucentral run: | - export NAMESPACE="openwifi-${{ steps.namespace.outputs.name }}" + export NAMESPACE="${{ steps.namespace.outputs.namespace }}" export DEPLOY_METHOD=git export CHART_VERSION="${{ github.event.inputs.sdk_version }}" export OWGW_VERSION=master @@ -89,9 +85,6 @@ jobs: export OWSEC_NEW_PASSWORD=${{ secrets.OWSEC_NEW_PASSWORD }} ./deploy.sh - - name: Wait for DNS to propagate - run: sleep 300 - - name: Checkout OWLS for CLI tool uses: actions/checkout@v2 with: @@ -101,20 +94,21 @@ jobs: - name: Run simulation working-directory: wlan-cloud-owls/test_scripts/curl run: | - export OWGW="${{ steps.gw_url.ouputs.name }}:15002" - export OWSEC="${{ steps.sec_url.ouputs.name }}:16001" - export OWLS="${{ steps.ls_url.output.name }}:16007" + export OWGW="${{ steps.gateway.outputs.url }}:15002" + export OWSEC="${{ steps.sec.outputs.url }}:16001" + export OWLS="${{ steps.ls.outputs.url }}:16007" + echo "OWGW - $OWGW" + echo "OWSEC - $OWSEC" + echo "OWLS - $OWLS" curl -s -X POST -H 'Content-Type: application/json' https://$OWSEC/api/v1/oauth2 -d '{"userId": "tip@ucentral.com", "password": "'${{ secrets.OWSEC_NEW_PASSWORD }}'"}' | jq '.access_token' -r > access_token echo echo "[Info] Creating simulation" cat > input_sim_info.json < CloudShellAPISession: return CloudShellAPISession(url, user, password, "Global") -def __wait_for_status(session, res_id, field, target_status): +def __wait_for_status(session, res_id, field, target_statuses=[], exit_statuses=[]): timer = 0 sleep_time = 5 while True: status = session.GetReservationStatus(res_id).ReservationSlimStatus.__dict__[field] - if status == target_status: + if status in target_statuses: + print(f'reached target status: {status}') break + if status in exit_statuses: + print(f'reached exit status: {status}') + exit(1) + + print(f'current reservation status: {status}') + if timer >= TIMEOUT: - raise RuntimeError(f'waiting for reservation to reach status {target_status} timed out') + raise RuntimeError(f'waiting for reservation to reach one of {target_statuses} or {exit_statuses} statuses timed out') time.sleep(sleep_time) timer += sleep_time -def wait_for_provisioning_status(session, res_id, target_status): - __wait_for_status(session, res_id, 'ProvisioningStatus', target_status) +def wait_for_provisioning_status(session, res_id, target_statuses, exit_statuses=[]): + __wait_for_status(session, res_id, 'ProvisioningStatus', target_statuses, exit_statuses) -def wait_for_reservation_status(session, res_id, target_status): - __wait_for_status(session, res_id, 'Status', target_status) +def wait_for_reservation_status(session, res_id, target_statuses, exit_statuses=[]): + __wait_for_status(session, res_id, 'Status', target_statuses, exit_statuses) diff --git a/.quali/start_reservation.py b/.quali/start_reservation.py index 44a0bf8f8..13b6b1e28 100644 --- a/.quali/start_reservation.py +++ b/.quali/start_reservation.py @@ -1,3 +1,4 @@ +import json import os from cloudshell.api.cloudshell_api import UpdateTopologyGlobalInputsRequest @@ -6,49 +7,40 @@ import argparse from common import wait_for_provisioning_status, get_session -run_id = os.environ.get('GITHUB_RUN_NUMBER', 1) +run_number = os.environ.get('GITHUB_RUN_NUMBER', 1) +run_id = os.environ.get('GITHUB_JOB', 'job') +workflow = os.environ.get('GITHUB_WORKFLOW', "workflow") marker_expression = os.environ.get('MARKER_EXPRESSION', 'sanity') def main(): parser = argparse.ArgumentParser() - parser.add_argument('--openwifi-version', default='main') - parser.add_argument('--openwifi-gw-version', default='master') - parser.add_argument('--openwifi-sec-version', default='main') - parser.add_argument('--openwifi-fms-version', default='main') - parser.add_argument('--openwifi-ui-version', default='main') - parser.add_argument('--ap-model', default='[Any]') - parser.add_argument('--wifi-type', default='[Any]') - parser.add_argument('--blueprint', default='Basic Lab') - parser.add_argument('--reservation-id-file', default='./reservation_id.txt') + parser.add_argument('--global-inputs', help="JSON dictionary that contains global inputs that will be passed to Quali", default="{}") + parser.add_argument('--reservation-duration', help='duration of reservation', default=360) + parser.add_argument('--reservation-id-file', help='file that the reservation ID will be written to', default='./reservation_id.txt') + parser.add_argument('blueprint', help='name of blueprint to create reservation from') args = parser.parse_args() session = get_session() - if marker_expression == 'advance': - reservation_duration = 720 - else: - reservation_duration = 360 + global_inputs = {} + try: + global_inputs = json.loads(args.global_inputs) + except json.JSONDecodeError as e: + print(f'failed to decode global inputs: {e}') + exit(1) reservation = session.CreateImmediateTopologyReservation( - reservationName=f'{marker_expression}-{run_id}', + reservationName=f'{workflow}/{run_number}/{run_id}', owner=session.username, - durationInMinutes=reservation_duration, + durationInMinutes=args.reservation_duration, topologyFullPath=args.blueprint, - globalInputs=[ - UpdateTopologyGlobalInputsRequest('Chart Version', args.openwifi_version), - UpdateTopologyGlobalInputsRequest('owgw Version', args.openwifi_gw_version), - UpdateTopologyGlobalInputsRequest('owsec Version', args.openwifi_sec_version), - UpdateTopologyGlobalInputsRequest('owfms Version', args.openwifi_fms_version), - UpdateTopologyGlobalInputsRequest('owgwui Version', args.openwifi_ui_version), - UpdateTopologyGlobalInputsRequest('AP Model', args.ap_model), - UpdateTopologyGlobalInputsRequest('Wifi type', args.wifi_type), - ] + globalInputs=[UpdateTopologyGlobalInputsRequest(key, value) for key, value in global_inputs.items()] ).Reservation with open(args.reservation_id_file, 'w') as f: f.write(reservation.Id) - wait_for_provisioning_status(session, reservation.Id, 'Ready') + wait_for_provisioning_status(session, reservation.Id, ['Ready'], ['Teardown']) if __name__ == '__main__': main() diff --git a/.quali/stop_reservation.py b/.quali/stop_reservation.py index c9733d788..783d1349e 100644 --- a/.quali/stop_reservation.py +++ b/.quali/stop_reservation.py @@ -6,7 +6,7 @@ def main(): session = get_session() res_id = sys.argv[1] session.EndReservation(res_id) - wait_for_reservation_status(session, res_id, 'Completed') + wait_for_reservation_status(session, res_id, ['Completed']) if __name__ == '__main__': main() diff --git a/helm/ucentral/deploy.sh b/helm/ucentral/deploy.sh index 4e7099519..53d61d277 100755 --- a/helm/ucentral/deploy.sh +++ b/helm/ucentral/deploy.sh @@ -145,37 +145,37 @@ helm upgrade --install --create-namespace --wait --timeout 60m \ --set owgw.configProperties."openwifi\.fileuploader\.host\.0\.name"=gw-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owgw.configProperties."rtty\.server"=rtty-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owgw.configProperties."openwifi\.system\.uri\.public"=https://gw-${NAMESPACE}.cicd.lab.wlan.tip.build:16002 \ - --set owgw.configProperties."openwifi\.system\.uri\.private"=https://gw-${NAMESPACE}.cicd.lab.wlan.tip.build:17002 \ + --set owgw.configProperties."openwifi\.system\.uri\.private"=https://owgw-owgw:17002 \ --set owgw.configProperties."openwifi\.system\.uri\.ui"=https://webui-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owgw.configProperties."rtty\.token"=${RTTY_TOKEN} \ - --set owgw.public_env_variables.OWSEC=owsec-pwsec:16001 \ + --set owgw.public_env_variables.OWSEC=sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ --set owsec.configProperties."authentication\.default\.username"=${OWGW_AUTH_USERNAME} \ --set owsec.configProperties."authentication\.default\.password"=${OWGW_AUTH_PASSWORD} \ --set owsec.services.owsec.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=sec-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owsec.configProperties."openwifi\.system\.uri\.public"=https://sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ - --set owsec.configProperties."openwifi\.system\.uri\.private"=https://sec-${NAMESPACE}.cicd.lab.wlan.tip.build:17001 \ + --set owsec.configProperties."openwifi\.system\.uri\.private"=https://owsec-owsec:17001 \ --set owsec.configProperties."openwifi\.system\.uri\.ui"=https://webui-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owfms.configProperties."s3\.secret"=${OWFMS_S3_SECRET} \ --set owfms.configProperties."s3\.key"=${OWFMS_S3_KEY} \ --set owfms.services.owfms.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=fms-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owfms.configProperties."openwifi\.system\.uri\.public"=https://fms-${NAMESPACE}.cicd.lab.wlan.tip.build:16004 \ - --set owfms.configProperties."openwifi\.system\.uri\.private"=https://fms-${NAMESPACE}.cicd.lab.wlan.tip.build:17004 \ + --set owfms.configProperties."openwifi\.system\.uri\.private"=https://owfms-owfms:17004 \ --set owfms.configProperties."openwifi\.system\.uri\.ui"=https://webui-${NAMESPACE}.cicd.lab.wlan.tip.build \ - --set owfms.public_env_variables.OWSEC=owsec-owsec:16001 \ + --set owfms.public_env_variables.OWSEC=sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ --set owgwui.ingresses.default.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=webui-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owgwui.ingresses.default.hosts={webui-${NAMESPACE}.cicd.lab.wlan.tip.build} \ --set owgwui.public_env_variables.DEFAULT_UCENTRALSEC_URL=https://sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ --set owprov.services.owprov.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=prov-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owprov.configProperties."openwifi\.system\.uri\.public"=https://prov-${NAMESPACE}.cicd.lab.wlan.tip.build:16005 \ - --set owprov.configProperties."openwifi\.system\.uri\.private"=https://prov-${NAMESPACE}.cicd.lab.wlan.tip.build:17005 \ + --set owprov.configProperties."openwifi\.system\.uri\.private"=https://owprov-owprov:17005 \ --set owprov.configProperties."openwifi\.system\.uri\.ui"=https://webui-${NAMESPACE}.cicd.lab.wlan.tip.build \ - --set owprov.public_env_variables.OWSEC=owsec-owsec:16001 \ + --set owprov.public_env_variables.OWSEC=sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ --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 rttys.config.token=${RTTY_TOKEN} \ --set rttys.services.rttys.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=rtty-${NAMESPACE}.cicd.lab.wlan.tip.build \ - --set clustersysteminfo.public_env_variables.OWSEC=owsec-owsec: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 owls.services.owls.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=ls-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owls.configProperties."openwifi\.system\.uri\.public"=https://ls-${NAMESPACE}.cicd.lab.wlan.tip.build:16007 \ diff --git a/helm/ucentral/values.ucentral-qa.selfsigned-restapi.yaml b/helm/ucentral/values.ucentral-qa.selfsigned-restapi.yaml deleted file mode 100644 index b95425a7d..000000000 --- a/helm/ucentral/values.ucentral-qa.selfsigned-restapi.yaml +++ /dev/null @@ -1,179 +0,0 @@ -owgw: - public_env_variables: - SELFSIGNED_CERTS: "true" - configProperties: - openwifi.internal.restapi.host.0.rootca: $OWGW_ROOT/certs/restapi-certs/ca.crt - openwifi.internal.restapi.host.0.cert: $OWGW_ROOT/certs/restapi-certs/tls.crt - openwifi.internal.restapi.host.0.key: $OWGW_ROOT/certs/restapi-certs/tls.key - openwifi.restapi.host.0.rootca: $OWGW_ROOT/certs/restapi-certs/ca.crt - openwifi.restapi.host.0.cert: $OWGW_ROOT/certs/restapi-certs/tls.crt - openwifi.restapi.host.0.key: $OWGW_ROOT/certs/restapi-certs/tls.key - openwifi.system.uri.private: https://owgw-owgw:17002 - volumes: - owgw: - - name: config - mountPath: /owgw-data/owgw.properties - subPath: owgw.properties - # Template below will be rendered in template - volumeDefinition: | - secret: - secretName: {{ include "owgw.fullname" . }}-config - - name: certs - mountPath: /owgw-data/certs - volumeDefinition: | - secret: - secretName: {{ include "owgw.fullname" . }}-certs - - name: certs-cas - mountPath: /owgw-data/certs/cas - volumeDefinition: | - secret: - secretName: {{ include "owgw.fullname" . }}-certs-cas - - name: persist - mountPath: /owgw-data/persist - volumeDefinition: | - persistentVolumeClaim: - claimName: {{ template "owgw.fullname" . }}-pvc - - - name: restapi-certs - mountPath: /owgw-data/certs/restapi-certs - volumeDefinition: | - secret: - secretName: {{ include "owgw.fullname" . }}-owgw-restapi-tls - - name: restapi-ca - mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem - subPath: ca.crt - volumeDefinition: | - secret: - secretName: {{ include "owgw.fullname" . }}-owgw-restapi-tls - -owsec: - public_env_variables: - SELFSIGNED_CERTS: "true" - configProperties: - openwifi.internal.restapi.host.0.rootca: $OWSEC_ROOT/certs/restapi-certs/ca.crt - openwifi.internal.restapi.host.0.cert: $OWSEC_ROOT/certs/restapi-certs/tls.crt - openwifi.internal.restapi.host.0.key: $OWSEC_ROOT/certs/restapi-certs/tls.key - openwifi.restapi.host.0.rootca: $OWSEC_ROOT/certs/restapi-certs/ca.crt - openwifi.restapi.host.0.cert: $OWSEC_ROOT/certs/restapi-certs/tls.crt - openwifi.restapi.host.0.key: $OWSEC_ROOT/certs/restapi-certs/tls.key - openwifi.system.uri.private: https://owsec-owsec:17001 - volumes: - owsec: - - name: config - mountPath: /owsec-data/owsec.properties - subPath: owsec.properties - # Template below will be rendered in template - volumeDefinition: | - secret: - secretName: {{ include "owsec.fullname" . }}-config - - name: certs - mountPath: /owsec-data/certs - volumeDefinition: | - secret: - secretName: {{ include "owsec.fullname" . }}-certs - - name: persist - mountPath: /owsec-data/persist - volumeDefinition: | - persistentVolumeClaim: - claimName: {{ template "owsec.fullname" . }}-pvc - - - name: restapi-certs - mountPath: /owsec-data/certs/restapi-certs - volumeDefinition: | - secret: - secretName: {{ include "owsec.fullname" . }}-owsec-restapi-tls - - name: restapi-ca - mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem - subPath: ca.crt - volumeDefinition: | - secret: - secretName: {{ include "owsec.fullname" . }}-owsec-restapi-tls - -owfms: - public_env_variables: - SELFSIGNED_CERTS: "true" - configProperties: - openwifi.internal.restapi.host.0.rootca: $OWFMS_ROOT/certs/restapi-certs/ca.crt - openwifi.internal.restapi.host.0.cert: $OWFMS_ROOT/certs/restapi-certs/tls.crt - openwifi.internal.restapi.host.0.key: $OWFMS_ROOT/certs/restapi-certs/tls.key - openwifi.restapi.host.0.rootca: $OWFMS_ROOT/certs/restapi-certs/ca.crt - openwifi.restapi.host.0.cert: $OWFMS_ROOT/certs/restapi-certs/tls.crt - openwifi.restapi.host.0.key: $OWFMS_ROOT/certs/restapi-certs/tls.key - openwifi.system.uri.private: https://owfms-owfms:17004 - volumes: - owfms: - - name: config - mountPath: /owfms-data/owfms.properties - subPath: owfms.properties - # Template below will be rendered in template - volumeDefinition: | - secret: - secretName: {{ include "owfms.fullname" . }}-config - - name: certs - mountPath: /owfms-data/certs - volumeDefinition: | - secret: - secretName: {{ include "owfms.fullname" . }}-certs - - name: persist - mountPath: /owfms-data/persist - volumeDefinition: | - persistentVolumeClaim: - claimName: {{ template "owfms.fullname" . }}-pvc - - - name: restapi-certs - mountPath: /owfms-data/certs/restapi-certs - volumeDefinition: | - secret: - secretName: {{ include "owfms.fullname" . }}-owfms-restapi-tls - - name: restapi-ca - mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem - subPath: ca.crt - volumeDefinition: | - secret: - secretName: {{ include "owfms.fullname" . }}-owfms-restapi-tls - -owprov: - public_env_variables: - SELFSIGNED_CERTS: "true" - configProperties: - openwifi.internal.restapi.host.0.rootca: $OWPROV_ROOT/certs/restapi-certs/ca.crt - openwifi.internal.restapi.host.0.cert: $OWPROV_ROOT/certs/restapi-certs/tls.crt - openwifi.internal.restapi.host.0.key: $OWPROV_ROOT/certs/restapi-certs/tls.key - openwifi.restapi.host.0.rootca: $OWPROV_ROOT/certs/restapi-certs/ca.crt - openwifi.restapi.host.0.cert: $OWPROV_ROOT/certs/restapi-certs/tls.crt - openwifi.restapi.host.0.key: $OWPROV_ROOT/certs/restapi-certs/tls.key - openwifi.system.uri.private: https://owprov-owprov:17005 - volumes: - owprov: - - name: config - mountPath: /owprov-data/owprov.properties - subPath: owprov.properties - # Template below will be rendered in template - volumeDefinition: | - secret: - secretName: {{ include "owprov.fullname" . }}-config - - name: certs - mountPath: /owprov-data/certs - volumeDefinition: | - secret: - secretName: {{ include "owprov.fullname" . }}-certs - - name: persist - mountPath: /owprov-data/persist - volumeDefinition: | - persistentVolumeClaim: - claimName: {{ template "owprov.fullname" . }}-pvc - - - name: restapi-certs - mountPath: /owprov-data/certs/restapi-certs - volumeDefinition: | - secret: - secretName: {{ include "owprov.fullname" . }}-owprov-restapi-tls - - name: restapi-ca - mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem - subPath: ca.crt - volumeDefinition: | - secret: - secretName: {{ include "owprov.fullname" . }}-owprov-restapi-tls - -restapiCerts: - enabled: true diff --git a/helm/ucentral/values.ucentral-qa.separate-lbs.yaml b/helm/ucentral/values.ucentral-qa.separate-lbs.yaml index dd2c43c36..cebf51ca4 100644 --- a/helm/ucentral/values.ucentral-qa.separate-lbs.yaml +++ b/helm/ucentral/values.ucentral-qa.separate-lbs.yaml @@ -4,7 +4,6 @@ owgw: type: LoadBalancer annotations: service.beta.kubernetes.io/aws-load-balancer-type: "nlb-ip" - service.beta.kubernetes.io/aws-load-balancer-type: "none" service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "16102" service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl diff --git a/helm/ucentral/values.ucentral-qa.test-nodes.yaml b/helm/ucentral/values.ucentral-qa.test-nodes.yaml index d64698fd9..0886a56c6 100644 --- a/helm/ucentral/values.ucentral-qa.test-nodes.yaml +++ b/helm/ucentral/values.ucentral-qa.test-nodes.yaml @@ -62,6 +62,22 @@ owprovui: operator: "Exists" effect: "NoSchedule" +owls: + nodeSelector: + env: tests + tolerations: + - key: "tests" + operator: "Exists" + effect: "NoSchedule" + +owlsui: + nodeSelector: + env: tests + tolerations: + - key: "tests" + operator: "Exists" + effect: "NoSchedule" + rttys: nodeSelector: env: tests diff --git a/helm/ucentral/values.ucentral-qa.yaml b/helm/ucentral/values.ucentral-qa.yaml index e28076123..360d377e8 100644 --- a/helm/ucentral/values.ucentral-qa.yaml +++ b/helm/ucentral/values.ucentral-qa.yaml @@ -61,6 +61,52 @@ owgw: 5IOM7ItsRmen6u3qu+JXros54e4juQ== -----END CERTIFICATE----- + public_env_variables: + SELFSIGNED_CERTS: "true" + configProperties: + openwifi.internal.restapi.host.0.rootca: $OWGW_ROOT/certs/restapi-certs/ca.crt + openwifi.internal.restapi.host.0.cert: $OWGW_ROOT/certs/restapi-certs/tls.crt + openwifi.internal.restapi.host.0.key: $OWGW_ROOT/certs/restapi-certs/tls.key + openwifi.restapi.host.0.rootca: $OWGW_ROOT/certs/restapi-certs/ca.crt + openwifi.restapi.host.0.cert: $OWGW_ROOT/certs/restapi-certs/tls.crt + openwifi.restapi.host.0.key: $OWGW_ROOT/certs/restapi-certs/tls.key + volumes: + owgw: + - name: config + mountPath: /owgw-data/owgw.properties + subPath: owgw.properties + # Template below will be rendered in template + volumeDefinition: | + secret: + secretName: {{ include "owgw.fullname" . }}-config + - name: certs + mountPath: /owgw-data/certs + volumeDefinition: | + secret: + secretName: {{ include "owgw.fullname" . }}-certs + - name: certs-cas + mountPath: /owgw-data/certs/cas + volumeDefinition: | + secret: + secretName: {{ include "owgw.fullname" . }}-certs-cas + - name: persist + mountPath: /owgw-data/persist + volumeDefinition: | + persistentVolumeClaim: + claimName: {{ template "owgw.fullname" . }}-pvc + + - name: restapi-certs + mountPath: /owgw-data/certs/restapi-certs + volumeDefinition: | + secret: + secretName: {{ include "owgw.fullname" . }}-owgw-restapi-tls + - name: restapi-ca + mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem + subPath: ca.crt + volumeDefinition: | + secret: + secretName: {{ include "owgw.fullname" . }}-owgw-restapi-tls + owsec: # https://telecominfraproject.atlassian.net/browse/WIFI-5840 checks: @@ -109,6 +155,47 @@ owsec: 5IOM7ItsRmen6u3qu+JXros54e4juQ== -----END CERTIFICATE----- + public_env_variables: + SELFSIGNED_CERTS: "true" + configProperties: + openwifi.internal.restapi.host.0.rootca: $OWSEC_ROOT/certs/restapi-certs/ca.crt + openwifi.internal.restapi.host.0.cert: $OWSEC_ROOT/certs/restapi-certs/tls.crt + openwifi.internal.restapi.host.0.key: $OWSEC_ROOT/certs/restapi-certs/tls.key + openwifi.restapi.host.0.rootca: $OWSEC_ROOT/certs/restapi-certs/ca.crt + openwifi.restapi.host.0.cert: $OWSEC_ROOT/certs/restapi-certs/tls.crt + openwifi.restapi.host.0.key: $OWSEC_ROOT/certs/restapi-certs/tls.key + volumes: + owsec: + - name: config + mountPath: /owsec-data/owsec.properties + subPath: owsec.properties + # Template below will be rendered in template + volumeDefinition: | + secret: + secretName: {{ include "owsec.fullname" . }}-config + - name: certs + mountPath: /owsec-data/certs + volumeDefinition: | + secret: + secretName: {{ include "owsec.fullname" . }}-certs + - name: persist + mountPath: /owsec-data/persist + volumeDefinition: | + persistentVolumeClaim: + claimName: {{ template "owsec.fullname" . }}-pvc + + - name: restapi-certs + mountPath: /owsec-data/certs/restapi-certs + volumeDefinition: | + secret: + secretName: {{ include "owsec.fullname" . }}-owsec-restapi-tls + - name: restapi-ca + mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem + subPath: ca.crt + volumeDefinition: | + secret: + secretName: {{ include "owsec.fullname" . }}-owsec-restapi-tls + rttys: enabled: true @@ -209,6 +296,47 @@ owfms: 5IOM7ItsRmen6u3qu+JXros54e4juQ== -----END CERTIFICATE----- + public_env_variables: + SELFSIGNED_CERTS: "true" + configProperties: + openwifi.internal.restapi.host.0.rootca: $OWFMS_ROOT/certs/restapi-certs/ca.crt + openwifi.internal.restapi.host.0.cert: $OWFMS_ROOT/certs/restapi-certs/tls.crt + openwifi.internal.restapi.host.0.key: $OWFMS_ROOT/certs/restapi-certs/tls.key + openwifi.restapi.host.0.rootca: $OWFMS_ROOT/certs/restapi-certs/ca.crt + openwifi.restapi.host.0.cert: $OWFMS_ROOT/certs/restapi-certs/tls.crt + openwifi.restapi.host.0.key: $OWFMS_ROOT/certs/restapi-certs/tls.key + volumes: + owfms: + - name: config + mountPath: /owfms-data/owfms.properties + subPath: owfms.properties + # Template below will be rendered in template + volumeDefinition: | + secret: + secretName: {{ include "owfms.fullname" . }}-config + - name: certs + mountPath: /owfms-data/certs + volumeDefinition: | + secret: + secretName: {{ include "owfms.fullname" . }}-certs + - name: persist + mountPath: /owfms-data/persist + volumeDefinition: | + persistentVolumeClaim: + claimName: {{ template "owfms.fullname" . }}-pvc + + - name: restapi-certs + mountPath: /owfms-data/certs/restapi-certs + volumeDefinition: | + secret: + secretName: {{ include "owfms.fullname" . }}-owfms-restapi-tls + - name: restapi-ca + mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem + subPath: ca.crt + volumeDefinition: | + secret: + secretName: {{ include "owfms.fullname" . }}-owfms-restapi-tls + owprov: checks: owprov: @@ -256,6 +384,47 @@ owprov: 5IOM7ItsRmen6u3qu+JXros54e4juQ== -----END CERTIFICATE----- + public_env_variables: + SELFSIGNED_CERTS: "true" + configProperties: + openwifi.internal.restapi.host.0.rootca: $OWPROV_ROOT/certs/restapi-certs/ca.crt + openwifi.internal.restapi.host.0.cert: $OWPROV_ROOT/certs/restapi-certs/tls.crt + openwifi.internal.restapi.host.0.key: $OWPROV_ROOT/certs/restapi-certs/tls.key + openwifi.restapi.host.0.rootca: $OWPROV_ROOT/certs/restapi-certs/ca.crt + openwifi.restapi.host.0.cert: $OWPROV_ROOT/certs/restapi-certs/tls.crt + openwifi.restapi.host.0.key: $OWPROV_ROOT/certs/restapi-certs/tls.key + volumes: + owprov: + - name: config + mountPath: /owprov-data/owprov.properties + subPath: owprov.properties + # Template below will be rendered in template + volumeDefinition: | + secret: + secretName: {{ include "owprov.fullname" . }}-config + - name: certs + mountPath: /owprov-data/certs + volumeDefinition: | + secret: + secretName: {{ include "owprov.fullname" . }}-certs + - name: persist + mountPath: /owprov-data/persist + volumeDefinition: | + persistentVolumeClaim: + claimName: {{ template "owprov.fullname" . }}-pvc + + - name: restapi-certs + mountPath: /owprov-data/certs/restapi-certs + volumeDefinition: | + secret: + secretName: {{ include "owprov.fullname" . }}-owprov-restapi-tls + - name: restapi-ca + mountPath: /usr/local/share/ca-certificates/restapi-ca-selfsigned.pem + subPath: ca.crt + volumeDefinition: | + secret: + secretName: {{ include "owprov.fullname" . }}-owprov-restapi-tls + owprovui: services: owprovui: @@ -299,7 +468,7 @@ kafka: cpu: 100m memory: 512Mi limits: - cpu: 200m + cpu: 500m memory: 1Gi readinessProbe: initialDelaySeconds: 45 @@ -321,12 +490,6 @@ clustersysteminfo: enabled: true delay: 60 # delaying to wait for AWS Route53 DNS propagation - public_env_variables: - FLAGS: "-s --connect-timeout 3 -k" - OWGW_OVERRIDE: owgw-owgw:16002 - OWFMS_OVERRIDE: owfms-owfms:16004 - OWPROV_OVERRIDE: owprov-owprov:16005 - haproxy: enabled: true service: @@ -338,3 +501,6 @@ haproxy: 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,16002,16003,17002,16005,17005,16001,17001,5912,5913" service.beta.kubernetes.io/aws-load-balancer-type: nlb-ip + +restapiCerts: + enabled: true diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 0431f852b..0c2ea53d0 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -36,7 +36,10 @@ class APNOS: self.password = credentials['password'] # if mode=1, enter jumphost password else ap password self.port = credentials['port'] # if mode=1, enter jumphost ssh port else ap ssh port self.mode = credentials['jumphost'] # 1 for jumphost, 0 for direct ssh - self.model = credentials['mode'] + + if 'mode' in credentials: + self.type = credentials['mode'] + if self.mode: self.tty = credentials['jumphost_tty'] # /dev/ttyAP1 # kill minicom instance @@ -603,13 +606,13 @@ class APNOS: return status def dfs(self): - if self.model == "wifi5": + if self.type == "wifi5": cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && echo 1 > dfs_simulate_radar" print("cmd: ", cmd) if self.mode: command = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " - elif self.model == "wifi6": + elif self.type == "wifi6": cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && ls && echo 1 > dfs_simulate_radar' print("cmd: ", cmd) if self.mode: @@ -622,13 +625,13 @@ class APNOS: client.close() def dfs_logread(self): - if self.model == "wifi5": + if self.type == "wifi5": cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && logread | grep DFS" print("cmd: ", cmd) if self.mode: cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " - elif self.model == "wifi6": + elif self.type == "wifi6": cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && logread | grep DFS' print("cmd: ", cmd) if self.mode: diff --git a/libs/controller/controller_2x/controller.py b/libs/controller/controller_2x/controller.py index 01115b450..2eb522aa1 100644 --- a/libs/controller/controller_2x/controller.py +++ b/libs/controller/controller_2x/controller.py @@ -3,6 +3,7 @@ Base Library for Ucentral """ +import datetime import json import ssl import sys @@ -627,6 +628,7 @@ class UProfileUtility: body=str(self.base_profile_config).replace("'", '"'), attachment_type=allure.attachment_type.JSON) print(self.base_profile_config) + print("Sending Configure Command: ", datetime.datetime.utcnow()) resp = requests.post(uri, data=basic_cfg_str, headers=self.sdk_client.make_headers(), verify=False, timeout=100) print(resp.json()) @@ -647,7 +649,7 @@ if __name__ == '__main__': } obj = Controller(controller_data=controller) print(obj.get_device_by_serial_number(serial_number="903cb36ae224")) - + # print(datetime.datetime.utcnow()) # fms = FMSUtils(sdk_client=obj) # new = fms.get_firmwares(model='ecw5410') # for i in new: @@ -657,4 +659,4 @@ if __name__ == '__main__': # print(profile.get_ssid_info()) # # print(obj.get_devices()) - obj.logout() + # obj.logout() diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index f2aab124d..7dae71f41 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -132,13 +132,17 @@ 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") + try: + supplicant = "/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=supplicant, + local_path=".") + obj.pull_file() + allure.attach.file(source="wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt", + name="supplicant_log") + except Exception as e: + print(e) + for result in run_results: print("test result: " + result) result = True @@ -165,7 +169,7 @@ class RunTest: station_name=[], key_mgmt="WPA-EAP", pairwise="NA", group="NA", wpa_psk="DEFAULT", ttls_passwd="nolastart", ieee80211w=1, - wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius",cleanup=True): + wep_key="NA", ca_cert="NA", eap="TTLS", identity="nolaradius",d_vlan=False,cleanup=True): self.eap_connect = TTLSTest(host=self.lanforge_ip, port=self.lanforge_port, sta_list=station_name, vap=False, _debug_on=self.debug) @@ -209,15 +213,21 @@ class RunTest: self.eap_connect.sta_list = station_name self.eap_connect.build(extra_securities=extra_securities) self.eap_connect.start(station_name, True, True) + if d_vlan: + self.station_ip = {} for sta_name in station_name: # try: station_data_str = "" # sta_url = self.eap_connect.get_station_url(sta_name) # station_info = self.eap_connect.json_get(sta_url) station_info = self.eap_connect.json_get("port/1/1/" + sta_name) + for i in station_info["interface"]: try: station_data_str = station_data_str + i + " : " + str(station_info["interface"][i]) + "\n" + if d_vlan: + if i == "ip": + self.station_ip[sta_name] = station_info["interface"][i] except Exception as e: print(e) allure.attach(name=str(sta_name), body=str(station_data_str)) @@ -225,13 +235,17 @@ 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") + try: + supplicant = "/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=supplicant, + local_path=".") + obj.pull_file() + allure.attach.file(source="wpa_supplicant_log_" + self.eap_connect.radio.split(".")[2] + ".txt", + name="supplicant_log") + except Exception as e: + print(e) + if not self.eap_connect.passes(): if self.debug: print("test result: " + self.eap_connect.passes()) @@ -246,7 +260,7 @@ class RunTest: cx_data = cx_data + "\n" allure.attach(name="cx_data", body=str(cx_data)) if cleanup: - self.eap_connect.cleanup(station_name) + self.eap_connect.cleanup(station_name) return self.eap_connect.passes() def wifi_capacity(self, mode="BRIDGE", vlan_id=100, batch_size="1,5,10,20,40,64,128", @@ -339,10 +353,10 @@ class RunTest: def Client_Connect_Using_Radio(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", vlan_id=100, radio=None, sta_mode=0, station_name=[]): - self.client_connect = CreateStation(_host=self.lanforge_ip, _port=self.lanforge_port, + self.client_connect = CreateStation(_host=self.lanforge_ip, _port=self.lanforge_port, _mode=sta_mode, _sta_list=station_name, _password=passkey, _ssid=ssid, _security=security) - self.client_connect.station_profile.sta_mode = sta_mode + # self.client_connect.station_profile.sta_mode = sta_mode self.client_connect.upstream_resource = 1 if mode == "BRIDGE": self.client_connect.upstream_port = self.upstream_port @@ -474,7 +488,7 @@ class RunTest: influx.glob() return self.dualbandptest_obj - + def apstabilitytest(self, ssid_5G="[BLANK]", ssid_2G="[BLANK]", mode="BRIDGE", vlan_id=100, dut_name="TIP", instance_name="test_demo", dut_5g="", dut_2g=""): instance_name = ''.join(random.choices(string.ascii_uppercase + string.digits, k=S)) @@ -808,6 +822,55 @@ class RunTest: atten_obj = CreateAttenuator(self.lanforge_ip, self.lanforge_port, serno, idx, val) atten_obj.build() + def attenuator_serial_2g_radio(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", + vlan_id=100, sta_mode=0, station_name=[], lf_tools_obj=None): + radio = self.twog_radios[0] + #index 0 of atten_serial_radio will ser no of 1st 2g radio and index 1 will ser no of 2nd and 3rd 2g radio + atten_serial_radio = [] + atten_serial = self.attenuator_serial() + self.Client_Connect_Using_Radio(ssid=ssid, passkey=passkey, security=security, mode=mode, + vlan_id=vlan_id, radio=radio, sta_mode=sta_mode, + station_name=station_name) + signal1 = lf_tools_obj.station_data_query(station_name=station_name[0], query="signal") + atten_sr = atten_serial[0].split(".") + for i in range(4): + self.attenuator_modify(int(atten_sr[2]), i, 400) + time.sleep(0.5) + signal2 = lf_tools_obj.station_data_query(station_name=station_name[0], query="signal") + if abs(int(signal2.split(" ")[0])) - abs(int(signal1.split(" ")[0])) >= 5: + atten_serial_radio = atten_serial + else: + atten_serial_radio = atten_serial[::-1] + self.Client_disconnect(station_name=station_name) + return atten_serial_radio + + def attenuator_serial_5g_radio(self, ssid="[BLANK]", passkey="[BLANK]", security="wpa2", mode="BRIDGE", + vlan_id=100, sta_mode=0, station_name=[], lf_tools_obj=None): + radio = self.fiveg_radios[0] + #index 0 of atten_serial_radio will ser no of 1st 5g radio and index 1 will ser no of 2nd and 3rd 5g radio + atten_serial_radio = [] + atten_serial = self.attenuator_serial() + self.Client_Connect_Using_Radio(ssid=ssid, passkey=passkey, security=security, mode=mode, + vlan_id=vlan_id, radio=radio, sta_mode=sta_mode, + station_name=station_name) + signal1 = lf_tools_obj.station_data_query(station_name=station_name[0], query="signal") + atten_sr = atten_serial[0].split(".") + for i in range(4): + self.attenuator_modify(int(atten_sr[2]), i, 400) + time.sleep(0.5) + signal2 = lf_tools_obj.station_data_query(station_name=station_name[0], query="signal") + if abs(int(signal2.split(" ")[0])) - abs(int(signal1.split(" ")[0])) >= 5: + atten_serial_radio = atten_serial + else: + atten_serial_radio = atten_serial[::-1] + self.Client_disconnect(station_name=station_name) + return atten_serial_radio + + + + + + if __name__ == '__main__': diff --git a/libs/lanforge/lf_tools.py b/libs/lanforge/lf_tools.py index 6f52bc31c..da685bf6d 100644 --- a/libs/lanforge/lf_tools.py +++ b/libs/lanforge/lf_tools.py @@ -31,7 +31,7 @@ import pandas as pd class ChamberView: def __init__(self, lanforge_data=None, access_point_data=None, debug=True, testbed=None): - print("lanforge data",lanforge_data) + print("lanforge data", lanforge_data) print("access point data", access_point_data) self.access_point_data = access_point_data print("testbed", testbed) @@ -62,9 +62,12 @@ class ChamberView: self.testbed = "mesh" self.scenario_name = "TIP-" + self.testbed self.raw_line = [ - ["profile_link " + self.upstream_resource_1 + " upstream-dhcp 1 NA NA " + self.upstream_port_1.split(".")[2] + ",AUTO -1 NA"], - ["profile_link " + self.uplink_resource_1 + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet + "' NA " + self.uplink_port_1.split(".")[2] + "," + self.upstream_port_1.split(".")[2] + " -1 NA"] - ] + ["profile_link " + self.upstream_resource_1 + " upstream-dhcp 1 NA NA " + + self.upstream_port_1.split(".")[2] + ",AUTO -1 NA"], + [ + "profile_link " + self.uplink_resource_1 + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet + "' NA " + + self.uplink_port_1.split(".")[2] + "," + self.upstream_port_1.split(".")[2] + " -1 NA"] + ] self.CreateChamberview = CreateChamberview(self.lanforge_ip, self.lanforge_port) else: self.lanforge_ip = lanforge_data["ip"] @@ -90,10 +93,10 @@ class ChamberView: 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"], - ["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet - + "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"] + ["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".") + [2] + ",AUTO -1 NA"], + ["profile_link " + self.uplink_resources + " uplink-nat 1 'DUT: upstream LAN " + self.upstream_subnet + + "' NA " + self.uplink_port.split(".")[2] + "," + self.upstream_port.split(".")[2] + " -1 NA"] ] # This is for rawline input | see create_chamberview_dut.py for more details @@ -328,7 +331,9 @@ class ChamberView: def read_csv_individual_station_throughput(self, dir_name, option): try: - df = pd.read_csv("../reports/" + str(dir_name) + "/csv-data/data-Combined_bps__60_second_running_average-1.csv", sep=r'\t', engine='python') + df = pd.read_csv( + "../reports/" + str(dir_name) + "/csv-data/data-Combined_bps__60_second_running_average-1.csv", + sep=r'\t', engine='python') print("csv file opened") except FileNotFoundError: print("csv file does not exist") @@ -378,6 +383,7 @@ class ChamberView: name=i, attachment_type="image/png", extension=None) + def create_mesh_scenario(self): # upstream_list = [] # for data in range(0,len(self.access_point_data)): @@ -449,6 +455,7 @@ class ChamberView: # [['ssid_idx=0 ssid=Default-SSID-2g security=WPA|WEP| password=12345678 bssid=90:3c:b3:94:48:58']] self.update_ssid(ssid_data=ssid_data[ssid]) + def set_radio_antenna(self, req_url, shelf, resources, radio, antenna): data = { "shelf": shelf, @@ -463,84 +470,84 @@ class ChamberView: def main(): # lanforge_data = {'ip': 'localhost', 'port': 8802, 'ssh_port': 8804, '2.4G-Radio': ['1.1.wiphy0', '1.1.wiphy2'], '5G-Radio': ['1.1.wiphy1', '1.1.wiphy3'], 'AX-Radio': ['1.1.wiphy4', '1.1.wiphy5', '1.1.wiphy6', '1.1.wiphy7'], 'upstream': '1.1.eth2', 'upstream_subnet': '10.28.2.1/24', 'uplink': '1.1.eth1', '2.4G-Station-Name': 'sta00', '5G-Station-Name': 'sta10', 'AX-Station-Name': 'ax'} lanforge_data = { - "type": "mesh", - "ip": "localhost", # 10.28.3.14 - "port": 8802, # 8080 - "ssh_port": 8804, - "2.4G-Radio-mobile-sta": ["1.1.wiphy0", "1.1.wiphy2"], - "5G-Radio-mobile-sta": ["1.1.wiphy1", "1.1.wiphy3"], - "AX-Radio-mobile-sta": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"], - "upstream-mobile-sta": "1.1.eth2", - "upstream_subnet-mobile-sta": "10.28.2.1/24", - "uplink-mobile-sta": "1.1.eth3", - "2.4G-Radio-root": ["1.2.wiphy0"], - "5G-Radio-root": ["1.2.wiphy1"], - "AX-Radio-root": [], - "upstream-root": "1.2.eth2", - "upstream_subnet-root": "10.28.2.1/24", - "uplink-root": "1.2.eth3", - "2.4G-Radio-node-1": ["1.3.wiphy0"], - "5G-Radio-node-1": ["1.3.wiphy1"], - "AX-Radio-node-1": [], - "upstream-node-1": "1.3.eth2", - "upstream_subnet-node-1": "10.28.2.1/24", - "uplink--node-1": "1.3.eth3", - "2.4G-Radio-node-2": ["1.4.wiphy0"], - "5G-Radio-node-2": ["1.4.wiphy1"], - "AX-Radio-node-2": [], - "upstream-node-2": "1.4.eth2", - "upstream_subnet-node-2": "10.28.2.1/24", - "uplink--node-2": "1.4.eth3", - "2.4G-Station-Name": "wlan0", - "5G-Station-Name": "wlan0", - "AX-Station-Name": "ax" - } + "type": "mesh", + "ip": "localhost", # 10.28.3.14 + "port": 8802, # 8080 + "ssh_port": 8804, + "2.4G-Radio-mobile-sta": ["1.1.wiphy0", "1.1.wiphy2"], + "5G-Radio-mobile-sta": ["1.1.wiphy1", "1.1.wiphy3"], + "AX-Radio-mobile-sta": ["1.1.wiphy4", "1.1.wiphy5", "1.1.wiphy6", "1.1.wiphy7"], + "upstream-mobile-sta": "1.1.eth2", + "upstream_subnet-mobile-sta": "10.28.2.1/24", + "uplink-mobile-sta": "1.1.eth3", + "2.4G-Radio-root": ["1.2.wiphy0"], + "5G-Radio-root": ["1.2.wiphy1"], + "AX-Radio-root": [], + "upstream-root": "1.2.eth2", + "upstream_subnet-root": "10.28.2.1/24", + "uplink-root": "1.2.eth3", + "2.4G-Radio-node-1": ["1.3.wiphy0"], + "5G-Radio-node-1": ["1.3.wiphy1"], + "AX-Radio-node-1": [], + "upstream-node-1": "1.3.eth2", + "upstream_subnet-node-1": "10.28.2.1/24", + "uplink--node-1": "1.3.eth3", + "2.4G-Radio-node-2": ["1.4.wiphy0"], + "5G-Radio-node-2": ["1.4.wiphy1"], + "AX-Radio-node-2": [], + "upstream-node-2": "1.4.eth2", + "upstream_subnet-node-2": "10.28.2.1/24", + "uplink--node-2": "1.4.eth3", + "2.4G-Station-Name": "wlan0", + "5G-Station-Name": "wlan0", + "AX-Station-Name": "ax" + } # ap_data = [{'model': 'wf188n', 'mode': 'wifi6', 'serial': '0000c1018812', 'jumphost': True, 'ip': 'localhost', 'username': 'lanforge', 'password': 'pumpkin77', 'port': 8803, 'jumphost_tty': '/dev/ttyAP1', 'version': 'https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/cig_wf188/20210729-cig_wf188-v2.0.0-rc2-ec3662e-upgrade.bin'}] ap_data = [ - { - 'type' : 'root', - 'model': 'eap101', - 'mode': 'wifi6', - 'serial': '34efb6af4a7a', - 'jumphost': True, - 'ip': "localhost", # 10\.28\.3\.101 - 'username': "lanforge", - 'password': "pumpkin77", - 'port': 8803, # 22 - 'jumphost_tty': '/dev/ttyAP2', - 'version': "latest" - }, - { - 'type': 'node-1', - 'model': 'eap101', - 'mode': 'wifi6', - 'serial': '34efb6af4903', - 'jumphost': True, - 'ip': "localhost", #10\.28\.3\.101 - 'username': "lanforge", - 'password': "pumpkin77", - 'port': 8803, # 22 - 'jumphost_tty': '/dev/ttyAP3', - 'version': "latest" - }, - { - 'type' : 'node-2', - 'model': 'eap102', - 'mode': 'wifi6', - 'serial': '34efb6af4a7a', - 'jumphost': True, - 'ip': "localhost", # 10\.28\.3\.101 - 'username': "lanforge", - 'password': "pumpkin77", - 'port': 8803, # 22 - 'jumphost_tty': '/dev/ttyAP4', - 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0.tar.gz" - } - ] + { + 'type': 'root', + 'model': 'eap101', + 'mode': 'wifi6', + 'serial': '34efb6af4a7a', + 'jumphost': True, + 'ip': "localhost", # 10\.28\.3\.101 + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 8803, # 22 + 'jumphost_tty': '/dev/ttyAP2', + 'version': "latest" + }, + { + 'type': 'node-1', + 'model': 'eap101', + 'mode': 'wifi6', + 'serial': '34efb6af4903', + 'jumphost': True, + 'ip': "localhost", # 10\.28\.3\.101 + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 8803, # 22 + 'jumphost_tty': '/dev/ttyAP3', + 'version': "latest" + }, + { + 'type': 'node-2', + 'model': 'eap102', + 'mode': 'wifi6', + 'serial': '34efb6af4a7a', + 'jumphost': True, + 'ip': "localhost", # 10\.28\.3\.101 + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 8803, # 22 + 'jumphost_tty': '/dev/ttyAP4', + 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/eap101/trunk/eap101-1.1.0.tar.gz" + } + ] testbed = "mesh" obj = ChamberView(lanforge_data=lanforge_data, access_point_data=ap_data, testbed="mesh") obj.create_mesh_dut() - obj.create_mesh() + if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/libs/perfecto_libs/android_lib.py b/libs/perfecto_libs/android_lib.py index a1d7cd330..dc216be0c 100644 --- a/libs/perfecto_libs/android_lib.py +++ b/libs/perfecto_libs/android_lib.py @@ -1331,11 +1331,37 @@ def get_ip_address_and(request, WifiName, WifiPass, setup_perfectoMobile, connDa 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 - + closeApp(connData["appPackage-android"], setup_perfectoMobile) + assert False + #allure.attach(name= body=str("IP address element not found")) + #--------------------Added for ssid security check-------------------------- + try: + time.sleep(2) + security_name_element = driver.find_element_by_xpath( + "//*[@text='Security']/parent::*/android.widget.TextView[@resource-id='com.android.settings:id/summary']") + security_name_element_text = security_name_element.text + print("Ssid security is :", security_name_element_text) + allure.attach(name="Ssid Security:", body=str(security_name_element_text)) + except: + print("Security is not available") + # --------------------Added for ssid Name check-------------------------- + try: + time.sleep(2) + ssid_name_element = driver.find_element_by_xpath( + "//*[@resource-id='com.android.settings:id/entity_header_title']") + ssid_name_element_text = ssid_name_element.text + print("Ssid Name is :", ssid_name_element_text) + allure.attach(name="Ssid connected:", body=str(ssid_name_element_text)) + except: + print("Ssid name not available") + closeApp(connData["appPackage-android"], setup_perfectoMobile) + assert False + if(ssid_name_element_text == WifiName): + print("Wifi is connected to the expected ssid") + else: + print("Wifi is not connected to the expected ssid") + closeApp(connData["appPackage-android"], setup_perfectoMobile) + assert False try: check_if_no_internet_popup(driver) driver.implicitly_wait(3) @@ -3034,8 +3060,36 @@ def get_ip_address_eap_and(request, WifiName, User, ttls_passwd, setup_perfectoM 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) + assert False + # --------------------Added for ssid security check-------------------------- + try: + time.sleep(2) + security_name_element = driver.find_element_by_xpath( + "//*[@text='Security']/parent::*/android.widget.TextView[@resource-id='com.android.settings:id/summary']") + security_name_element_text = security_name_element.text + print("Ssid security is :", security_name_element_text) + allure.attach(name="Ssid Security:", body=str(security_name_element_text)) + except: + print("Security is not available") + # --------------------Added for ssid Name check-------------------------- + try: + time.sleep(2) + ssid_name_element = driver.find_element_by_xpath( + "//*[@resource-id='com.android.settings:id/entity_header_title']") + ssid_name_element_text = ssid_name_element.text + print("Ssid Name is :", ssid_name_element_text) + allure.attach(name="Ssid connected:", body=str(ssid_name_element_text)) + except: + print("Ssid name not available") + closeApp(connData["appPackage-android"], setup_perfectoMobile) + assert False + if (ssid_name_element_text == WifiName): + print("Wifi is connected to the expected ssid") + else: + print("Wifi is not connected to the expected ssid") + closeApp(connData["appPackage-android"], setup_perfectoMobile) + assert False # closeApp(connData["appPackage-android"], setup_perfectoMobile) # return ip_address_element_text, ssid_with_internet @@ -3311,6 +3365,7 @@ def get_ip_address_eap_and(request, WifiName, User, ttls_passwd, setup_perfectoM try: driver.implicitly_wait(3) report.step_start("Click Connect Button") + print("Click Connect Button") join_element = driver.find_element_by_xpath("//*[@text='Connect']") join_element.click() except NoSuchElementException: diff --git a/libs/perfecto_libs/iOS_lib.py b/libs/perfecto_libs/iOS_lib.py index f3f2a1065..3d8eaf5ad 100644 --- a/libs/perfecto_libs/iOS_lib.py +++ b/libs/perfecto_libs/iOS_lib.py @@ -114,9 +114,9 @@ def set_APconnMobileDevice_iOS(request, WifiNameSSID, WifiPass, setup_perfectoMo report.step_start("Checking Internet Connection Error..") try: + driver.implicitly_wait(5) # WifiInternetErrMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text - NoInternetConnectionMsg = WebDriverWait(driver, 30).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + NoInternetConnectionMsg = driver.find_element_by_xpath("//*[@label='No Internet Connection']") except Exception as e: print("No Error with Wifi-AP Connection: " + Wifi_AP_Name) @@ -931,7 +931,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa print("Exception: Verify Xpath - unable to click on Wifi") time.sleep(2) - driver.implicitly_wait(2) + driver.implicitly_wait(4) # --------------------To Turn on WIFi Switch if already OFF-------------------------------- try: get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") @@ -982,17 +982,19 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa # ---------------------This is to Forget current connected SSID------------------------------- try: - time.sleep(3) + time.sleep(4) print("getting in to Additional details") report.step_start("Clicking More Info") additional_details_element = driver.find_element_by_xpath("//*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info']") additional_details_element.click() try: + time.sleep(2) print("Forget Connected Network") forget_ssid = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget This Network']"))) forget_ssid.click() print("Forget old ssid") try: + time.sleep(2) report.step_start("Forget SSID popup1") forget_ssid_popup = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget']"))) forget_ssid_popup.click() @@ -1025,15 +1027,22 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa scrollDown(setup_perfectoMobile) time.sleep(2) else: - report.step_start("Selecting SSID To Connect") - ssid_found = True - print(WifiName + " : Found in Device") - wifiSelElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) - print(wifiSelElement) - wifiSelElement.click() - print("Selecting SSID") - # allure.attach(name= body=str(WifiName + " : Found in Device")) - break + try: + driver.implicitly_wait(8) + report.step_start("Selecting SSID To Connect") + ssid_found = True + print(WifiName + " : Found in Device") + wifiSelElement = WebDriverWait(driver, 35).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) + print(wifiSelElement) + wifiSelElement.click() + print("Selecting SSID") + break + except: + print("SSID unable to select") + report.step_start("Selecting Unable SSID To Connect") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet + except: print("couldn't connect to " + WifiName) #request.config.cache.set(key="SelectingWifiFailed", value=str(e)) @@ -1054,7 +1063,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa # ---------------------This is to Select SSID------------------------------- # ---------------------Set Password------------------------------- try: - time.sleep(3) + driver.implicitly_wait(5) print("Entering Password") report.step_start("Entering Password") wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") @@ -1065,7 +1074,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa # ---------------------Click on join------------------------------- try: - time.sleep(2) + driver.implicitly_wait(4) print("Selecting join") report.step_start("Clicking JOIN") joinBTN = driver.find_element_by_xpath("//*[@label='Join']") @@ -1076,8 +1085,8 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa # ---------------------check if internet------------------------------- try: - WifiInternetErrMsg2 = WebDriverWait(driver, 5).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + driver.implicitly_wait(5) + WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']") # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text except Exception as e: is_internet = True @@ -1088,15 +1097,17 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa # ---------------------Additional INFO------------------------------- try: + driver.implicitly_wait(5) print("Selecting SSID: ", WifiName) report.step_start("Additional details of SSID") - additional_details_element = WebDriverWait(driver, 30).until( + additional_details_element = WebDriverWait(driver, 35).until( EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) # //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info'] additional_details_element.click() try: + driver.implicitly_wait(2) report.step_start("Checking SSID Name as Expected") print("Checking SSID Name") ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text @@ -1123,6 +1134,7 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa except Exception as e: print("WiFi-Address not Found") try: + time.sleep(4) report.step_start("Checking IP Address") print("Checking IP address") # (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2] @@ -1130,8 +1142,16 @@ def get_ip_address_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa "(//*[@label='IP Address']/parent::*/XCUIElementTypeStaticText)[2]").text print("ip_address_element_text: ", ip_address_element_text) except Exception as e: - print("IP Address not Found") - request.config.cache.set(key="select IP failed", value=str(e)) + try: + time.sleep(4) + print("Scrolling for checking ip address") + scrollDown(setup_perfectoMobile) + 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) + except: + print("IP Address not Found") + request.config.cache.set(key="select IP failed", value=str(e)) try: report.step_start("Forget Network") @@ -1400,8 +1420,8 @@ def wifi_connect(request, WifiName, WifiPass, setup_perfectoMobile, connData): # ---------------------check if internet------------------------------- try: - WifiInternetErrMsg2 = WebDriverWait(driver, 30).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + driver.implicitly_wait(5) + WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']") # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text except Exception as e: is_internet = True @@ -1685,7 +1705,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM print("Exception: Verify Xpath - unable to click on Wifi") time.sleep(2) - driver.implicitly_wait(2) + driver.implicitly_wait(4) # --------------------To Turn on WIFi Switch if already OFF-------------------------------- try: get_wifi_switch_element = driver.find_element_by_xpath("//*[@label='Wi-Fi' and @value='0']") @@ -1736,19 +1756,21 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # ---------------------This is to Forget current connected SSID------------------------------- try: - time.sleep(2) + time.sleep(4) report.step_start("Selecting Connected SSID Info") 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: + time.sleep(2) print("Forget Connected Network") report.step_start("Forget Connected SSID") forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']") forget_ssid.click() print("Forget old ssid") try: + time.sleep(2) report.step_start("Forget SSID popup1") forget_ssid_popup = driver.find_element_by_xpath("//*[@label='Forget']") forget_ssid_popup.click() @@ -1766,7 +1788,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # ---------------------To get all available SSID------------------------------- print("Searching for Wifi: " + WifiName) # allure.attach(name= body=str("Searching for Wifi: " + WifiName)) - time.sleep(2) + time.sleep(5) print("Selecting Wifi: " + WifiName) ssid_found = False available_ssids = False @@ -1780,16 +1802,22 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM scrollDown(setup_perfectoMobile) time.sleep(2) else: - report.step_start("Selecting SSID To Connect") - ssid_found = True - print(WifiName + " : Found in Device") - wifiSelElement = WebDriverWait(driver, 30).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) - print(wifiSelElement) - wifiSelElement.click() - print("Selecting SSID") - # allure.attach(name= body=str(WifiName + " : Found in Device")) - break + try: + driver.implicitly_wait(8) + report.step_start("Selecting SSID To Connect") + ssid_found = True + print(WifiName + " : Found in Device") + wifiSelElement = WebDriverWait(driver, 35).until( + EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) + print(wifiSelElement) + wifiSelElement.click() + print("Selecting SSID") + break + except: + print("SSID unable to select") + report.step_start("Selecting Unable SSID To Connect") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet except: print("couldn't connect to " + WifiName) # request.config.cache.set(key="SelectingWifiFailed", value=str(e)) @@ -1808,7 +1836,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # Set username # ------------------------------------------------------- try: - driver.implicitly_wait(5) + driver.implicitly_wait(4) report.step_start("Entering User") print("Entering User name") wifiUserElement = driver.find_element_by_xpath("//*[@label='Username']") @@ -1819,7 +1847,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # ---------------------Set Password------------------------------- try: - driver.implicitly_wait(5) + driver.implicitly_wait(4) report.step_start("Entering Password") print("Entering password") wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") @@ -1831,9 +1859,10 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # ---------------------Click on join------------------------------- try: + driver.implicitly_wait(4) report.step_start("Clicking Join") print("Clicking Join") - joinBTN = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Join']"))) + joinBTN = driver.find_element_by_xpath("//*[@label='Join']") joinBTN.click() except Exception as e: print("Join Button Not Enabled...Password may not be needed") @@ -1841,17 +1870,18 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # Selecting certificate # ------------------------------------------------------- try: + driver.implicitly_wait(4) report.step_start("Clicking Trust CA Cert") print("Clicking Trust CA Cert") - certElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Trust']"))) + certElement = driver.find_element_by_xpath("//*[@label='Trust']") certElement.click() except NoSuchElementException: print("Password Page Not Loaded, password May be cached in the System") # ---------------------check if internet------------------------------- try: + driver.implicitly_wait(5) report.step_start("Checking Internet connection") - WifiInternetErrMsg2 = WebDriverWait(driver, 35).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']") # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text except Exception as e: is_internet = True @@ -1862,7 +1892,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM # ---------------------Additional INFO------------------------------- try: - driver.implicitly_wait(2) + driver.implicitly_wait(4) print("Selecting SSID: ", WifiName) report.step_start("Selecting More Info") additional_details_element = WebDriverWait(driver, 35).until( @@ -1872,6 +1902,7 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM additional_details_element.click() try: + driver.implicitly_wait(2) report.step_start("Checking SSID Name as Expected") print("Checking SSID Name") ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text @@ -1899,21 +1930,27 @@ def get_ip_address_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoM print("WiFi-Address not Found") allure.attach(name="No Connected SSID WiFi-Address Found") try: - driver.implicitly_wait(5) + time.sleep(5) print("Checking IP address") report.step_start("Checking IP address") - time.sleep(4) + time.sleep(1) # (//*[@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) except Exception as e: - print("IP Address not Found") - request.config.cache.set(key="select IP failed", value=str(e)) - + try: + time.sleep(4) + print("Scrolling for checking IP Address") + scrollDown(setup_perfectoMobile) + 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) + except: + print("IP Address not Found") + request.config.cache.set(key="select IP failed", value=str(e)) try: - time.sleep(2) - driver.implicitly_wait(2) + driver.implicitly_wait(4) report.step_start("Forget Network") forget_ssid = driver.find_element_by_xpath("//*[@label='Forget This Network']") forget_ssid.click() @@ -2177,9 +2214,9 @@ def wifi_connect_eap(request, WifiName, User, ttls_passwd, setup_perfectoMobile, print("Password Page Not Loaded, password May be cached in the System") # ---------------------check if internet------------------------------- try: + driver.implicitly_wait(5) report.step_start("Checking Internet connection") - WifiInternetErrMsg2 = WebDriverWait(driver, 35).until( - EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']") # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text except Exception as e: is_internet = True @@ -2419,6 +2456,7 @@ def captive_portal_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa additional_details_element.click() try: + time.sleep(5) 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 @@ -2428,8 +2466,8 @@ def captive_portal_ios(request, WifiName, WifiPass, setup_perfectoMobile, connDa 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']"))) + driver.implicitly_wait(5) + WifiInternetErrMsg2 = driver.find_element_by_xpath("//*[@label='No Internet Connection']") except Exception as e: is_internet = True print("No Wifi-AP Error Internet Error: " + WifiName) @@ -2450,4 +2488,658 @@ def ssid_Visible(driver,WifiName): if(isVisible == 'false'): return False else: - return True \ No newline at end of file + return True + +#--------------------------------Gets ip address from ssid but it won't get disconnected from it------------------ +def get_ip_add_ios(request, WifiName, WifiPass, setup_perfectoMobile, connData): + print("\n-------------------------------------") + print("Select Wifi/Get IP Address IOS Connection") + 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 ip_address_element_text, is_internet + else: + print("Switch is Still OFF") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, 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 ip_address_element_text, is_internet + + # ---------------------This is to Forget current connected SSID------------------------------- + + try: + time.sleep(3) + print("getting in to Additional details") + report.step_start("Clicking More Info") + 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 = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Forget This Network']"))) + forget_ssid.click() + print("Forget old ssid") + try: + report.step_start("Forget SSID popup1") + forget_ssid_popup = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.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) + report.step_start("Searching SSID") + print("Selecting Wifi: " + WifiName) + ssid_found = False + available_ssids = False + + try: + for check_for_all_ssids in range(9): + available_ssids = get_all_available_ssids(driver) + allure.attach(name="Available SSIDs in device: ", body=str(available_ssids)) + try: + if WifiName not in available_ssids: + scrollDown(setup_perfectoMobile) + time.sleep(2) + else: + report.step_start("Selecting SSID To Connect") + ssid_found = True + print(WifiName + " : Found in Device") + wifiSelElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) + print(wifiSelElement) + wifiSelElement.click() + print("Selecting SSID") + # allure.attach(name= body=str(WifiName + " : Found in Device")) + break + except: + print("couldn't connect to " + WifiName) + #request.config.cache.set(key="SelectingWifiFailed", value=str(e)) + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet + pass + + if not ssid_found: + print("could not found " + WifiName + " in device") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet + except: + pass + # ---------------------To get all available SSID------------------------------- + + # ---------------------This is to Select SSID------------------------------- + + # ---------------------This is to Select SSID------------------------------- + # ---------------------Set Password------------------------------- + try: + time.sleep(3) + print("Entering Password") + report.step_start("Entering Password") + 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: + time.sleep(2) + print("Selecting join") + report.step_start("Clicking JOIN") + 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------------------------------- + + # ---------------------check if internet------------------------------- + try: + WifiInternetErrMsg2 = WebDriverWait(driver, 5).until( + EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text + except Exception as e: + is_internet = True + print("No Wifi-AP Error Internet Error: " + WifiName) + # Need to add Wait for Selected Wifi Xpath + # time.sleep(3) + # ---------------------check if internet------------------------------- + + # ---------------------Additional INFO------------------------------- + try: + print("Selecting SSID: ", WifiName) + report.step_start("Additional details of 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: + report.step_start("Checking SSID Name as Expected") + print("Checking SSID Name") + ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text + print(ssidname_text) + if(ssidname_text == WifiName): + print("SSID Matched") + allure.attach(name="SSID Matched ", body=str(WifiName)) + else: + print("SSID Not Matched") + allure.attach(name="SSID Not Matched ", body=str(WifiName)) + reportFlag = False + assert reportFlag + except: + print("SSID is not Checked in more Info") + + try: + report.step_start("Checking WiFi Address") + print("Checking WIFI address") + # (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2] + wifi_address_element_text = driver.find_element_by_xpath( + "(//*[@label='Wi-Fi Address']/parent::*/XCUIElementTypeStaticText)[2]").text + print("wifi_address_element_text: ", wifi_address_element_text) + allure.attach(name="Connected SSID WiFi-Address: ", body=str(wifi_address_element_text)) + except Exception as e: + print("WiFi-Address not Found") + try: + report.step_start("Checking IP Address") + 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) + except Exception as e: + print("IP Address not Found") + request.config.cache.set(key="select IP failed", value=str(e)) + + 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 +#----------------Gets ip address of Enterprise ssids and won't forget it--------------- +def get_ip_add_eap_ios(request, WifiName, User, ttls_passwd, setup_perfectoMobile, connData): + print("\n-------------------------------------") + print("Get IP Address Enterprise IOS Connection") + 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 ip_address_element_text, is_internet + else: + print("Switch is Still OFF") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, 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 ip_address_element_text, is_internet + + # ---------------------This is to Forget current connected SSID------------------------------- + + try: + time.sleep(2) + report.step_start("Selecting Connected SSID Info") + 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") + report.step_start("Forget Connected SSID") + 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(9): + available_ssids = get_all_available_ssids(driver) + allure.attach(name="Available SSIDs in device: ", body=str(available_ssids)) + try: + if WifiName not in available_ssids: + scrollDown(setup_perfectoMobile) + time.sleep(2) + else: + report.step_start("Selecting SSID To Connect") + ssid_found = True + print(WifiName + " : Found in Device") + wifiSelElement = WebDriverWait(driver, 30).until( + EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='" + WifiName + "']"))) + print(wifiSelElement) + wifiSelElement.click() + print("Selecting SSID") + # allure.attach(name= body=str(WifiName + " : Found in Device")) + break + except: + print("couldn't connect to " + WifiName) + # request.config.cache.set(key="SelectingWifiFailed", value=str(e)) + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet + pass + + if not ssid_found: + print("could not found " + WifiName + " in device") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, is_internet + except: + pass + # ---------------------To get all available SSID------------------------------- + + # Set username + # ------------------------------------------------------- + try: + driver.implicitly_wait(5) + report.step_start("Entering User") + print("Entering User name") + wifiUserElement = driver.find_element_by_xpath("//*[@label='Username']") + wifiUserElement.send_keys(User) + except NoSuchElementException: + print("Password Page Not Loaded, password May be cached in the System") + # ------------------------------------------------------- + + # ---------------------Set Password------------------------------- + try: + driver.implicitly_wait(5) + report.step_start("Entering Password") + print("Entering password") + wifiPassword = driver.find_element_by_xpath("//*[@label='Password']") + wifiPassword.send_keys(ttls_passwd) + except NoSuchElementException: + print("Enter Password Page Not Loaded") + # ---------------------Set Password------------------------------- + # ------------------------------------------------------- + + # ---------------------Click on join------------------------------- + try: + report.step_start("Clicking Join") + print("Clicking Join") + joinBTN = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Join']"))) + joinBTN.click() + except Exception as e: + print("Join Button Not Enabled...Password may not be needed") + # ---------------------Click on join------------------------------- + # Selecting certificate + # ------------------------------------------------------- + try: + report.step_start("Clicking Trust CA Cert") + print("Clicking Trust CA Cert") + certElement = WebDriverWait(driver, 30).until(EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='Trust']"))) + certElement.click() + except NoSuchElementException: + print("Password Page Not Loaded, password May be cached in the System") + # ---------------------check if internet------------------------------- + try: + report.step_start("Checking Internet connection") + WifiInternetErrMsg2 = WebDriverWait(driver, 35).until( + EC.presence_of_element_located((MobileBy.XPATH, "//*[@label='No Internet Connection']"))) + # = driver.find_element_by_xpath("//*[@label='No Internet Connection']").text + except Exception as e: + is_internet = True + print("No Wifi-AP Error Internet Error: " + WifiName) + # Need to add Wait for Selected Wifi Xpath + # time.sleep(3) + # ---------------------check if internet------------------------------- + + # ---------------------Additional INFO------------------------------- + try: + driver.implicitly_wait(2) + print("Selecting SSID: ", WifiName) + report.step_start("Selecting More Info") + additional_details_element = WebDriverWait(driver, 35).until( + EC.presence_of_element_located((MobileBy.XPATH, + "//*[@label='" + WifiName + "']"))) + # //*[@label='selected']/parent::*/parent::*/XCUIElementTypeButton[@label='More Info'] + additional_details_element.click() + + try: + report.step_start("Checking SSID Name as Expected") + print("Checking SSID Name") + ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text + print(ssidname_text) + if(ssidname_text == WifiName): + print("SSID Matched") + allure.attach(name="SSID Matched ", body=str(WifiName)) + else: + print("SSID Not Matched") + allure.attach(name="SSID Not Matched ", body=str(WifiName)) + reportFlag = False + assert reportFlag + except: + print("SSID is not Checked in more Info") + + try: + report.step_start("Checking WiFi Address") + print("Checking WIFI address") + # (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2] + wifi_address_element_text = driver.find_element_by_xpath( + "(//*[@label='Wi-Fi Address']/parent::*/XCUIElementTypeStaticText)[2]").text + print("wifi_address_element_text: ", wifi_address_element_text) + allure.attach(name="Connected SSID WiFi-Address: ", body=str(wifi_address_element_text)) + except Exception as e: + print("WiFi-Address not Found") + allure.attach(name="No Connected SSID WiFi-Address Found") + try: + driver.implicitly_wait(5) + print("Checking IP address") + report.step_start("Checking IP address") + time.sleep(4) + # (//*[@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) + except Exception as e: + print("IP Address not Found") + request.config.cache.set(key="select IP failed", value=str(e)) + + 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 + + + + +#------------------Gets the ip address of already connected ssid--------------------------------------- +def get_ip_add_check_ios(request, WifiName, WifiPass, setup_perfectoMobile, connData): + print("\n-------------------------------------") + print("Select Wifi/Get IP Address IOS Connection") + 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 ip_address_element_text, is_internet + else: + print("Switch is Still OFF") + closeApp(connData["bundleId-iOS-Settings"], setup_perfectoMobile) + return ip_address_element_text, 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 ip_address_element_text, is_internet + + # ---------------------Additional INFO------------------------------- + try: + print("Selecting SSID: ", WifiName) + report.step_start("Additional details of 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: + report.step_start("Checking SSID Name as Expected") + print("Checking SSID Name") + ssidname_text = driver.find_element_by_xpath("//*[@label='" + WifiName + "']").text + print(ssidname_text) + if(ssidname_text == WifiName): + print("SSID Matched") + allure.attach(name="SSID Matched ", body=str(WifiName)) + else: + print("SSID Not Matched") + allure.attach(name="SSID Not Matched ", body=str(WifiName)) + reportFlag = False + assert reportFlag + except: + print("SSID is not Checked in more Info") + + try: + report.step_start("Checking WiFi Address") + print("Checking WIFI address") + # (//*[@label="IP Address"]/parent::*/XCUIElementTypeStaticText)[2] + wifi_address_element_text = driver.find_element_by_xpath( + "(//*[@label='Wi-Fi Address']/parent::*/XCUIElementTypeStaticText)[2]").text + print("wifi_address_element_text: ", wifi_address_element_text) + allure.attach(name="Connected SSID WiFi-Address: ", body=str(wifi_address_element_text)) + except Exception as e: + print("WiFi-Address not Found") + try: + report.step_start("Checking IP Address") + 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) + except Exception as e: + print("IP Address not Found") + request.config.cache.set(key="select IP failed", value=str(e)) + + 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 \ No newline at end of file diff --git a/tests/configuration.py b/tests/configuration.py index 7f0f0207e..d35e8c6b0 100644 --- a/tests/configuration.py +++ b/tests/configuration.py @@ -617,6 +617,23 @@ RATE_LIMITING_RADIUS_ACCOUNTING_DATA = { "password": "password", "pk_password": "whatever" } +DYNAMIC_VLAN_RADIUS_SERVER_DATA = { + "ip": "3.20.165.131", + "port": 1812, + "secret": "testing123", + "user": "user", + "password": "password", + "pk_password": "whatever" +} + +DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA = { + "ip": "3.20.165.131", + "port": 1813, + "secret": "testing123", + "user": "user", + "password": "password", + "pk_password": "whatever" +} PASSPOINT_RADIUS_SERVER_DATA = { "ip": "52.234.179.191", diff --git a/tests/e2e/advanced/air_time_fairness_test/wpa2_personal/__init__.py b/tests/e2e/advanced/air_time_fairness_test/wpa2_personal/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/advanced/air_time_fairness_test/wpa2_personal/test_bridge_air_time_fairness.py b/tests/e2e/advanced/air_time_fairness_test/wpa2_personal/test_bridge_air_time_fairness.py new file mode 100644 index 000000000..8c59e6b47 --- /dev/null +++ b/tests/e2e/advanced/air_time_fairness_test/wpa2_personal/test_bridge_air_time_fairness.py @@ -0,0 +1,168 @@ +import pytest +import allure +import os +import time +import pandas as pd + +pytestmark = [pytest.mark.advance, pytest.mark.atf, 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 +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestAtfBridge(object): + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6394", name="WIFI-6394") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.atf_sta1_greenfieldmode_sta2_atten30dB_2g + def test_atf_sta1_greenfieldmode_sta2_atten30dB_2g(self, lf_test, lf_tools, station_names_twog): + lf_tools.reset_scenario() + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + station_name = station_names_twog[0] + radio_name1 = lf_tools.twog_radios[0] + radio_name2 = lf_tools.twog_radios[1] + sta = [] + for i in range(2): + sta.append(station_name + str(i)) + print(sta) + atten_serial = lf_test.attenuator_serial_2g_radio(ssid=ssid_name, passkey=profile_data["security_key"], station_name=station_names_twog, lf_tools_obj=lf_tools) + atten_serial_split = atten_serial[1].split(".") + sta_ip1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name1, station_name=sta[0:1], sta_mode=11) + sta_ip2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name2, station_name=sta[1:2], sta_mode=11) + if (not sta_ip1) or (not sta_ip2): + print("test failed due to no station ip") + assert False + for i in range(2): + lf_test.attenuator_modify(int(atten_serial_split[2]), i, 300) + time.sleep(0.5) + wct_obj = lf_test.wifi_capacity(instance_name="atf_sta1_greenfieldmode_sta2_atten30dB_2g", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000", sort="linear") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6395", name="WIFI-6395") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.atf_sta1_greenfieldmode_sta2_legacymode_2g + def test_atf_sta1_greenfieldmode_sta2_legacymode_2g(self, lf_test, lf_tools, station_names_twog): + lf_tools.reset_scenario() + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + station_name = station_names_twog[0] + radio_name1 = lf_tools.twog_radios[0] + radio_name2 = lf_tools.twog_radios[1] + sta = [] + for i in range(2): + sta.append(station_name + str(i)) + print(sta) + sta_ip1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name1, station_name=sta[0:1], sta_mode=11) + sta_ip2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name2, station_name=sta[1:2], sta_mode=2) + if (not sta_ip1) or (not sta_ip2): + print("test failed due to no station ip") + assert False + wct_obj = lf_test.wifi_capacity(instance_name="atf_sta1_greenfieldmode_sta2_legacymode_2g", mode=mode, vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000", sort="linear") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6396", name="WIFI-6396") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.atf_sta1_greenfieldmode_sta2_atten30dB_5g + def test_atf_sta1_greenfieldmode_sta2_atten30dB_5g(self, lf_test, lf_tools, station_names_fiveg): + lf_tools.reset_scenario() + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + station_name = station_names_fiveg[0] + radio_name1 = lf_tools.fiveg_radios[0] + radio_name2 = lf_tools.fiveg_radios[1] + sta = [] + for i in range(2): + sta.append(station_name + str(i)) + print(sta) + atten_serial = lf_test.attenuator_serial_5g_radio(ssid=ssid_name, passkey=profile_data["security_key"], + station_name=station_names_fiveg, lf_tools_obj=lf_tools) + atten_serial_split = atten_serial[1].split(".") + sta_ip1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name1, station_name=sta[0:1], sta_mode=9) + sta_ip2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name2, station_name=sta[1:2], sta_mode=9) + if (not sta_ip1) or (not sta_ip2): + print("test failed due to no station ip") + assert False + for i in range(2): + lf_test.attenuator_modify(int(atten_serial_split[2]), i, 300) + time.sleep(0.5) + wct_obj = lf_test.wifi_capacity(instance_name="atf_sta1_greenfieldmode_sta2_atten30dB_5g", mode=mode, + vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000", sort="linear") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6397", name="WIFI-6397") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.atf_sta1_greenfieldmode_sta2_legacymode_5g + def test_atf_sta1_greenfieldmode_sta2_legacymode_5g(self, lf_test, lf_tools, station_names_fiveg): + lf_tools.reset_scenario() + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + mode = "BRIDGE" + vlan = 1 + station_name = station_names_fiveg[0] + radio_name1 = lf_tools.fiveg_radios[0] + radio_name2 = lf_tools.fiveg_radios[1] + sta = [] + for i in range(2): + sta.append(station_name + str(i)) + print(sta) + sta_ip1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name1, station_name=sta[0:1], sta_mode=9) + sta_ip2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=profile_data["security_key"], + radio=radio_name2, station_name=sta[1:2], sta_mode=1) + if (not sta_ip1) or (not sta_ip2): + print("test failed due to no station ip") + assert False + wct_obj = lf_test.wifi_capacity(instance_name="atf_sta1_greenfieldmode_sta2_legacymode_5g", mode=mode, + vlan_id=vlan, + download_rate="1Gbps", batch_size="1,2", + upload_rate="1Gbps", protocol="UDP-IPv4", duration="60000", sort="linear") + + report_name = wct_obj.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + + lf_tools.attach_report_graphs(report_name=report_name) \ No newline at end of file diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/__init__.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py new file mode 100644 index 000000000..36e0486ec --- /dev/null +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_20MHz/test_dfs_20_bridge.py @@ -0,0 +1,969 @@ +import pytest +import allure +import os +import time +import pandas as pd + +pytestmark = [pytest.mark.regression, pytest.mark.dfs, pytest.mark.bridge] + +setup_params_general1 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 52, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general1], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel52Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6472", name="WIFI-6472") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_52_bw_20 + def test_dfs_channel_52_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general1["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general2 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 100, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general2], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel100Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6473", name="WIFI-6473") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_100_bw_20 + def test_dfs_channel_100_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general2["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general3 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 104, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general3], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel104Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6474", name="WIFI-6474") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_104_bw_20 + def test_dfs_channel_104_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general3["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general4 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 56, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general4], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel56Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6475", name="WIFI-6475") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_56_bw_20 + def test_dfs_channel_56_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general4["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general5 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 60, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general5], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel60Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6476", name="WIFI-6476") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_60_bw_20 + def test_dfs_channel_60_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general5["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general6 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 64, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general6], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel64Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6477", name="WIFI-6477") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_64_bw_20 + def test_dfs_channel_64_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general6["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general7 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 108, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general7], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel108Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6478", name="WIFI-6478") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_108_bw_20 + def test_dfs_channel_108_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general7["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general8 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 112, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general8], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel112Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6479", name="WIFI-6479") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_112_bw_20 + def test_dfs_channel_112_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general8["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +# setup_params_general9 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 124, +# "channel_bandwidth": 20 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general9], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel124Bw20(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6480", name="WIFI-6480") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_124_bw_20 +# def test_dfs_channel_124_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general9["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False + +setup_params_general10 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 132, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general10], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel132Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6481", name="WIFI-6481") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_132_bw_20 + def test_dfs_channel_132_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general10["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general11 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 136, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general11], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel136Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6482", name="WIFI-6482") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_136_bw_20 + def test_dfs_channel_136_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general11["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general12 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 140, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general12], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel140Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6483", name="WIFI-6483") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_140_bw_20 + def test_dfs_channel_140_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general12["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False + +setup_params_general13 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "dfs": { + "channel": 144, + "channel_bandwidth": 20 + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general13], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") + +class TestDFSChannel144Bw20(object): + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6484", name="WIFI-6484") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.dfs_channel_144_bw_20 + def test_dfs_channel_144_bw_20(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + lf_tools.reset_scenario() + profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + channel = setup_params_general13["dfs"]["channel"] + security = "wpa2" + band = "fiveg" + mode = "BRIDGE" + vlan = 1 + dfs_fail = True + print("station_names_fiveg :", station_names_fiveg) + 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) + channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + print("channel before dfs: ", channel1) + if channel1 == str(channel): + dfs_start.dfs() + time.sleep(15) + else: + print("Station not connected to applied channel") + allure.attach(name="log Data", body="Station not connected to applied channel") + assert False + channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") + log = dfs_start.dfs_logread() + if channel1 != channel2: + print(log) + print("channel after dfs: ", channel2) + allure.attach(name="log Data", body=log) + else: + print(log) + print("dfs not happened") + allure.attach(name="log Data", body=log) + dfs_fail = False + dfs_start.reboot() + time.sleep(200) + while True: + connected, latest, active = dfs_start.get_ucentral_status() + if connected is True: + print("status is connected after reboot: ", connected) + break + time.sleep(1) + if not dfs_fail: + assert False \ No newline at end of file diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py index 17bcee058..61d6b3bf5 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_40MHz/test_dfs_40_bridge.py @@ -154,153 +154,153 @@ class TestDFSChannel100Bw40(object): if not dfs_fail: assert False -setup_params_general3 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 104, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general3], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") +# setup_params_general3 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 104, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general3], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel104Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6312", name="WIFI-6312") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_104_bw_40 +# def test_dfs_channel_104_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general3["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False -class TestDFSChannel104Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6312", name="WIFI-6312") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_104_bw_40 - def test_dfs_channel_104_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general3["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general4 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 56, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general4], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel56Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6314", name="WIFI-6314") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_56_bw_40 - def test_dfs_channel_56_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general4["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False +# setup_params_general4 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 56, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general4], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel56Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6314", name="WIFI-6314") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_56_bw_40 +# def test_dfs_channel_56_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general4["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False setup_params_general5 = { "mode": "BRIDGE", @@ -376,79 +376,79 @@ class TestDFSChannel60Bw40(object): if not dfs_fail: assert False -setup_params_general6 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 64, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general6], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel64Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6316", name="WIFI-6316") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_64_bw_40 - def test_dfs_channel_64_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general6["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False +# setup_params_general6 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 64, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general6], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel64Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6316", name="WIFI-6316") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_64_bw_40 +# def test_dfs_channel_64_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general6["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False setup_params_general7 = { "mode": "BRIDGE", @@ -524,227 +524,227 @@ class TestDFSChannel108Bw40(object): if not dfs_fail: assert False -setup_params_general8 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 120, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general8], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") +# setup_params_general8 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 120, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general8], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel120Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6318", name="WIFI-6318") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_120_bw_40 +# def test_dfs_channel_120_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general8["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False -class TestDFSChannel120Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6318", name="WIFI-6318") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_120_bw_40 - def test_dfs_channel_120_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general8["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False +# setup_params_general9 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 124, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general9], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel124Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6319", name="WIFI-6319") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_124_bw_40 +# def test_dfs_channel_124_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general9["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False -setup_params_general9 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 124, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general9], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel124Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6319", name="WIFI-6319") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_124_bw_40 - def test_dfs_channel_124_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general9["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general10 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 128, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general10], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel128Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6320", name="WIFI-6320") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_128_bw_40 - def test_dfs_channel_128_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general10["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False +# setup_params_general10 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 128, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general10], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel128Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6320", name="WIFI-6320") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_128_bw_40 +# def test_dfs_channel_128_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general10["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False setup_params_general11 = { "mode": "BRIDGE", @@ -754,7 +754,7 @@ setup_params_general11 = { ] }, "dfs": { - "channel": 136, + "channel": 132, "channel_bandwidth": 40 }, "rf": {}, @@ -768,12 +768,12 @@ setup_params_general11 = { ) @pytest.mark.usefixtures("setup_profiles") -class TestDFSChannel136Bw40(object): +class TestDFSChannel132Bw40(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6321", name="WIFI-6321") @pytest.mark.wpa2_personal @pytest.mark.fiveg - @pytest.mark.dfs_channel_136_bw_40 - def test_dfs_channel_136_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + @pytest.mark.dfs_channel_132_bw_40 + def test_dfs_channel_132_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): lf_tools.reset_scenario() profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] @@ -820,150 +820,150 @@ class TestDFSChannel136Bw40(object): if not dfs_fail: assert False -setup_params_general12 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 140, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general12], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") +# setup_params_general12 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 140, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general12], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel140Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6321", name="WIFI-6321") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_140_bw_40 +# def test_dfs_channel_140_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general12["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False -class TestDFSChannel140Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6321", name="WIFI-6321") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_140_bw_40 - def test_dfs_channel_140_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general12["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general13 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 144, - "channel_bandwidth": 40 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general13], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel144Bw40(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6322", name="WIFI-6322") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_144_bw_40 - def test_dfs_channel_144_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general13["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False \ No newline at end of file +# setup_params_general13 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 144, +# "channel_bandwidth": 40 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general13], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel144Bw40(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6322", name="WIFI-6322") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_144_bw_40 +# def test_dfs_channel_144_bw_40(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general13["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False \ No newline at end of file diff --git a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py index 27b77cfcf..9e3d35426 100644 --- a/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py +++ b/tests/e2e/basic/dfs_test/wpa2_personal/dfs_80MHz/test_dfs_80_bridge.py @@ -154,597 +154,597 @@ class TestDFSChannel100Bw80(object): if not dfs_fail: assert False -setup_params_general3 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 104, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general3], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel104Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6313", name="WIFI-6313") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_104_bw_80 - def test_dfs_channel_104_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general3["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general4 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 56, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general4], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel56Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6377", name="WIFI-6377") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_56_bw_80 - def test_dfs_channel_56_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general4["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general5 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 60, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general5], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel60Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6378", name="WIFI-6378") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_60_bw_80 - def test_dfs_channel_60_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general5["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general6 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 64, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general6], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel64Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6379", name="WIFI-6379") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_64_bw_80 - def test_dfs_channel_64_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general6["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general7 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 108, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general7], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel108Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6380", name="WIFI-6380") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_108_bw_80 - def test_dfs_channel_108_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general7["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general8 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 120, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general8], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel120Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6381", name="WIFI-6381") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_120_bw_80 - def test_dfs_channel_120_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general8["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general9 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 124, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general9], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel124Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6382", name="WIFI-6382") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_124_bw_80 - def test_dfs_channel_124_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general9["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general10 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 128, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general10], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel128Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6383", name="WIFI-6383") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_128_bw_80 - def test_dfs_channel_128_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general10["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False +# setup_params_general3 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 104, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general3], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel104Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6313", name="WIFI-6313") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_104_bw_80 +# def test_dfs_channel_104_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general3["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general4 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 56, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general4], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel56Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6377", name="WIFI-6377") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_56_bw_80 +# def test_dfs_channel_56_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general4["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general4["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general5 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 60, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general5], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel60Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6378", name="WIFI-6378") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_60_bw_80 +# def test_dfs_channel_60_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general5["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general5["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general6 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 64, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general6], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel64Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6379", name="WIFI-6379") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_64_bw_80 +# def test_dfs_channel_64_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general6["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general6["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general7 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 108, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general7], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel108Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6380", name="WIFI-6380") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_108_bw_80 +# def test_dfs_channel_108_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general7["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general7["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general8 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 120, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general8], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel120Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6381", name="WIFI-6381") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_120_bw_80 +# def test_dfs_channel_120_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general8["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general8["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general9 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 124, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general9], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel124Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6382", name="WIFI-6382") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_124_bw_80 +# def test_dfs_channel_124_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general9["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general9["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general10 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 128, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general10], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel128Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6383", name="WIFI-6383") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_128_bw_80 +# def test_dfs_channel_128_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general10["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general10["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False setup_params_general11 = { "mode": "BRIDGE", @@ -754,7 +754,7 @@ setup_params_general11 = { ] }, "dfs": { - "channel": 136, + "channel": 132, "channel_bandwidth": 80 }, "rf": {}, @@ -768,12 +768,12 @@ setup_params_general11 = { ) @pytest.mark.usefixtures("setup_profiles") -class TestDFSChannel136Bw80(object): +class TestDFSChannel132Bw80(object): @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6384", name="WIFI-6384") @pytest.mark.wpa2_personal @pytest.mark.fiveg - @pytest.mark.dfs_channel_136_bw_80 - def test_dfs_channel_136_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): + @pytest.mark.dfs_channel_132_bw_80 + def test_dfs_channel_132_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): lf_tools.reset_scenario() profile_data = setup_params_general11["ssid_modes"]["wpa2_personal"][0] ssid_name = profile_data["ssid_name"] @@ -820,150 +820,150 @@ class TestDFSChannel136Bw80(object): if not dfs_fail: assert False -setup_params_general12 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 140, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general12], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel140Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6385", name="WIFI-6385") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_140_bw_80 - def test_dfs_channel_140_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general12["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False - -setup_params_general13 = { - "mode": "BRIDGE", - "ssid_modes": { - "wpa2_personal": [ - {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} - ] - }, - "dfs": { - "channel": 144, - "channel_bandwidth": 80 - }, - "rf": {}, - "radius": False -} -@pytest.mark.parametrize( - 'setup_profiles', - [setup_params_general13], - indirect=True, - scope="class" -) -@pytest.mark.usefixtures("setup_profiles") - -class TestDFSChannel144Bw80(object): - @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6386", name="WIFI-6386") - @pytest.mark.wpa2_personal - @pytest.mark.fiveg - @pytest.mark.dfs_channel_144_bw_80 - def test_dfs_channel_144_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): - lf_tools.reset_scenario() - profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] - ssid_name = profile_data["ssid_name"] - security_key = profile_data["security_key"] - channel = setup_params_general13["dfs"]["channel"] - security = "wpa2" - band = "fiveg" - mode = "BRIDGE" - vlan = 1 - dfs_fail = True - print("station_names_fiveg :", station_names_fiveg) - 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) - channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - print("channel before dfs: ", channel1) - if channel1 == str(channel): - dfs_start.dfs() - time.sleep(15) - else: - print("Station not connected to applied channel") - allure.attach(name="log Data", body="Station not connected to applied channel") - assert False - channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") - log = dfs_start.dfs_logread() - if channel1 != channel2: - print(log) - print("channel after dfs: ", channel2) - allure.attach(name="log Data", body=log) - else: - print(log) - print("dfs not happened") - allure.attach(name="log Data", body=log) - dfs_fail = False - dfs_start.reboot() - time.sleep(200) - while True: - connected, latest, active = dfs_start.get_ucentral_status() - if connected is True: - print("status is connected after reboot: ", connected) - break - time.sleep(1) - if not dfs_fail: - assert False \ No newline at end of file +# setup_params_general12 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 140, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general12], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel140Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6385", name="WIFI-6385") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_140_bw_80 +# def test_dfs_channel_140_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general12["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general12["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False +# +# setup_params_general13 = { +# "mode": "BRIDGE", +# "ssid_modes": { +# "wpa2_personal": [ +# {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} +# ] +# }, +# "dfs": { +# "channel": 144, +# "channel_bandwidth": 80 +# }, +# "rf": {}, +# "radius": False +# } +# @pytest.mark.parametrize( +# 'setup_profiles', +# [setup_params_general13], +# indirect=True, +# scope="class" +# ) +# @pytest.mark.usefixtures("setup_profiles") +# +# class TestDFSChannel144Bw80(object): +# @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6386", name="WIFI-6386") +# @pytest.mark.wpa2_personal +# @pytest.mark.fiveg +# @pytest.mark.dfs_channel_144_bw_80 +# def test_dfs_channel_144_bw_80(self, lf_test, lf_tools, station_names_fiveg, dfs_start): +# lf_tools.reset_scenario() +# profile_data = setup_params_general13["ssid_modes"]["wpa2_personal"][0] +# ssid_name = profile_data["ssid_name"] +# security_key = profile_data["security_key"] +# channel = setup_params_general13["dfs"]["channel"] +# security = "wpa2" +# band = "fiveg" +# mode = "BRIDGE" +# vlan = 1 +# dfs_fail = True +# print("station_names_fiveg :", station_names_fiveg) +# 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) +# channel1 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# print("channel before dfs: ", channel1) +# if channel1 == str(channel): +# dfs_start.dfs() +# time.sleep(15) +# else: +# print("Station not connected to applied channel") +# allure.attach(name="log Data", body="Station not connected to applied channel") +# assert False +# channel2 = lf_tools.station_data_query(station_name=station_names_fiveg[0], query="channel") +# log = dfs_start.dfs_logread() +# if channel1 != channel2: +# print(log) +# print("channel after dfs: ", channel2) +# allure.attach(name="log Data", body=log) +# else: +# print(log) +# print("dfs not happened") +# allure.attach(name="log Data", body=log) +# dfs_fail = False +# dfs_start.reboot() +# time.sleep(200) +# while True: +# connected, latest, active = dfs_start.get_ucentral_status() +# if connected is True: +# print("status is connected after reboot: ", connected) +# break +# time.sleep(1) +# if not dfs_fail: +# assert False \ No newline at end of file diff --git a/tests/e2e/basic/performance_tests/throughput_benchmark/tcp_udp_upstream_downstream_bidirection_throughput_test/wpa2_personal/test_bridge_mode.py b/tests/e2e/basic/performance_tests/throughput_benchmark/tcp_udp_upstream_downstream_bidirection_throughput_test/wpa2_personal/test_bridge_mode.py index 21989fc6f..206fa4c3e 100644 --- a/tests/e2e/basic/performance_tests/throughput_benchmark/tcp_udp_upstream_downstream_bidirection_throughput_test/wpa2_personal/test_bridge_mode.py +++ b/tests/e2e/basic/performance_tests/throughput_benchmark/tcp_udp_upstream_downstream_bidirection_throughput_test/wpa2_personal/test_bridge_mode.py @@ -11,7 +11,7 @@ import time import pytest import allure -pytestmark = [pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")] +pytestmark = [pytest.mark.performance, pytest.mark.throughput_benchmark_test, pytest.mark.bridge] # pytest.mark.usefixtures("setup_test_run")] setup_params_general = { diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/__init__.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/__init__.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/__init__.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_over_ssid_fiveg.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_over_ssid_fiveg.py new file mode 100644 index 000000000..d00ff93f4 --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_over_ssid_fiveg.py @@ -0,0 +1,110 @@ +""" + + Dynamic_Vlan: VLAN Mode + pytest -m "dynamic_vlan and wpa2_enterprise and vlan" + +""" + +import os +import allure +import pytest +from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA +from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA + +pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,pytest.mark.fiveg] + +setup_params_general = { + "mode": "VLAN", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2e_5g", "appliedRadios": ["5G"], + "security_key": "something", + "radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA, + "radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA, + "vlan": 100 + }]}, + "rf": {}, + "radius": True +} + + +@allure.suite("regression") +@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestDynamicVlan(object): + + @pytest.mark.dynamic_precedence_over_ssid + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_dynamic_precedence_over_ssid_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5705") + def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100,200] + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan[0], + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True) + + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + + eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + eth_vlan_ip_1 = eth_radius_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("vlan ip...", eth_radius_vlan_ip) + print("eth_upstream_ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip_1[0] == "0": + print("radius configured vlan didnt recieved ip") + assert False + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip)) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per dynamic vlan") + elif not val: + print("Station ip not assigned as per dynamic vlan") + assert False \ No newline at end of file diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_vlan_fiveg.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_vlan_fiveg.py new file mode 100644 index 000000000..e0c12528e --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/fiveg/test_dynamic_vlan_fiveg.py @@ -0,0 +1,648 @@ +""" + + Dynamic_Vlan: VLAN Mode + pytest -m "dynamic_vlan and wpa2_enterprise and vlan" + +""" + +import os +import allure +import pytest +import time +from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA +from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA + +pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan, + pytest.mark.fiveg] + +setup_params_general = { + "mode": "VLAN", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2e_5g", "appliedRadios": ["5G"], + "security_key": "something", + "radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA, + "radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA, + "vlan": 100 + }]}, + "rf": {}, + "radius": True +} + + +@allure.suite("regression") +@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestDynamicVlan(object): + + @pytest.mark.absence_of_radius_vlan_identifier + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5704") + def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_fiveg): + """ + pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan_id = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan_id]) + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordvlannotsentuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"] + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + print(sta_ip_1) + eth_vlan_ip_1 = eth_vlan_ip.split('.') + # eth_ip_1 = eth_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("upstream ip...", eth_ip) + print("ssid configured vlan ip", eth_vlan_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + elif i == j: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid vlan") + elif not val: + print("Station ip not assigned as per ssid vlan") + assert False + + @pytest.mark.invalidradiusvlan + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_dynamic_invalid_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5706") + def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "invalidradiusvlan and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan_id = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan_id]) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan_id, + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordinvalidvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + eth_vlan_ip_1 = eth_vlan_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("ssid vlan ip...", eth_vlan_ip) + print("upstream ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid vlan") + elif not val: + print("Station ip not assigned as per ssid vlan") + assert False + + @pytest.mark.periodic_reauthentication + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5707") + def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_fiveg): + """ + pytest -m "periodic_reauthentication and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100, 200] + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan[1], + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False) + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + sta_ip = lf_test.station_ip[station_names_fiveg[0]] + + count = 0 + # print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + # print("vlan ip...", eth_vlan_ip) + # print("eth_vlan_ip..", eth_ip) + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_vlan_ip_1 = eth_rad_vlan_ip.split('.') + sta_ip_1 = sta_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip_1[0] == "0": + print("radius configured vlan didnt recieved ip") + assert False + print(sta_ip_1) + for k in range(0, 2): + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + break + else: + if count == 2: + break # allure.attach(name="station ip",body=str(sta_ip)) + continue + count = count + 1 + time.sleep(30) + lf_tools.admin_up_down([station_names_fiveg[0]], option="up") + + sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + station_names_fiveg[0])["interface"]["ip"] + sta_ip_1 = sta_ip.split('.') + print(sta_ip) + allure.attach(name="station ip....", body=str(sta_ip)) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if count == 2: + assert True + print("Station ip assigned as per dynamic vlan") + elif count == 0: + print("Station ip not assigned as per dynamic vlan") + assert False + + @pytest.mark.absenceofvlanid + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5708") + def test_ssid_vlan_used_in_absence_of_radius_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "absenceofvlanid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan, + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordvlannotsentuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + eth_vlan_ip_1 = eth_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("ssid configured vlan ip...", eth_vlan_ip) + print("upstream ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid configured vlan") + elif not val: + print("Station ip not assigned as per ssid configured vlan") + assert False + + ''' + @pytest.mark.unsupported + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_dynamic_unsupported_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5710") + def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "unsupported and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=100, + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordinvalidvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + eth_vlan_ip_1 = eth_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="vlan ip....", body=str(eth_vlan_ip)) + print("Station ip not assigned as per vlan") + assert False + else: + assert True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="vlan ip....", body=str(eth_vlan_ip)) + allure.attach(name="vlan ip....", body=str(eth_ip)) + print("Station ip assigned as per vlan") + ''' + + @pytest.mark.outofboundvlanid + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_outof_bound_vlanid", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5711") + def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "outofboundvlanid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan, + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + if lf_test.station_ip[station_names_fiveg[0]] == "0.0.0.0": + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + assert True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + allure.attach(name="out of bound vlan id..", body=str(7000)) + print("Test Passsed...Client Connection failed") + + @pytest.mark.client_association_ap_with_dynamic_vlan + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_client_association_ap_with_dynamic_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5712") + def test_client_association_ap_with_dynamic_vlan(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_fiveg): + """ + pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100, 200] + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan[0], + station_name=station_names_fiveg, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True) + + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + + eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_fiveg[0]].split('.') + eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_fiveg[0]]) + print("radius vlan ip...", eth_radius_vlan_ip) + print("eth_upstream_ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_radius_vlan_ip_1[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + + for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_fiveg[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip)) + allure.attach(name="Upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per radius vlan") + elif not val: + print("Station ip not assigned as per radius vlan") + assert False + + @pytest.mark.subsequent_user_for_same_user_account + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_subsequent_user_for_same_user_account", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5713") + def test_subsequent_user_for_same_user_account(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_fiveg): + """ + pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + station_list = [] + sta_ip = [] + for i in range(0, 2): + station_list.append(lf_tools.fiveg_prefix + str(i)) + print(station_list) + print([station_list[0]]) + + for m in range(0, len(station_list)): + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=100, + station_name=[station_list[m]], key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordA", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False) + lf_tools.admin_up_down([station_list[m]], option="up") + sta_ip.append(lf_test.station_ip[station_list[m]]) + if sta_ip[m] == "0.0.0.0": + allure.attach("station didnt recieved ip..") + assert False + print(sta_ip) + time.sleep(30) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + eth_vlan_ip_1 = eth_vlan_ip.split('.') + for n in range(0, len(station_list)): + sta_ip_1 = sta_ip[n].split('.') + print("station ip...", sta_ip[n]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(sta_ip[n])) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per radius vlan") + elif not val: + print("Station ip not assigned as per radius vlan") + assert False + + @pytest.mark.subsequent_user_for_different_user_account + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + @allure.testcase(name="test_subsequent_user_for_different_user_account_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5714") + def test_subsequent_user_for_different_user_account(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_fiveg): + """ + pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_5G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100, 200] + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + station_list = [] + sta_ip = [] + dynamic_vlan_user = ["userA", "userB"] + dynamic_vlan_pass = ["passwordA", "passwordB"] + for i in range(0, 2): + station_list.append(lf_tools.fiveg_prefix + str(i)) + + for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))): + lf_test.EAP_Connect(ssid=ssid_5G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="fiveg", vlan_id=vlan[sta], + station_name=[station_list[sta]], key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd=user_pass, ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity=user_id, d_vlan=True, cleanup=False) + + sta_ip.append(lf_test.station_ip[station_list[sta]]) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"] + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + eth_vlan_ip_1 = eth_vlan_ip.split('.') + print(sta_ip) + sta_ip_1 = sta_ip[sta].split('.') + if sta_ip_1 == "0.0.0.0": + allure.attach("station didn't received ip..") + assert False + print("station ip...", lf_test.station_ip[station_list[sta]]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(sta_ip[sta])) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[sta]))) + allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print(f"{station_list[sta]} ip assigned as per radius vlan") + elif not val: + print(f"{station_list[sta]} ip not assigned as per radius vlan") + assert False + lf_tools.admin_up_down([station_list[sta]], option="up") + time.sleep(5) + diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/__init__.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_over_ssid_twog.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_over_ssid_twog.py new file mode 100644 index 000000000..59f98c100 --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_over_ssid_twog.py @@ -0,0 +1,110 @@ +""" + + Dynamic_Vlan: VLAN Mode + pytest -m "dynamic_vlan and wpa2_enterprise and vlan" + +""" + +import os +import allure +import pytest +from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA +from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA + +pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan,pytest.mark.twog] + +setup_params_general = { + "mode": "VLAN", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2e_2g", "appliedRadios": ["2G"], + "security_key": "something", + "radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA, + "radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA, + "vlan": 100 + }]}, + "rf": {}, + "radius": True +} + + +@allure.suite("regression") +@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestDynamicVlan(object): + + @pytest.mark.dynamic_precedence_over_ssid + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_dynamic_precedence_over_ssid_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5705") + def test_dynamic_precedence_over_ssid_vlan(self, get_vif_state, lf_tools,get_ap_logs,get_lf_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "dynamic_precedence_over_ssid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100,200] + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan[0], + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True) + + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + + eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + eth_vlan_ip_1 = eth_radius_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("vlan ip...", eth_radius_vlan_ip) + print("eth_upstream_ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip_1[0] == "0": + print("radius configured vlan didnt recieved ip") + assert False + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip)) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per dynamic vlan") + elif not val: + print("Station ip not assigned as per dynamic vlan") + assert False \ No newline at end of file diff --git a/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_vlan_twog.py b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_vlan_twog.py new file mode 100644 index 000000000..e98775311 --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/vlan_mode/dynamic_vlan/wpa2_enterprise/twog/test_dynamic_vlan_twog.py @@ -0,0 +1,648 @@ +""" + + Dynamic_Vlan: VLAN Mode + pytest -m "dynamic_vlan and wpa2_enterprise and vlan" + +""" + +import os +import allure +import pytest +import time +from configuration import DYNAMIC_VLAN_RADIUS_SERVER_DATA +from configuration import DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA + +pytestmark = [pytest.mark.regression, pytest.mark.dynamic_vlan, pytest.mark.wpa2_enterprise, pytest.mark.vlan, + pytest.mark.twog] + +setup_params_general = { + "mode": "VLAN", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2e_2g", "appliedRadios": ["2G"], + "security_key": "something", + "radius_auth_data": DYNAMIC_VLAN_RADIUS_SERVER_DATA, + "radius_acc_data": DYNAMIC_VLAN_RADIUS_ACCOUNTING_DATA, + "vlan": 100 + }]}, + "rf": {}, + "radius": True +} + + +@allure.suite("regression") +@allure.feature("VLAN MODE wpa2_enterprise Dynamic Vlan") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestDynamicVlan(object): + + @pytest.mark.absence_of_radius_vlan_identifier + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_ssid_vlan_in_the_absence_of_radius_vlan_identifier", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5704") + def test_ssid_vlan_in_the_absence_of_radius_vlan_identifier(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_twog): + """ + pytest -m " absence_of_radius_vlan_identifier and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan_id = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan_id]) + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordvlannotsentuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"] + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + print(sta_ip_1) + eth_vlan_ip_1 = eth_vlan_ip.split('.') + # eth_ip_1 = eth_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("upstream ip...", eth_ip) + print("ssid configured vlan ip", eth_vlan_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + elif i == j: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid vlan") + elif not val: + print("Station ip not assigned as per ssid vlan") + assert False + + @pytest.mark.invalidradiusvlan + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_dynamic_invalid_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5706") + def test_dynamic_invalid_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "invalidradiusvlan and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan_id = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan_id]) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan_id, + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordinvalidvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan_id))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + eth_vlan_ip_1 = eth_vlan_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("ssid vlan ip...", eth_vlan_ip) + print("upstream ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan_id))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid vlan") + elif not val: + print("Station ip not assigned as per ssid vlan") + assert False + + @pytest.mark.periodic_reauthentication + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_radius_vlan_info_retained_after_periodic_reauthentication", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5707") + def test_radius_vlan_info_retained_after_periodic_reauthentication(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_twog): + """ + pytest -m "periodic_reauthentication and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100, 200] + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan[1], + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True, cleanup=False) + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + sta_ip = lf_test.station_ip[station_names_twog[0]] + + count = 0 + # print("station ip...", lf_test.station_ip[station_names_twog[0]]) + # print("vlan ip...", eth_vlan_ip) + # print("eth_vlan_ip..", eth_ip) + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + eth_rad_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_vlan_ip_1 = eth_rad_vlan_ip.split('.') + sta_ip_1 = sta_ip.split('.') + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip_1[0] == "0": + print("radius configured vlan didnt recieved ip") + assert False + print(sta_ip_1) + for k in range(0, 2): + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + break + else: + if count == 2: + break # allure.attach(name="station ip",body=str(sta_ip)) + continue + count = count + 1 + time.sleep(30) + lf_tools.admin_up_down([station_names_twog[0]], option="up") + + sta_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + station_names_twog[0])["interface"]["ip"] + sta_ip_1 = sta_ip.split('.') + print(sta_ip) + allure.attach(name="station ip....", body=str(sta_ip)) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_rad_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if count == 2: + assert True + print("Station ip assigned as per dynamic vlan") + elif count == 0: + print("Station ip not assigned as per dynamic vlan") + assert False + + @pytest.mark.absenceofvlanid + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_ssid_vlan_used_in_absence_of_radius_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5708") + def test_ssid_vlan_used_in_absence_of_radius_vlan(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "absenceofvlanid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan, + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordvlannotsentuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="vlannotsentuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + eth_vlan_ip_1 = eth_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("ssid configured vlan ip...", eth_vlan_ip) + print("upstream ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_vlan_ip[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per ssid configured vlan") + elif not val: + print("Station ip not assigned as per ssid configured vlan") + assert False + + ''' + @pytest.mark.unsupported + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_dynamic_unsupported_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5710") + def test_dynamic_unsupported_vlan(self, get_vif_state, lf_tools, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "unsupported and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=100, + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordinvalidvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="invalidvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + eth_vlan_ip_1 = eth_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="vlan ip....", body=str(eth_vlan_ip)) + print("Station ip not assigned as per vlan") + assert False + else: + assert True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="vlan ip....", body=str(eth_vlan_ip)) + allure.attach(name="vlan ip....", body=str(eth_ip)) + print("Station ip assigned as per vlan") + ''' + + @pytest.mark.outofboundvlanid + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_outof_bound_vlanid", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5711") + def test_out_of_bound_vlanid(self, get_vif_state, lf_tools, get_lf_logs, get_ap_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "outofboundvlanid and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan, + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordoutofboundvlanuser", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="outofboundvlanuser", d_vlan=True) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + if lf_test.station_ip[station_names_twog[0]] == "0.0.0.0": + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + assert True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="ssid configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + allure.attach(name="out of bound vlan id..", body=str(7000)) + print("Test Passsed...Client Connection failed") + + @pytest.mark.client_association_ap_with_dynamic_vlan + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_client_association_ap_with_dynamic_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5712") + def test_client_association_ap_with_dynamic_vlan(self, get_vif_state, lf_tools, get_ap_logs, get_lf_logs, + create_lanforge_chamberview_dut, lf_test, get_configuration, + station_names_twog): + """ + pytest -m "client_association_ap_with_dynamic_vlan and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = [100, 200] + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan[0], + station_name=station_names_twog, key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordB", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userB", d_vlan=True) + + eth_ssid_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[0]))["interface"]["ip"] + + eth_radius_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[1]))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + + sta_ip_1 = lf_test.station_ip[station_names_twog[0]].split('.') + eth_radius_vlan_ip_1 = eth_radius_vlan_ip.split('.') + print("station ip...", lf_test.station_ip[station_names_twog[0]]) + print("radius vlan ip...", eth_radius_vlan_ip) + print("eth_upstream_ip..", eth_ip) + if sta_ip_1[0] == "0": + print("station didnt received any ip") + allure.attach("station didnt recieved ip..") + assert False + elif eth_radius_vlan_ip_1[0] == "0": + print("ssid configured vlan didnt recieved ip") + assert False + + for i, j in zip(sta_ip_1[0:2], eth_radius_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(lf_test.station_ip[station_names_twog[0]])) + allure.attach(name="ssid configured vlan..", body=str(port_resources[2] + "." + str(vlan[0]))) + allure.attach(name="ssid configured vlan ip....", body=str(eth_ssid_vlan_ip)) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan[1]))) + allure.attach(name="radius configured vlan ip....", body=str(eth_radius_vlan_ip)) + allure.attach(name="Upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per radius vlan") + elif not val: + print("Station ip not assigned as per radius vlan") + assert False + + @pytest.mark.subsequent_user_for_same_user_account + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_subsequent_user_for_same_user_account", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5713") + def test_subsequent_user_for_same_user_account(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_twog): + """ + pytest -m "subsequent_user_for_same_user_account and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + vlan = 100 + val = "" + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=[vlan]) + + station_list = [] + sta_ip = [] + for i in range(0, 2): + station_list.append(lf_tools.twog_prefix + str(i)) + print(station_list) + print([station_list[0]]) + + for m in range(0, len(station_list)): + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=100, + station_name=[station_list[m]], key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd="passwordA", ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity="userA", d_vlan=True, cleanup=False) + lf_tools.admin_up_down([station_list[m]], option="up") + sta_ip.append(lf_test.station_ip[station_list[m]]) + if sta_ip[m] == "0.0.0.0": + allure.attach("station didnt recieved ip..") + assert False + print(sta_ip) + time.sleep(30) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan))["interface"]["ip"] + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + eth_vlan_ip_1 = eth_vlan_ip.split('.') + for n in range(0, len(station_list)): + sta_ip_1 = sta_ip[n].split('.') + print("station ip...", sta_ip[n]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(sta_ip[n])) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print("Station ip assigned as per radius vlan") + elif not val: + print("Station ip not assigned as per radius vlan") + assert False + + @pytest.mark.subsequent_user_for_different_user_account + @pytest.mark.wpa2_enterprise + @pytest.mark.twog + @allure.testcase(name="test_subsequent_user_for_different_user_account_vlan", + url="https://telecominfraproject.atlassian.net/browse/WIFI-5714") + def test_subsequent_user_for_different_user_account(self, get_vif_state, lf_tools, get_lf_logs, + get_ap_logs, + create_lanforge_chamberview_dut, lf_test, + get_configuration, + station_names_twog): + """ + pytest -m "subsequent_user_for_different_user_account and wpa2_enterprise and vlan" + """ + + profile_data = setup_params_general["ssid_modes"]["wpa2_enterprise"] + ssid_2G = profile_data[0]["ssid_name"] + mode = "VLAN" + val = "" + vlan = [100, 200] + upstream_port = lf_tools.upstream_port + print(upstream_port) + port_resources = upstream_port.split(".") + print(lf_tools.dut_idx_mapping) + lf_tools.reset_scenario() + lf_tools.add_vlan(vlan_ids=vlan) + + station_list = [] + sta_ip = [] + dynamic_vlan_user = ["userA", "userB"] + dynamic_vlan_pass = ["passwordA", "passwordB"] + for i in range(0, 2): + station_list.append(lf_tools.twog_prefix + str(i)) + + for user_id, user_pass, sta in zip(dynamic_vlan_user, dynamic_vlan_pass, range(0, len(station_list))): + lf_test.EAP_Connect(ssid=ssid_2G, passkey="[BLANK]", security="wpa2", extra_securities=[], + mode=mode, band="twog", vlan_id=vlan[sta], + station_name=[station_list[sta]], key_mgmt="WPA-EAP", + pairwise="NA", group="NA", wpa_psk="DEFAULT", + ttls_passwd=user_pass, ieee80211w=0, + wep_key="NA", ca_cert="NA", eap="TTLS", identity=user_id, d_vlan=True, cleanup=False) + + sta_ip.append(lf_test.station_ip[station_list[sta]]) + + eth_vlan_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2] + "." + str(vlan[sta]))["interface"]["ip"] + + eth_ip = lf_tools.json_get("/port/" + port_resources[0] + "/" + port_resources[1] + + "/" + port_resources[2])["interface"]["ip"] + eth_vlan_ip_1 = eth_vlan_ip.split('.') + print(sta_ip) + sta_ip_1 = sta_ip[sta].split('.') + if sta_ip_1 == "0.0.0.0": + allure.attach("station didn't received ip..") + assert False + print("station ip...", lf_test.station_ip[station_list[sta]]) + print("vlan ip...", eth_vlan_ip) + print("eth_vlan_ip..", eth_ip) + for i, j in zip(sta_ip_1[0:2], eth_vlan_ip_1[0:2]): + if i != j: + val = False + else: + val = True + allure.attach(name="station ip....", body=str(sta_ip[sta])) + allure.attach(name="radius configured vlan..", body=str(port_resources[2] + "." + str(vlan))) + allure.attach(name="radius configured vlan ip..", body=str(eth_vlan_ip)) + allure.attach(name="upstream port....", body=str(port_resources[2])) + allure.attach(name="upstream ip....", body=str(eth_ip)) + if val: + assert True + print(f"{station_list[sta]} ip assigned as per radius vlan") + elif not val: + print(f"{station_list[sta]} ip not assigned as per radius vlan") + assert False + lf_tools.admin_up_down([station_list[sta]], option="up") + time.sleep(5) + diff --git a/tests/e2e/interOp/captive_portal/nat_mode/android/test_captive_portal_modes.py b/tests/e2e/interOp/captive_portal/nat_mode/android/test_captive_portal_modes.py index b2dfc26dd..c5cfccebb 100644 --- a/tests/e2e/interOp/captive_portal/nat_mode/android/test_captive_portal_modes.py +++ b/tests/e2e/interOp/captive_portal/nat_mode/android/test_captive_portal_modes.py @@ -275,3 +275,76 @@ class TestNATModeCaptivePortalSuiteOneNAT(object): allure.attach(name="Connection Status: ", body=str("No Internet access")) assert False + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5129", name="WIFI-5129") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_Captive_Portal_WPA3_2g_Personal_NAT(self, request, get_vif_state, get_ap_logs, + get_APToMobileDevice_data, + setup_perfectoMobile_android): + + 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_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-5137", name="WIFI-5137") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_Captive_Portal_WPA3_5g_Personal_NAT(self, request, get_vif_state, get_ap_logs, + get_APToMobileDevice_data, + setup_perfectoMobile_android): + + 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_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 \ No newline at end of file diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py new file mode 100644 index 000000000..842d22516 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py @@ -0,0 +1,342 @@ +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 random +import string +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_add_eap_ios, get_ip_add_check_ios, wifi_connect_eap, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_reconnect + , pytest.mark.bridge, pytest.mark.enterprise, pytest.mark.ToggleAirplaneMode] + +setup_params_enterprise = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, + {"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"]}], + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]}, + + "rf": {}, + "radius": True +} +for sec_modes in setup_params_enterprise['ssid_modes'].keys(): + for i in range(len(setup_params_enterprise['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop Regression") +@allure.sub_suite(sub_suite_name="Bridge Mode EAP Client ReConnect : Suite-A") +@pytest.mark.suiteA +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeBridgeModeEnterpriseTTLSSuiteA(object): + """ SuiteA Enterprise Test Cases + pytest -m "client_reconnect and bridge and enterprise and ttls and interop and suiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6545", name="WIFI-6545") + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6546", name="WIFI-6546") + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ToggleAirplaneMode_2g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6547", name="WIFI-6547") + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA3_Eap_Bridge(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6548", name="WIFI-6548") + @pytest.mark.twog + @pytest.mark.wpa3_enterprise + def test_ToggleAirplaneMode_2g_WPA3_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"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6543", name="WIFI-6543") + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6544", name="WIFI-6544") + @pytest.mark.twog + @pytest.mark.wpa_enterprise + def test_ToggleAirplaneMode_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False diff --git a/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_general_securtiy_modes.py b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_general_securtiy_modes.py new file mode 100644 index 000000000..afd80b955 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/bridge_mode/toggle_airplane_mode_test/iOS/test_general_securtiy_modes.py @@ -0,0 +1,624 @@ +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 random +import string +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_add_ios, get_ip_add_check_ios, wifi_connect, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, + pytest.mark.client_reconnect, pytest.mark.bridge, pytest.mark.ToggleAirplaneMode] + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"]}], + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "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 +} +for sec_modes in setup_params_general['ssid_modes'].keys(): + for i in range(len(setup_params_general['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="Bridge Mode Client Reconnect : Suite-A") +@pytest.mark.InteropsuiteA +@allure.feature("BRIDGE MODE CLIENT RECONNECT") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteOneBridge(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and bridge and InteropsuiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6531", name="WIFI-6531") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_5g_WPA2_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6532", name="WIFI-6532") + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_2g_WPA2_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6533", name="WIFI-6533") + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ToggleAirplaneMode_5g_WPA_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6534", name="WIFI-6534") + @pytest.mark.twog + @pytest.mark.wpa + def test_ToggleAirplaneMode_2g_WPA_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6537", name="WIFI-6537") + @pytest.mark.fiveg + @pytest.mark.open + def test_ToggleAirplaneMode_5g_Open_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6538", name="WIFI-6538") + @pytest.mark.twog + @pytest.mark.open + def test_ToggleAirplaneMode_2g_Open_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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + + + + +setup_params_general_two = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} +for sec_modes in setup_params_general_two['ssid_modes'].keys(): + for i in range(len(setup_params_general_two['ssid_modes'][sec_modes])): + N = 2 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'].replace("ssid_","") + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="Bridge Mode Client Reconnect : Suite-B") +@pytest.mark.InteropsuiteB +@allure.feature("BRIDGE MODE CLIENT Reconnect") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteBridgeTwo(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and bridge and InteropsuiteB" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6535", name="WIFI-6535") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_5g_wpa3_personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6536", name="WIFI-6536") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_2g_wpa3_personal_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6539", name="WIFI-6539") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_5g_wpa3_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6540", name="WIFI-6540") + @pytest.mark.twog + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_2g_wpa3_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6541", name="WIFI-6541") + @pytest.mark.fiveg + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_5g_wpa_wpa2_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6542", name="WIFI-6542") + @pytest.mark.twog + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_2g_wpa_wpa2_personal_mixed_BRIDGE(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + # 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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + diff --git a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py new file mode 100644 index 000000000..24d304b66 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py @@ -0,0 +1,342 @@ +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 random +import string +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_add_eap_ios, get_ip_add_check_ios, wifi_connect_eap, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_reconnect + ,pytest.mark.ToggleAirplaneMode, pytest.mark.nat, pytest.mark.enterprise] + +setup_params_enterprise = { + "mode": "NAT", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"]}, + {"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"]}], + "wpa_enterprise": [ + {"ssid_name": "ssid_wpa_eap_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_wpa_eap_5g", "appliedRadios": ["5G"]}]}, + + "rf": {}, + "radius": True +} +for sec_modes in setup_params_enterprise['ssid_modes'].keys(): + for i in range(len(setup_params_enterprise['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="Nat Mode EAP Client ReConnect : Suite-A") +@pytest.mark.suiteA +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeNatModeEnterpriseTTLSSuiteA(object): + """ SuiteA Enterprise Test Cases + pytest -m "client_reconnect and nat and enterprise and ttls and interop and suiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6561", name="WIFI-6561") + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6562", name="WIFI-6562") + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ToggleAirplaneMode_2g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6563", name="WIFI-6563") + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA3_Eap_Nat(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6564", name="WIFI-6564") + @pytest.mark.twog + @pytest.mark.wpa3_enterprise + def test_ToggleAirplaneMode_2g_WPA3_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"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6559", name="WIFI-6559") + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_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 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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6560", name="WIFI-6560") + @pytest.mark.twog + @pytest.mark.wpa_enterprise + def test_ToggleAirplaneMode_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False diff --git a/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py new file mode 100644 index 000000000..c1b9f6188 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/nat_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py @@ -0,0 +1,626 @@ +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 random +import string +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_add_ios, get_ip_add_check_ios, wifi_connect, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, + pytest.mark.client_reconnect, pytest.mark.ToggleAirplaneMode, pytest.mark.nat] + +setup_params_general = { + "mode": "NAT", + "ssid_modes": { + "open": [{"ssid_name": "ssid_open_2g", "appliedRadios": ["2G"]}, + {"ssid_name": "ssid_open_5g", "appliedRadios": ["5G"]}], + "wpa": [{"ssid_name": "ssid_wpa_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "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 +} +for sec_modes in setup_params_general['ssid_modes'].keys(): + for i in range(len(setup_params_general['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + + setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="Nat Mode Client Reconnect : Suite-A") +@pytest.mark.InteropsuiteA +@allure.feature("NAT MODE CLIENT RECONNECT") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteOneNat(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and nat and InteropsuiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6549", name="WIFI-6549") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_5g_WPA2_Personal_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6550", name="WIFI-6550") + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_2g_WPA2_Personal_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6553", name="WIFI-6553") + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ToggleAirplaneMode_5g_WPA_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6554", name="WIFI-6554") + @pytest.mark.twog + @pytest.mark.wpa + def test_ToggleAirplaneMode_2g_WPA_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6569", name="WIFI-6569") + @pytest.mark.fiveg + @pytest.mark.open + def test_ToggleAirplaneMode_5g_Open_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6570", name="WIFI-6570") + @pytest.mark.twog + @pytest.mark.open + def test_ToggleAirplaneMode_2g_Open_NAT(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + + + + +setup_params_general_two = { + "mode": "NAT", + "ssid_modes": { + "wpa3_personal": [ + {"ssid_name": "ssid_wpa3_p_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "wpa3_personal_mixed": [ + {"ssid_name": "ssid_wpa3_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa3_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something"}], + "wpa_wpa2_personal_mixed": [ + {"ssid_name": "ssid_wpa_wpa2_p_m_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa_wpa2_p_m_5g", "appliedRadios": ["5G"], + "security_key": "something"}] + }, + "rf": {}, + "radius": False +} +for sec_modes in setup_params_general_two['ssid_modes'].keys(): + for i in range(len(setup_params_general_two['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="NAT Mode Client Reconnect : Suite-B") +@pytest.mark.InteropsuiteB +@allure.feature("NAT MODE CLIENT Reconnect") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteNatTwo(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and nat and InteropsuiteB" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6551", name="WIFI-6551") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_5g_wpa3_personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6552", name="WIFI-6552") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_2g_wpa3_personal_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6555", name="WIFI-6555") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_5g_wpa3_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6556", name="WIFI-6556") + @pytest.mark.twog + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_2g_wpa3_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6557", name="WIFI-6557") + @pytest.mark.fiveg + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_5g_wpa_wpa2_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6558", name="WIFI-6558") + @pytest.mark.twog + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_2g_wpa_wpa2_personal_mixed_NAT(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + # 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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/__init__.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/__init__.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py new file mode 100644 index 000000000..18383e55f --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_enterprise_ttls.py @@ -0,0 +1,342 @@ +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 random +import string +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_add_eap_ios, get_ip_add_check_ios, wifi_connect_eap, wifi_disconnect_and_forget + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, pytest.mark.client_reconnect + ,pytest.mark.ToggleAirplaneMode, pytest.mark.vlan, pytest.mark.enterprise] + +setup_params_enterprise = { + "mode": "VLAN", + "ssid_modes": { + "wpa2_enterprise": [ + {"ssid_name": "ssid_wpa2_eap_2g", "appliedRadios": ["2G"], "vlan": 100}, + {"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}], + "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 +} +for sec_modes in setup_params_enterprise['ssid_modes'].keys(): + for i in range(len(setup_params_enterprise['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_enterprise['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="VLAN Mode EAP Client ReConnect : Suite-A") +@pytest.mark.suiteA +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_enterprise], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeVlanModeEnterpriseTTLSSuiteA(object): + """ SuiteA Enterprise Test Cases + pytest -m "client_reconnect and vlan and enterprise and ttls and interop and suiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6585", name="WIFI-6585") + @pytest.mark.wpa2_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6586", name="WIFI-6586") + @pytest.mark.twog + @pytest.mark.wpa2_enterprise + def test_ToggleAirplaneMode_2g_WPA2_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"]["wpa2_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6587", name="WIFI-6587") + @pytest.mark.wpa3_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_5g_WPA3_Eap_VLAN(self, request, get_vif_state, get_ToggleAirplaneMode_data + , setup_perfectoMobile_iOS, radius_info, get_ap_logs): + """ wpa2 enterprise 5g + pytest -m "client_connect and bridge and enterprise and ttls and wpa_enterprise and fiveg" + """ + profile_data = setup_params_enterprise["ssid_modes"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6588", name="WIFI-6588") + @pytest.mark.twog + @pytest.mark.wpa3_enterprise + def test_ToggleAirplaneMode_2g_WPA3_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"]["wpa3_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6583", name="WIFI-6583") + @pytest.mark.wpa_enterprise + @pytest.mark.fiveg + def test_ToggleAirplaneMode_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 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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6584", name="WIFI-6584") + @pytest.mark.twog + @pytest.mark.wpa_enterprise + def test_ToggleAirplaneMode_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_add_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(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False diff --git a/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py new file mode 100644 index 000000000..9bc6990b8 --- /dev/null +++ b/tests/e2e/interOp/validation_of_operating_modes/vlan_mode/toggle_airplane_mode_test/iOS/test_general_security_modes.py @@ -0,0 +1,623 @@ +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 random +import string +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,\ + get_ip_add_ios, get_ip_add_check_ios + +pytestmark = [pytest.mark.regression, pytest.mark.interop, pytest.mark.ios, pytest.mark.interop_ios, + pytest.mark.client_reconnect, pytest.mark.ToggleAirplaneMode, pytest.mark.vlan] + +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}], + "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}]}, + "rf": {}, + "radius": False +} +for sec_modes in setup_params_general['ssid_modes'].keys(): + for i in range(len(setup_params_general['ssid_modes'][sec_modes])): + N = 3 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general['ssid_modes'][sec_modes][i]['ssid_name'] + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="Vlan Mode Client Reconnect : Suite-A") +@pytest.mark.InteropsuiteA +@allure.feature("VLAN MODE CLIENT RECONNECT") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteOneVLAN(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and vlan and InteropsuiteA" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6571", name="WIFI-6571") + @pytest.mark.fiveg + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_5g_WPA2_Personal_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6572", name="WIFI-6572") + @pytest.mark.twog + @pytest.mark.wpa2_personal + def test_ToggleAirplaneMode_2g_WPA2_Personal_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6575", name="WIFI-6575") + @pytest.mark.fiveg + @pytest.mark.wpa + def test_ToggleAirplaneMode_5g_WPA_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6576", name="WIFI-6576") + @pytest.mark.twog + @pytest.mark.wpa + def test_ToggleAirplaneMode_2g_WPA_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6577", name="WIFI-6577") + @pytest.mark.fiveg + @pytest.mark.open + def test_ToggleAirplaneMode_5g_Open_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6578", name="WIFI-6578") + @pytest.mark.twog + @pytest.mark.open + def test_ToggleAirplaneMode_2g_Open_VLAN(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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + + + + +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"], + "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"], + "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"], + "security_key": "something", "vlan": 100}] + }, + "rf": {}, + "radius": False +} +for sec_modes in setup_params_general_two['ssid_modes'].keys(): + for i in range(len(setup_params_general_two['ssid_modes'][sec_modes])): + N = 2 + rand_string = (''.join(random.choices(string.ascii_uppercase + + string.digits, k=N)))+str(int(time.time_ns())%10000) + setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'] = setup_params_general_two['ssid_modes'][sec_modes][i]['ssid_name'].replace("ssid_","") + "_"+ rand_string + +@allure.suite(suite_name="interop regression") +@allure.sub_suite(sub_suite_name="VLAN Mode Client Reconnect : Suite-B") +@pytest.mark.InteropsuiteB +@allure.feature("VLAN MODE CLIENT Reconnect") +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general_two], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class TestToggleAirplaneModeSuiteVLANTwo(object): + """ Client Connectivity SuiteA + pytest -m "client_reconnect and vlan and InteropsuiteB" + """ + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6573", name="WIFI-6573") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_5g_wpa3_personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6574", name="WIFI-6574") + @pytest.mark.twog + @pytest.mark.wpa3_personal + def test_ToggleAirplaneMode_2g_wpa3_personal_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6579", name="WIFI-6579") + @pytest.mark.fiveg + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_5g_wpa3_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6580", name="WIFI-6580") + @pytest.mark.twog + @pytest.mark.wpa3_personal_mixed + def test_ToggleAirplaneMode_2g_wpa3_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa3_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6581", name="WIFI-6581") + @pytest.mark.fiveg + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_5g_wpa_wpa2_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-6582", name="WIFI-6582") + @pytest.mark.twog + @pytest.mark.wpa_wpa2_personal_mixed + def test_ToggleAirplaneMode_2g_wpa_wpa2_personal_mixed_VLAN(self, request, get_vif_state, get_ap_logs, get_APToMobileDevice_data, setup_perfectoMobile_iOS): + + profile_data = setup_params_general_two["ssid_modes"]["wpa_wpa2_personal_mixed"][0] + ssidName = profile_data["ssid_name"] + ssidPassword = profile_data["security_key"] + # 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 = get_ip_add_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)) + + # wifi_connect(request, ssidName, ssidPassword, setup_perfectoMobile_android, connData) + Toggle_AirplaneMode_iOS(request, setup_perfectoMobile_iOS, connData) + ip_check, is_internet_check = get_ip_add_check_ios(request, ssidName, ssidPassword, + setup_perfectoMobile_iOS, connData) + if (ip_check == ip): + assert True + else: + assert False + else: + allure.attach(name="Connection Status: ", body=str("No Internet access")) + assert False \ No newline at end of file diff --git a/tests/fixtures_2x.py b/tests/fixtures_2x.py index 5d0d17023..ecb2aaebe 100644 --- a/tests/fixtures_2x.py +++ b/tests/fixtures_2x.py @@ -507,7 +507,7 @@ class Fixtures_2x: else: print("no") var = False - + for j in profile_data["ssid"][mode]: if mode in get_markers.keys() and get_markers[mode]: try: if j["appliedRadios"].__contains__("2G"): @@ -516,6 +516,7 @@ class Fixtures_2x: lf_dut_data.append(j) j["appliedRadios"] = list(set(j["appliedRadios"])) j['security'] = 'wpa2' + if var : RADIUS_SERVER_DATA = j["radius_auth_data"] RADIUS_ACCOUNTING_DATA = j['radius_acc_data'] diff --git a/tests/test_connectivity.py b/tests/test_connectivity.py index 6a8766150..309e7519f 100644 --- a/tests/test_connectivity.py +++ b/tests/test_connectivity.py @@ -9,7 +9,7 @@ import requests import json pytestmark = [pytest.mark.test_resources, pytest.mark.sanity, pytest.mark.uc_sanity, - pytest.mark.sanity_55] + pytest.mark.sanity_55, pytest.mark.interop_uc_sanity, pytest.mark.android, pytest.mark.ios, pytest.mark.client_connect] @allure.testcase(name="Test Resources", url="") @@ -18,6 +18,7 @@ class TestResources(object): @pytest.mark.test_cloud_controller @pytest.mark.uc_sanity + @pytest.mark.interop_uc_sanity @allure.testcase(name="test_controller_connectivity", url="") def test_controller_connectivity(self, setup_controller, get_configuration): """Test case to verify cloud Controller Connectivity"""