From 01447ec56a500a3f857658d901eff92a48d5d6e5 Mon Sep 17 00:00:00 2001 From: Shivam Thakur <70829776+shivamcandela@users.noreply.github.com> Date: Mon, 23 Aug 2021 10:16:34 +0530 Subject: [PATCH 01/14] removed the compulsory performance marker from manual.yml --- .github/workflows/manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 9001964df..9ff05405c 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -116,7 +116,7 @@ jobs: - -c - | cd tests - pytest -m "performance and ${{ github.event.inputs.marker_expression }}" -s -vvv --testbed="${{ github.event.inputs.testbed }}" --skip-testrail --alluredir=/tmp/allure-results "${{ github.event.inputs.additional_args }}" + pytest -m "${{ github.event.inputs.marker_expression }}" -s -vvv --testbed="${{ github.event.inputs.testbed }}" --skip-testrail --alluredir=/tmp/allure-results "${{ github.event.inputs.additional_args }}" ret=\$? # sleep some time to be able to download the Allure results sleep 60 From 33651bbc21eee315eb6df54e53da74b67525bfaa Mon Sep 17 00:00:00 2001 From: saurabh Date: Mon, 23 Aug 2021 12:26:11 +0530 Subject: [PATCH 02/14] Test Summary Banner Changes Signed-off-by: saurabh --- tests/e2e/interOp/conftest.py | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tests/e2e/interOp/conftest.py b/tests/e2e/interOp/conftest.py index ae614f904..4453cecd5 100644 --- a/tests/e2e/interOp/conftest.py +++ b/tests/e2e/interOp/conftest.py @@ -692,32 +692,32 @@ def pytest_runtest_makereport(item, call): def pytest_sessionfinish(session, exitstatus): + if reporting_client is not None: + print() + skipped_amount = 0 + # print('Perfecto TestCase Execution Status:', exitstatus) + passed_amount = sum(1 for result in session.results.values() if result.passed) + failed_amount = sum(1 for result in session.results.values() if result.failed) + skipped_amount = sum(1 for result in session.results.values() if result.skipped) + # print(f'There are {passed_amount} passed and {failed_amount} failed tests') + TotalExecutedCount = failed_amount + passed_amount + skipped_amount - print() - skipped_amount = 0 - #print('Perfecto TestCase Execution Status:', exitstatus) - passed_amount = sum(1 for result in session.results.values() if result.passed) - failed_amount = sum(1 for result in session.results.values() if result.failed) - skipped_amount = sum(1 for result in session.results.values() if result.skipped) - # print(f'There are {passed_amount} passed and {failed_amount} failed tests') - TotalExecutedCount = failed_amount + passed_amount + skipped_amount - - print('\n------------------------------------') - print('Interop Perfecto TestCase Execution Summary') - print('------------------------------------') - print('Total TestCase Executed: ' + str(TotalExecutedCount)) - print('Total Passed: ' + str(passed_amount)) - print('Total Failed: ' + str(failed_amount)) - print('Total Skipped: ' + str(skipped_amount) + "\n") - - try: - for index in range(len(testCaseNameList)): - print(str(index+1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) - print(" ReportURL: " + str(testCaseReportURL[index])) - print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") - except Exception as e: - print('No Interop Test Cases Executed') - + print('\n------------------------------------') + print('TestCase Execution Summary') + print('------------------------------------') + print('Total TestCase Executed: ' + str(TotalExecutedCount)) + print('Total Passed: ' + str(passed_amount)) + print('Total Failed: ' + str(failed_amount)) + print('Total Skipped: ' + str(skipped_amount) + "\n") + try: + for index in range(len(testCaseNameList)): + print(str(index + 1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) + print(" ReportURL: " + str(testCaseReportURL[index])) + print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") + except Exception as e: + print('No Interop Test Cases Executed') + else: + pass print('------------------------------------------------------------------\n\n\n\n') @pytest.fixture(scope="function") From 9b29a29d86e1283eea7a11a8c3cb4f3bb372297f Mon Sep 17 00:00:00 2001 From: haricharan-jaka Date: Tue, 24 Aug 2021 14:35:36 +0530 Subject: [PATCH 03/14] Added cache_clear function in perfecto Android library --- libs/perfecto_libs/android_lib.py | 207 ++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) diff --git a/libs/perfecto_libs/android_lib.py b/libs/perfecto_libs/android_lib.py index 5b0424e7e..dc326a3b0 100644 --- a/libs/perfecto_libs/android_lib.py +++ b/libs/perfecto_libs/android_lib.py @@ -805,3 +805,210 @@ def verify_APconnMobileDevice_Android(request, profileNameSSID, setup_perfectoMo assert False closeApp(connData["appPackage-android"], setup_perfectoMobile) + + # Cache_clear Function +def cache_clear_android(request, setup_perfectoMobile, connData): + print("\n-------------------------------------") + print("Select Cache Clear") + print("-------------------------------------") + report = setup_perfectoMobile[1] + driver = setup_perfectoMobile[0] + + report.step_start("Switching Driver Context") + print("Switching Context to Native") + contexts = driver.contexts + driver.switch_to.context(contexts[0]) + + # Open Settings Application + openApp(connData["appPackage-android"], setup_perfectoMobile) + + deviceModelName = getDeviceModelName(setup_perfectoMobile) + print("Selected Device Model: " + deviceModelName) + + if deviceModelName != ("Pixel 4" and "Galaxy S9"): + try: + print("Clicking Search button") + report.step_start("Click Search") + conn_ele = driver.find_element_by_xpath("//*[@content-desc='Search']") + conn_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Search") + + try: + driver.implicitly_wait(30) + print("Entering Chrome in Search") + report.step_start("Entering text Chrome") + search_ele = driver.find_element_by_xpath("//*[@resource-id='com.android.settings.intelligence:id/search_src_text']") + search_ele.send_keys("chrome") + except Exception as e: + print("Exception: Entering chrome failed") + print(e) + + try: + driver.implicitly_wait(40) + print("Clicking Chrome App Info") + report.step_start("Click Chrome App Info") + chrome_ele = driver.find_element_by_xpath("//*[@text='Chrome']") + chrome_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Chrome") + + # Scroll Down + scrollDown(setup_perfectoMobile) + + try: + driver.implicitly_wait(30) + print("Clicking Storage") + report.step_start("Click Storage") + store_ele = driver.find_element_by_xpath("//*[@text='Storage']") + store_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Storage") + + try: + driver.implicitly_wait(30) + print("Clicking Clear Cache") + report.step_start("Click Clear Cache") + clear_ele = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/button2']") + clear_ele.click() + print("Cleared Cache") + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Clearcache") + + try: + driver.implicitly_wait(30) + print("Checking if cache cleared or not with 0B") + report.step_start("Checking if cache cleared or not with 0B") + check_ele = driver.find_element_by_xpath("//*[@text='0 B']") + if check_ele is not None: + return True + else: + return False + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Checking cache clear") + + elif deviceModelName == ("Pixel 4"): + # Pixel cache clear code + try: + print("Clicking Search button") + report.step_start("Click Search") + conn_ele = driver.find_element_by_xpath("//*[@class='android.widget.ImageButton']") + conn_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Search") + + try: + driver.implicitly_wait(30) + print("Entering Chrome in Search") + report.step_start("Entering text Chrome") + search_ele = driver.find_element_by_xpath("//*[@resource-id='android:id/search_src_text']") + search_ele.send_keys("chrome") + except Exception as e: + print("Exception: Entering chrome failed") + print(e) + + try: + driver.implicitly_wait(35) + print("Clicking Chrome App Info") + report.step_start("Click Chrome App Info") + chrom_ele = driver.find_element_by_xpath("//*[@text='Chrome']") + chrom_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Chrome") + + try: + driver.implicitly_wait(30) + print("Clicking Storage & cache") + report.step_start("Click Storage & cache") + store_ele = driver.find_element_by_xpath("//*[@text='Storage & cache']") + store_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Storage & cache") + + try: + driver.implicitly_wait(30) + print("Clicking Clear Cache") + report.step_start("Click Clear Cache") + clear_ele = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/button2']") + clear_ele.click() + print("Cleared cache") + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Clearcache") + + try: + driver.implicitly_wait(30) + print("Checking if cache cleared or not with 0B") + report.step_start("Checking if cache cleared or not with 0B") + store_ele = driver.find_element_by_xpath("//*[@text='0 B']") + if store_ele is not None: + return True + else: + return False + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Checking cache clear") + + else: + try: + print("Clicking Search button") + report.step_start("Click Search") + conn_ele = driver.find_element_by_xpath("//*[@content-desc='Search settings']") + conn_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Search") + + try: + driver.implicitly_wait(30) + print("Entering Chrome in Search") + report.step_start("Entering text Chrome") + search_ele = driver.find_element_by_xpath( + "//*[@resource-id='com.android.settings.intelligence:id/search_src_text']") + search_ele.send_keys("chrome") + except Exception as e: + print("Exception: Entering chrome failed") + print(e) + + try: + driver.implicitly_wait(40) + print("Clicking Chrome App Info") + report.step_start("Click Chrome App Info") + chrome_ele = driver.find_element_by_xpath("//*[@text='Chrome']") + chrome_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Chrome") + + # Scroll Down + scrollDown(setup_perfectoMobile) + + try: + driver.implicitly_wait(30) + print("Clicking Storage") + report.step_start("Click Storage") + store_ele = driver.find_element_by_xpath("//*[@text='Storage']") + store_ele.click() + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Storage") + + try: + driver.implicitly_wait(30) + print("Clicking Clear Cache") + report.step_start("Click Clear Cache") + clear_ele = driver.find_element_by_xpath("//*[@resource-id='com.android.settings:id/button2']") + clear_ele.click() + print("Cleared Cache") + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Click Clearcache") + + try: + driver.implicitly_wait(30) + print("Checking if cache cleared or not with 0B") + report.step_start("Checking if cache cleared or not with 0B") + check_ele = driver.find_element_by_xpath("//*[@text='0 B']") + if check_ele is not None: + return True + else: + return False + except NoSuchElementException: + print("Exception: Verify Xpath - Update/check Xpath for Checking cache clear") + + + closeApp(connData["appPackage-android"], setup_perfectoMobile) \ No newline at end of file From 5a97227ff0b84545fc6f1eedf243d14327d49e92 Mon Sep 17 00:00:00 2001 From: saurabh Date: Tue, 24 Aug 2021 17:45:30 +0530 Subject: [PATCH 04/14] Test Summary Banner Changes Signed-off-by: saurabh --- tests/e2e/interOp/conftest.py | 51 ++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/tests/e2e/interOp/conftest.py b/tests/e2e/interOp/conftest.py index 4453cecd5..fa719a112 100644 --- a/tests/e2e/interOp/conftest.py +++ b/tests/e2e/interOp/conftest.py @@ -692,31 +692,34 @@ def pytest_runtest_makereport(item, call): def pytest_sessionfinish(session, exitstatus): - if reporting_client is not None: - print() - skipped_amount = 0 - # print('Perfecto TestCase Execution Status:', exitstatus) - passed_amount = sum(1 for result in session.results.values() if result.passed) - failed_amount = sum(1 for result in session.results.values() if result.failed) - skipped_amount = sum(1 for result in session.results.values() if result.skipped) - # print(f'There are {passed_amount} passed and {failed_amount} failed tests') - TotalExecutedCount = failed_amount + passed_amount + skipped_amount + try: + if reporting_client is not None: + print() + skipped_amount = 0 + # print('Perfecto TestCase Execution Status:', exitstatus) + passed_amount = sum(1 for result in session.results.values() if result.passed) + failed_amount = sum(1 for result in session.results.values() if result.failed) + skipped_amount = sum(1 for result in session.results.values() if result.skipped) + # print(f'There are {passed_amount} passed and {failed_amount} failed tests') + TotalExecutedCount = failed_amount + passed_amount + skipped_amount - print('\n------------------------------------') - print('TestCase Execution Summary') - print('------------------------------------') - print('Total TestCase Executed: ' + str(TotalExecutedCount)) - print('Total Passed: ' + str(passed_amount)) - print('Total Failed: ' + str(failed_amount)) - print('Total Skipped: ' + str(skipped_amount) + "\n") - try: - for index in range(len(testCaseNameList)): - print(str(index + 1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) - print(" ReportURL: " + str(testCaseReportURL[index])) - print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") - except Exception as e: - print('No Interop Test Cases Executed') - else: + print('\n------------------------------------') + print('TestCase Execution Summary') + print('------------------------------------') + print('Total TestCase Executed: ' + str(TotalExecutedCount)) + print('Total Passed: ' + str(passed_amount)) + print('Total Failed: ' + str(failed_amount)) + print('Total Skipped: ' + str(skipped_amount) + "\n") + try: + for index in range(len(testCaseNameList)): + print(str(index + 1) + ") " + str(testCaseNameList[index]) + " : " + str(testCaseStatusList[index])) + print(" ReportURL: " + str(testCaseReportURL[index])) + print(" FailureMsg: " + str(testCaseErrorMsg[index]) + "\n") + except Exception as e: + print('No Interop Test Cases Executed') + else: + pass + except Exception as e: pass print('------------------------------------------------------------------\n\n\n\n') From 8a14413c39efd500d1456fb23bc93fabdf518edc Mon Sep 17 00:00:00 2001 From: Jaspreet Sachdev Date: Wed, 25 Aug 2021 16:34:08 -0400 Subject: [PATCH 05/14] Added 2.x interop workflow --- .github/workflows/uc_interop.yml | 290 +++++++++++++++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 .github/workflows/uc_interop.yml diff --git a/.github/workflows/uc_interop.yml b/.github/workflows/uc_interop.yml new file mode 100644 index 000000000..473f9827e --- /dev/null +++ b/.github/workflows/uc_interop.yml @@ -0,0 +1,290 @@ +name: 2.x interop testing + +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: + additional_markers: + default: '' + description: 'Pass additional markers that will be and-combined with the interop marker, e.g. "twog or fiveg" -> "interop and twog or fiveg"' + required: false + schedule: + - cron: '15 0 * * *' + +defaults: + run: + shell: bash + +jobs: + build: + runs-on: ubuntu-latest + steps: + # checkout needed repositories + - name: Checkout Testing repo + uses: actions/checkout@v2 + with: + path: wlan-testing + + - name: Checkout LANforge scripts + uses: actions/checkout@v2 + with: + path: wlan-lanforge-scripts + repository: Telecominfraproject/wlan-lanforge-scripts + + - name: import LANforge scripts + working-directory: wlan-testing + run: ./sync_repos.bash + + # build and push docker image + - name: docker login + run: docker login ${{ env.DOCKER_SERVER }} -u ${{ env.DOCKER_USER_NAME }} -p ${{ env.DOCKER_USER_PASSWORD }} + - name: build docker image + working-directory: wlan-testing + run: docker build -t ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} -f docker/Dockerfile . + - name: push docker image + run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} + + + test: + runs-on: ubuntu-latest + needs: [ build ] + strategy: + fail-fast: false + max-parallel: 1 + matrix: + test_type: [android, ios] + + outputs: + additional_markers: ${{ steps.marker.outputs.additional }} + + 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::2-x-interop-ci-${{ github.run_number }}-${{ matrix.test_type }}" + + - name: create configuration.py secret + run: | + cat << EOF > configuration.py + ${{ secrets.LAB_CONFIGURATION }} + EOF + kubectl create secret generic configuration --from-file=configuration=./configuration.py + + - name: calculate marker expression + id: marker + run: | + if [ "${{ matrix.test_type }}" = "android" ]; then + MARKER_EXPRESSION="interop_and" + else + MARKER_EXPRESSION="interop_ios" + fi + + ADDITIONAL_MARKERS="${{ github.event.inputs.additional_markers || '' }}" + if [ ! -z "$ADDITIONAL_MARKERS" ]; then + MARKER_EXPRESSION="$MARKER_EXPRESSION and ${ADDITIONAL_MARKERS}" + fi + + echo "::set-output name=additional::${ADDITIONAL_MARKERS}" + echo "::set-output name=expression::${MARKER_EXPRESSION}" + + - name: run interop 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.test_type }} + path: allure-results + + - name: cleanup + if: ${{ always() }} + run: | + kubectl delete job "${{ steps.job.outputs.name }}" --wait=true --ignore-not-found=true + kubectl delete secret configuration --wait=true --ignore-not-found=true + + report: + needs: [ test ] + if: always() + runs-on: ubuntu-latest + 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-android + path: allure-results-android + + - uses: actions/download-artifact@v2 + with: + name: allure-results-ios + path: allure-results-ios + + - 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/interop/2.x-interop/latest" ] ; then + cp -r reports/interop/2.x-interop/latest/history/ allure-results-ios/history + cp -r reports/interop/2.x-interop/latest/history/ allure-results-android/history + fi + + - name: add report metadata + run: | + cat << EOF >> allure-results-android/environment.properties + Testbed=interop + Tests.CommitId=$(cd wlan-testing && git rev-parse --short HEAD) + CiRun.Id=${{ github.run_id }} + CiRun.Number=${{ github.run_number }} + CiRun.Url=https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + EOF + + - name: generate Allure report + run: allure-${{ env.ALLURE_CLI_VERSION }}/bin/allure generate allure-results-android allure-results-ios + + - name: upload Allure report as artifact + uses: actions/upload-artifact@v2 + with: + name: allure-report + path: allure-report + + # doing this to be able to aggregate multiple reports together later on + - name: copy results into report + run: | + mkdir -p allure-report/results + cp -r allure-results-android/* allure-report/results + cp -r allure-results-ios/* allure-report/results + + - name: copy new report + run: | + mkdir -p reports/interop/2.x-interop + cp -Tr allure-report reports/interop/2.x-interop/${{ github.run_number }} + + - name: update latest symlink + working-directory: reports/interop/2.x-interop + run: ln -fns ${{ github.run_number }} latest + + - name: generate new index.html + run: python wlan-testing/.github/tools/generate_directory_index.py -r reports + + - name: commit reports update + working-directory: reports + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git add . + git commit -m "Automated deployment: $(date -u)" + + - name: push + if: github.ref == 'refs/heads/master' && needs.test.outputs.additional_markers == '' + uses: ad-m/github-push-action@v0.6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + branch: gh-pages + directory: reports + + cleanup: + needs: [ test ] + runs-on: ubuntu-latest + if: always() + steps: + - name: cleanup Docker image + run: curl -u${{ env.DOCKER_USER_NAME }}:${{ env.DOCKER_USER_PASSWORD }} -X DELETE "https://tip.jfrog.io/artifactory/tip-wlan-cloud-docker-repo/cloud-sdk-nightly/${{ github.run_id }}" From af6f7dedae8d75f75806cf4b64f16381d9fce33a Mon Sep 17 00:00:00 2001 From: jaspreetsachdev Date: Wed, 25 Aug 2021 16:57:40 -0400 Subject: [PATCH 06/14] Renamed the name of the workflow --- .github/workflows/uc_sanity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/uc_sanity.yml b/.github/workflows/uc_sanity.yml index 4334f2e20..f7ddab021 100644 --- a/.github/workflows/uc_sanity.yml +++ b/.github/workflows/uc_sanity.yml @@ -1,4 +1,4 @@ -name: uCentral sanity testing +name: 2.x sanity testing env: # thirdparties DOCKER_SERVER: tip-tip-wlan-cloud-docker-repo.jfrog.io From 420648a8f67ffa8030374a45d0ba6875c24cf781 Mon Sep 17 00:00:00 2001 From: oblom0v Date: Fri, 27 Aug 2021 15:38:41 +0200 Subject: [PATCH 07/14] Increase Kafka memory limit since it is reached pretty fast --- helm/ucentral/values.ucentral-qa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/ucentral/values.ucentral-qa.yaml b/helm/ucentral/values.ucentral-qa.yaml index f96a8a8fb..89fa58f3a 100644 --- a/helm/ucentral/values.ucentral-qa.yaml +++ b/helm/ucentral/values.ucentral-qa.yaml @@ -166,7 +166,7 @@ kafka: memory: 512Mi limits: cpu: 200m - memory: 700Mi + memory: 1Gi zookeeper: heapSize: 256 resources: From 14cefd9b0a8dd3129eedffec8ac754dd20306577 Mon Sep 17 00:00:00 2001 From: oblom0v Date: Fri, 27 Aug 2021 16:19:52 +0200 Subject: [PATCH 08/14] Set fixed RC versions for uCentral dev/qa instances --- .github/workflows/ucentralgw-dev-deployment.yaml | 10 +++++----- .github/workflows/ucentralgw-qa-deployment.yaml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ucentralgw-dev-deployment.yaml b/.github/workflows/ucentralgw-dev-deployment.yaml index 9854b9506..87a3b619d 100644 --- a/.github/workflows/ucentralgw-dev-deployment.yaml +++ b/.github/workflows/ucentralgw-dev-deployment.yaml @@ -29,11 +29,11 @@ env: { "namespace": "dev01", "deploy_method": "git", - "chart_version": "main", - "ucentralgw_version": "master", - "ucentralsec_version": "main", - "ucentralfms_version": "main", - "ucentralgwui_version": "main" + "chart_version": "2.1.0-RC1", + "ucentralgw_version": "v2.1.0-RC1", + "ucentralsec_version": "v2.1.0-RC1", + "ucentralfms_version": "v2.1.0-RC1", + "ucentralgwui_version": "v2.1.0-RC1" } ]' diff --git a/.github/workflows/ucentralgw-qa-deployment.yaml b/.github/workflows/ucentralgw-qa-deployment.yaml index bfc2fc553..41f6b3e95 100644 --- a/.github/workflows/ucentralgw-qa-deployment.yaml +++ b/.github/workflows/ucentralgw-qa-deployment.yaml @@ -29,11 +29,11 @@ env: { "namespace": "qa01", "deploy_method": "git", - "chart_version": "main", - "ucentralgw_version": "master", - "ucentralsec_version": "main", - "ucentralfms_version": "main", - "ucentralgwui_version": "main" + "chart_version": "2.1.0-RC1", + "ucentralgw_version": "v2.1.0-RC1", + "ucentralsec_version": "v2.1.0-RC1", + "ucentralfms_version": "v2.1.0-RC1", + "ucentralgwui_version": "v2.1.0-RC1" } ]' From 7908dfbae754048d13e912f67a7744ccbc926391 Mon Sep 17 00:00:00 2001 From: oblom0v Date: Fri, 27 Aug 2021 16:29:37 +0200 Subject: [PATCH 09/14] Fix chart_version --- .github/workflows/ucentralgw-dev-deployment.yaml | 2 +- .github/workflows/ucentralgw-qa-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ucentralgw-dev-deployment.yaml b/.github/workflows/ucentralgw-dev-deployment.yaml index 87a3b619d..da18504a7 100644 --- a/.github/workflows/ucentralgw-dev-deployment.yaml +++ b/.github/workflows/ucentralgw-dev-deployment.yaml @@ -29,7 +29,7 @@ env: { "namespace": "dev01", "deploy_method": "git", - "chart_version": "2.1.0-RC1", + "chart_version": "v2.1.0-RC1", "ucentralgw_version": "v2.1.0-RC1", "ucentralsec_version": "v2.1.0-RC1", "ucentralfms_version": "v2.1.0-RC1", diff --git a/.github/workflows/ucentralgw-qa-deployment.yaml b/.github/workflows/ucentralgw-qa-deployment.yaml index 41f6b3e95..3331d051c 100644 --- a/.github/workflows/ucentralgw-qa-deployment.yaml +++ b/.github/workflows/ucentralgw-qa-deployment.yaml @@ -29,7 +29,7 @@ env: { "namespace": "qa01", "deploy_method": "git", - "chart_version": "2.1.0-RC1", + "chart_version": "v2.1.0-RC1", "ucentralgw_version": "v2.1.0-RC1", "ucentralsec_version": "v2.1.0-RC1", "ucentralfms_version": "v2.1.0-RC1", From 7303123112bea22c1ec6b1b785965356ba116792 Mon Sep 17 00:00:00 2001 From: oblom0v Date: Fri, 27 Aug 2021 17:30:39 +0200 Subject: [PATCH 10/14] Increase initial delay for probes to grant Kafka more startup time --- helm/ucentral/values.ucentral-qa.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helm/ucentral/values.ucentral-qa.yaml b/helm/ucentral/values.ucentral-qa.yaml index 89fa58f3a..2d12ce8e9 100644 --- a/helm/ucentral/values.ucentral-qa.yaml +++ b/helm/ucentral/values.ucentral-qa.yaml @@ -176,3 +176,7 @@ kafka: limits: cpu: 200m memory: 384Mi + readinessProbe: + initialDelaySeconds: 45 + livenessProbe: + initialDelaySeconds: 60 From d56bcfcf86d56aa9d1a633a1e4b364633ea7c85d Mon Sep 17 00:00:00 2001 From: oblom0v Date: Fri, 27 Aug 2021 17:46:52 +0200 Subject: [PATCH 11/14] Fix previous commit --- helm/ucentral/values.ucentral-qa.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helm/ucentral/values.ucentral-qa.yaml b/helm/ucentral/values.ucentral-qa.yaml index 2d12ce8e9..e9ce642a2 100644 --- a/helm/ucentral/values.ucentral-qa.yaml +++ b/helm/ucentral/values.ucentral-qa.yaml @@ -167,6 +167,10 @@ kafka: limits: cpu: 200m memory: 1Gi + readinessProbe: + initialDelaySeconds: 45 + livenessProbe: + initialDelaySeconds: 60 zookeeper: heapSize: 256 resources: @@ -176,7 +180,3 @@ kafka: limits: cpu: 200m memory: 384Mi - readinessProbe: - initialDelaySeconds: 45 - livenessProbe: - initialDelaySeconds: 60 From 9ac4709208fcc411f0b212812314a91e5372b909 Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Sun, 29 Aug 2021 10:53:52 +0530 Subject: [PATCH 12/14] added tx power reporting Signed-off-by: shivamcandela --- libs/apnos/apnos.py | 40 ++++++++++++++++++++++++++++++++++++++-- tests/fixtures_2x.py | 19 +++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/libs/apnos/apnos.py b/libs/apnos/apnos.py index 7b8457186..f9f36616b 100644 --- a/libs/apnos/apnos.py +++ b/libs/apnos/apnos.py @@ -457,6 +457,40 @@ class APNOS: print(e) return iwinfo_bssid_data + def iwinfo(self): + client = self.ssh_cli_connect() + cmd = "iwinfo" + if self.mode: + cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read().replace(b":~# iwinfo", b"").decode('utf-8') + o = output + return o + + def gettxpower(self): + client = self.ssh_cli_connect() + cmd = "iw dev | grep txpower" + if self.mode: + cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read().replace(b":~# iw dev | grep txpower", b"").decode('utf-8') + tx_power = output.replace("\t\t", "").split("\r\n") + tx_power.remove('') + tx_power.remove('\n') + cmd = "iw dev | grep Interface" + if self.mode: + cmd = f"cd ~/cicd-git/ && ./openwrt_ctl.py {self.owrt_args} -t {self.tty} --action " \ + f"cmd --value \"{cmd}\" " + stdin, stdout, stderr = client.exec_command(cmd) + output = stdout.read().replace(b":~# iw dev | grep Interface", b"").decode('utf-8') + name = output.replace("\t", "").splitlines() + name.remove('') + name.pop(-1) + return tx_power, name + + def logread(self): try: client = self.ssh_cli_connect() @@ -537,5 +571,7 @@ if __name__ == '__main__': 'version': "https://tip.jfrog.io/artifactory/tip-wlan-ap-firmware/uCentral/edgecore_eap102/20210625-edgecore_eap102-uCentral-trunk-4225122-upgrade.bin" } var = APNOS(credentials=obj, sdk="2.x") - x = var.get_iwinfo() - print(x) + tx_power, name = var.gettxpower() + allure.attach(name="interface name: ", body=str(name)) + allure.attach(name="tx power: ", body=str(tx_power)) + print(tx_power, name) diff --git a/tests/fixtures_2x.py b/tests/fixtures_2x.py index bd9effe46..7787561d7 100644 --- a/tests/fixtures_2x.py +++ b/tests/fixtures_2x.py @@ -286,8 +286,20 @@ class Fixtures_2x: print("AP is Not Broadcasting Applied Config") allure.attach(name="Failed to Apply Config : Active Config in AP : ", body=str(ap_config_active)) time.sleep(10) + try: + iwinfo = ap_ssh.iwinfo() + allure.attach(name="iwinfo: ", body=str(iwinfo)) + + tx_power, name = ap_ssh.gettxpower() + allure.attach(name="interface name: ", body=str(name)) + allure.attach(name="tx power: ", body=str(tx_power)) + except: + pass ap_logs = ap_ssh.logread() allure.attach(body=ap_logs, name="AP Logs: ") + + + try: ssid_info_sdk = instantiate_profile_obj.get_ssid_info() ap_wifi_data = ap_ssh.get_iwinfo() @@ -321,6 +333,13 @@ class Fixtures_2x: pass def teardown_session(): + iwinfo = ap_ssh.iwinfo() + allure.attach(name="iwinfo: ", body=str(iwinfo)) + + tx_power, name = ap_ssh.gettxpower() + allure.attach(name="interface name: ", body=str(name)) + allure.attach(name="tx power: ", body=str(tx_power)) + ap_logs = ap_ssh.logread() allure.attach(body=ap_logs, name="AP Logs after test completion") print("\nTeardown") From b4a4f711e2e53d9fc638f01d1d0cab0db6c99462 Mon Sep 17 00:00:00 2001 From: shivamcandela Date: Sun, 29 Aug 2021 13:10:53 +0530 Subject: [PATCH 13/14] fix: tx power additional log logic Signed-off-by: shivamcandela --- tests/fixtures_2x.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/fixtures_2x.py b/tests/fixtures_2x.py index 7787561d7..47c98909a 100644 --- a/tests/fixtures_2x.py +++ b/tests/fixtures_2x.py @@ -290,9 +290,9 @@ class Fixtures_2x: iwinfo = ap_ssh.iwinfo() allure.attach(name="iwinfo: ", body=str(iwinfo)) - tx_power, name = ap_ssh.gettxpower() - allure.attach(name="interface name: ", body=str(name)) - allure.attach(name="tx power: ", body=str(tx_power)) + # tx_power, name = ap_ssh.gettxpower() + # allure.attach(name="interface name: ", body=str(name)) + # allure.attach(name="tx power: ", body=str(tx_power)) except: pass ap_logs = ap_ssh.logread() @@ -336,9 +336,9 @@ class Fixtures_2x: iwinfo = ap_ssh.iwinfo() allure.attach(name="iwinfo: ", body=str(iwinfo)) - tx_power, name = ap_ssh.gettxpower() - allure.attach(name="interface name: ", body=str(name)) - allure.attach(name="tx power: ", body=str(tx_power)) + # tx_power, name = ap_ssh.gettxpower() + # allure.attach(name="interface name: ", body=str(name)) + # allure.attach(name="tx power: ", body=str(tx_power)) ap_logs = ap_ssh.logread() allure.attach(body=ap_logs, name="AP Logs after test completion") From 30c7acab1b9fa82ced795dab234fddb39e98f7a5 Mon Sep 17 00:00:00 2001 From: sushant Date: Sun, 29 Aug 2021 14:19:43 +0530 Subject: [PATCH 14/14] - removed openroaming from execution Signed-off-by: Sushant Bawiskar --- .../OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py | 3 ++- .../iOS/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py | 3 ++- .../iOS/OpenRoamingPassPoint/test_OpenRoaming_NatMode.py | 3 ++- .../iOS/OpenRoamingPassPoint/test_OpenRoaming_vlan_mode.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/e2e/interOp/android/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py b/tests/e2e/interOp/android/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py index cd6ae3b22..7165fd0f5 100644 --- a/tests/e2e/interOp/android/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py +++ b/tests/e2e/interOp/android/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py @@ -16,7 +16,8 @@ import allure if 'perfecto_libs' not in sys.path: sys.path.append(f'../libs/perfecto_libs') -pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.openRoaming, pytest.mark.bridge] +# pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.android, pytest.mark.interop_and, pytest.mark.openRoaming, pytest.mark.bridge] +pytestmark = [pytest.mark.openRoaming] from android_lib import closeApp, set_APconnMobileDevice_android, verify_APconnMobileDevice_Android, deleteOpenRoamingInstalledProfile, downloadInstallOpenRoamingProfile, verifyUploadDownloadSpeed_android, Toggle_AirplaneMode_android, ForgetWifiConnection, openApp diff --git a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py index b79e45c23..79d1577c6 100644 --- a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py +++ b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_BridgeMode.py @@ -27,7 +27,8 @@ import allure if 'perfecto_libs' not in sys.path: sys.path.append(f'../libs/perfecto_libs') -pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.bridge] +# pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.bridge] +pytestmark = [pytest.mark.openRoaming] from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown diff --git a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_NatMode.py b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_NatMode.py index 84df3c741..5c74b9e15 100644 --- a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_NatMode.py +++ b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_NatMode.py @@ -28,7 +28,8 @@ import allure if 'perfecto_libs' not in sys.path: sys.path.append(f'../libs/perfecto_libs') -pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.nat] +# pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.nat] +pytestmark = [pytest.mark.openRoaming] from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown diff --git a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_vlan_mode.py b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_vlan_mode.py index 7398ff623..76c5d28d3 100644 --- a/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_vlan_mode.py +++ b/tests/e2e/interOp/iOS/OpenRoamingPassPoint/test_OpenRoaming_vlan_mode.py @@ -27,7 +27,8 @@ import allure if 'perfecto_libs' not in sys.path: sys.path.append(f'../libs/perfecto_libs') -pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.vlan] +# pytestmark = [pytest.mark.sanity, pytest.mark.interop, pytest.mark.interop_ios, pytest.mark.ios, pytest.mark.openRoaming, pytest.mark.vlan] +pytestmark = [pytest.mark.openRoaming] from iOS_lib import closeApp, openApp, ForgetProfileWifiConnection, deleteOpenRoamingInstalledProfile, verifyUploadDownloadSpeediOS, downloadInstallOpenRoamingProfile, ForgetWifiConnection, Toggle_AirplaneMode_iOS, set_APconnMobileDevice_iOS, verify_APconnMobileDevice_iOS, Toggle_WifiMode_iOS, tearDown