diff --git a/.github/workflows/get_redirector_url.yml b/.github/workflows/get_redirector_url.yml new file mode 100644 index 000000000..a3d9138c7 --- /dev/null +++ b/.github/workflows/get_redirector_url.yml @@ -0,0 +1,67 @@ +name: Get testbeds current redirector urls + +on: + workflow_dispatch: + inputs: + testbeds: + default: 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' + description: 'Testbed(s) to test' + required: false + +defaults: + run: + shell: bash + +jobs: + generate-matrix: + name: generate testbed matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: generate-matrix + id: set-matrix + run: | + TESTBEDS="${{ github.event.inputs.testbeds || 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' }}" + TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') + TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') + echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" + + get-redirector-url: + needs: [ generate-matrix ] + runs-on: ubuntu-latest + strategy: + matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} + steps: + - name: checkout testing repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-testing + path: wlan-testing + + - name: checkout pki cert scripts repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-pki-cert-scripts + path: wlan-pki-cert-scripts + + - name: install dependencies + run: | + sudo apt-get install -y python3-pip + pip install paramiko scp + + - name: create configuration.py file + run: | + cat << EOF > configuration.py + ${{ secrets.LAB_CONFIGURATION }} + EOF + + - name: Get redirector URL + env: + DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }} + run: | + for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3) + do + ./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id + echo "Exit code - $?" + done diff --git a/.github/workflows/ow_sdk_docker-compose.yml b/.github/workflows/ow_sdk_docker-compose.yml new file mode 100644 index 000000000..7bfd440a4 --- /dev/null +++ b/.github/workflows/ow_sdk_docker-compose.yml @@ -0,0 +1,11 @@ +name: 2.x SDK testing with Docker Compose deployment + +on: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-20.04 + steps: + - name: Run echo + run: echo "This is a dummy workflow." diff --git a/.github/workflows/uc_sanity.yml b/.github/workflows/uc_sanity.yml index f6e302484..bea8f0ef9 100644 --- a/.github/workflows/uc_sanity.yml +++ b/.github/workflows/uc_sanity.yml @@ -67,85 +67,6 @@ jobs: - name: push docker image run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} - deploy-controller: - name: Deploy OpenWIFI Cloud SDK - runs-on: ubuntu-latest - outputs: - gateway_url: ${{ steps.gateway_url.outputs.value }} - sec_url: ${{ steps.sec_url.outputs.value }} - namespace: ${{ steps.namespace.outputs.value }} - steps: - - name: Checkout repo with Helm values - uses: actions/checkout@v2 - with: - path: wlan-testing - - - name: Prepare certificates from secrets - working-directory: wlan-testing/helm/ucentral - run: | - echo "${{ secrets.DIGICERT_CERT }}" | base64 -d > cert.pem - echo "${{ secrets.DIGICERT_KEY }}" | base64 -d > key.pem - - - name: Fetch kubeconfig - run: | - aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} - - - name: Set namespace output - id: namespace - run: echo "::set-output name=value::openwifi-${{ github.run_id }}" - - - name: Set gateway URL output - id: gateway_url - run: echo "::set-output name=value::gw-${{ github.run_id }}.cicd.lab.wlan.tip.build" - - - name: Set sec service URL output - id: sec_url - run: echo "::set-output name=value::sec-${{ github.run_id }}.cicd.lab.wlan.tip.build" - - - name: Deploy OpenWIFI Cloud SDK - working-directory: wlan-testing/helm/ucentral - run: | - export NAMESPACE=${{ github.run_id }} - export DEPLOY_METHOD=git - export CHART_VERSION=v2.2.0-RC1 - export OWGW_VERSION=v2.2.0-RC1 - export OWGWUI_VERSION=v2.2.0-RC1 - export OWSEC_VERSION=v2.2.0-RC1 - export OWFMS_VERSION=v2.2.0-RC1 - export OWPROV_VERSION=main - export OWPROVUI_VERSION=main - export VALUES_FILE_LOCATION=values.ucentral-qa.yaml - export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }} - export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }} - export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }} - export OWFMS_S3_SECRET=${{ secrets.UCENTRALFMS_S3_SECRET }} - export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }} - export CERT_LOCATION=cert.pem - export KEY_LOCATION=key.pem - ./deploy.sh - - - name: Show resource state on deployment failure - if: failure() - run: | - kubectl get pods --namespace openwifi-${{ github.run_id }} - kubectl get services --namespace openwifi-${{ github.run_id }} - kubectl get persistentvolumeclaims --namespace openwifi-${{ github.run_id }} - - name: Describe pods on deployment failure - if: failure() - run: | - kubectl describe pods --namespace openwifi-${{ github.run_id }} - - name: Describe services on deployment failure - if: failure() - run: | - kubectl describe services --namespace openwifi-${{ github.run_id }} - - name: Describe persistentvolumeclaims on deployment failure - if: failure() - run: | - kubectl describe persistentvolumeclaims --namespace openwifi-${{ github.run_id }} - - - name: wait for DNS to propagate - run: sleep 900 - generate-matrix: name: generate testbed matrix runs-on: ubuntu-latest @@ -160,70 +81,9 @@ jobs: TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" - set-redirector-url: - needs: [ deploy-controller, generate-matrix ] - strategy: - fail-fast: false - matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} - runs-on: self-hosted - steps: - - name: checkout testing repo - uses: actions/checkout@v2 - with: - repository: Telecominfraproject/wlan-testing - path: wlan-testing - ref: WIFI-3620 - - - name: checkout pki cert scripts repo - uses: actions/checkout@v2 - with: - repository: Telecominfraproject/wlan-pki-cert-scripts - path: wlan-pki-cert-scripts - - - name: install dependencies - run: | - sudo apt-get install -y python3-pip - pip install paramiko scp allure-pytest - - - name: create configuration.py file - run: | - cat << EOF > configuration.py - ${{ secrets.LAB_CONFIGURATION }} - EOF - - - name: set redirector URL - env: - DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }} - run: | - for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3) - do - ./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id "${{ needs.deploy-controller.outputs.gateway_url }}" - done - - - name: factory reset APs - run: | - set -x - AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3) - for index in $(seq 0 $AP_LEN) - do - HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3) - JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3) - TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3) - PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3) - USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3) - PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3) - - cd wlan-testing/tools - python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r" - cd ../.. - done - - - name: wait for APs to come up again - run: sleep 300 - test: runs-on: ubuntu-latest - needs: [ build, generate-matrix, deploy-controller, set-redirector-url ] + needs: [ build, generate-matrix ] strategy: fail-fast: false matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} @@ -251,8 +111,6 @@ jobs: cat << EOF > configuration.py ${{ secrets.LAB_CONFIGURATION }} EOF - sed -i -r "s/'url': ('|\").*('|\")/'url': 'https:\/\/${{ needs.deploy-controller.outputs.sec_url }}:16001'/" configuration.py - cat configuration.py kubectl create secret generic configuration --from-file=configuration=./configuration.py - name: run sanity tests run: | @@ -423,80 +281,3 @@ jobs: steps: - name: cleanup Docker image run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}" - - destroy-controller: - needs: [ test ] - runs-on: ubuntu-latest - if: always() - steps: - - name: Checkout repo with Helm values - uses: actions/checkout@v2 - with: - path: wlan-testing - - - name: Fetch kubeconfig - run: | - aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} - - - name: Delete namespace - run: kubectl delete ns --ignore-not-found=true "openwifi-${{ github.run_id }}" - - reset-redirector-url: - needs: [ test, generate-matrix ] - if: always() - strategy: - fail-fast: false - matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} - runs-on: self-hosted - steps: - - name: checkout testing repo - uses: actions/checkout@v2 - with: - repository: Telecominfraproject/wlan-testing - path: wlan-testing - ref: WIFI-3620 - - - name: checkout pki cert scripts repo - uses: actions/checkout@v2 - with: - repository: Telecominfraproject/wlan-pki-cert-scripts - path: wlan-pki-cert-scripts - - - name: install dependencies - run: | - pip install paramiko scp allure-pytest - - - name: create configuration.py file - run: | - cat << EOF > configuration.py - ${{ secrets.LAB_CONFIGURATION }} - EOF - - - name: reset redirector URL - env: - DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }} - run: | - for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3) - do - ./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id gw-qa01.cicd.lab.wlan.tip.build - done - - - name: factory reset APs - run: | - AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3) - for index in $(seq 0 $AP_LEN) - do - HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3) - JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3) - TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3) - PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3) - USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3) - PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3) - - cd wlan-testing/tools - python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r" - cd ../.. - done - - - name: wait for APs to come up again - run: sleep 300 diff --git a/.github/workflows/uc_sanity_dynamic.yml b/.github/workflows/uc_sanity_dynamic.yml new file mode 100644 index 000000000..254f82f8e --- /dev/null +++ b/.github/workflows/uc_sanity_dynamic.yml @@ -0,0 +1,503 @@ +name: 2.x sanity testing in dynamic environment +env: + # thirdparties + DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io + DOCKER_USER_NAME: wlan-testing-cicd + DOCKER_USER_PASSWORD: ${{ secrets.DOCKER_USER_PASSWORD }} + # AWS credentials + AWS_EKS_NAME: tip-wlan-main + AWS_DEFAULT_OUTPUT: json + AWS_DEFAULT_REGION: us-east-2 + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_CLIENT_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_CLIENT_KEY }} + # Cloud SDK certs + CACERT: ${{ secrets.CACERT }} + CAKEY: ${{ secrets.CAKEY }} + ALLURE_CLI_VERSION: 2.14.0 + +on: + workflow_dispatch: + inputs: + testbeds: + default: 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' + description: 'Testbed(s) to test' + required: false + marker_expression: + default: 'uc_sanity' + description: 'Markers expression that will be passed to the pytest command.' + required: false + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + # checkout needed repositories + - name: Checkout Testing repo + uses: actions/checkout@v2 + with: + path: wlan-testing + + - name: Checkout LANforge scripts + uses: actions/checkout@v2 + with: + path: wlan-lanforge-scripts + repository: Telecominfraproject/wlan-lanforge-scripts + + - name: import LANforge scripts + working-directory: wlan-testing + run: ./sync_repos.bash + + # build and push docker image + - name: docker login + run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }} + - name: build docker image + working-directory: wlan-testing + run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile . + - name: push docker image + run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} + + deploy-controller: + name: Deploy OpenWIFI Cloud SDK + runs-on: ubuntu-latest + outputs: + gateway_url: ${{ steps.gateway_url.outputs.value }} + sec_url: ${{ steps.sec_url.outputs.value }} + namespace: ${{ steps.namespace.outputs.value }} + steps: + - name: Checkout repo with Helm values + uses: actions/checkout@v2 + with: + path: wlan-testing + + - name: Prepare certificates from secrets + working-directory: wlan-testing/helm/ucentral + run: | + echo "${{ secrets.DIGICERT_CERT }}" | base64 -d > cert.pem + echo "${{ secrets.DIGICERT_KEY }}" | base64 -d > key.pem + + - name: Fetch kubeconfig + run: | + aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + - name: Set namespace output + id: namespace + run: echo "::set-output name=value::openwifi-${{ github.run_id }}" + + - name: Set gateway URL output + id: gateway_url + run: echo "::set-output name=value::gw-${{ github.run_id }}.cicd.lab.wlan.tip.build" + + - name: Set sec service URL output + id: sec_url + run: echo "::set-output name=value::sec-${{ github.run_id }}.cicd.lab.wlan.tip.build" + + - name: Deploy OpenWIFI Cloud SDK + working-directory: wlan-testing/helm/ucentral + run: | + export NAMESPACE=${{ github.run_id }} + export DEPLOY_METHOD=git + export CHART_VERSION=main + export OWGW_VERSION=master + export OWGWUI_VERSION=main + export OWSEC_VERSION=main + export OWFMS_VERSION=main + export OWPROV_VERSION=main + export OWPROVUI_VERSION=main + export VALUES_FILE_LOCATION=values.ucentral-qa.yaml + export RTTY_TOKEN=${{ secrets.RTTY_TOKEN }} + export OWGW_AUTH_USERNAME=${{ secrets.UCENTRALGW_AUTH_USERNAME }} + export OWGW_AUTH_PASSWORD=${{ secrets.UCENTRALGW_AUTH_PASSWORD }} + export OWFMS_S3_SECRET=${{ secrets.UCENTRALFMS_S3_SECRET }} + export OWFMS_S3_KEY=${{ secrets.UCENTRALFMS_S3_KEY }} + export CERT_LOCATION=cert.pem + export KEY_LOCATION=key.pem + ./deploy.sh + + - name: Show resource state on deployment failure + if: failure() + run: | + kubectl get pods --namespace openwifi-${{ github.run_id }} + kubectl get services --namespace openwifi-${{ github.run_id }} + kubectl get persistentvolumeclaims --namespace openwifi-${{ github.run_id }} + - name: Describe pods on deployment failure + if: failure() + run: | + kubectl describe pods --namespace openwifi-${{ github.run_id }} + - name: Describe services on deployment failure + if: failure() + run: | + kubectl describe services --namespace openwifi-${{ github.run_id }} + - name: Describe persistentvolumeclaims on deployment failure + if: failure() + run: | + kubectl describe persistentvolumeclaims --namespace openwifi-${{ github.run_id }} + + generate-matrix: + name: generate testbed matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: generate-matrix + id: set-matrix + run: | + TESTBEDS="${{ github.event.inputs.testbeds || 'basic-01,basic-02,basic-03,basic-04,basic-05,basic-06,basic-07,basic-08' }}" + TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') + TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') + echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" + + set-redirector-url: + needs: [ deploy-controller, generate-matrix ] + strategy: + fail-fast: false + matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} + runs-on: self-hosted + steps: + - name: checkout testing repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-testing + path: wlan-testing + ref: WIFI-3620 + + - name: checkout pki cert scripts repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-pki-cert-scripts + path: wlan-pki-cert-scripts + + - name: install dependencies + run: | + sudo apt-get install -y python3-pip + pip install paramiko scp allure-pytest + + - name: create configuration.py file + run: | + cat << EOF > configuration.py + ${{ secrets.LAB_CONFIGURATION }} + EOF + + - name: set redirector URL + env: + DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }} + run: | + for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3) + do + ./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id "${{ needs.deploy-controller.outputs.gateway_url }}" + current_redirector=$(./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id) + if [[ "$current_redirector" != "${{ needs.deploy-controller.outputs.gateway_url }}" ]]; then + echo "Current redirector in DigiCert ($current_redirector) is different from the required one (${{ needs.deploy-controller.outputs.gateway_url }})" + exit 1 + fi + done + + - name: factory reset APs + run: | + set -x + AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3) + for index in $(seq 0 $AP_LEN) + do + HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3) + JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3) + TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3) + PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3) + USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3) + PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3) + + cd wlan-testing/tools + python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r" + cd ../.. + done + + - name: wait for APs to come up again + run: sleep 300 + + test: + runs-on: ubuntu-latest + needs: [ build, generate-matrix, deploy-controller, set-redirector-url ] + strategy: + fail-fast: false + matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} + steps: + - name: get EKS access credentials + run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + - name: install Allure CLI tool + run: | + wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz + tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz + - name: set job name + id: job + run: echo "::set-output name=name::testing-${{ github.run_number }}" + + - name: prepare namespace + id: namespace + run: | + NAMESPACE="testing-${{ github.run_id }}-${{ matrix.testbed }}" + kubectl create ns $NAMESPACE + kubectl config set-context --current --namespace=$NAMESPACE + echo "::set-output name=name::${NAMESPACE}" + - name: create configuration.py secret + run: | + cat << EOF > configuration.py + ${{ secrets.LAB_CONFIGURATION }} + EOF + sed -i -r "s/'url': ('|\").*('|\")/'url': 'https:\/\/${{ needs.deploy-controller.outputs.sec_url }}:16001'/" configuration.py + cat configuration.py + kubectl create secret generic configuration --from-file=configuration=./configuration.py + - name: run sanity tests + run: | + cat </dev/null 2>&1 + done + echo "tests completed" + echo "downloading allure results..." + kubectl cp $podname:/tmp/allure-results allure-results >/dev/null 2>&1 + echo "waiting for pod to exit" + kubectl logs -f $podname >/dev/null 2>&1 + exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}") + - name: print logs + if: always() + run: | + podname=$(kubectl get pods --no-headers -o custom-columns=":metadata.name" -l job-name="${{ steps.job.outputs.name }}" | sed "s/pod\///") + kubectl logs $podname + - name: upload Allure results as artifact + if: always() + uses: actions/upload-artifact@v2 + with: + name: allure-results-${{ matrix.testbed }} + path: allure-results + + - name: cleanup + if: always() + run: | + kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true + + report: + runs-on: ubuntu-latest + needs: [ test, generate-matrix ] + if: always() + strategy: + max-parallel: 1 + fail-fast: false + matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} + steps: + - name: install Allure CLI tool + run: | + wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/${{ env.ALLURE_CLI_VERSION }}/allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz + tar -xzf allure-commandline-${{ env.ALLURE_CLI_VERSION }}.tgz + + - uses: actions/download-artifact@v2 + with: + name: allure-results-${{ matrix.testbed }} + path: allure-results + + - name: checkout testing repo + uses: actions/checkout@v2 + with: + path: wlan-testing + + - name: get reports branch + uses: actions/checkout@v2 + continue-on-error: true + with: + ref: gh-pages + path: reports + + - name: copy history into results + run: | + if [ -e "reports/sanity/${{ matrix.testbed }}/latest" ] ; then + cp -r reports/sanity/${{ matrix.testbed }}/latest/history/ allure-results/history + fi + + - name: add report metadata + run: | + cat << EOF >> allure-results/environment.properties + Testbed=${{ matrix.testbed }} + Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD) + CiRun.Id=${{ github.run_id }} + CiRun.Number=${{ github.run_number }} + CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + EOF + + - name: generate Allure report + run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate + + - name: upload Allure report as artifact + uses: actions/upload-artifact@v2 + with: + name: allure-report-${{ matrix.testbed }} + path: allure-report + + # doing this to be able to aggregate multiple reports together later on + - name: copy results into report + run: cp -r allure-results allure-report/results + + - name: copy new report + if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }} + run: | + mkdir -p reports/sanity/${{ matrix.testbed }} + cp -Tr allure-report reports/sanity/${{ matrix.testbed }}/${{ github.run_number }} + + - name: update latest symlink + if: ${{ (github.event.inputs.marker_expression || 'uc_sanity') == 'uc_sanity' }} + working-directory: reports/sanity/${{ matrix.testbed }} + run: ln -fns ${{ github.run_number }} latest + + - name: generate new index.html + run: python wlan-testing/.github/tools/generate_directory_index.py -r reports + + - name: commit reports update + working-directory: reports + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Automated deployment: $(date -u)" + + - name: push + if: github.ref == 'refs/heads/master' + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + directory: reports + + delete-docker-image: + needs: [ test ] + runs-on: ubuntu-latest + if: always() + steps: + - name: cleanup Docker image + run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}" + + destroy-controller: + needs: [ test ] + runs-on: ubuntu-latest + if: always() + steps: + - name: Checkout repo with Helm values + uses: actions/checkout@v2 + with: + path: wlan-testing + + - name: Fetch kubeconfig + run: | + aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} + + - name: Delete namespace + run: kubectl delete ns --ignore-not-found=true "openwifi-${{ github.run_id }}" + + reset-redirector-url: + needs: [ test, generate-matrix ] + if: always() + strategy: + fail-fast: false + matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} + runs-on: self-hosted + steps: + - name: checkout testing repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-testing + path: wlan-testing + ref: WIFI-3620 + + - name: checkout pki cert scripts repo + uses: actions/checkout@v2 + with: + repository: Telecominfraproject/wlan-pki-cert-scripts + path: wlan-pki-cert-scripts + + - name: install dependencies + run: | + pip install paramiko scp allure-pytest + + - name: create configuration.py file + run: | + cat << EOF > configuration.py + ${{ secrets.LAB_CONFIGURATION }} + EOF + + - name: reset redirector URL + env: + DIGICERT_API_KEY: ${{ secrets.DIGICERT_API_KEY }} + run: | + for id in $(echo -e 'from configuration import CONFIGURATION\nfor ap in CONFIGURATION["${{ matrix.testbed }}"]["access_point"]: print(ap["serial"])' | python3) + do + ./wlan-pki-cert-scripts/digicert-change-ap-redirector.sh $id gw-qa01.cicd.lab.wlan.tip.build + current_redirector=$(./wlan-pki-cert-scripts/digicert-get-ap-redirector.sh $id) + if [[ "$current_redirector" != "gw-qa01.cicd.lab.wlan.tip.build" ]]; then + echo "Current redirector in DigiCert ($current_redirector) is different from the required one (gw-qa01.cicd.lab.wlan.tip.build)" + exit 1 + fi + done + + - name: factory reset APs + run: | + AP_LEN=$(echo -e "from configuration import CONFIGURATION\nprint(len(CONFIGURATION['${{ matrix.testbed }}']['access_point']) - 1)" | python3) + for index in $(seq 0 $AP_LEN) + do + HOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['ip'])" | python3) + JUMPHOST=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost'])" | python3) + TTY=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['jumphost_tty'])" | python3) + PORT=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['port'])" | python3) + USERNAME=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['username'])" | python3) + PASSWORD=$(echo -e "from configuration import CONFIGURATION\nprint(CONFIGURATION['${{ matrix.testbed }}']['access_point'][$index]['password'])" | python3) + + cd wlan-testing/tools + python3 ap_tools.py --host $HOST --jumphost $JUMPHOST --tty $TTY --port $PORT --username $USERNAME --password $PASSWORD --cmd "jffs2reset -y -r" + cd ../.. + done + + - name: wait for APs to come up again + run: sleep 300 diff --git a/.github/workflows/ucentralgw-qa-deployment.yaml b/.github/workflows/ucentralgw-qa-deployment.yaml index 12b5c7b86..028fbe0f1 100644 --- a/.github/workflows/ucentralgw-qa-deployment.yaml +++ b/.github/workflows/ucentralgw-qa-deployment.yaml @@ -31,12 +31,12 @@ env: { "namespace": "qa01", "deploy_method": "git", - "chart_version": "main", - "owgw_version": "master", - "owsec_version": "main", - "owfms_version": "main", + "chart_version": "v2.3.0-RC1", + "owgw_version": "v2.3.0-RC1", + "owsec_version": "v2.3.0-RC1", + "owfms_version": "v2.3.0-RC1", "owprov_version": "main", - "owgwui_version": "main", + "owgwui_version": "v2.3.0-RC1", "owprovui_version": "main" } ]' diff --git a/helm/ucentral/deploy.sh b/helm/ucentral/deploy.sh index 2f3e5a0cc..47430275b 100755 --- a/helm/ucentral/deploy.sh +++ b/helm/ucentral/deploy.sh @@ -127,6 +127,7 @@ helm upgrade --install --create-namespace --wait --timeout 20m \ --set owprovui.ingresses.default.annotations."external-dns\.alpha\.kubernetes\.io/hostname"=provui-${NAMESPACE}.cicd.lab.wlan.tip.build \ --set owprovui.ingresses.default.hosts={provui-${NAMESPACE}.cicd.lab.wlan.tip.build} \ --set owprovui.public_env_variables.DEFAULT_UCENTRALSEC_URL=https://sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ + --set clustersysteminfo.public_env_variables.OWSEC=sec-${NAMESPACE}.cicd.lab.wlan.tip.build:16001 \ --set-file owgw.certs."restapi-cert\.pem"=$CERT_LOCATION \ --set-file owgw.certs."restapi-key\.pem"=$KEY_LOCATION \ --set-file owgw.certs."websocket-cert\.pem"=$CERT_LOCATION \ diff --git a/helm/ucentral/values.ucentral-qa.external-db.yaml b/helm/ucentral/values.ucentral-qa.external-db.yaml index 2ce286961..72311cda7 100644 --- a/helm/ucentral/values.ucentral-qa.external-db.yaml +++ b/helm/ucentral/values.ucentral-qa.external-db.yaml @@ -9,6 +9,7 @@ owgw: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16002,16003,17002" + external-dns.alpha.kubernetes.io/ttl: "60" configProperties: # -> Public part @@ -19,8 +20,13 @@ owgw: storage.type.postgresql.host: owgw-pgsql storage.type.postgresql.database: owgw - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: 100m + memory: 200Mi certs: restapi-ca.pem: | @@ -68,9 +74,15 @@ owsec: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16001,17001" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 15Mi + limits: + cpu: 100m + memory: 100Mi certs: restapi-ca.pem: | @@ -110,6 +122,15 @@ rttys: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "5912,5913" + external-dns.alpha.kubernetes.io/ttl: "60" + + resources: + requests: + cpu: 10m + memory: 15Mi + limits: + cpu: 100m + memory: 100Mi owgwui: services: @@ -126,6 +147,7 @@ owgwui: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285 alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}' + external-dns.alpha.kubernetes.io/ttl: "60" paths: - path: /* serviceName: owgwui @@ -134,6 +156,14 @@ owgwui: public_env_variables: ALLOW_UCENTRALSEC_CHANGE: false + resources: + requests: + cpu: 10m + memory: 30Mi + limits: + cpu: 10m + memory: 30Mi + owfms: services: owfms: @@ -145,9 +175,15 @@ owfms: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16004,17004" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 30Mi + limits: + cpu: 50m + memory: 80Mi certs: restapi-ca.pem: | @@ -185,9 +221,15 @@ owprov: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16005,17005" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 20Mi + limits: + cpu: 100m + memory: 100Mi certs: restapi-ca.pem: | @@ -229,6 +271,7 @@ owprovui: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285 alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}' + external-dns.alpha.kubernetes.io/ttl: "60" paths: - path: /* serviceName: owprovui @@ -237,6 +280,14 @@ owprovui: public_env_variables: ALLOW_UCENTRALSEC_CHANGE: false +# resources: +# requests: +# cpu: 10m +# memory: 30m +# limits: +# cpu: 100m +# memory: 100m + kafka: heapOpts: -Xmx512m -Xms512m resources: @@ -245,7 +296,11 @@ kafka: memory: 512Mi limits: cpu: 200m - memory: 700Mi + memory: 1Gi + readinessProbe: + initialDelaySeconds: 45 + livenessProbe: + initialDelaySeconds: 60 zookeeper: heapSize: 256 resources: @@ -255,3 +310,6 @@ kafka: limits: cpu: 200m memory: 384Mi + +clustersysteminfo: + enabled: true diff --git a/helm/ucentral/values.ucentral-qa.yaml b/helm/ucentral/values.ucentral-qa.yaml index c7acc66fc..5be5a7196 100644 --- a/helm/ucentral/values.ucentral-qa.yaml +++ b/helm/ucentral/values.ucentral-qa.yaml @@ -9,6 +9,7 @@ owgw: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16002,16003,17002" + external-dns.alpha.kubernetes.io/ttl: "60" configProperties: # -> Public part @@ -16,8 +17,13 @@ owgw: # rtty rtty.enabled: "true" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 100m + memory: 100Mi + limits: + cpu: 100m + memory: 200Mi certs: restapi-ca.pem: | @@ -55,9 +61,15 @@ owsec: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16001,17001" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 15Mi + limits: + cpu: 100m + memory: 100Mi certs: restapi-ca.pem: | @@ -97,6 +109,15 @@ rttys: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "5912,5913" + external-dns.alpha.kubernetes.io/ttl: "60" + + resources: + requests: + cpu: 10m + memory: 15Mi + limits: + cpu: 100m + memory: 100Mi owgwui: services: @@ -113,6 +134,7 @@ owgwui: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285 alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}' + external-dns.alpha.kubernetes.io/ttl: "60" paths: - path: /* serviceName: owgwui @@ -121,6 +143,14 @@ owgwui: public_env_variables: ALLOW_UCENTRALSEC_CHANGE: false + resources: + requests: + cpu: 10m + memory: 30Mi + limits: + cpu: 10m + memory: 30Mi + owfms: services: owfms: @@ -132,9 +162,15 @@ owfms: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16004,17004" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 30Mi + limits: + cpu: 50m + memory: 80Mi certs: restapi-ca.pem: | @@ -172,9 +208,15 @@ owprov: service.beta.kubernetes.io/aws-load-balancer-backend-protocol: ssl service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285" service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "16005,17005" + external-dns.alpha.kubernetes.io/ttl: "60" - public_env_variables: - READINESS_METHOD: systeminfo + resources: + requests: + cpu: 10m + memory: 20Mi + limits: + cpu: 100m + memory: 100Mi certs: restapi-ca.pem: | @@ -216,6 +258,7 @@ owprovui: alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:289708231103:certificate/bfa89c7a-5b64-4a8a-bcfe-ffec655b5285 alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]' alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_302"}}' + external-dns.alpha.kubernetes.io/ttl: "60" paths: - path: /* serviceName: owprovui @@ -224,6 +267,14 @@ owprovui: public_env_variables: ALLOW_UCENTRALSEC_CHANGE: false +# resources: +# requests: +# cpu: 10m +# memory: 30m +# limits: +# cpu: 100m +# memory: 100m + kafka: heapOpts: -Xmx512m -Xms512m resources: @@ -246,3 +297,6 @@ kafka: limits: cpu: 200m memory: 384Mi + +clustersysteminfo: + enabled: true diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 0833ba86e..94aba65ee 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -337,8 +337,11 @@ class APNOS: active = output.decode('utf-8').splitlines()[4].split(":")[1].replace(" ", "").replace(",", "") client.close() except Exception as e: - pytest.exit("ubus call ucentral status: error" + output) - print(e) + if output.__contains__(b'"connected":'): + pass + else: + pytest.exit("ubus call ucentral status: error" + str(output)) + print(e) connected, latest, active = "Error", "Error", "Error" return connected, latest, active diff --git a/libs/controller/controller_1x/controller.py b/libs/controller/controller_1x/controller.py index 0f5d20ed6..7bcf74844 100644 --- a/libs/controller/controller_1x/controller.py +++ b/libs/controller/controller_1x/controller.py @@ -66,7 +66,7 @@ class ConfigureController: class Controller(ConfigureController): """ - constructor for cloud_controller_tests library : can be used from pytest framework + constructor for cloud_controller_tests library """ def __init__(self, controller_data=None, customer_id=None): @@ -275,8 +275,7 @@ class Controller(ConfigureController): class ProfileUtility: """ - constructor for Access Point Utility library : can be used from pytest framework - to control Access Points + constructor for Access Point Utility library """ def __init__(self, sdk_client=None, controller_data=None, customer_id=None): diff --git a/libs/controller/controller_2x/controller.py b/libs/controller/controller_2x/controller.py index 2da52bf4d..cd7d69b3f 100644 --- a/libs/controller/controller_2x/controller.py +++ b/libs/controller/controller_2x/controller.py @@ -226,7 +226,7 @@ class FMSUtils: devices = self.get_device_set() model_name = "" for device in devices['deviceTypes']: - if str(device).__contains__(model): + if str(device).__eq__(model): model_name = device return model_name @@ -433,7 +433,7 @@ class UProfileUtility: "band": "5G", "country": "US", # "channel-mode": "HE", - "channel-width": 80, + "channel-width": 160, # "channel": "auto" }) diff --git a/libs/lanforge/lf_tests.py b/libs/lanforge/lf_tests.py index 766ab0e63..a8048b494 100644 --- a/libs/lanforge/lf_tests.py +++ b/libs/lanforge/lf_tests.py @@ -41,6 +41,7 @@ from lf_ap_auto_test import ApAutoTest from csv_to_influx import CSVtoInflux from influx2 import RecordInflux from lf_multipsk import MultiPsk +from lf_rvr_test import RvrTest class RunTest: @@ -478,7 +479,7 @@ class RunTest: influx.glob() return self.apstab_obj - + def ratevsrange(self, station_name=None, mode="BRIDGE", vlan_id=100, download_rate="85%", dut_name="TIP", upload_rate="0", duration="1m", instance_name="test_demo", raw_lines=None): if mode == "BRIDGE": @@ -763,7 +764,7 @@ if __name__ == '__main__': "influx_tag": ["basic-03", "ec420"], } lanforge_data = { - "ip": "192.168.200.80", + "ip": "192.168.200.10", "port": 8080, "ssh_port": 22, "2.4G-Radio": ["wiphy0"], @@ -777,8 +778,20 @@ if __name__ == '__main__': "AX-Station-Name": "ax" } obj = RunTest(lanforge_data=lanforge_data, debug=False, influx_params=influx_params) - obj.Client_Connect(ssid="ssid_wpa_5g_br", passkey="something", security="wpa", station_name=['sta0000']) - obj.dataplane(station_name=["sta0000"]) + upstream = lanforge_data['upstream'] + data = obj.staConnect.json_get("/port/all") + for i in data["interfaces"]: + if list(i.keys())[0] == "1.1.eth1.10": + print(i) + # print(dict(list(data['interfaces'])).keys()) + # print(obj.staConnect.json_get("/port/" + upstream.split(".")[0] + + # "/" + upstream.split(".")[1] + + # "/" + upstream.split(".")[2] + "/" + "10")) + # print("/port/" + upstream.split(".")[0] + + # "/" + upstream.split(".")[1] + + # "/" + upstream.split(".")[2] + "/" + "100") + # obj.Client_Connect(ssid="ssid_wpa_5g_br", passkey="something", security="wpa", station_name=['sta0000']) + # obj.dataplane(station_name=["sta0000"]) # a = obj.staConnect.json_get("/events/since/") # print(a) # print(obj.eap_connect.json_get("port/1/1/sta0000?fields=ap,ip")) diff --git a/libs/lanforge/lf_tools.py b/libs/lanforge/lf_tools.py index f5d02476f..83b2fc22e 100644 --- a/libs/lanforge/lf_tools.py +++ b/libs/lanforge/lf_tools.py @@ -18,7 +18,7 @@ sys.path.append(f"../lanforge/lanforge-scripts/py-scripts/tip-cicd-sanity") sys.path.append(f'../libs') sys.path.append(f'../libs/lanforge/') import allure - +from sta_connect2 import StaConnect2 from create_chamberview import CreateChamberview from create_chamberview_dut import DUT import time @@ -88,6 +88,7 @@ class ChamberView: self.exit_on_error = False self.dut_idx_mapping = {} self.ssid_list = [] + self.staConnect = StaConnect2(self.lanforge_ip, self.lanforge_port, debug_=self.debug) self.raw_line = [ ["profile_link " + self.upstream_resources + " upstream-dhcp 1 NA NA " + self.upstream_port.split(".") [2] + ",AUTO -1 NA"], @@ -148,10 +149,17 @@ class ChamberView: return self.CreateChamberview, self.scenario_name def add_vlan(self, vlan_ids=[]): + data = self.staConnect.json_get("/port/all") + flag = 0 for vlans in vlan_ids: - self.raw_line.append(["profile_link 1.1 " + "vlan-100 1 " + self.upstream_port - + " NA " + self.upstream_port.split(".")[2] + ",AUTO -1 " + str(vlans)]) - self.Chamber_View() + for i in data["interfaces"]: + if list(i.keys())[0] != self.upstream_port + "." + str(vlans): + flag = 1 + if flag == 1: + for vlans in vlan_ids: + self.raw_line.append(["profile_link 1.1 " + "vlan-100 1 " + self.upstream_port + + " NA " + self.upstream_port.split(".")[2] + ",AUTO -1 " + str(vlans)]) + self.Chamber_View() def add_stations(self, band="2G", num_stations="max", dut="NA", ssid_name=[]): idx = 0 @@ -281,7 +289,8 @@ class ChamberView: if df.empty == True: return "empty" else: - return df + result = df.to_string(index=False) + return result def attach_report_graphs(self, report_name=None, pdf_name="WIFI Capacity Test PDF Report"): relevant_path = "../reports/" + report_name + "/" diff --git a/tests/configuration.py b/tests/configuration.py index cf70dec02..d10b41d24 100644 --- a/tests/configuration.py +++ b/tests/configuration.py @@ -343,7 +343,7 @@ CONFIGURATION = { } } }, # checked - "advanced-02": { + "advanced-01": { "controller": { 'url':'https://sec-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller 'username': "tip@ucentral.com", @@ -353,7 +353,7 @@ CONFIGURATION = { { 'model': 'eap102', 'mode': 'wifi6', - 'serial': '903cb39d6958', + 'serial': '903cb3bd7335', 'jumphost': True, 'ip': "10.28.3.102", # 10.28.3.103 'username': "lanforge", @@ -366,13 +366,52 @@ CONFIGURATION = { "traffic_generator": { "name": "lanforge", "details": { - "ip": "10.28.3.26", + "ip": "10.28.3.24", "port": 8080, # 8080 "ssh_port": 22, "2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2","1.1.wiphy4"], "5G-Radio": ["1.1.wiphy1", "1.1.wiphy3", "1.1.wiphy5"], "AX-Radio": [], - "upstream": "1.1.eth2", + "upstream": "1.1.eth1", + "upstream_subnet": "10.28.2.1/24", + "uplink": "1.1.eth3", + "2.4G-Station-Name": "wlan0", + "5G-Station-Name": "wlan0", + "AX-Station-Name": "ax" + } + } + + }, + "advanced-02": { + "controller": { + 'url':'https://sec-qa01.cicd.lab.wlan.tip.build:16001', # API base url for the controller + 'username': "tip@ucentral.com", + 'password': 'openwifi', + }, + 'access_point': [ + { + 'model': 'eap102', + 'mode': 'wifi6', + 'serial': '903cb39d6958', + 'jumphost': True, + 'ip': "10.28.3.102", # 10.28.3.102 + 'username': "lanforge", + 'password': "pumpkin77", + 'port': 8803, # 22 + 'jumphost_tty': '/dev/ttyAP3', + 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/cig_wf194c/20210729-cig_wf194c-v2.0.0-rc2-02244b8-upgrade.bin" + } + ], + "traffic_generator": { + "name": "lanforge", + "details": { + "ip": "10.28.3.26", # 10.28.3.26 + "port": 8802, # 8080 + "ssh_port": 8804, + "2.4G-Radio": ["1.1.wiphy0", "1.1.wiphy2","1.1.wiphy4"], + "5G-Radio": ["1.1.wiphy1", "1.1.wiphy3", "1.1.wiphy5"], + "AX-Radio": [], + "upstream": "1.1.eth1", "upstream_subnet": "10.28.2.1/24", "uplink": "1.1.eth3", "2.4G-Station-Name": "wlan0", diff --git a/tests/e2e/advanced/spatial_consistency/wpa2_personal/__init__.py b/tests/e2e/advanced/spatial_consistency/wpa2_personal/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py b/tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py new file mode 100644 index 000000000..2dae5667a --- /dev/null +++ b/tests/e2e/advanced/spatial_consistency/wpa2_personal/test_bridge_spatial.py @@ -0,0 +1,1305 @@ +import pytest +import allure +import os +import time +import pandas as pd + +pytestmark = [pytest.mark.spatial_consistency, pytest.mark.bridge] + +setup_params_general = { + "mode": "BRIDGE", + "ssid_modes": { + "wpa2_personal": [ + {"ssid_name": "ssid_wpa2_2g", "appliedRadios": ["2G"], "security_key": "something"}, + {"ssid_name": "ssid_wpa2_5g", "appliedRadios": ["5G"], "security_key": "something"} + ] + }, + "rf": {}, + "radius": False +} +@pytest.mark.parametrize( + 'setup_profiles', + [setup_params_general], + indirect=True, + scope="class" +) +@pytest.mark.usefixtures("setup_profiles") +class Test_SpatialConsistency_Bridge(object): + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5052", name="WIFI-5052") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.nss1 + def test_nss1_wpa2_personal_2g_10db_0degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, create_lanforge_chamberview_dut, get_configuration ): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'],['attenuator2: 1.1.3059'], + ['attenuations: 100'],['attenuations2: 100'],['chamber: DUT-Chamber'], ['tt_deg: 0']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + #print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(60): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else : + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5070", name="WIFI-5070") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.nss2 + def test_nss2_wpa2_personal_2g_10db_0degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 0']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS2_RVR1", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(90): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5069", name="WIFI-5069") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree60 + def test_nss1_wpa2_personal_2g_10db_60degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 60']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree60", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(45): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5068", name="WIFI-5068") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree60_nss2 + def test_nss2_wpa2_personal_2g_10db_60degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 60']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree60", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(90): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5057", name="WIFI-5057") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree240_nss1 + def test_nss1_wpa2_personal_5g_10db_240degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 240']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree240_fiveg", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(250): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5066", name="WIFI-5066") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree0_nss2_10db + def test_nss2_wpa2_personal_5g_10db_0degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 0']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree0_fiveg", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(500): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5065", name="WIFI-5065") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree60_nss1_10db + def test_nss1_wpa2_personal_5g_10db_60degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 60']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree60_fiveg", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(250): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5064", name="WIFI-5064") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree60_nss2_10db + def test_nss2_wpa2_personal_5g_10db_60degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 60']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree60_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(500): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5063", name="WIFI-5063") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree120_nss1_10db + def test_nss1_wpa2_personal_2g_10db_120degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 120']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree120_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(45): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5062", name="WIFI-5062") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree120_nss2_10db + def test_nss2_wpa2_personal_2g_10db_120degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 120']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree120_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(90): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5061", name="WIFI-5061") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree240_nss1_10db + def test_nss1_wpa2_personal_2g_10db_240degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 240']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree240_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(45): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5060", name="WIFI-5060") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree240_nss2_10db + def test_nss1_wpa2_personal_2g_10db_240degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 240']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree240_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(90): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5059", name="WIFI-5059") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree120_nss1_10db + def test_nss1_wpa2_personal_5g_10db_120degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 120']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree120_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range ") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(250): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5058", name="WIFI-5058") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree120_nss2_10db + def test_nss2_wpa2_personal_5g_10db_120degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 120']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree120_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range ") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(500): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5056", name="WIFI-5056") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree240_nss2_10db + def test_nss2_wpa2_personal_5g_10db_240degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 240']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree240_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range ") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(500): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5055", name="WIFI-5055") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree300_nss1_10db + def test_nss1_wpa2_personal_2g_10db_300degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 300']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree300_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(45): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5055", name="WIFI-5055") + @pytest.mark.wpa2_personal + @pytest.mark.twog + @pytest.mark.degree300_nss1_10db + def test_nss1_wpa2_personal_2g_10db_300degree(self, setup_profiles, lf_tools, lf_test, station_names_twog, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][0] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "twog" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_twog, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 300']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_twog, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree300_twog_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range Test - UDP 2.4G") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_twog) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(45): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5020", name="WIFI-5020") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree300_nss1_10db + def test_nss1_wpa2_personal_5g_10db_300degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 1'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 300']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS1_RVR1_Degree300_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range ") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(250): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + @allure.testcase(url="https://telecominfraproject.atlassian.net/browse/WIFI-5019", name="WIFI-5019") + @pytest.mark.wpa2_personal + @pytest.mark.fiveg + @pytest.mark.degree300_nss2_10db + def test_nss2_wpa2_personal_5g_10db_300degree(self, setup_profiles, lf_tools, lf_test, station_names_fiveg, + create_lanforge_chamberview_dut, get_configuration): + profile_data = setup_params_general["ssid_modes"]["wpa2_personal"][1] + ssid_name = profile_data["ssid_name"] + security_key = profile_data["security_key"] + security = "wpa2" + mode = "BRIDGE" + band = "fiveg" + vlan = 1 + dut_name = create_lanforge_chamberview_dut + station = lf_test.Client_Connect(ssid=ssid_name, security=security, + passkey=security_key, mode=mode, band=band, + station_name=station_names_fiveg, vlan_id=vlan) + print("station", station) + val = [['modes: Auto'], ['pkts: MTU'], ['directions: DUT Transmit'], ['traffic_types:UDP'], + ['bandw_options: AUTO'], ['spatial_streams: 2'], ['attenuator: 1.1.3034'], ['attenuator2: 1.1.3059'], + ['attenuations: 100'], ['attenuations2: 100'], ['chamber: DUT-Chamber'], ['tt_deg: 300']] + if station: + time.sleep(3) + rvr_o = lf_test.ratevsrange(station_name=station_names_fiveg, mode=mode, + instance_name="SPATIAL_NSS2_RVR1_Degree300_fiveg_10db", + vlan_id=vlan, dut_name=dut_name, raw_lines=val) + report_name = rvr_o.report_name[0]['LAST']["response"].split(":::")[1].split("/")[-1] + print("report name ", report_name) + entries = os.listdir("../reports/" + report_name + '/') + print("entries", entries) + lf_tools.attach_report_graphs(report_name=report_name, + pdf_name="Rate vs Range ") + kpi = False + for i in entries: + if "kpi.csv" in i: + kpi = i + if kpi: + allure.attach.file(source="../reports/" + report_name + "/" + kpi, + name="kpi.csv") + + print("Test Completed... Cleaning up Stations") + lf_test.Client_disconnect(station_name=station_names_fiveg) + + kpi_val = lf_tools.read_kpi_file(column_name=["numeric-score"], dir_name=report_name) + print(type(kpi_val)) + print(str(kpi_val)) + val = kpi_val.split(" ") + print(val) + # print(type(val)) + print(val[5]) + if str(kpi_val) == "empty": + print("kpi is empty, station did not got ip, Test failed") + allure.attach(name="Kpi Data", body="station did not got ip Test failed.") + assert False + else: + if float(val[5]) > float(500): + print("Test passed successfully") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert True + else: + print(" valueTest faled due to lesser") + allure.attach(name="Kpi Data", body=str(kpi_val)) + assert False + else: + print("test failed due to no station ip") + assert False + + + + + + diff --git a/tests/e2e/basic/conftest.py b/tests/e2e/basic/conftest.py index 2bb310cd8..369a60b09 100644 --- a/tests/e2e/basic/conftest.py +++ b/tests/e2e/basic/conftest.py @@ -47,10 +47,9 @@ def create_lanforge_chamberview_dut(lf_tools): @pytest.fixture(scope="class") -def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, +def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtures_ver, reset_scenario_lf, instantiate_profile, get_markers, create_lanforge_chamberview_dut, lf_tools, get_security_flags, get_configuration, radius_info, get_apnos, radius_accounting_info): - lf_tools.reset_scenario() param = dict(request.param) # VLAN Setup @@ -84,8 +83,6 @@ def setup_profiles(request, setup_controller, testbed, get_equipment_ref, fixtur yield return_var - - @pytest.fixture(scope="session") def station_names_twog(request, get_configuration): station_names = [] @@ -101,6 +98,7 @@ def station_names_fiveg(request, get_configuration): station_names.append(get_configuration["traffic_generator"]["details"]["5G-Station-Name"] + "0" + str(i)) yield station_names + @pytest.fixture(scope="session") def station_names_ax(request, get_configuration): station_names = [] @@ -108,6 +106,7 @@ def station_names_ax(request, get_configuration): station_names.append(get_configuration["traffic_generator"]["details"]["AX-Station-Name"] + "0" + str(i)) yield station_names + @pytest.fixture(scope="session") def num_stations(request): num_sta = int(request.config.getini("num_stations")) @@ -131,3 +130,14 @@ def get_vlan_list(get_apnos, get_configuration): vlan_list = list(ap_ssh.get_vlan()) vlan_list.sort() yield vlan_list + + +@pytest.fixture(scope="session") +def reset_scenario_lf(request, lf_tools): + lf_tools.reset_scenario() + + def teardown_session(): + lf_tools.reset_scenario() + + request.addfinalizer(teardown_session) + yield "" diff --git a/tests/test_connectivity.py b/tests/test_connectivity.py index a9bcc2473..726924c58 100644 --- a/tests/test_connectivity.py +++ b/tests/test_connectivity.py @@ -52,7 +52,7 @@ class TestResources(object): class TestFMS(object): @pytest.mark.get_firmware_list - def test_fms_version_list(self, fixtures_ver, get_configuration): + def test_fms_version_list(self, fixtures_ver, get_configuration, get_ap_logs): PASS = [] for ap in get_configuration['access_point']: # get the latest branch @@ -135,18 +135,18 @@ class TestFMS(object): assert False not in PASS @pytest.mark.firmware_upgrade - def test_firmware_upgrade_request(self, firmware_upgrade): + def test_firmware_upgrade_request(self, firmware_upgrade, get_ap_logs): for update in firmware_upgrade: allure.attach(name='serial: ' + update[0], body="") assert True @pytest.mark.test_firmware_ap - def test_firmware_upgrade_status_AP(self, firmware_upgrade): + def test_firmware_upgrade_status_AP(self, firmware_upgrade, get_ap_logs): allure.attach(name="firmware Upgrade Status:", body="") assert True @pytest.mark.test_firmware_gw - def test_firmware_upgrade_status_gateway(self, get_apnos, get_configuration, setup_controller): + def test_firmware_upgrade_status_gateway(self, get_apnos, get_configuration, setup_controller, get_ap_logs): status = [] for ap in get_configuration['access_point']: ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")