From 65fc37591b2934871e7ca4d2db4a76ad4bba7572 Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Wed, 5 Apr 2023 13:47:15 +0100 Subject: Enable ACM tests in K8s CSIT Moved all the image references to the parent chart. Updating the latest image tags during installation. Disabling charts by default and enabling only the project specific ones. Issue-ID: POLICY-4541 Signed-off-by: zrrmmua Change-Id: Ie22584ff38e777379ac1ee2d61743868a8b93b5c --- csit/resources/tests/api-slas.robot | 10 +- csit/resources/tests/data/AcDocker.json | 25 +++ csit/resources/tests/data/AcK8s.json | 211 +++++++++++++++++++++ .../tests/data/AutomationComposition.json | 25 --- csit/resources/tests/pap-slas.robot | 4 +- csit/resources/tests/policy-clamp-test.robot | 6 +- 6 files changed, 248 insertions(+), 33 deletions(-) create mode 100644 csit/resources/tests/data/AcDocker.json create mode 100644 csit/resources/tests/data/AcK8s.json delete mode 100644 csit/resources/tests/data/AutomationComposition.json (limited to 'csit/resources/tests') diff --git a/csit/resources/tests/api-slas.robot b/csit/resources/tests/api-slas.robot index 717ac3d7..7fd8ff98 100644 --- a/csit/resources/tests/api-slas.robot +++ b/csit/resources/tests/api-slas.robot @@ -8,8 +8,8 @@ Resource ${CURDIR}/common-library.robot *** Keywords *** ValidateResponseTimeForApi [Arguments] ${uri} ${method} - [Documentation] Check if uri response is under the 500ms required time for api metrics - ValidateResponseTime api-metrics ${uri} ${method} 500 + [Documentation] Check if uri response is under the 1500ms required time for api metrics + ValidateResponseTime api-metrics ${uri} ${method} 1500 *** Test Cases *** WaitForPrometheusServer @@ -30,12 +30,12 @@ ValidateResponseTimeQueryPolicies ValidateResponseTimeQueryPolicyTypeListVersions [Documentation] Validate query policyType versions response time - ValidateResponseTime api-metrics /policytypes/{policyTypeId} GET 400 + ValidateResponseTime api-metrics /policytypes/{policyTypeId} GET 1500 -#Time increased from 200 to 250 due to slow ONAP machines +#Time increased from 200 to 1500 due to slow ONAP machines ValidateResponseTimeQueryPolicyVersion [Documentation] Validate query policy by version response time - ValidateResponseTime api-metrics /policies/{policyId}/versions/{policyVersion} GET 250 + ValidateResponseTime api-metrics /policies/{policyId}/versions/{policyVersion} GET 1500 ValidateResponseTimeCreatePolicy [Documentation] Validate response time for creating a policy diff --git a/csit/resources/tests/data/AcDocker.json b/csit/resources/tests/data/AcDocker.json new file mode 100644 index 00000000..57148256 --- /dev/null +++ b/csit/resources/tests/data/AcDocker.json @@ -0,0 +1,25 @@ +{ + "name": "DemoInstance0", + "version": "1.0.1", + "compositionId": "COMPOSITIONIDPLACEHOLDER", + "description": "Demo automation composition instance 0", + "elements": { + "709c62b3-8918-41b9-a747-d21eb79c6c20": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c20", + "definition": { + "name": "onap.policy.clamp.ac.element.Policy_AutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Policy Automation Composition Element for the Demo", + "properties": { + "policy_type_id": { + "name": "onap.policies.native.Apex", + "version": "1.0.0" + }, + "policy_id": { + "get_input": "acm_element_policy" + } + } + } + } +} \ No newline at end of file diff --git a/csit/resources/tests/data/AcK8s.json b/csit/resources/tests/data/AcK8s.json new file mode 100644 index 00000000..f9ef5b0c --- /dev/null +++ b/csit/resources/tests/data/AcK8s.json @@ -0,0 +1,211 @@ +{ + "name": "DemoInstance0", + "version": "1.0.1", + "compositionId": "COMPOSITIONIDPLACEHOLDER", + "description": "Demo automation composition instance 0", + "elements": { + "709c62b3-8918-41b9-a747-d21eb79c6c20": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c20", + "definition": { + "name": "onap.policy.clamp.ac.element.Policy_AutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Demo", + "properties": { + "policy_type_id": { + "name": "onap.policies.operational.pm-subscription-handler", + "version": "1.0.0" + }, + "policy_id": { + "get_input": "acm_element_policy" + } + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c21": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c21", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Demo", + "properties": { + "chart": { + "chartId": { + "name": "acelement", + "version": "0.1.0" + }, + "namespace": "default", + "releaseName": "acm-starter", + "podName": "acm-starter", + "repository": { + "repoName": "policy-chartmuseum", + "address": "http://policy-chartmuseum:8080" + }, + "overrideParams": { + "acelement.elementId.name": "onap.policy.clamp.ac.starter", + "service.nodeport": 30800 + } + } + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c22": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c22", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_BridgeAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Bridge Automation Composition Element for the Demo", + "properties": { + "chart": { + "chartId": { + "name": "acelement", + "version": "0.1.0" + }, + "namespace": "default", + "releaseName": "acm-bridge", + "podName": "acm-bridge", + "repository": { + "repoName": "policy-chartmuseum", + "address": "http://policy-chartmuseum:8080" + }, + "overrideParams": { + "acelement.elementId.name": "onap.policy.clamp.ac.bridge", + "service.nodeport": 30801 + } + } + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c23": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c23", + "definition": { + "name": "onap.policy.clamp.ac.element.K8S_SinkAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Sink Automation Composition Element for the Demo", + "properties": { + "chart": { + "chartId": { + "name": "acelement", + "version": "0.1.0" + }, + "namespace": "default", + "releaseName": "acm-sink", + "podName": "acm-sink", + "repository": { + "repoName": "policy-chartmuseum", + "address": "http://policy-chartmuseum:8080" + }, + "overrideParams": { + "acelement.elementId.name": "onap.policy.clamp.ac.sink", + "service.nodeport": 30802 + } + } + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c24": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c24", + "definition": { + "name": "onap.policy.clamp.ac.element.Http_StarterAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Starter Automation Composition Element for the Demo", + "properties": { + "baseUrl": "http://acm-starter-ac-element-impl:8084", + "httpHeaders": { + "Content-Type": "application/json", + "Authorization": "Basic YWNtVXNlcjp6YiFYenRHMzQ=" + }, + "configurationEntities": [ + { + "configurationEntityId": { + "name": "onap.policy.clamp.ac.starter", + "version": "1.0.0" + }, + "restSequence": [ + { + "restRequestId": { + "name": "request1", + "version": "1.0.1" + }, + "httpMethod": "POST", + "path": "/onap/policy/clamp/acelement/v2/activate", + "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.startertobridge\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"STARTER\", \"topicParameterGroup\": { \"server\": \"message-router:3904\", \"listenerTopic\": \"POLICY_UPDATE_MSG\", \"publisherTopic\": \"AC_ELEMENT_MSG\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"dmaap\" } }", + "expectedResponse": 201 + } + ] + } + ] + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c25": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c25", + "definition": { + "name": "onap.policy.clamp.ac.element.Http_BridgeAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Bridge Automation Composition Element for the Demo", + "properties": { + "baseUrl": "http://acm-bridge-ac-element-impl:8084", + "httpHeaders": { + "Content-Type": "application/json", + "Authorization": "Basic YWNtVXNlcjp6YiFYenRHMzQ=" + }, + "configurationEntities": [ + { + "configurationEntityId": { + "name": "onap.policy.clamp.ac.bridge", + "version": "1.0.0" + }, + "restSequence": [ + { + "restRequestId": { + "name": "request2", + "version": "1.0.1" + }, + "httpMethod": "POST", + "path": "/onap/policy/clamp/acelement/v2/activate", + "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.bridgetosink\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"BRIDGE\", \"topicParameterGroup\": { \"server\": \"message-router:3904\", \"listenerTopic\": \"POLICY_UPDATE_MSG\", \"publisherTopic\": \"AC_ELEMENT_MSG\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"dmaap\" } }", + "expectedResponse": 201 + } + ] + } + ] + } + }, + "709c62b3-8918-41b9-a747-d21eb79c6c26": { + "id": "709c62b3-8918-41b9-a747-d21eb79c6c26", + "definition": { + "name": "onap.policy.clamp.ac.element.Http_SinkAutomationCompositionElement", + "version": "1.2.3" + }, + "description": "Sink Automation Composition Element for the Demo", + "properties": { + "baseUrl": "http://acm-sink-ac-element-impl:8084", + "httpHeaders": { + "Content-Type": "application/json", + "Authorization": "Basic YWNtVXNlcjp6YiFYenRHMzQ=" + }, + "configurationEntities": [ + { + "configurationEntityId": { + "name": "onap.policy.clamp.ac.sink", + "version": "1.0.0" + }, + "restSequence": [ + { + "restRequestId": { + "name": "request3", + "version": "1.0.1" + }, + "httpMethod": "POST", + "path": "/onap/policy/clamp/acelement/v2/activate", + "body": "{ \"receiverId\": { \"name\": \"onap.policy.clamp.ac.sink\", \"version\": \"1.0.0\" }, \"timerMs\": 20000, \"elementType\": \"SINK\", \"topicParameterGroup\": { \"server\": \"message-router\", \"listenerTopic\": \"POLICY_UPDATE_MSG\", \"publisherTopic\": \"AC_ELEMENT_MSG\", \"fetchTimeout\": 15000, \"topicCommInfrastructure\": \"dmaap\" } }", + "expectedResponse": 201 + } + ] + } + ] + } + } + } +} \ No newline at end of file diff --git a/csit/resources/tests/data/AutomationComposition.json b/csit/resources/tests/data/AutomationComposition.json deleted file mode 100644 index 57148256..00000000 --- a/csit/resources/tests/data/AutomationComposition.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "DemoInstance0", - "version": "1.0.1", - "compositionId": "COMPOSITIONIDPLACEHOLDER", - "description": "Demo automation composition instance 0", - "elements": { - "709c62b3-8918-41b9-a747-d21eb79c6c20": { - "id": "709c62b3-8918-41b9-a747-d21eb79c6c20", - "definition": { - "name": "onap.policy.clamp.ac.element.Policy_AutomationCompositionElement", - "version": "1.2.3" - }, - "description": "Policy Automation Composition Element for the Demo", - "properties": { - "policy_type_id": { - "name": "onap.policies.native.Apex", - "version": "1.0.0" - }, - "policy_id": { - "get_input": "acm_element_policy" - } - } - } - } -} \ No newline at end of file diff --git a/csit/resources/tests/pap-slas.robot b/csit/resources/tests/pap-slas.robot index 1fa19627..4b240047 100644 --- a/csit/resources/tests/pap-slas.robot +++ b/csit/resources/tests/pap-slas.robot @@ -8,8 +8,8 @@ Resource ${CURDIR}/common-library.robot *** Keywords *** ValidateResponseTimeForPap [Arguments] ${uri} ${method} - [Documentation] Check if uri response is under the 500ms required time for pap metrics - ValidateResponseTime pap-metrics ${uri} ${method} 500 + [Documentation] Check if uri response is under the 1500ms required time for pap metrics + ValidateResponseTime pap-metrics ${uri} ${method} 1500 *** Test Cases *** WaitForPrometheusServer diff --git a/csit/resources/tests/policy-clamp-test.robot b/csit/resources/tests/policy-clamp-test.robot index 3fc41550..29a99ebb 100644 --- a/csit/resources/tests/policy-clamp-test.robot +++ b/csit/resources/tests/policy-clamp-test.robot @@ -55,7 +55,11 @@ InstantiateAutomationComposition [Documentation] Instantiate automation composition. ${auth}= Create List runtimeUser zb!XztG34 Log Creating session http://${POLICY_RUNTIME_ACM_IP} - ${postjson}= Get file ${CURDIR}/data/AutomationComposition.json + ${K8sEnabled}= Convert To Boolean ${CLAMP_K8S_TEST} + Run Keyword If '${K8sEnabled}'=='True' set Suite variable ${instantiationfile} AcK8s.json + + ... ELSE set Suite variable ${instantiationfile} AcDocker.json + ${postjson}= Get file ${CURDIR}/data/${instantiationfile} ${updatedpostjson}= Replace String ${postjson} COMPOSITIONIDPLACEHOLDER ${compositionId} ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json -- cgit 1.2.3-korg