diff options
author | FrancescoFioraEst <francesco.fiora@est.tech> | 2024-10-03 09:19:48 +0100 |
---|---|---|
committer | Francesco Fiora <francesco.fiora@est.tech> | 2024-10-04 07:53:20 +0000 |
commit | d8bbbb3c33e020e9979e4f127d876ff8d2ad6613 (patch) | |
tree | a029a2ff89fdd8f4f9acbaec8b7230c15193f33d /csit/resources/tests/policy-clamp-test.robot | |
parent | 36dcba5249bd13892941d73cc1ac1b561e6d2424 (diff) |
Add Timeout test in ACM CSIT
Issue-ID: POLICY-5132
Change-Id: If2999eb8a17d4906959cceff7ebb603c44577def
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 | 58 |
1 files changed, 43 insertions, 15 deletions
diff --git a/csit/resources/tests/policy-clamp-test.robot b/csit/resources/tests/policy-clamp-test.robot index ea119b01..e765dd4f 100644 --- a/csit/resources/tests/policy-clamp-test.robot +++ b/csit/resources/tests/policy-clamp-test.robot @@ -121,13 +121,30 @@ InstantiateAutomationCompositionMigrationFrom set Suite variable ${instanceMigrationId} ${respyaml["instanceId"]} Should Be Equal As Strings ${resp.status_code} 201 +FailDeployAutomationCompositionMigration + [Documentation] Fail Deploy automation composition. + SetParticipantSimFail + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/DeployAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} FAILED + +TimeoutDeployAutomationCompositionMigration + [Documentation] Timeout Deploy automation composition. + SetParticipantSimTimeout + ${auth}= ClampAuth + ${postjson}= Get file ${CURDIR}/data/DeployAC.json + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + PrepareAutomationComposition [Documentation] Prepare automation composition. ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/PrepareAC.json ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} ${postjson} ${auth} Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} UNDEPLOYED + Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionId} ${instanceId} DeployAutomationComposition [Documentation] Deploy automation composition. @@ -200,16 +217,11 @@ ReviewAutomationComposition ${postjson}= Get file ${CURDIR}/data/ReviewAC.json ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances/${instanceId} ${postjson} ${auth} Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} DEPLOYED + Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionId} ${instanceId} -FailDeployAutomationCompositionMigration - [Documentation] Fail Deploy automation composition. - SetParticipantSimFail - ${auth}= ClampAuth - ${postjson}= Get file ${CURDIR}/data/DeployAC.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances/${instanceMigrationId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 2 min 5 sec VerifyFailDeploy ${compositionFromId} ${instanceMigrationId} +CheckTimeoutAutomationComposition + [Documentation] Timeout Deploy automation composition. + Wait Until Keyword Succeeds 5 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} TIMEOUT DeployAutomationCompositionMigration [Documentation] Deploy automation composition. @@ -253,7 +265,7 @@ PrecheckAutomationCompositionMigration ${updatedpostyaml}= Replace String ${updatedpostyaml} TEXTPLACEHOLDER TextForMigration ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances ${updatedpostyaml} ${auth} Should Be Equal As Strings ${resp.status_code} 200 - Wait Until Keyword Succeeds 2 min 5 sec VerifyDeployStatus ${compositionFromId} ${instanceMigrationId} DEPLOYED + Wait Until Keyword Succeeds 2 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId} AutomationCompositionMigrationTo [Documentation] Migration of an automation composition. @@ -286,7 +298,7 @@ FailUnDeployAutomationCompositionMigrationTo ${postjson}= Get file ${CURDIR}/data/UndeployAC.json ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionToId}/instances/${instanceMigrationId} ${postjson} ${auth} Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 2 min 5 sec VerifyFailDeploy ${compositionToId} ${instanceMigrationId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionToId} ${instanceMigrationId} FAILED UnDeployAutomationCompositionMigrationTo [Documentation] UnDeploy automation composition migrated. @@ -318,7 +330,7 @@ FailUnInstantiateAutomationCompositionMigrationTo ${resp}= DELETE On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionToId}/instances/${instanceMigrationId} headers=${headers} Log Received response from runtime acm ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 2 min 5 sec VerifyFailDeploy ${compositionToId} ${instanceMigrationId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionToId} ${instanceMigrationId} FAILED UnInstantiateAutomationCompositionMigrationTo [Documentation] Delete automation composition instance migrated. @@ -437,13 +449,22 @@ VerifyDeployStatus Should Be Equal As Strings ${resp.json()['stateChangeResult']} NO_ERROR Run Keyword If ${resp.status_code}==200 Should Be Equal As Strings ${resp.json()['deployState']} ${deploystate} -VerifyFailDeploy +VerifySubStatus [Arguments] ${theCompositionId} ${theInstanceId} + [Documentation] Verify the Sub status of automation composition. + ${auth}= ClampAuth + ${resp}= MakeGetRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${theCompositionId}/instances/${theInstanceId} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + Should Be Equal As Strings ${resp.json()['stateChangeResult']} NO_ERROR + Run Keyword If ${resp.status_code}==200 Should Be Equal As Strings ${resp.json()['subState']} NONE + +VerifyStateChangeResult + [Arguments] ${theCompositionId} ${theInstanceId} ${stateChangeResult} [Documentation] Verify the Deploy status of automation composition. ${auth}= ClampAuth ${resp}= MakeGetRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${theCompositionId}/instances/${theInstanceId} ${auth} Should Be Equal As Strings ${resp.status_code} 200 - Run Keyword If ${resp.status_code}==200 Should Be Equal As Strings ${resp.json()['stateChangeResult']} FAILED + Run Keyword If ${resp.status_code}==200 Should Be Equal As Strings ${resp.json()['stateChangeResult']} ${stateChangeResult} VerifyPropertiesUpdated [Arguments] ${theCompositionId} ${theInstanceId} ${textToFind} @@ -511,6 +532,13 @@ SetParticipantSimSuccess ${resp}= MakeJsonPutRequest participant ${POLICY_PARTICIPANT_SIM_IP} /onap/policy/simparticipant/v2/parameters ${postjson} ${auth} Should Be Equal As Strings ${resp.status_code} 200 +SetParticipantSimTimeout + [Documentation] Set Participant Simulator Timeout. + ${auth}= ParticipantAuth + ${postjson}= Get file ${CURDIR}/data/SettingSimPropertiesTimeout.json + ${resp}= MakeJsonPutRequest participant ${POLICY_PARTICIPANT_SIM_IP} /onap/policy/simparticipant/v2/parameters ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 200 + ClampAuth ${auth}= Create List runtimeUser zb!XztG34 RETURN ${auth} |