diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-07-26 15:55:11 +0100 |
---|---|---|
committer | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-08-06 16:46:06 +0100 |
commit | 3e6f925ec89d771164a1d7ca694523f6da8e212c (patch) | |
tree | b648ce37b2eb3604d966bd40e6619a53499b8d38 /csit/resources/tests/policy-clamp-test.robot | |
parent | ed78bda8e9f46b3f8d86e5beaf810903781fa9d5 (diff) |
Add tests for Prepare, Review and Migrate pre-check in CSIT
Issue-ID: POLICY-5081
Change-Id: I4293a3adf698f62dcc6f310d11e66838a1ece832
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'csit/resources/tests/policy-clamp-test.robot')
-rw-r--r-- | csit/resources/tests/policy-clamp-test.robot | 40 |
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 |