From aba7d001115ba5ba548395079481056703d833dd Mon Sep 17 00:00:00 2001 From: waynedunican Date: Fri, 15 Nov 2024 14:30:18 +0000 Subject: [PATCH] Fix weekly S3P tests Issue-ID: POLICY-5150 Change-Id: Ib62c3613dfb1f61117af666504f8cc38216d43fb Signed-off-by: waynedunican --- .../gerrit-pap-performance-test.yaml | 26 +- .../workflows/gerrit-pap-stability-test.yaml | 91 ++++ .../main/resources/testplans/performance.jmx | 439 +++++++----------- testsuites/run-s3p-test.sh | 4 +- .../main/resources/testplans/stability.jmx | 40 +- 5 files changed, 298 insertions(+), 302 deletions(-) create mode 100644 .github/workflows/gerrit-pap-stability-test.yaml diff --git a/.github/workflows/gerrit-pap-performance-test.yaml b/.github/workflows/gerrit-pap-performance-test.yaml index 3d170338..14842acc 100644 --- a/.github/workflows/gerrit-pap-performance-test.yaml +++ b/.github/workflows/gerrit-pap-performance-test.yaml @@ -1,3 +1,21 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + name: policy-pap-performance-test on: @@ -64,4 +82,10 @@ jobs: uses: actions/upload-artifact@v4 with: name: policy-pap-s3p-results - path: ${{ github.workspace }}/testsuites/automate-performance/s3pTestResults.jtl + path: ${{ github.workspace }}/testsuites/automate-s3p-test/s3pTestResults.jtl + + - name: Archive JMeter logs + uses: actions/upload-artifact@v4 + with: + name: policy-pap-s3p-results + path: ${{ github.workspace }}/testsuites/automate-s3p-test/jmeter.log diff --git a/.github/workflows/gerrit-pap-stability-test.yaml b/.github/workflows/gerrit-pap-stability-test.yaml new file mode 100644 index 00000000..1d87f9cd --- /dev/null +++ b/.github/workflows/gerrit-pap-stability-test.yaml @@ -0,0 +1,91 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2024 Nordix Foundation. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +name: policy-pap-stability-test + +on: + workflow_dispatch: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + inputs: + GERRIT_BRANCH: + description: 'Branch that change is against' + required: true + type: string + GERRIT_CHANGE_ID: + description: 'The ID for the change' + required: true + type: string + GERRIT_CHANGE_NUMBER: + description: 'The Gerrit number' + required: true + type: string + GERRIT_CHANGE_URL: + description: 'URL to the change' + required: true + type: string + GERRIT_EVENT_TYPE: + description: 'Gerrit event type' + required: true + type: string + GERRIT_PATCHSET_NUMBER: + description: 'The patch number for the change' + required: true + type: string + GERRIT_PATCHSET_REVISION: + description: 'The revision sha' + required: true + type: string + GERRIT_PROJECT: + description: 'Project in Gerrit' + required: true + type: string + GERRIT_REFSPEC: + description: 'Gerrit refspec of change' + required: true + type: string + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + + # Run every Monday at 16:30 UTC + schedule: + - cron: '30 16 * * 1' + +jobs: + run-s3p-tests: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + + - name: Run S3P script + working-directory: ${{ github.workspace }}/testsuites + run: sudo bash ./run-s3p-test.sh run stability + + - name: Archive result jtl + uses: actions/upload-artifact@v4 + with: + name: policy-pap-s3p-results + path: ${{ github.workspace }}/testsuites/automate-s3p-test/s3pTestResults.jtl + + - name: Archive JMeter logs + uses: actions/upload-artifact@v4 + with: + name: policy-pap-s3p-results + path: ${{ github.workspace }}/testsuites/automate-s3p-test/jmeter.log diff --git a/testsuites/performance/src/main/resources/testplans/performance.jmx b/testsuites/performance/src/main/resources/testplans/performance.jmx index f2370551..15855201 100644 --- a/testsuites/performance/src/main/resources/testplans/performance.jmx +++ b/testsuites/performance/src/main/resources/testplans/performance.jmx @@ -4,7 +4,7 @@ ONAP Policy PAP ================================================================================ Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2020-2021,2023 Nordix Foundation. + Modifications Copyright (C) 2020-2021,2023-2024 Nordix Foundation. Modifications Copyright (C) 2020,2022 Bell Canada. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +18,7 @@ limitations under the License. ============LICENSE_END========================================================= --> - + Policy PAP Stability Tests @@ -57,7 +57,7 @@ - + http://${PAP_HOST}:${PAP_PORT}/policy/pap/v1 @@ -95,20 +95,17 @@ + ${USERS} + 1 + true continue - - false + 1 + false - ${USERS} - 1 - false - - - true - + 1 1 @@ -118,6 +115,13 @@ + ${API_HOST} + ${API_PORT} + http + /policy/api/v1/policies + true + POST + true true @@ -180,24 +184,11 @@ - ${API_HOST} - ${API_PORT} - http - - /policy/api/v1/policies - POST - true - false - true - false - - - - + - 200 + 201 Assertion.response_code @@ -207,22 +198,17 @@ - - - ${PAP_HOST} ${PAP_PORT} http - policy/pap/v1/pdps/groups/defaultGroup?state=ACTIVE - PUT true - false + PUT true - false - - - + false + + + @@ -237,18 +223,17 @@ - + + ${USERS} + 0 + 7200 + true + true continue - - false + -1 + false - ${USERS} - 0 - true - 7200 - - true @@ -261,26 +246,21 @@ - - - + Basic Health Check ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/healthcheck - GET true - false + GET true - false - - - - Basic Health Check + false + + + - + 200 @@ -290,7 +270,7 @@ 1 - + groovy @@ -312,27 +292,22 @@ if (prev.getResponseCode() == '200') { - - - - + + PAP Metrics ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/metrics - GET true - false + GET true - false - - - - PAP Metrics + false + + + - + 200 @@ -342,7 +317,7 @@ if (prev.getResponseCode() == '200') { 1 - + true @@ -369,6 +344,14 @@ if (prev.getResponseCode() == '200') { + create SampleGroup + ${PAP_HOST} + ${PAP_PORT} + http + /policy/pap/v1/pdps/groups/batch + true + POST + true true @@ -401,23 +384,9 @@ if (prev.getResponseCode() == '200') { - ${PAP_HOST} - ${PAP_PORT} - http - - /policy/pap/v1/pdps/groups/batch - POST - true - false - true - false - - - - create SampleGroup - + 200 @@ -429,23 +398,18 @@ if (prev.getResponseCode() == '200') { - - - + Check PdpGroup Query ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/pdps - GET true - false + GET true - false - - - - Check PdpGroup Query + false + + + @@ -479,6 +443,13 @@ if (prev.getResponseCode() == '200') { + ${PAP_HOST} + ${PAP_PORT} + http + policy/pap/v1/pdps/policies + true + POST + true true @@ -496,19 +467,6 @@ if (prev.getResponseCode() == '200') { - ${PAP_HOST} - ${PAP_PORT} - http - - policy/pap/v1/pdps/policies - POST - true - false - true - false - - - @@ -527,23 +485,18 @@ if (prev.getResponseCode() == '200') { - - - + Query policies status for defaultGroup ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/policies/status/defaultGroup/operational.modifyconfig${threadCount}/1.0.0 - GET true - false + GET true - false - - - - Query policies status for defaultGroup + false + + + @@ -558,23 +511,18 @@ if (prev.getResponseCode() == '200') { - - - + Query policies status ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/policies/status - GET true - false + GET true - false - - - - Query policies status + false + + + @@ -589,23 +537,18 @@ if (prev.getResponseCode() == '200') { - - - + Check PdpGroup Audit ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/policies/audit/defaultGroup - GET true - false + GET true - false - - - - Check PdpGroup Audit + false + + + @@ -620,23 +563,18 @@ if (prev.getResponseCode() == '200') { - - - + Check PdpGroup Audit ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/policies/audit/defaultGroup/operational.modifyconfig${threadCount}/1.0.0 - GET true - false + GET true - false - - - - Check PdpGroup Audit + false + + + @@ -651,23 +589,18 @@ if (prev.getResponseCode() == '200') { - - - + Check PdpGroup Query ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/pdps - GET true - false + GET true - false - - - - Check PdpGroup Query + false + + + @@ -719,23 +652,18 @@ if (prev.getResponseCode() == '200') { - - - + Consolidated Health Check ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/components/healthcheck - GET true - false + GET true - false - - - - Consolidated Health Check + false + + + @@ -769,23 +697,18 @@ if (prev.getResponseCode() == '200') { - - - + Query Deployed policies ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/policies/deployed - GET true - false + GET true - false - - - - Query Deployed policies + false + + + @@ -817,6 +740,13 @@ if (prev.getResponseCode() == '200') { + ${PAP_HOST} + ${PAP_PORT} + http + /policy/pap/v1/pdps/deployments/batch + true + POST + true true @@ -845,19 +775,6 @@ if (prev.getResponseCode() == '200') { - ${PAP_HOST} - ${PAP_PORT} - http - - /policy/pap/v1/pdps/deployments/batch - POST - true - false - true - false - - - @@ -872,22 +789,17 @@ if (prev.getResponseCode() == '200') { - - - ${PAP_HOST} ${PAP_PORT} http - policy/pap/v1/pdps/groups/sampleGroup${threadCount}?state=PASSIVE - PUT true - false + PUT true - false - - - + false + + + @@ -902,23 +814,18 @@ if (prev.getResponseCode() == '200') { - - - + Delete PdpGroup ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/pdps/groups/sampleGroup${threadCount} - DELETE true - false + DELETE true - false - - - - Delete PdpGroup + false + + + @@ -933,23 +840,18 @@ if (prev.getResponseCode() == '200') { - - - + Check PdpGroup Query ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/pdps - GET true - false + GET true - false - - - - Check PdpGroup Query + false + + + @@ -997,27 +899,22 @@ if (prev.getResponseCode() == '200') { - - - - + + PAP Metrics after deployments ${PAP_HOST} ${PAP_PORT} http - /policy/pap/v1/metrics - GET true - false + GET true - false - - - - PAP Metrics after deployments + false + + + - + 200 @@ -1027,7 +924,7 @@ if (prev.getResponseCode() == '200') { 1 - + groovy @@ -1048,26 +945,20 @@ if (prev.getResponseCode() == '200') { newBatchDeploymentAPICount = (res =~ /http_server_requests_seconds_count\{error="none",exception="none",method="POST",outcome="SUCCESS",status="202",uri="\/pdps\/deployments\/batch",\} ([0-9]+)?([.]*[0-9]*)?/)[0][1] } - assert Long.valueOf(vars.get("simpleDeployAPICount")) < Long.valueOf(newSimpleDeployAPICount); - assert Long.valueOf(vars.get("batchDeploymentAPICount")) < Long.valueOf(newBatchDeploymentAPICount); - } + ${USERS} + 1 + true stoptest - - false + 1 + false - ${USERS} - 1 - false - - - true @@ -1080,22 +971,17 @@ if (prev.getResponseCode() == '200') { - - - ${PAP_HOST} ${PAP_PORT} http - policy/pap/v1/pdps/groups/defaultGroup?state=PASSIVE - PUT true - false + PUT true - false - - - + false + + + @@ -1110,22 +996,17 @@ if (prev.getResponseCode() == '200') { - - - ${API_HOST} ${API_PORT} http - /policy/api/v1/policies/operational.modifyconfig${threadCount}/versions/1.0.0 - DELETE true - false + DELETE true - false - - - + false + + + diff --git a/testsuites/run-s3p-test.sh b/testsuites/run-s3p-test.sh index 91576070..c0b4b8ed 100755 --- a/testsuites/run-s3p-test.sh +++ b/testsuites/run-s3p-test.sh @@ -1,6 +1,6 @@ #!/bin/bash # ============LICENSE_START======================================================= -# Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2023-2024 Nordix Foundation. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ export PAP_STAB_TEST_FILE=$TESTDIR/stability/src/main/resources/testplans/stabil if [ $1 == "run" ] then - mkdir automate-performance;cd automate-performance; + mkdir automate-s3p-test;cd automate-s3p-test; git clone "https://gerrit.onap.org/r/policy/docker" cd docker/csit diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx index 2cf6b07c..b79ca541 100644 --- a/testsuites/stability/src/main/resources/testplans/stability.jmx +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -7561,9 +7561,9 @@ - + - 200 + 201 Assertion.response_code @@ -7572,7 +7572,7 @@ - + Create Nodetemplate metadata for sampleGroup policy 6 ${API_HOST} @@ -9858,9 +9858,9 @@ - + - 200 + 201 Assertion.response_code @@ -9869,7 +9869,7 @@ - + 6 ${API_HOST} ${API_PORT} @@ -10063,9 +10063,9 @@ - + - 200 + 201 Assertion.response_code @@ -10089,7 +10089,7 @@ - + 200 @@ -10100,7 +10100,7 @@ - + create SampleGroup 6 ${PAP_HOST} @@ -10144,7 +10144,7 @@ - + 200 @@ -10175,7 +10175,7 @@ 120000 - + 200 @@ -10185,7 +10185,7 @@ 1 - + groovy @@ -10206,10 +10206,10 @@ if (prev.getResponseCode() == '200') { - + 1 1 - 259200 + 7200 true true continue @@ -10470,7 +10470,7 @@ vars.put("dg_status_check_counter", "0"); - + 200 @@ -10480,7 +10480,7 @@ vars.put("dg_status_check_counter", "0"); 1 - + groovy @@ -11143,7 +11143,7 @@ if (prev.getResponseCode() == '200') { - + PAP Metrics after deployments 6 ${PAP_HOST} @@ -11159,7 +11159,7 @@ if (prev.getResponseCode() == '200') { - + 200 @@ -11169,7 +11169,7 @@ if (prev.getResponseCode() == '200') { 1 - + groovy