mirror of
				https://github.com/Telecominfraproject/wlan-testing.git
				synced 2025-10-31 10:57:50 +00:00 
			
		
		
		
	add AP model matrix (#205)
This commit is contained in:
		
							
								
								
									
										132
									
								
								.github/workflows/quali.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										132
									
								
								.github/workflows/quali.yml
									
									
									
									
										vendored
									
									
								
							| @@ -19,30 +19,31 @@ env: | |||||||
| on: | on: | ||||||
|   workflow_dispatch: |   workflow_dispatch: | ||||||
|     inputs: |     inputs: | ||||||
|       ucentral_revision: |       openwifi_revision: | ||||||
|         required: true |         required: true | ||||||
|         default: 'main' |         default: 'main' | ||||||
|         description: 'revision of the uCentral Helm chart' |         description: 'revision of the Open Wifi Helm chart' | ||||||
|       ucentral_gw_revision: |       openwifi_gw_revision: | ||||||
|         required: true |         required: true | ||||||
|         default: 'master' |         default: 'master' | ||||||
|         description: 'revision of the uCentral gateway service' |         description: 'revision of the Open Wifi gateway service' | ||||||
|       ucentral_sec_revision: |       openwifi_sec_revision: | ||||||
|         required: true |         required: true | ||||||
|         default: 'main' |         default: 'main' | ||||||
|         description: 'revision of the uCentral security service' |         description: 'revision of the Open Wifi security service' | ||||||
|       ucentral_fms_revision: |       openwifi_fms_revision: | ||||||
|         required: true |         required: true | ||||||
|         default: 'main' |         default: 'main' | ||||||
|         description: 'revision of the uCentral fms service' |         description: 'revision of the Open Wifi fms service' | ||||||
|       ucentral_ui_revision: |       openwifi_ui_revision: | ||||||
|         required: true |         required: true | ||||||
|         default: 'main' |         default: 'main' | ||||||
|         description: 'revision of the uCentral UI' |         description: 'revision of the Open Wifi UI' | ||||||
|       ap_model: |       ap_models: | ||||||
|         required: true |         required: true | ||||||
|         default: 'ec420' |         #default: 'EC420,EAP101,ECW5211,ECW5410' | ||||||
|         description: 'the AP model to test' |         default: 'EC420,ECW5211' | ||||||
|  |         description: 'the AP models to test' | ||||||
|       ap_version: |       ap_version: | ||||||
|         required: true |         required: true | ||||||
|         default: 'latest' |         default: 'latest' | ||||||
| @@ -52,51 +53,40 @@ jobs: | |||||||
|   vars: |   vars: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     outputs: |     outputs: | ||||||
|       ucentral_revision: ${{ steps.vars.outputs.ucentral}} |       openwifi_revision: ${{ steps.vars.outputs.openwifi}} | ||||||
|       ucentral_gw_revision: ${{ steps.vars.outputs.gw}} |       openwifi_gw_revision: ${{ steps.vars.outputs.gw}} | ||||||
|       ucentral_sec_revision: ${{ steps.vars.outputs.sec}} |       openwifi_sec_revision: ${{ steps.vars.outputs.sec}} | ||||||
|       ucentral_fms_revision: ${{ steps.vars.outputs.fms}} |       openwifi_fms_revision: ${{ steps.vars.outputs.fms}} | ||||||
|       ucentral_ui_revision: ${{ steps.vars.outputs.ui}} |       openwifi_ui_revision: ${{ steps.vars.outputs.ui}} | ||||||
|       ap_model: ${{ steps.vars.outputs.ap_model}} |       ap_models: ${{ steps.vars.outputs.ap_models}} | ||||||
|       ap_version: ${{ steps.vars.outputs.ap_version}} |       ap_version: ${{ steps.vars.outputs.ap_version}} | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|       - name: set variables |       - name: set variables | ||||||
|         id: vars |         id: vars | ||||||
|         run: | |         run: | | ||||||
|           echo ::set-output name=ucentral::$(echo "${{ github.event.inputs.ucentral_revision || 'main' }}") |           echo ::set-output name=openwifi::$(echo "${{ github.event.inputs.openwifi_revision || 'main' }}") | ||||||
|           echo ::set-output name=gw::$(echo "${{ github.event.inputs.ucentral_gw_revision || 'master' }}") |           echo ::set-output name=gw::$(echo "${{ github.event.inputs.openwifi_gw_revision || 'master' }}") | ||||||
|           echo ::set-output name=sec::$(echo "${{ github.event.inputs.ucentral_sec_revision || 'main' }}") |           echo ::set-output name=sec::$(echo "${{ github.event.inputs.openwifi_sec_revision || 'main' }}") | ||||||
|           echo ::set-output name=fms::$(echo "${{ github.event.inputs.ucentral_fms_revision || 'main' }}") |           echo ::set-output name=fms::$(echo "${{ github.event.inputs.openwifi_fms_revision || 'main' }}") | ||||||
|           echo ::set-output name=ui::$(echo "${{ github.event.inputs.ucentral_ui_revision || 'main' }}") |           echo ::set-output name=ui::$(echo "${{ github.event.inputs.openwifi_ui_revision || 'main' }}") | ||||||
|           echo ::set-output name=ap_model::$(echo "${{ github.event.inputs.ap_model || 'ec420' }}") |           echo ::set-output name=ap_models::$(echo "${{ github.event.inputs.ap_models || 'EC420,EAP101,ECW5211,ECW5410' }}") | ||||||
|           echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'latest' }}") |           echo ::set-output name=ap_version::$(echo "${{ github.event.inputs.ap_version || 'latest' }}") | ||||||
|  |  | ||||||
|   start-reservation: |   generate-matrix: | ||||||
|     needs: vars |     name: generate AP model matrix | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     needs: vars | ||||||
|     outputs: |     outputs: | ||||||
|       reservation_id: ${{ steps.start.outputs.res_id }} |       matrix: ${{ steps.set-matrix.outputs.matrix }} | ||||||
|     env: |  | ||||||
|       CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build |  | ||||||
|       CLOUDSHELL_USER: admin |  | ||||||
|       CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v2 |     - name: generate-matrix | ||||||
|     - name: Set up Python |       id: set-matrix | ||||||
|       uses: actions/setup-python@v2 |       run: | | ||||||
|       with: |         AP_MODELS="${{ needs.vars.outputs.ap_models }}" | ||||||
|         python-version: '3.8' |         AP_MODELS=$(echo $AP_MODELS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') | ||||||
|  |         AP_MODELS=$(echo "$AP_MODELS" | jq -c 'map({"ap_model":.})') | ||||||
|     - name: install dependencies |         echo "::set-output name=matrix::{\"include\":${AP_MODELS}}" | ||||||
|       run: pip install -r .quali/requirements.txt |  | ||||||
|  |  | ||||||
|     - name: start reservation |  | ||||||
|       id: start |  | ||||||
|       run: echo ::set-output name=res_id::$(python .quali/start_reservation.py --ucentral-version "${{ needs.vars.outputs.ucentral_revision }}" --ucentral-gw-version "${{ needs.vars.outputs.ucentral_gw_revision }}" --ucentral-sec-version "${{ needs.vars.outputs.ucentral_sec_revision }}" --ucentral-fms-version "${{ needs.vars.outputs.ucentral_fms_revision }}" --ucentral-ui-version "${{ needs.vars.outputs.ucentral_ui_revision }}") |  | ||||||
|  |  | ||||||
|     - name: wait for DNS to propagate |  | ||||||
|       run: sleep 300 |  | ||||||
|  |  | ||||||
|   build: |   build: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
| @@ -127,15 +117,18 @@ jobs: | |||||||
|       run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} |       run: docker push ${{ env.DOCKER_SERVER }}/cloud-sdk-nightly:${{ github.run_id }} | ||||||
|  |  | ||||||
|   test: |   test: | ||||||
|     needs: ['start-reservation', 'build'] |     needs: ['generate-matrix', 'build', 'vars'] | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: ${{ fromJson( needs.generate-matrix.outputs.matrix ) }} | ||||||
|     env: |     env: | ||||||
|       CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build |       CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build | ||||||
|       CLOUDSHELL_USER: admin |       CLOUDSHELL_USER: admin | ||||||
|       CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} |       CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} | ||||||
|  |  | ||||||
|     steps: |     steps: | ||||||
|     - uses: actions/checkout@v2 |     - uses: actions/checkout@v2 | ||||||
|  |  | ||||||
|     - name: Set up Python |     - name: Set up Python | ||||||
|       uses: actions/setup-python@v2 |       uses: actions/setup-python@v2 | ||||||
|       with: |       with: | ||||||
| @@ -144,6 +137,13 @@ jobs: | |||||||
|     - name: install dependencies |     - name: install dependencies | ||||||
|       run: pip install -r .quali/requirements.txt |       run: pip install -r .quali/requirements.txt | ||||||
|  |  | ||||||
|  |     - name: start reservation | ||||||
|  |       id: start | ||||||
|  |       run: echo ::set-output name=res_id::$(python .quali/start_reservation.py --openwifi-version "${{ needs.vars.outputs.openwifi_revision }}" --openwifi-gw-version "${{ needs.vars.outputs.openwifi_gw_revision }}" --openwifi-sec-version "${{ needs.vars.outputs.openwifi_sec_revision }}" --openwifi-fms-version "${{ needs.vars.outputs.openwifi_fms_revision }}" --openwifi-ui-version "${{ needs.vars.outputs.openwifi_ui_revision }}" --ap-model "${{ matrix.ap_model }}") | ||||||
|  |  | ||||||
|  |     - name: wait for DNS to propagate | ||||||
|  |       run: sleep 300 | ||||||
|  |  | ||||||
|     - name: get EKS access credentials |     - name: get EKS access credentials | ||||||
|       run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} |       run: aws eks update-kubeconfig --name ${{ env.AWS_EKS_NAME }} | ||||||
|  |  | ||||||
| @@ -159,7 +159,7 @@ jobs: | |||||||
|     - name: prepare namespace |     - name: prepare namespace | ||||||
|       id: namespace |       id: namespace | ||||||
|       run: | |       run: | | ||||||
|         NAMESPACE="testing-${{ github.run_id }}-basic" |         NAMESPACE="testing-${{ github.run_id }}-$(echo ${{ matrix.ap_model }} | tr '[:upper:]' '[:lower:]')" | ||||||
|         kubectl create ns $NAMESPACE |         kubectl create ns $NAMESPACE | ||||||
|         kubectl config set-context --current --namespace=$NAMESPACE |         kubectl config set-context --current --namespace=$NAMESPACE | ||||||
|         echo "::set-output name=name::${NAMESPACE}" |         echo "::set-output name=name::${NAMESPACE}" | ||||||
| @@ -170,7 +170,7 @@ jobs: | |||||||
|         Customer = "" |         Customer = "" | ||||||
|         server = "" |         server = "" | ||||||
|         CONFIGURATION = { |         CONFIGURATION = { | ||||||
|           "basic": $(python .quali/get_configuration.py ${{ needs.start-reservation.outputs.reservation_id }}) |           "basic": $(python .quali/get_configuration.py ${{ steps.start.outputs.res_id }}) | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         RADIUS_SERVER_DATA = { |         RADIUS_SERVER_DATA = { | ||||||
| @@ -476,7 +476,8 @@ jobs: | |||||||
|                   - -c |                   - -c | ||||||
|                   - | |                   - | | ||||||
|                     cd tests |                     cd tests | ||||||
|                     pytest -m "uc_sanity" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}" |                     #pytest -m "uc_sanity" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}" | ||||||
|  |                     pytest -m "sdk_restapi" -s -vvv --testbed="basic" --alluredir=/tmp/allure-results -o firmware="${{ needs.vars.outputs.ap_version }}" | ||||||
|                     ret=\$? |                     ret=\$? | ||||||
|                     # sleep some time to be able to download the Allure results |                     # sleep some time to be able to download the Allure results | ||||||
|                     sleep 60 |                     sleep 60 | ||||||
| @@ -513,11 +514,7 @@ jobs: | |||||||
|         echo "waiting for pod to exit" |         echo "waiting for pod to exit" | ||||||
|         kubectl logs -f $podname >/dev/null 2>&1 |         kubectl logs -f $podname >/dev/null 2>&1 | ||||||
|         exit $(kubectl get pod $podname --output="jsonpath={.status.containerStatuses[].state.terminated.exitCode}") |         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 |     - name: upload Allure results as artifact | ||||||
|       if: always() |       if: always() | ||||||
|       uses: actions/upload-artifact@v2 |       uses: actions/upload-artifact@v2 | ||||||
| @@ -530,26 +527,9 @@ jobs: | |||||||
|       run: | |       run: | | ||||||
|         kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true |         kubectl delete ns "${{ steps.namespace.outputs.name }}" --wait=true | ||||||
|  |  | ||||||
|   stop-reservation: |  | ||||||
|     needs: ['start-reservation', test] |  | ||||||
|     if: always() |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     env: |  | ||||||
|       CLOUDSHELL_URL: quali-cloudshell.lab.wlan.tip.build |  | ||||||
|       CLOUDSHELL_USER: admin |  | ||||||
|       CLOUDSHELL_PASSWORD: ${{ secrets.CLOUDSHELL_PASSWORD }} |  | ||||||
|     steps: |  | ||||||
|     - uses: actions/checkout@v2 |  | ||||||
|     - name: Set up Python |  | ||||||
|       uses: actions/setup-python@v2 |  | ||||||
|       with: |  | ||||||
|         python-version: '3.8' |  | ||||||
|  |  | ||||||
|     - name: install dependencies |  | ||||||
|       run: pip install -r .quali/requirements.txt |  | ||||||
|  |  | ||||||
|     - name: stop reservation |     - name: stop reservation | ||||||
|       run: python .quali/stop_reservation.py ${{ needs.start-reservation.outputs.reservation_id }} |       if: always() | ||||||
|  |       run: python .quali/stop_reservation.py ${{ steps.start.outputs.res_id }} | ||||||
|  |  | ||||||
|   cleanup: |   cleanup: | ||||||
|     needs: [ test ] |     needs: [ test ] | ||||||
|   | |||||||
| @@ -23,13 +23,13 @@ def main(): | |||||||
|         if service.ServiceName != 'Helm Service V2': |         if service.ServiceName != 'Helm Service V2': | ||||||
|             continue |             continue | ||||||
|  |  | ||||||
|         config['controller']['url'] = f'https://sec-ucentral-{res_id.split("-")[0]}.cicd.lab.wlan.tip.build:16001' |         config['controller']['url'] = f'https://sec-{res_id.split("-")[0]}.cicd.lab.wlan.tip.build:16001' | ||||||
|         config['controller']['username'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.User') |         config['controller']['username'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.User') | ||||||
|         #config['controller']['password'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.Password') |         #config['controller']['password'] = next(attr.Value for attr in service.Attributes if attr.Name == f'{service.ServiceName}.Password') | ||||||
|         config['controller']['password'] = 'openwifi' |         config['controller']['password'] = 'openwifi' | ||||||
|  |  | ||||||
|     for resource in resources_in_reservation: |     for resource in resources_in_reservation: | ||||||
|         if resource.ResourceModelName == 'Ap': |         if resource.ResourceModelName == 'ApV2': | ||||||
|             details = session.GetResourceDetails(resource.Name) |             details = session.GetResourceDetails(resource.Name) | ||||||
|             ap_config = {} |             ap_config = {} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -11,11 +11,11 @@ run_id = os.environ.get('GITHUB_RUN_NUMBER', 1) | |||||||
|  |  | ||||||
| def main(): | def main(): | ||||||
|     parser = argparse.ArgumentParser() |     parser = argparse.ArgumentParser() | ||||||
|     parser.add_argument('--ucentral-version', default='main') |     parser.add_argument('--openwifi-version', default='main') | ||||||
|     parser.add_argument('--ucentral-gw-version', default='master') |     parser.add_argument('--openwifi-gw-version', default='master') | ||||||
|     parser.add_argument('--ucentral-sec-version', default='main') |     parser.add_argument('--openwifi-sec-version', default='main') | ||||||
|     parser.add_argument('--ucentral-fms-version', default='main') |     parser.add_argument('--openwifi-fms-version', default='main') | ||||||
|     parser.add_argument('--ucentral-ui-version', default='main') |     parser.add_argument('--openwifi-ui-version', default='main') | ||||||
|     parser.add_argument('--ap-model', default='EC420') |     parser.add_argument('--ap-model', default='EC420') | ||||||
|     parser.add_argument('--wifi-type', default='Wifi5') |     parser.add_argument('--wifi-type', default='Wifi5') | ||||||
|     args = parser.parse_args() |     args = parser.parse_args() | ||||||
| @@ -28,11 +28,11 @@ def main(): | |||||||
|         durationInMinutes=360, |         durationInMinutes=360, | ||||||
|         topologyFullPath='Basic Lab', |         topologyFullPath='Basic Lab', | ||||||
|         globalInputs=[ |         globalInputs=[ | ||||||
|             UpdateTopologyGlobalInputsRequest('Chart Version', args.ucentral_version), |             UpdateTopologyGlobalInputsRequest('Chart Version', args.openwifi_version), | ||||||
|             UpdateTopologyGlobalInputsRequest('ucentralgw Version', args.ucentral_gw_version), |             UpdateTopologyGlobalInputsRequest('owgw Version', args.openwifi_gw_version), | ||||||
|             UpdateTopologyGlobalInputsRequest('ucentralsec Version', args.ucentral_sec_version), |             UpdateTopologyGlobalInputsRequest('owsec Version', args.openwifi_sec_version), | ||||||
|             UpdateTopologyGlobalInputsRequest('ucentralfms Version', args.ucentral_fms_version), |             UpdateTopologyGlobalInputsRequest('owfms Version', args.openwifi_fms_version), | ||||||
|             UpdateTopologyGlobalInputsRequest('ucentralgwui Version', args.ucentral_ui_version), |             UpdateTopologyGlobalInputsRequest('owgwui Version', args.openwifi_ui_version), | ||||||
|             UpdateTopologyGlobalInputsRequest('AP Model', args.ap_model), |             UpdateTopologyGlobalInputsRequest('AP Model', args.ap_model), | ||||||
|             UpdateTopologyGlobalInputsRequest('Wifi type', args.wifi_type), |             UpdateTopologyGlobalInputsRequest('Wifi type', args.wifi_type), | ||||||
|         ] |         ] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max
					Max