aboutsummaryrefslogtreecommitdiffstats
path: root/csit/resources
diff options
context:
space:
mode:
Diffstat (limited to 'csit/resources')
-rwxr-xr-xcsit/resources/scripts/run-test.sh3
-rwxr-xr-xcsit/resources/scripts/setup-clamp.sh4
-rw-r--r--csit/resources/tests/api-slas.robot10
-rw-r--r--csit/resources/tests/data/AcDocker.json (renamed from csit/resources/tests/data/AutomationComposition.json)0
-rw-r--r--csit/resources/tests/data/AcK8s.json211
-rw-r--r--csit/resources/tests/pap-slas.robot4
-rw-r--r--csit/resources/tests/policy-clamp-test.robot6
7 files changed, 228 insertions, 10 deletions
diff --git a/csit/resources/scripts/run-test.sh b/csit/resources/scripts/run-test.sh
index 6286e9cf..02f06ff4 100755
--- a/csit/resources/scripts/run-test.sh
+++ b/csit/resources/scripts/run-test.sh
@@ -36,6 +36,7 @@ DISTRIBUTION_IP=policy-distribution:6969
DMAAP_IP=message-router:3904
APEX_EVENTS_IP=policy-apex-pdp:23324
PROMETHEUS_IP=prometheus:9090
+CLAMP_K8S_TEST=true
DIST_TEMP_FOLDER=/tmp/distribution
@@ -44,7 +45,7 @@ ROBOT_VARIABLES="-v DATA:$DATA -v NODETEMPLATES:$NODETEMPLATES -v POLICY_API_IP:
-v POLICY_RUNTIME_ACM_IP:$POLICY_RUNTIME_ACM_IP -v POLICY_PAP_IP:$POLICY_PAP_IP -v APEX_IP:$APEX_IP
-v APEX_EVENTS_IP:$APEX_EVENTS_IP -v DMAAP_IP:$DMAAP_IP -v PROMETHEUS_IP:${PROMETHEUS_IP}
-v POLICY_PDPX_IP:$POLICY_PDPX_IP -v POLICY_DROOLS_IP:$POLICY_DROOLS_IP -v TEMP_FOLDER:${DIST_TEMP_FOLDER}
--v DISTRIBUTION_IP:$DISTRIBUTION_IP"
+-v DISTRIBUTION_IP:$DISTRIBUTION_IP -v CLAMP_K8S_TEST:$CLAMP_K8S_TEST"
echo "Run Robot test"
echo ROBOT_VARIABLES="${ROBOT_VARIABLES}"
diff --git a/csit/resources/scripts/setup-clamp.sh b/csit/resources/scripts/setup-clamp.sh
index e680cf09..4eae4da3 100755
--- a/csit/resources/scripts/setup-clamp.sh
+++ b/csit/resources/scripts/setup-clamp.sh
@@ -25,9 +25,11 @@ unset http_proxy https_proxy
# wait for the app to start up
"${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
+CLAMP_K8S_TEST=false
+
export SUITES="policy-clamp-test.robot"
ROBOT_VARIABLES="-v POLICY_RUNTIME_ACM_IP:localhost:${ACM_PORT}
--v POLICY_API_IP:localhost:${API_PORT} -v POLICY_PAP_IP:localhost:${PAP_PORT}"
+-v POLICY_API_IP:localhost:${API_PORT} -v POLICY_PAP_IP:localhost:${PAP_PORT} -v CLAMP_K8S_TEST:$CLAMP_K8S_TEST"
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/AutomationComposition.json b/csit/resources/tests/data/AcDocker.json
index 57148256..57148256 100644
--- a/csit/resources/tests/data/AutomationComposition.json
+++ b/csit/resources/tests/data/AcDocker.json
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/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