summaryrefslogtreecommitdiffstats
path: root/csit/resources/tests/policy-clamp-test.robot
diff options
context:
space:
mode:
authorAdheli Tavares <adheli.tavares@est.tech>2024-08-07 15:56:57 +0000
committerGerrit Code Review <gerrit@onap.org>2024-08-07 15:56:57 +0000
commit85428a6302a499db4fa000e575fdcf72a1ea0f83 (patch)
tree938dc45e0aebf227265a8bbf4ceaa6246b6b87d3 /csit/resources/tests/policy-clamp-test.robot
parent0b5f6e073af02a68c8d693399ca5c5c7c6d96b3f (diff)
parent3e6f925ec89d771164a1d7ca694523f6da8e212c (diff)
Merge "Add tests for Prepare, Review and Migrate pre-check in CSIT"
Diffstat (limited to 'csit/resources/tests/policy-clamp-test.robot')
-rw-r--r--csit/resources/tests/policy-clamp-test.robot40
1 files changed, 40 insertions, 0 deletions
diff --git a/csit/resources/tests/policy-clamp-test.robot b/csit/resources/tests/policy-clamp-test.robot
index 72c5672e..3afcf12e 100644
--- a/csit/resources/tests/policy-clamp-test.robot
+++ b/csit/resources/tests/policy-clamp-test.robot
@@ -161,6 +161,18 @@ InstantiateAutomationCompositionMigrationFrom
set Suite variable ${instanceMigrationId} ${respyaml["instanceId"]}
Should Be Equal As Strings ${resp.status_code} 201
+PrepareAutomationComposition
+ [Documentation] Prepare automation composition.
+ ${auth}= Create List runtimeUser zb!XztG34
+ Log Creating session http://${POLICY_RUNTIME_ACM_IP}
+ ${postjson}= Get file ${CURDIR}/data/PrepareAC.json
+ ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} data=${postjson} headers=${headers}
+ Log Received response from runtime acm ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 202
+ Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} UNDEPLOYED
+
DeployAutomationComposition
[Documentation] Deploy automation composition.
${auth}= Create List runtimeUser zb!XztG34
@@ -230,6 +242,18 @@ QueryPolicyTypes
Should Be Equal As Strings ${resp.status_code} 200
List Should Contain Value ${resp.json()['policy_types']} onap.policies.native.Apex
+ReviewAutomationComposition
+ [Documentation] Review automation composition.
+ ${auth}= Create List runtimeUser zb!XztG34
+ Log Creating session http://${POLICY_RUNTIME_ACM_IP}
+ ${postjson}= Get file ${CURDIR}/data/ReviewAC.json
+ ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} data=${postjson} headers=${headers}
+ Log Received response from runtime acm ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 202
+ Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} DEPLOYED
+
FailDeployAutomationCompositionMigration
[Documentation] Fail Deploy automation composition.
SetParticipantSimFail
@@ -287,6 +311,22 @@ AutomationCompositionUpdate
VerifyPropertiesUpdated ${compositionFromId} ${instanceMigrationId} MyTextUpdated
VerifyParticipantSim ${instanceMigrationId} MyTextUpdated
+PrecheckAutomationCompositionMigration
+ [Documentation] Precheck Migration of an automation composition.
+ ${auth}= Create List runtimeUser zb!XztG34
+ Log Creating session http://${POLICY_RUNTIME_ACM_IP}
+ ${postyaml}= Get file ${CURDIR}/data/ac-instance-precheck-migration.yaml
+ ${updatedpostyaml}= Replace String ${postyaml} COMPOSITIONIDPLACEHOLDER ${compositionFromId}
+ ${updatedpostyaml}= Replace String ${updatedpostyaml} COMPOSITIONTARGETIDPLACEHOLDER ${compositionToId}
+ ${updatedpostyaml}= Replace String ${updatedpostyaml} INSTACEIDPLACEHOLDER ${instanceMigrationId}
+ ${updatedpostyaml}= Replace String ${updatedpostyaml} TEXTPLACEHOLDER TextForMigration
+ ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
+ ${resp}= POST On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances data=${updatedpostyaml} headers=${headers}
+ Log Received response from runtime acm ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Wait Until Keyword Succeeds 2 min 5 sec VerifyDeployStatus ${compositionFromId} ${instanceMigrationId} DEPLOYED
+
AutomationCompositionMigrationTo
[Documentation] Migration of an automation composition.
${auth}= Create List runtimeUser zb!XztG34