aboutsummaryrefslogtreecommitdiffstats
path: root/csit/api
diff options
context:
space:
mode:
Diffstat (limited to 'csit/api')
-rw-r--r--csit/api/plans/setup.sh3
-rw-r--r--csit/api/tests/api-test.robot33
2 files changed, 36 insertions, 0 deletions
diff --git a/csit/api/plans/setup.sh b/csit/api/plans/setup.sh
index c8346e38..8a20d93d 100644
--- a/csit/api/plans/setup.sh
+++ b/csit/api/plans/setup.sh
@@ -30,6 +30,8 @@ bash "${SCRIPTS}"/get-models-examples.sh
DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
+NODETEMPLATES=${WORKSPACE}/models/models-examples/src/main/resources/nodetemplates
+
# create a couple of variations of the policy definitions
sed -e 's!Measurement_vGMUX!ADifferentValue!' \
${DATA}/vCPE.policy.monitoring.input.tosca.json \
@@ -60,3 +62,4 @@ echo MARIADB IP IS "${MARIADB_IP}"
ROBOT_VARIABLES=""
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}"
+ROBOT_VARIABLES="${ROBOT_VARIABLES} -v NODETEMPLATES:${NODETEMPLATES}" \ No newline at end of file
diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot
index 80e8afd5..c5c7e860 100644
--- a/csit/api/tests/api-test.robot
+++ b/csit/api/tests/api-test.robot
@@ -54,6 +54,12 @@ CreateNewMonitoringPolicyV2
${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v2.json
CreatePolicy /policy/api/v1/policies 200 ${postjson} onap.restart.tca 2.0.0
+
+CreateNodeTemplates
+ [Documentation] Create node templates in database using specific api
+ ${postjson}= Get file ${NODETEMPLATES}/nodetemplates.metadatasets.input.tosca.json
+ CreateNodeTemplate /policy/api/v1/nodetemplates 200 ${postjson} 3
+
RetrievePoliciesOfType
[Documentation] Retrieve all policies belonging to a specific Policy Type
FetchPolicies /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 2
@@ -66,6 +72,20 @@ RetrieveSpecificPolicy
[Documentation] Retrieve a policy named 'onap.restart.tca' and version '1.0.0' using generic api
FetchPolicy /policy/api/v1/policies/onap.restart.tca/versions/1.0.0 onap.restart.tca
+RetrieveAllNodeTemplates
+ [Documentation] Retrieve all node templates
+ FetchNodeTemplates /policy/api/v1/nodetemplates 3
+
+RetrieveSpecificNodeTemplate
+ [Documentation] Retrieve a node template named 'apexMetadata_grpc' and version '1.2.1' using generic api
+ FetchNodeTemplate /policy/api/v1/nodetemplates/apexMetadata_grpc/versions/1.2.1 apexMetadata_grpc
+
+DeleteSpecificNodeTemplate
+ [Documentation] Delete a node template named 'apexMetadata_adaptive' and version '2.3.1' using generic api
+ DeleteReq /policy/api/v1/nodetemplates/apexMetadata_adaptive/versions/2.3.1 200
+ DeleteReq /policy/api/v1/nodetemplates/apexMetadata_adaptive/versions/2.3.1 404
+
+
DeleteSpecificPolicy
[Documentation] Delete a policy named 'onap.restart.tca' and version '1.0.0' using generic api
DeleteReq /policy/api/v1/policies/onap.restart.tca/versions/1.0.0 200
@@ -126,3 +146,16 @@ FetchPolicies
[Documentation] Fetch all policies
${resp}= GetReq ${url}
Length Should Be ${resp.json()['topology_template']['policies']} ${expectedLength}
+
+
+FetchNodeTemplates
+ [Arguments] ${url} ${expectedLength}
+ [Documentation] Fetch all node templates
+ ${resp}= GetReq ${url}
+ Length Should Be ${resp.json()} ${expectedLength}
+
+FetchNodeTemplate
+ [Arguments] ${url} ${keyword}
+ [Documentation] Fetch the specific node template
+ ${resp}= GetReq ${url}
+ Dictionary Should Contain Value ${resp.json()[0]} ${keyword} \ No newline at end of file