diff --git a/.allure-overview/overviews.json b/.allure-overview/overviews.json index fcf816b50..94c0ec104 100644 --- a/.allure-overview/overviews.json +++ b/.allure-overview/overviews.json @@ -1,7 +1,7 @@ { "sanity": { "OVERVIEW_TITLE": "'OpenWifi sanity results'", - "OVERVIEW_TESTBEDS": ["Wallys_DR6018","hfcl_ion4","hfcl_ion4xe","edgecore_ecw5211","edgecore_eap101","edgecore_eap102","cig_wf194c4","cig_wf188n","indio_um-305ac","hfcl_ion4xi","udaya_a5-id2","cig_wf196"] + "OVERVIEW_TESTBEDS": ["Wallys_DR6018","hfcl_ion4","hfcl_ion4xe","edgecore_ecw5211","edgecore_eap101","edgecore_eap102","liteon_wpx8324","cig_wf188n","indio_um-305ac","hfcl_ion4xi","udaya_a5-id2","cig_wf196"] }, "interop": { "OVERVIEW_TITLE": "'OpenWifi interop results'", @@ -15,6 +15,6 @@ "performance": { "OVERVIEW_TITLE": "'OpenWifi performance results'", - "OVERVIEW_TESTBEDS": ["wallys_dr40x9","hfcl_ion4","hfcl_ion4xe","edgecore_ecw5211","edgecore_eap101","edgecore_eap102","cig_wf194c4","cig_wf188n","indio_um-305ac","udaya_a5-id2"] + "OVERVIEW_TESTBEDS": ["wallys_dr40x9","hfcl_ion4","hfcl_ion4xe","edgecore_ecw5211","edgecore_eap101","edgecore_eap102","liteon_wpx8324","cig_wf188n","indio_um-305ac","udaya_a5-id2"] } } diff --git a/.github/workflows/interop.yml b/.github/workflows/interop.yml index 21245e07e..9b215f353 100644 --- a/.github/workflows/interop.yml +++ b/.github/workflows/interop.yml @@ -53,7 +53,7 @@ jobs: DEVICES=$(echo $DEVICES | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') echo "::set-output name=devices::${DEVICES}" 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,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4' }}") + echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'edgecore_ecw5410,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4' }}") echo ::set-output name=firmware::$(echo "${{ github.event.inputs.firmware || 'next-latest' }}") echo ::set-output name=marker_expression::$(echo "${{ github.event.inputs.marker_expression || 'uc_sanity' }}") echo ::set-output name=existing_controller::$(echo "${{ github.event.inputs.existing_controller || 'qa01' }}") diff --git a/.github/workflows/interop_modified.yml b/.github/workflows/interop_modified.yml new file mode 100644 index 000000000..5bfc14ec6 --- /dev/null +++ b/.github/workflows/interop_modified.yml @@ -0,0 +1,688 @@ +name: interop testing v2 + +env: + # AWS credentials + AWS_EKS_NAME: tip-wlan-main + AWS_DEFAULT_OUTPUT: json + AWS_DEFAULT_REGION: us-east-2 + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }} + +on: + workflow_dispatch: + inputs: + devices: + description: comma-separated list of devices to test + default: galaxy-s9,galaxy-s10,galaxy-s20,pixel-4,iphone-7,iphone-11,iphone-xr,iphone-12 + required: false + marker_overwrite: + description: overwrite the Pytest markers that will be selected, will disable report uploading + required: false + schedule: + - cron: "30 20 * * *" + +defaults: + run: + shell: bash + +jobs: + vars: + runs-on: ubuntu-latest + outputs: + devices: ${{ steps.vars.outputs.devices }} + marker_overwrite: ${{ steps.vars.outputs.marker_overwrite }} + openwifi_revision: ${{ steps.vars.outputs.openwifi}} + ap_models: ${{ steps.vars.outputs.ap_models}} + ap_version: ${{ steps.vars.outputs.ap_version}} + marker_expression: ${{ steps.vars.outputs.marker_expression }} + existing_controller: ${{ steps.vars.outputs.existing_controller }} + + steps: + - name: set variables + id: vars + run: | + echo "::set-output name=marker_overwrite::${{ github.event.inputs.marker_overwrite || '' }}" + DEVICES="${{ github.event.inputs.devices || 'galaxy-s9,galaxy-s10,galaxy-s20,pixel-4,iphone-7,iphone-11,iphone-xr,iphone-12' }}" + DEVICES=$(echo $DEVICES | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') + echo "::set-output name=devices::${DEVICES}" + 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=existing_controller::$(echo "${{ github.event.inputs.existing_controller || 'qa01' }}") + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: build and push Docker image + uses: ./.github/actions/build-and-push-docker + with: + registry: tip-tip-wlan-cloud-docker-repo.jfrog.io + registry_user: ${{ secrets.DOCKER_USER_NAME }} + registry_password: ${{ secrets.DOCKER_USER_PASSWORD }} + + # interop-01 + quali_reservation: + runs-on: ubuntu-latest + needs: [vars, build] + if: "!cancelled()" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + - name: start reservation + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + python .quali/start_reservation.py --global-inputs '{"Phone ID(s)":"1,2,3,4,5,6,7,8","AP ID(s)":"1,2,3,4","Optional Existing SDK Namespace":"${{ needs.vars.outputs.existing_controller }}","Include a LANForge?":"Yes","securityToken":"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI3NzkzZGM0Ni1jZmU4LTQ4ODMtYjhiOS02ZWFlZGU2OTc2MDkifQ.eyJpYXQiOjE2MzI4Mzc2NDEsImp0aSI6IjAwZGRiYWY5LWQwYjMtNDRjNS1hYjVlLTkyNzFlNzc5ZGUzNiIsImlzcyI6Imh0dHBzOi8vYXV0aDIucGVyZmVjdG9tb2JpbGUuY29tL2F1dGgvcmVhbG1zL3RpcC1wZXJmZWN0b21vYmlsZS1jb20iLCJhdWQiOiJodHRwczovL2F1dGgyLnBlcmZlY3RvbW9iaWxlLmNvbS9hdXRoL3JlYWxtcy90aXAtcGVyZmVjdG9tb2JpbGUtY29tIiwic3ViIjoiODNkNjUxMWQtNTBmZS00ZWM5LThkNzAtYTA0ZjBkNTdiZDUyIiwidHlwIjoiT2ZmbGluZSIsImF6cCI6Im9mZmxpbmUtdG9rZW4tZ2VuZXJhdG9yIiwibm9uY2UiOiI2ZjE1YzYxNy01YTU5LTQyOWEtODc2Yi1jOTQxMTQ1ZDFkZTIiLCJzZXNzaW9uX3N0YXRlIjoiYmRjZTFmYTMtMjlkYi00MmFmLWI5YWMtYjZjZmJkMDEyOTFhIiwic2NvcGUiOiJvcGVuaWQgcHJvZmlsZSBvZmZsaW5lX2FjY2VzcyBlbWFpbCJ9.5R85_1R38ZFXv_wIjjCIsj8NJm1p66dCsLJI5DBEmks"}' --reservation-duration 1440 "InterOp Lab - Specific Selection" + - name: set reservation outputs + if: always() + id: quali_reservation + run: | + echo ::set-output name=identifier::"$(cat ./reservation_id.txt)" + echo ::set-output name=namespace::"$(cat ./reservation_id.txt | cut -d "-" -f 1)" +# echo "reservation_id=$(cat ./reservation_id.txt)" >> $GITHUB_ENV +# echo "namespace=$(cat ./reservation_id.txt | cut -d "-" -f 1)" >> $GITHUB_ENV +# echo "${{ env.reservation_id}}" +# echo "${{ env.namespace}}" + outputs: + identifier: ${{steps.quali_reservation.outputs.identifier}} + namespace: ${{steps.quali_reservation.outputs.namespace}} + + + + test-galaxy-s9: + + runs-on: ubuntu-latest + needs: [vars, quali_reservation] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'galaxy-s9')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json "${{needs.quali_reservation.outputs.identifier}}")" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."Galaxy S9".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-galaxy-s9 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and android and not wpa3_personal' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='Galaxy S9' --skip-lanforge" + allure_results_artifact_name: allure-results-galaxy-s9 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-galaxy-s9 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-galaxy-s9 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-galaxy-s9 + + + test-iphone-11: + runs-on: ubuntu-latest + needs: [vars, quali_reservation, test-galaxy-s9] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'iphone-11')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{needs.quali_reservation.outputs.identifier}})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."iPhone-11".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-iphone-11 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and ios' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='iPhone-11' --skip-lanforge" + allure_results_artifact_name: allure-results-iphone-11 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-iphone-11 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-iphone-11 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-iphone-11 + + + # interop-02 + test-galaxy-s10: + runs-on: ubuntu-latest + needs: [vars, quali_reservation] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'galaxy-s10')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."Galaxy S10.*".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-galaxy-s10 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and android' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='Galaxy S10.*' --skip-lanforge" + allure_results_artifact_name: allure-results-galaxy-s10 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-galaxy-s10 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-galaxy-s10 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-galaxy-s10 + + test-iphone-7: + runs-on: ubuntu-latest + needs: [vars, quali_reservation, test-galaxy-s10] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'iphone-7')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."iPhone-7".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-iphone-7 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and ios' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='iPhone-7' --skip-lanforge" + allure_results_artifact_name: allure-results-iphone-7 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-iphone-7 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-iphone-7 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-iphone-7 + + # interop-03 + test-galaxy-s20: + runs-on: ubuntu-latest + needs: [vars, quali_reservation] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'galaxy-s20')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."Galaxy S20".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-galaxy-s20 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and android' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='Galaxy S20' --skip-lanforge" + allure_results_artifact_name: allure-results-galaxy-s20 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-galaxy-s20 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-galaxy-s20 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-galaxy-s20 + + test-iphone-xr: + runs-on: ubuntu-latest + needs: [vars, quali_reservation, test-galaxy-s20] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'iphone-xr')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."iPhone-XR".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-iphone-xr + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and ios' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='iPhone-XR' --skip-lanforge" + allure_results_artifact_name: allure-results-iphone-xr + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-iphone-xr --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-iphone-xr $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-iphone-xr + + #interop-04 + test-pixel-4: + runs-on: ubuntu-latest + needs: [vars, quali_reservation] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'pixel-4')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."Pixel 4".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-pixel-4 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and android' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='Pixel 4' --skip-lanforge" + allure_results_artifact_name: allure-results-pixel-4 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-pixel-4 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-pixel-4 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-pixel-4 + + test-iphone-12: + runs-on: ubuntu-latest + needs: [vars, quali_reservation, test-pixel-4] + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.devices), 'iphone-12')" + steps: + - uses: actions/checkout@v2 + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + # curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" + # unzip awscliv2.zip + # sudo ./aws/install + + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: prepare configuration + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + run: | + cat << EOF > lab_info.json + ${{ secrets.LAB_CONFIGURATION_JSON }} + EOF + DYN_CONFIG="$(python .quali/get_configuration.py --json ${{ needs.quali_reservation.outputs.identifier }})" + jq ".CONFIGURATION.interop=$DYN_CONFIG" lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + jq --arg git_run "${{ github.run_number }}" '.PERFECTO_DETAILS."iPhone-12".jobNumber=$git_run' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + if [ ${{ needs.vars.outputs.existing_controller }} != '' ] + then + jq '.CONFIGURATION.interop.controller.url="https://sec-${{ needs.vars.outputs.existing_controller }}.cicd.lab.wlan.tip.build:16001"' lab_info.json > lab_info.json.tmp && mv lab_info.json.tmp lab_info.json + fi + - name: run tests + uses: ./.github/actions/run-tests + with: + namespace: interop-${{ github.run_id }}-iphone-12 + testbed: interop + marker_expression: "${{ needs.vars.outputs.marker_overwrite || 'ow_sanity_interop and ios' }}" + configuration_file: "./lab_info.json" + testing_docker_image: tip-tip-wlan-cloud-docker-repo.jfrog.io/cloud-sdk-nightly:${{ github.run_id }} + additional_args: "--device='iPhone-12' --skip-lanforge" + allure_results_artifact_name: allure-results-iphone-12 + + # necessary because if conditionals in composite actions are currently not respected + - name: get tests logs + if: always() + continue-on-error: true + run: | + podname=$(kubectl get pods -n interop-${{ github.run_id }}-iphone-12 --no-headers -o custom-columns=":metadata.name" -l job-name=testing | sed "s/pod\///") + kubectl logs --timestamps -n interop-${{ github.run_id }}-iphone-12 $podname || true + + - name: delete namespace + if: always() + continue-on-error: true + run: kubectl delete ns --ignore-not-found=true --wait interop-${{ github.run_id }}-iphone-12 + + report: + needs: [vars, test-iphone-11, test-iphone-xr, test-iphone-12, test-iphone-7] + if: "!cancelled()" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + device: ${{ fromJson( needs.vars.outputs.devices ) }} + + steps: + + + - name: checkout testing repo + uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: allure-results-${{ matrix.device }} + path: allure-results + + - name: download history of previous run + continue-on-error: true + run: | + LAST_RUN_ID=$(aws s3api head-object --bucket openwifi-allure-reports --key interop/${{ matrix.device }}/latest/index.html | jq -r .Metadata.latest) + aws s3 cp --recursive s3://openwifi-allure-reports/interop/${{ matrix.device }}/$LAST_RUN_ID/history history + - name: generate Allure report + uses: ./.github/actions/generate-allure-report + with: + results_path: ./allure-results + history_path: ./history + additional_metadata: | + Device=${{ matrix.device }} + - name: upload Allure report as artifact + uses: actions/upload-artifact@v2 + with: + name: allure-report-${{ matrix.device }} + path: allure-report + + # doing this to be able to aggregate multiple reports together later on + - name: copy results into report + run: cp -r allure-results allure-report/results + + - name: upload to S3 + if: github.ref == 'refs/heads/master' && needs.vars.outputs.marker_overwrite == '' + uses: ./.github/actions/allure-report-to-s3 + with: + test_type: interop + testbed: ${{ matrix.device }} + report_path: allure-report + s3_access_key_id: ${{ secrets.ALLURE_S3_ACCESS_KEY_ID }} + s3_access_key_secret: ${{ secrets.ALLURE_S3_ACCESS_KEY_SECRET }} + + cleanup: + needs: [quali_reservation, test-iphone-11, test-iphone-xr, test-iphone-12, test-iphone-7] + runs-on: ubuntu-latest + if: always() + steps: + - uses: actions/checkout@v2 + - name: cleanup Docker image + uses: ./.github/actions/cleanup-docker + with: + registry_user: ${{ secrets.DOCKER_USER_NAME }} + registry_password: ${{ secrets.DOCKER_USER_PASSWORD }} + + + - name: install dependencies + run: | + pip install -r .quali/requirements.txt + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + # TODO WIFI-7839 delete when issue is resolved on AWS CLI side + - name: install kubectl + run: | + curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + - name: stop reservation + if: always() + run: python .quali/stop_reservation.py ${{ needs.quali_reservation.outputs.identifier}} + env: + CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build + CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} + CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} + diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 0190bb74c..e191e685d 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -81,6 +81,14 @@ jobs: run: | echo ::set-output name=time::$(date --iso-8601=s) + - name: tests env info + run: | + export NAMESPACE=manual-${{ github.run_id }}-${{ github.event.inputs.testbed }} + echo "Namespace name - $NAMESPACE" + echo "Link to related job in Kubernetes dashboard - https://k8s-dashboard.lab.wlan.tip.build/#/job/$NAMESPACE/testing?namespace=$NAMESPACE" + echo "In order to get logs, open the link above and press 'View logs' button in top right corner" + echo "If you want to get logs auto-updated, choose this option in dropdown menu hidden behind three dots in top right corner of logs viewer" + - name: run tests uses: ./.github/actions/run-tests with: diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 9fdb61002..bfc72b028 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -22,7 +22,7 @@ on: description: "revision of the Open Wifi Helm chart" ap_models: required: true - default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" + default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" description: "the AP models to test" ap_version: required: true @@ -62,7 +62,7 @@ jobs: MARKER_EXPRESSIONS=$(echo $MARKER_EXPRESSIONS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') echo "::set-output name=marker_expressions::${MARKER_EXPRESSIONS}" - AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196' }}" + AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196' }}" AP_MODELS=$(echo $AP_MODELS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') echo "::set-output name=ap_models::${AP_MODELS}" @@ -1207,16 +1207,16 @@ jobs: if: always() run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }} - test-cig-wf194c4: + test-liteon-wpx8324: needs: ["vars", "build"] runs-on: [ self-hosted, small ] timeout-minutes: 1440 - if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'cig_wf194c4')" + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'liteon_wpx8324')" env: CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} - AP_MODEL: cig_wf194c4 + AP_MODEL: liteon_wpx8324 steps: - name: Set AP model output id: ap_model @@ -1960,7 +1960,7 @@ jobs: run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }} test-udaya-a5-id2: - needs: [ "vars", "build", "test-cig-wf194c4" ] + needs: [ "vars", "build", "test-liteon-wpx8324" ] runs-on: [ self-hosted, small ] timeout-minutes: 1440 if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'udaya_a5-id2')" @@ -2339,7 +2339,7 @@ jobs: report: if: "!cancelled()" runs-on: ubuntu-latest - needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] + needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] strategy: fail-fast: false matrix: @@ -2408,7 +2408,7 @@ jobs: # Cleanup cleanup: - needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] + needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] runs-on: ubuntu-latest if: always() steps: diff --git a/.github/workflows/quali-basic-manual.yml b/.github/workflows/quali-basic-manual.yml index d72ce8f09..e20b3219f 100644 --- a/.github/workflows/quali-basic-manual.yml +++ b/.github/workflows/quali-basic-manual.yml @@ -20,7 +20,7 @@ on: default: 'main' description: 'revision of the Open Wifi Helm chart' ap_model: - description: 'AP model to test, one of edgecore_ecw5410,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4' + description: 'AP model to test, one of edgecore_ecw5410,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4' required: true firmware: default: 'next-latest' diff --git a/.github/workflows/quali.yml b/.github/workflows/quali.yml index bcd48346f..ce36f8911 100644 --- a/.github/workflows/quali.yml +++ b/.github/workflows/quali.yml @@ -22,7 +22,7 @@ on: description: "revision of the Open Wifi Helm chart" ap_models: required: true - default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" + default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" description: "the AP models to test" ap_version: required: true @@ -69,7 +69,7 @@ jobs: AP_MODELS="${{ github.event.inputs.ap_models || 'hfcl_ion4,indio_um-305ac,hfcl_ion4xe,cig_wf188n,edgecore_ecw5211,edgecore_eap101,udaya_a5-id2' }}" else echo "Choosing second slot since $SLOT != 0" - AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xi,edgecore_eap102,cig_wf194c4,cig_wf196' }}" + AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xi,edgecore_eap102,liteon_wpx8324,cig_wf196' }}" fi echo "List of AP models to test - $AP_MODELS" AP_MODELS=$(echo $AP_MODELS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') @@ -861,15 +861,15 @@ jobs: if: always() run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }} - test-cig-wf194c4: + test-liteon-wpx8324: needs: ["vars", "build"] runs-on: ubuntu-latest - if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'cig_wf194c4')" + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'liteon_wpx8324')" env: CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} - AP_MODEL: cig_wf194c4 + AP_MODEL: liteon_wpx8324 steps: - name: Set AP model output id: ap_model @@ -1376,7 +1376,7 @@ jobs: # Test for udaya_a5-id2 test-udaya-a5-id2: - needs: [ "vars", "build", "test-cig-wf194c4" ] + needs: [ "vars", "build", "test-liteon-wpx8324" ] runs-on: ubuntu-latest if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'udaya_a5-id2')" env: @@ -1637,7 +1637,7 @@ jobs: report: if: "!cancelled()" runs-on: ubuntu-latest - needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig_wf196] + needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig_wf196] strategy: fail-fast: false matrix: @@ -1688,7 +1688,7 @@ jobs: # Cleanup cleanup: - needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig_wf196] + needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig_wf196] runs-on: ubuntu-latest if: always() steps: diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index 11ad84be2..fbf967116 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -22,7 +22,7 @@ on: description: "revision of the Open Wifi Helm chart" ap_models: required: true - default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" + default: "Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196" description: "the AP models to test" ap_version: required: true @@ -62,7 +62,7 @@ jobs: MARKER_EXPRESSIONS=$(echo $MARKER_EXPRESSIONS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') echo "::set-output name=marker_expressions::${MARKER_EXPRESSIONS}" - AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,cig_wf194c4,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196' }}" + AP_MODELS="${{ github.event.inputs.ap_models || 'Wallys_DR6018,hfcl_ion4xe,edgecore_eap101,edgecore_ecw5211,cig_wf188n,edgecore_eap102,liteon_wpx8324,hfcl_ion4,indio_um-305ac,hfcl_ion4xi,udaya_a5-id2,cig_wf196' }}" AP_MODELS=$(echo $AP_MODELS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') echo "::set-output name=ap_models::${AP_MODELS}" @@ -1639,16 +1639,16 @@ jobs: if: always() run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }} - test-cig-wf194c4: + test-liteon-wpx8324: needs: ["vars", "build"] runs-on: [self-hosted, small] timeout-minutes: 1440 - if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'cig_wf194c4')" + if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'liteon_wpx8324')" env: CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build CLOUDSHELL_USER: ${{ secrets.CLOUDSHELL_USER }} CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} - AP_MODEL: cig_wf194c4 + AP_MODEL: liteon_wpx8324 steps: - name: Set AP model output id: ap_model @@ -2680,7 +2680,7 @@ jobs: run: python .quali/stop_reservation.py ${{ steps.reservation.outputs.identifier }} test-udaya-a5-id2: - needs: [ "vars", "build", "test-cig-wf194c4" ] + needs: [ "vars", "build", "test-liteon-wpx8324" ] runs-on: [self-hosted, small] timeout-minutes: 1440 if: "!cancelled() && contains(fromJSON(needs.vars.outputs.ap_models), 'udaya_a5-id2')" @@ -3191,7 +3191,7 @@ jobs: report: if: "!cancelled()" runs-on: ubuntu-latest - needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] + needs: [vars, test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] strategy: fail-fast: false matrix: @@ -3244,7 +3244,7 @@ jobs: # Cleanup cleanup: - needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-cig-wf194c4, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] + needs: [test-wallys-DR6018, test-hfcl-ion4xe, test-edgecore-eap101, test-edgecore-ecw5211, test-cig-wf188n, test-edgecore-eap102, test-liteon-wpx8324, test-hfcl-ion4, test-indio-um-305ac, test-hfcl-ion4xi, test-udaya-a5-id2, test-cig-wf196] runs-on: ubuntu-latest if: always() steps: diff --git a/.github/workflows/restart_qa_gw.yml b/.github/workflows/restart_gw.yml similarity index 64% rename from .github/workflows/restart_qa_gw.yml rename to .github/workflows/restart_gw.yml index 6d927b8c7..d76764e37 100644 --- a/.github/workflows/restart_qa_gw.yml +++ b/.github/workflows/restart_gw.yml @@ -1,4 +1,4 @@ -name: Restart OWGW on QA +name: Restart OWGW defaults: run: @@ -13,8 +13,12 @@ env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }} on: - workflow_dispatch: {} - + workflow_dispatch: + inputs: + environment: + default: 'qa01' + description: 'In which environment OWGW must be restarted (qa01 will restart OWGW in openwifi-qa01)' + required: true jobs: restart-owgw: @@ -29,5 +33,5 @@ jobs: curl -LO "https://dl.k8s.io/release/v1.23.6/bin/linux/amd64/kubectl" sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - - name: Restart OWGW in QA01 - run: kubectl delete pod -n openwifi-qa01 -l app.kubernetes.io/name=owgw + - name: Restart OWGW in defined namespace + run: kubectl delete pod -n openwifi-${{ github.event.inputs.environment }} -l app.kubernetes.io/name=owgw diff --git a/.github/workflows/ucentralgw-qa-deployment.yaml b/.github/workflows/ucentralgw-qa-deployment.yaml index 84cf92a4a..97d1afa79 100644 --- a/.github/workflows/ucentralgw-qa-deployment.yaml +++ b/.github/workflows/ucentralgw-qa-deployment.yaml @@ -34,21 +34,7 @@ env: { "namespace": "qa01", "deploy_method": "git", - "chart_version": "v2.7.1", - "owgw_version": "master", - "owsec_version": "main", - "owfms_version": "main", - "owprov_version": "main", - "owanalytics_version": "main", - "owsub_version": "main", - "owrrm_version": "main", - "owgwui_version": "main", - "owprovui_version": "main" - }, - { - "namespace": "qa02", - "deploy_method": "git", - "chart_version": "v2.7.1", + "chart_version": "main", "owgw_version": "master", "owsec_version": "main", "owfms_version": "main", @@ -123,7 +109,7 @@ jobs: export OWANALYTICS_VERSION=${{ matrix.owanalytics_version }} export OWSUB_VERSION=${{ matrix.owsub_version }} export OWRRM_VERSION=${{ matrix.owrrm_version }} - export VALUES_FILE_LOCATION=values.openwifi-qa.yaml,values.openwifi-qa.external-db.yaml + export VALUES_FILE_LOCATION=values.openwifi-qa.yaml,values.openwifi-qa.single-external-db.yaml export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }} export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }} export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }} @@ -135,6 +121,7 @@ jobs: export MAILER_USERNAME=${{ secrets.MAILER_USERNAME }} export MAILER_PASSWORD=${{ secrets.MAILER_PASSWORD }} export IPTOCOUNTRY_IPINFO_TOKEN=${{ secrets.IPTOCOUNTRY_IPINFO_TOKEN }} + export EXTRA_VALUES='owgw.configProperties.logging\.level=information' ./deploy.sh - name: Show resource state on deployment failure diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index c521cbe43..51267a8fd 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -57,7 +57,7 @@ class APNOS: cmd = '[ -f ~/cicd-git/ ] && echo "True" || echo "False"' stdin, stdout, stderr = client.exec_command(cmd) output = str(stdout.read()) - + if output.__contains__("False"): cmd = 'mkdir ~/cicd-git/' stdin, stdout, stderr = client.exec_command(cmd) @@ -638,9 +638,24 @@ class APNOS: command = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " elif self.type.lower() == "wifi6" or self.type.lower() == "wifi6e": - cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && ls && echo 1 > dfs_simulate_radar' - print("cmd: ", cmd) + client = self.ssh_cli_connect() + cmd1 = '[ -f /sys/kernel/debug/ath11k/qcn6122_2/mac0/dfs_simulate_radar ] && echo "True" || echo "False"' if self.mode: + cmd1 = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd1}\" " + stdin, stdout, stderr = client.exec_command(cmd1) + output = stdout.read() + print("Output", output) + status = output.decode('utf-8') + status_count = int(status.count("True")) + print("status", status) + print("count", status_count) + if status_count == 1: + cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && ls && echo 1 > dfs_simulate_radar' + else: + cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd qcn6122_2 && cd mac0 && ls && echo 1 > dfs_simulate_radar' + client.close() + print("cmd: ", cmd) command = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ f"cmd --value \"{cmd}\" " client = self.ssh_cli_connect() @@ -661,13 +676,28 @@ class APNOS: else: cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && logread | grep DFS" client.close() - #cmd = "cd /sys/kernel/debug/ieee80211/phy1/ath10k/ && logread | grep DFS" - #print("cmd: ", cmd) + # 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.type.lower() == "wifi6" or self.type.lower() == "wifi6e": - cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && logread | grep DFS' + client = self.ssh_cli_connect() + cmd1 = '[ -f /sys/kernel/debug/ath11k/qcn6122_2/mac0/dfs_simulate_radar ] && echo "True" || echo "False"' + cmd1 = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd1}\" " + stdin, stdout, stderr = client.exec_command(cmd1) + output = stdout.read() + print("Output", output) + status = output.decode('utf-8') + status_count = int(status.count("True")) + print("status", status) + print("count", status_count) + if status_count == 1: + cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd ipq* && cd mac0 && logread | grep DFS' + else: + cmd = f'cd && cd /sys/kernel/debug/ath11k/ && cd qcn6122_2 && cd mac0 && logread | grep DFS' + client.close() print("cmd: ", cmd) if self.mode: cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ @@ -690,16 +720,16 @@ class APNOS: if __name__ == '__main__': obj = { - "model": "cig_wf188n", - "mode": "wifi6", - "serial": "0000c1018812", - "jumphost": True, - "ip": "10.28.3.103", - "username": "lanforge", - "password": "pumpkin77", - "port": 22, - "jumphost_tty": "/dev/ttyAP1", - "version": "next-latest" - } + "model": "cig_wf188n", + "mode": "wifi6", + "serial": "0000c1018812", + "jumphost": True, + "ip": "10.28.3.103", + "username": "lanforge", + "password": "pumpkin77", + "port": 22, + "jumphost_tty": "/dev/ttyAP1", + "version": "next-latest" + } var = APNOS(credentials=obj, sdk="2.x") print(var.get_memory_profile()) diff --git a/libs/controller/controller_2x/controller.py b/libs/controller/controller_2x/controller.py index 8b7c08a6a..0998640a3 100644 --- a/libs/controller/controller_2x/controller.py +++ b/libs/controller/controller_2x/controller.py @@ -1668,12 +1668,16 @@ class UProfileUtility: def add_ssid(self, ssid_data, radius=False, radius_auth_data={}, radius_accounting_data={}): print("ssid data : ", ssid_data) ssid_info = {'name': ssid_data["ssid_name"], "bss-mode": "ap", "wifi-bands": [], "services": ["wifi-frames"]} + for options in ssid_data: if options == "multi-psk": ssid_info[options] = ssid_data[options] print("hi", ssid_info) if options == "rate-limit": ssid_info[options] = ssid_data[options] + if options == "isolate-clients": + ssid_info[options] = ssid_data[options] + for i in ssid_data["appliedRadios"]: ssid_info["wifi-bands"].append(i) ssid_info['encryption'] = {} diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index 4d046882a..795c9edb6 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -1338,12 +1338,19 @@ class RunTest: json_response = cli_base.json_get(_req_url=_req_url) return json_response + def l3_cleanup(self): + local_realm = realm.Realm(lfclient_host=self.lanforge_ip, lfclient_port=self.lanforge_port) + local_realm.remove_all_cxs(remove_all_endpoints=True) + def create_layer3(self, side_a_min_rate, side_a_max_rate, side_b_min_rate, side_b_max_rate, - traffic_type, sta_list,): + traffic_type, sta_list, side_b=""): # checked + if side_b=="": + side_b=self.upstream print(sta_list) print(type(sta_list)) - print(self.upstream) + print(side_b) + print(type(side_b)) local_realm = realm.Realm(lfclient_host=self.lanforge_ip, lfclient_port=self.lanforge_port) cx_profile = local_realm.new_l3_cx_profile() cx_profile.host = self.lanforge_ip @@ -1356,7 +1363,7 @@ class RunTest: # create cx_profile.create(endp_type=traffic_type, side_a=sta_list, - side_b=self.upstream, + side_b=side_b, sleep_time=0) cx_profile.start_cx() diff --git a/tests/e2e/basic/validation_of_operating_modes/client_isolation/__init__.py b/tests/e2e/basic/validation_of_operating_modes/client_isolation/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py b/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py new file mode 100644 index 000000000..d554f0086 --- /dev/null +++ b/tests/e2e/basic/validation_of_operating_modes/client_isolation/test_client_isolation.py @@ -0,0 +1,1788 @@ +""" + Test Client Isolation: Bridge Mode + pytest -m client_isolation +""" + +import time +import allure +import pytest +from tabulate import tabulate + +pytestmark = [pytest.mark.ow_regression_lf, pytest.mark.client_isolation, pytest.mark.bridge] + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + { + "ssid_name": "ci_enabled_wpa2_ssid1_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_enabled_wpa2_ssid2_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_enabled_wpa2_ssid1_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_enabled_wpa2_ssid2_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + } + ] + }, + "rf": {}, + "radius": False +} + + +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.ci_enabled +class TestClientIsolationEnabled(object): + """ + Test Config with Enabling Client Isolation in SSIDs + pytest -m "client_isolation and ci_enabled and bridge" + """ + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.ci_enabled_in_5g_ssid + @allure.title("Verify the connectivity of 2 clients connected to the different SSID by enabling the client " + "isolation in both the SSID's.(5Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10610", name="WIFI-10610") + def test_client_isolation_enabled_ssid_5g(self, lf_test, get_configuration): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][2] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + sta = ["sta100", "sta101"] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][2])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta,side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names",value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("Test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " + "5g stations, when isolation enabled in different 5g ssids."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" + "isolation enabled in different 5g ssids." +"\n\n"+str(table)) + + print("Test pass, traffic ran between two stations when isolation enabled in both 5g ssids.") + assert True + else: + print("Layer3 not ran properly.") + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.ci_enabled_in_2g_ssid + @allure.title("Run traffic between eth2 port (AP) and station (with client isolation enabled) -2.4GHz") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10620", name="WIFI-10620") + def test_client_isolation_enabled_with_2g(self, lf_test, get_configuration): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list = "sta000" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][0])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list]) + result = lf_test.json_get(_req_url="port/1/1/%s" % (station_list)) + lf_test.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", + name="%s info" % (station_list)) + + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list], side_b="") + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list,"eth2"], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"], rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"], rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 2g station " + "and eth-port, when isolation enabled in 2g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, 2g station able to ping eth-port, when" + "isolation enabled in 2g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between eth2 and station when isolation enabled in one 2g ssid.") + assert True + else: + print("Layer3 not ran properly.") + + + + # clients_connected to different ssid, enabling isolation in both(2.4GH) + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.ci_ebabled_in_2g + @allure.title("Verify the connectivity of 2 clients connected to the different SSID by enabling the client " + "isolation in both the SSID's.(2.4Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10602",name="WIFI-10602") + def test_client_isolation_enabled_ssids_2g(self,lf_test, get_configuration): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + sta = ["sta000", "sta001"] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][1])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("Test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " + "stations, when isolation enabled in different 2g ssids."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" + "isolation enabled in different 2g ssids."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation enabled in both 2g ssids.") + assert True + else: + print("Layer3 not ran properly.") + + + # Running traffic between eth2 to station with client-isolation enabled in (5GH) ssid + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.eth_to_5g_station_true + @allure.title("Run traffic between eth2 port (AP) and station (with client isolation enabled) -5GHz") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10621", name="WIFI-10621") + def test_client_isolation_enabled_with_5g(self, lf_test, get_configuration): + + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][2] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general["ssid_modes"]["wpa2_personal"][2])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list]) + result = lf_test.json_get(_req_url="port/1/1/%s" % (station_list)) + lf_test.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", + name="%s info" % (station_list)) + + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list], side_b="") + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list,"eth2"], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" + " and eth-port, when isolation enabled in 5g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, 5g station able to ping eth-port, when isolation" + " enabled in 5g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between eth2 and station when isolation enabled in one 5g ssid.") + assert True + else: + print("Layer3 not ran properly.") + + +setup_params_general1 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + { + "ssid_name": "ci_disabled_wpa2_ssid1_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + { + "ssid_name": "ci_disabled_wpa2_ssid2_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + { + "ssid_name": "ci_disabled_wpa2_ssid1_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + { + "ssid_name": "ci_disabled_wpa2_ssid2_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + } + ] + }, + "rf": {}, + "radius": False +} + + +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general1], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.ci_disabled +class TestClientIsolationDisabled(object): + """ + Test Config with Enabling Client Isolation in SSIDs + pytest -m "client_isolation and ci_disabled and bridge" + """ + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.ci_disabled_in_2g_ssid + @allure.title("Verify the connectivity of 2 clients connected to the different SSID disabling the client " + "isolation(2.4Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10603", name="WIFI-10603") + def test_client_isolation_disabled_ssids_2g(self, lf_test, get_configuration): + + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][1] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + sta = ["sta000", "sta001"] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][1])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[sta[0]]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[sta[1]]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between two " + "stations, when isolation disabled in different 2g ssids."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" + "isolation disabled in different 2g ssids."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation disabled in both 2g ssids.") + assert True + else: + print("Layer3 not ran properly.") + + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.eth_to_2g_station_false + @allure.title("Run traffic between eth2 port (AP) and station (with client isolation disabled) -2.4GHz") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10624", name="WIFI-10624") + def test_client_isolation_disabled_with_2g(self, lf_test, get_configuration): + + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list = "sta000" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][0])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list]) + result = lf_test.json_get(_req_url="port/1/1/%s" % (station_list)) + lf_test.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", + name="%s info" % (station_list)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list], side_b="") + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list,"eth2"], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 2g station " + "and eth-port, when isolation disabled in 2g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, 2g station able to ping eth-port, when" + "isolation disabled in 2g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between eth2 and station when isolation disabled in one 2g ssid.") + assert True + else: + print("Layer3 not ran properly.") + + # clients_connected to different ssid, disabling isolation in both(5GH) + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.ci_disabled_in_5g_ssid + @allure.title("Verify the connectivity of 2 clients connected to the different SSID disabling the client " + "isolation(5Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10611",name="WIFI-10611") + def test_client_isolation_disabled_ssid_5g(self,lf_test, get_configuration): + + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][2] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + sta = ["sta100", "sta101"] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][2])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[0]]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, station_name=[sta[1]]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" + " and eth-port, when isolation disabled in 5g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when" + "isolation disabled in different 5g ssids."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation disabled in both 5g ssids.") + assert True + else: + print("Layer3 not ran properly.") + + # Running traffic between eth2 to station with client-isolation disabled in (5GH) ssid + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.eth_to_5g_station_false + @allure.title("Run traffic between eth2 port (AP) and station (with client isolation disabled) -5GHz") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10623", name="WIFI-10623") + def test_client_isolation_disabled_with_5g(self, lf_test, get_configuration): + + profile_data = setup_params_general1["ssid_modes"]["wpa2_personal"][2] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general1["ssid_modes"]["wpa2_personal"][2])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list]) + result = lf_test.json_get(_req_url="port/1/1/%s" % (station_list)) + lf_test.allure_report_table_format(dict_data=result["interface"], key="Station_port_data",value="VALUE", + name="%s info" % (station_list)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list], side_b="") + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list,"eth2"], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% between 5g station" + " and eth-port, when isolation disabled in 5g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, 5g station able to ping eth-port, when isolation" + " disabled in 5g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between eth2 and stations when isolation disabled in one 5g ssid.") + assert True + else: + print("Layer3 not ran properly.") + + +setup_params_general2 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + { + "ssid_name": "ci_enabled_wpa2_ssid", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_disabled_wpa2_ssid", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + { + "ssid_name": "ci_enabled_wpa2_ssid", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_disabled_wpa2_ssid", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + ] + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general2], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.ci_same_ssid +class TestClientIsolationSameSSID(object): + """ + Test Config with Enabling Client Isolation in SSIDs + pytest -m "client_isolation and ci_same_ssid and bridge" + """ + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.same_ssid_enabling_isolation_2g + @allure.title("Verify the connectivity of 2 clients connected to the same SSID enabling the client " + "isolation.(2.4Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10601", name="WIFI-10601") + def test_cleint_isolation_enabled_same_ssid_2g(self, lf_test, get_configuration): + + profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + sta = ["sta000", "sta001"] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][0])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=sta) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result",body="TEST PASS, Rx drop has 100% when isolation enabled in ssid."+"\n\n"+str(table)) + print("Test PASS,Rx drop has 100%") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Stations should not ping each other, when " + "isolation enabled in same ssid"+"\n\n"+str(table)) + print("Test fail, traffic ran between two stations when isolation enabled in both 2g same-ssid.") + assert False + else: + print("Layer3 not ran properly.") + + # clients_connected to same ssid, disabled isolation(2.4GH) + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.same_ssid_disabling_isolation_2g + @allure.title("Verify the connectivity of 2 clients connected to the same SSID without enabling the client " + "isolation.(2.4Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10604",name="WIFI-10604") + def test_cleint_isolation_disabled_same_ssid_2g(self,lf_test, get_configuration): + + profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + sta = ["sta000", "sta001"] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][1])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=sta) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " + "disabled in same ssid"+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations are able to ping each other, when " + "isolation disabled in ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation disabled in both 2g same-ssid.") + assert True + else: + print("Layer3 not ran properly.") + + # clients_connected to same ssid, enabled isolation(5GHZ) + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.same_ssid_enabling_isolation_5g + @allure.title("Verify the connectivity of 2 clients connected to the same SSID by enabling client isolation.(5Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10606", name="WIFI-10606") + def test_cleint_isolation_enabled_same_ssid_5g(self, lf_test, get_configuration): + + profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][2] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + sta = ["sta100", "sta101"] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][2])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=sta) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST PASS, Rx drop has 100% when isolation enabled in ssid"+"\n\n"+str(table)) + print("Test PASS,Rx drop has 100%") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Stations are should not ping each other, when" + "isolation enabled in ssid."+"\n\n"+str(table)) + print("Test FAIL, traffic ran between two stations when isolation enabled in both 5g same-ssid.") + assert False + else: + print("Layer3 not ran properly.") + + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.same_ssid_disabling_isolation_5g + @allure.title("Verify the connectivity of 2 clients connected to the same SSID disabling the client isolation.(5Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10612", name="WIFI-10612") + def test_cleint_isolation_disabled_same_ssid_5g(self, lf_test, get_configuration): + + profile_data = setup_params_general2["ssid_modes"]["wpa2_personal"][3] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + sta = ["sta100", "sta101"] + + allure.attach(name="station_ssid_config-info", body=str(setup_params_general2["ssid_modes"]["wpa2_personal"][3])) + station_result = lf_test.Client_Connect_Using_Radio(ssid=ssid_name, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=sta) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[0])) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (sta[1])) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[0])) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS",value="VALUE", + name="%s info" % (sta[1])) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=sta, side_b=sta[1]) + print("waiting 30 sec for getting cx_list data...") + time.sleep(30) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [sta[0], sta[1]], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not station_result: + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " + "disabled in ssid."+"\n\n"+str(table)) + print("TEST FAIL,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Stations able to ping each other, when isolation" + "disabled in ssid."+"\n\n"+str(table)) + print("TEST PASS, traffic ran between two stations when isolation disabled in both 5g same-ssid.") + assert True + else: + print("Layer3 not ran properly.") + + +setup_params_general3 = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + { + "ssid_name": "ci_enabled_wpa2_ssid1_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_disabled_wpa2_ssid2_2g", + "appliedRadios": ["2G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + }, + { + "ssid_name": "ci_enabled_wpa2_ssid1_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": True + }, + { + "ssid_name": "ci_disabled_wpa2_ssid2_5g", + "appliedRadios": ["5G"], + "security": "psk2", + "security_key": "OpenWifi", + "isolate-clients": False + } + ] + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general3], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +@pytest.mark.ci_different_ssid +class TestClientIsolationDifferentSSID(object): + """ + Test Config with Enabling Client Isolation in SSIDs + pytest -m "client_isolation and ci_different_ssid and bridge" + """ + + # clients_connected to different ssid,enabling isolation in ssid (2GH)& isolation disabled in ssid (2GHZ) + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.ci_enable_and_disable_2g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in one and disabled in other.(2.4Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10605", name="WIFI-10605") + def test_client_isoaltion_enabled_ssid_2g_disabled_ssid_2g(self, lf_test, station_names_twog, get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta001" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.twog_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1], side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " + "enabled in one 2g ssid & disabled in another 2g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Two 2g stations are able to ping each other, " + "when isolation enabled in one 2g ssid & disabled in another 2g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation enabled in one 2g ssid disabled " + "in another.") + assert True + else: + print("Layer3 not ran properly.") + + + # clients_connected to different ssid,enabling isolation in ssid (5GH)& isolation disabled in ssid (5GHZ) + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.ci_enable_and_disable_5g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in one and disabled in other.(5Ghz)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10613", name="WIFI-10613") + def test_client_isoaltion_enabled_ssid_5g_disabled_ssid_5g(self, lf_test, station_names_fiveg, get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta100" + station_list2 = "sta101" + security = "wpa2" + mode = "BRIDGE" + radio_name = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name, + station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1], side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["rx drop % a"] and rx_data[f"{cx_list[0]}"]["rx drop % b"] == 100: + allure.attach(name="Test Result", body="TEST FAILED, Rx drop should not be 100% when isolation " + "enabled in one 5g ssid & disabled in another 5g ssid."+"\n\n"+str(table)) + print("Test failed,Rx drop should not be 100%") + assert False + else: + allure.attach(name="Test Result", body="TEST PASS, Two 5g stations are able to ping each other, " + "when isolation enabled in one 5g ssid & disabled in another 5g ssid."+"\n\n"+str(table)) + print("Test pass, traffic ran between two stations when isolation enabled in one 5g and disabled " + "in another.") + assert True + else: + print("Layer3 not ran properly.") + + # run traffic from 2g to 5g + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.twog + @pytest.mark.ci_enabled_2g_and_5g_traffic_2g_to_5g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in 2G SSID and 5G SSID (run traffic from 2G client to 5G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10616", name="WIFI-10616") + def test_client_isolation_enabled_ssid2g_and_ssid5g(self, lf_test, station_names_twog, station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="0 (zero)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1], side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: + allure.attach(name="Test Result",body="TEST PASS, The 5g station Received rx bytes per second is %s" % (rx_data[f"{cx_list[0]}"]["bps rx b"]) + + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 2g to 5g stations when isolation enabled in 2g and 5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " + "after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test failed, bps rx b received none") + assert False + else: + print("Layer3 not ran properly.") + + # run traffic from 2g to 5g + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.twog + @pytest.mark.ci_disable_2g_and_5g_traffic_2g_to_5g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" + " in 2G SSID and 5G SSID (run traffic from 2G client to 5G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10618",name="WIFI-10618") + def test_client_isolation_disabled_ssid2g_and_ssid5g(self, lf_test, station_names_twog, station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="0 (zero)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1], side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: + allure.attach(name="Test Result", + body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 2g to 5g stations when isolation disabled in 2g and 5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " + "after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test failed, bps rx b received none") + assert False + else: + print("Layer3 not ran properly.") + + # clients_connected to different ssid, enabling isolation in both (2GHz) & (5GHz) ssid + # run traffic from 5g to 2g + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.twog + @pytest.mark.ci_enabled_2g_and_5g_traffic_5g_to_2g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in 2G SSID and 5G SSID (run traffic from 5G client to 2G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10617", name="WIFI-10617") + def test_client_isolation_enabled_ssid_2gandssid_5g(self, lf_test, station_names_twog, station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="0 (zero)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1],side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: + allure.attach(name="Test Result", + body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 5g to 2g stations when isolation enabled in 2g and 5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " + "after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test failed, bps rx -a received none") + assert False + else: + print("Layer3 not ran properly.") + + # clients_connected to different ssid, disabled isolation in both (2GHz) & (5GHz) ssid + # run traffic from 5g to 2g + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.twog + @pytest.mark.ci_disable_2g_and_5g_traffic_5g_to_2g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" + " in 2G SSID and 5G SSID (run traffic from 5G client to 2G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10619",name="WIFI-10619") + def test_client_isolation_disabled_ssid_2gandssid_5g(self, lf_test, station_names_twog, station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="0 (zero)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1],side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: + allure.attach(name="Test Result", + body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and 5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " + "after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test failed, bps rx -a received none") + assert False + else: + print("Layer3 not ran properly.") + + # run traffic from 2g to 5g + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.fiveg + @pytest.mark.ci_enabled_2g_disabled_5g_traffic_2g_to_5g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in 2G SSID and disabled in 5G SSID (run traffic from 2G client to 5G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10614", name="WIFI-10614") + def test_client_isolation_enabled_ssids_2gdisabled_ssid_5g(self, lf_test, station_names_twog, station_names_fiveg, + get_ap_channel): + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="0 (zero)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1],side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: + allure.attach(name="Test Result", + body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 2g to 5g stations when isolation enabled in 2g and disabled " + "5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " + "after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test failed, bps rx b received none") + assert False + else: + print("Layer3 not ran properly.") + + # run traffic from 5g to 2g + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.fiveg + @pytest.mark.ci_disabled_2g_enabled_5g_traffic_5g_to_2g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" + " in 2G SSID and enabled in 5G SSID (run traffic from 5G client to 2G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10625", name="WIFI-10625") + def test_client_isolation_disabled_ssid_2genabled_ssid_5g(self, lf_test, station_names_twog,station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, + station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, + station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="0 (zero)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1], side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: + allure.attach(name="Test Result", + body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and enabled " + "5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " + "after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test failed, bps rx a received none") + assert False + else: + print("Layer3 not ran properly.") + + + # clients_connected to different ssid,enabled isolation in (2GHz)ssid & isolation disabled in (5GH)ssid + # run traffic from 5g to 2g + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.fiveg + @pytest.mark.ci_enabled_2g_disabled_5g_traffic_5g_to_2g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is enabled" + " in 2G SSID and disabled in 5G SSID (run traffic from 5G client to 2G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10615",name="WIFI-10615") + def test_client_isolation_enabled_ssids_2g_disabled_ssid_5g(self, lf_test, station_names_twog, station_names_fiveg, + get_ap_channel): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][0] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][3] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][0])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][3])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="0 (zero)") + allure.attach(name="Min Tx rate -B", body="6291456 (6.2 Mbps)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=0, side_a_max_rate=0, + side_b_min_rate=6291456, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1],side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] != 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] == 0: + allure.attach(name="Test Result", + body="TEST PASS, The 2g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx a"]) + " after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 5g to 2g stations when isolation disabled in 2g and enabled " + "5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 2g station not received rx bytes, " + "after traffic ran from 5g to 2g"+"\n\n"+str(table)) + print("Test failed, bps rx a received none") + assert False + else: + print("Layer3 not ran properly.") + + # clients_connected to different ssid,disabled isolation in ssid (2GHz)& isolation enabled in ssid(5GH) + # run traffic from 2g to 5g + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.fiveg + @pytest.mark.ci_disabled_2g_enabled_5g_traffic_2g_to_5g + @allure.title("Verify the connectivity of 2 clients connected to different SSID's where Client isolation is disabled" + " in 2G SSID and enabled in 5G SSID (run traffic from 2G client to 5G client)") + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-10626", name="WIFI-10626") + def test_client_isolation_disabled_ssid_2g_enabled_ssid_5g(self, lf_test, station_names_twog, station_names_fiveg, + get_configuration): + + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][1] + ssid_name1 = profile_data["ssid_name"] + profile_data = setup_params_general3["ssid_modes"]["wpa2_personal"][2] + ssid_name2 = profile_data["ssid_name"] + security_key = profile_data["security_key"] + station_list1 = "sta000" + station_list2 = "sta100" + security = "wpa2" + mode = "BRIDGE" + radio_name1 = lf_test.twog_radios[0] + radio_name2 = lf_test.fiveg_radios[0] + + allure.attach(name="station1_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][1])) + allure.attach(name="station2_ssid_config-info", body=str(setup_params_general3["ssid_modes"]["wpa2_personal"][2])) + station_result1 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name1, passkey=security_key, + security=security, mode=mode, radio=radio_name1, station_name=[station_list1]) + station_result2 = lf_test.Client_Connect_Using_Radio(ssid=ssid_name2, passkey=security_key, + security=security, mode=mode, radio=radio_name2, station_name=[station_list2]) + sta_data1 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list1)) + sta_data2 = lf_test.json_get(_req_url="port/1/1/%s" % (station_list2)) + lf_test.allure_report_table_format(dict_data=sta_data1["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list1)) + lf_test.allure_report_table_format(dict_data=sta_data2["interface"], key="STATION DETAILS", value="VALUE", + name="%s info" % (station_list2)) + allure.attach(name="Min Tx rate -A", body="6291456 (6.2 Mbps)") + allure.attach(name="Min Tx rate -B", body="0 (zero)") + layer3_restult = lf_test.create_layer3(side_a_min_rate=6291456, side_a_max_rate=0, + side_b_min_rate=0, side_b_max_rate=0, + traffic_type="lf_udp", sta_list=[station_list1],side_b=station_list2) + print("waiting 45 sec for getting cx_list data...") + time.sleep(45) + + cx_list = lf_test.get_cx_list() + rx_data = lf_test.json_get(_req_url=f"cx/{cx_list[0]}") + lf_test.allure_report_table_format(dict_data=rx_data[f"{cx_list[0]}"], key="Layer-3 Column Names", + value="VALUE", name="cx_data") + lf_test.l3_cleanup() + table_data = {"Station Name": [station_list1,station_list2], + "bps rx a": [rx_data[f"{cx_list[0]}"]["bps rx a"],rx_data[f"{cx_list[0]}"]["bps rx b"]], + "rx drop %": [rx_data[f"{cx_list[0]}"]["rx drop % a"],rx_data[f"{cx_list[0]}"]["rx drop % b"]]} + table = tabulate(table_data, headers='keys', tablefmt='fancy_grid', showindex=True) + print(table) + + if not (station_result1 and station_result2): + allure.attach(name="Test Result", body="TEST FAILED, due to station has no ip") + print("Test failed due to station has no ip") + assert False + else: + print("Station creation passed. Successful.") + if layer3_restult is None: + print("Layer3 traffic ran.") + if rx_data[f"{cx_list[0]}"]["bps rx a"] == 0 and rx_data[f"{cx_list[0]}"]["bps rx b"] != 0: + allure.attach(name="Test Result", + body="TEST PASS, The 5g station Received rx bytes per second is %s" % ( + rx_data[f"{cx_list[0]}"]["bps rx b"]) + " after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test pass, traffic ran between 2g to 5g stations when isolation disabled in 2g and enabled " + "5g ssid.") + assert True + else: + allure.attach(name="Test Result", body="TEST FAILED, Due to the 5g station not received rx bytes, " + "after traffic ran from 2g to 5g"+"\n\n"+str(table)) + print("Test failed, bps rx b received none") + assert False + else: + print("Layer3 not ran properly.") diff --git a/tests/fixtures_2x.py b/tests/fixtures_2x.py index eafaaaeae..50a1d084c 100644 --- a/tests/fixtures_2x.py +++ b/tests/fixtures_2x.py @@ -717,7 +717,7 @@ class Fixtures_2x: allure.attach(body=str(e), name="Exception data after config push: ") print(e) - config = json.loads(str(instantiate_profile_obj.base_profile_config).replace(" ", "").replace("'", '"').replace("True", "true")) + config = json.loads(str(instantiate_profile_obj.base_profile_config).replace(" ", "").replace("'", '"').replace("True", "true").replace("False", "false")) config["uuid"] = 0 # Attach the config that is sent from API