aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdheli Tavares <adheli.tavares@est.tech>2024-10-07 09:58:49 +0000
committerGerrit Code Review <gerrit@onap.org>2024-10-07 09:58:49 +0000
commit3893fda035d2be48f3a518e508ac941a29498d63 (patch)
treeb62ac9fc445d552d0096e27a8b5e137cd967c660
parente502acbd82829b11624bd10e38c01a5e57d88492 (diff)
parentd8bbbb3c33e020e9979e4f127d876ff8d2ad6613 (diff)
Merge "Add Timeout test in ACM CSIT"
-rw-r--r--csit/resources/tests/data/SettingSimPropertiesFail.json6
-rw-r--r--csit/resources/tests/data/SettingSimPropertiesSuccess.json6
-rw-r--r--csit/resources/tests/data/SettingSimPropertiesTimeout.json26
-rw-r--r--csit/resources/tests/policy-clamp-test.robot58
4 files changed, 81 insertions, 15 deletions
diff --git a/csit/resources/tests/data/SettingSimPropertiesFail.json b/csit/resources/tests/data/SettingSimPropertiesFail.json
index 0c6402bd..0e0de30e 100644
--- a/csit/resources/tests/data/SettingSimPropertiesFail.json
+++ b/csit/resources/tests/data/SettingSimPropertiesFail.json
@@ -6,6 +6,9 @@
"deleteSuccess": false,
"updateSuccess": false,
"migrateSuccess": false,
+ "migratePrecheck": false,
+ "prepare": false,
+ "review": false,
"primeSuccess": false,
"deprimeSuccess": false,
"deployTimerMs": 100,
@@ -14,6 +17,9 @@
"unlockTimerMs": 100,
"updateTimerMs": 100,
"migrateTimerMs": 100,
+ "migratePrecheckTimerMs": 100,
+ "prepareTimerMs": 100,
+ "reviewTimerMs": 100,
"deleteTimerMs": 100,
"primeTimerMs": 100,
"deprimeTimerMs": 100
diff --git a/csit/resources/tests/data/SettingSimPropertiesSuccess.json b/csit/resources/tests/data/SettingSimPropertiesSuccess.json
index e0673322..14fbe01a 100644
--- a/csit/resources/tests/data/SettingSimPropertiesSuccess.json
+++ b/csit/resources/tests/data/SettingSimPropertiesSuccess.json
@@ -6,6 +6,9 @@
"deleteSuccess": true,
"updateSuccess": true,
"migrateSuccess": true,
+ "migratePrecheck": true,
+ "prepare": true,
+ "review": true,
"primeSuccess": true,
"deprimeSuccess": true,
"deployTimerMs": 100,
@@ -14,6 +17,9 @@
"unlockTimerMs": 100,
"updateTimerMs": 100,
"migrateTimerMs": 100,
+ "migratePrecheckTimerMs": 100,
+ "prepareTimerMs": 100,
+ "reviewTimerMs": 100,
"deleteTimerMs": 100,
"primeTimerMs": 100,
"deprimeTimerMs": 100
diff --git a/csit/resources/tests/data/SettingSimPropertiesTimeout.json b/csit/resources/tests/data/SettingSimPropertiesTimeout.json
new file mode 100644
index 00000000..a63c3044
--- /dev/null
+++ b/csit/resources/tests/data/SettingSimPropertiesTimeout.json
@@ -0,0 +1,26 @@
+{
+ "deploySuccess": true,
+ "undeploySuccess": true,
+ "lockSuccess": true,
+ "unlockSuccess": true,
+ "deleteSuccess": true,
+ "updateSuccess": true,
+ "migrateSuccess": true,
+ "migratePrecheck": true,
+ "prepare": true,
+ "review": true,
+ "primeSuccess": true,
+ "deprimeSuccess": true,
+ "deployTimerMs": 260000,
+ "undeployTimerMs": 260000,
+ "lockTimerMs": 260000,
+ "unlockTimerMs": 260000,
+ "updateTimerMs": 260000,
+ "migrateTimerMs": 260000,
+ "migratePrecheckTimerMs": 260000,
+ "prepareTimerMs": 260000,
+ "reviewTimerMs": 260000,
+ "deleteTimerMs": 260000,
+ "primeTimerMs": 260000,
+ "deprimeTimerMs": 260000
+}
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}