# ============LICENSE_START=======================================================
-# Copyright (C) 2024 Nordix Foundation.
+# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
in reverse start phase order. Automation Composition Elements with the same start phase are started and
stopped simultaneously
stage:
- type: list
- description: A list indicating the stages in which this automation composition element will be started, the
+ type: map
+ description: A map of list indicating for each operation the stages in which this automation composition element will be started, the
first stage is zero. Automation Composition Elements are started in their stage order.
Automation Composition Elements with the same stage are started simultaneously.
properties:
provider: ONAP
startPhase: 0
- stage: [1,2]
+ stage:
+ prepare: [1,2]
+ migrate: [1,2]
onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement:
version: 1.2.3
properties:
provider: ONAP
startPhase: 0
- stage: [0,1]
+ stage:
+ prepare: [0,1]
+ migrate: [0,1]
onap.policy.clamp.ac.element.Sim_SinkAutomationCompositionElement:
version: 1.2.3
properties:
provider: ONAP
startPhase: 0
- stage: [0,2]
+ stage:
+ prepare: [0,2]
+ migrate: [0,2]
onap.policy.clamp.ac.element.AutomationCompositionDefinition:
version: 1.2.3
# ============LICENSE_START=======================================================
-# Copyright (C) 2024 Nordix Foundation.
+# Copyright (C) 2024-2025 OpenInfra Foundation Europe. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
in reverse start phase order. Automation Composition Elements with the same start phase are started and
stopped simultaneously
stage:
- type: list
- description: A list indicating the stages in which this automation composition element will be started, the
+ type: map
+ description: A map of list indicating for each operation the stages in which this automation composition element will be started, the
first stage is zero. Automation Composition Elements are started in their stage order.
Automation Composition Elements with the same stage are started simultaneously.
properties:
provider: ONAP
startPhase: 0
- stage: [1,2]
+ stage:
+ prepare: [1,2]
+ migrate: [1,2]
onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement:
version: 1.2.4
properties:
provider: ONAP
startPhase: 0
- stage: [0,1]
+ stage:
+ prepare: [0,1]
+ migrate: [0,1]
onap.policy.clamp.ac.element.Sim_NewAutomationCompositionElement:
version: 1.2.4
properties:
provider: ONAP
startPhase: 0
- stage: [0,2]
+ stage:
+ prepare: [0,2]
+ migrate: [0,2]
onap.policy.clamp.ac.element.AutomationCompositionDefinition:
version: 1.2.4
set Suite variable ${instanceMigrationId} ${respyaml["instanceId"]}
Should Be Equal As Strings ${resp.status_code} 201
+FailPrepareAutomationCompositionMigrationFrom
+ [Documentation] Fail Prepare automation composition migration.
+ SetParticipantSimFail
+ ${auth}= ClampAuth
+ ${postjson}= Get file ${CURDIR}/data/PrepareAC.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
+
+PrepareAutomationCompositionMigrationFrom
+ [Documentation] Prepare automation composition migration.
+ SetParticipantSimSuccess
+ ${auth}= ClampAuth
+ ${postjson}= Get file ${CURDIR}/data/PrepareAC.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 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId}
+ VerifyPrepareElementsRuntime ${compositionFromId} ${instanceMigrationId}
+
FailDeployAutomationCompositionMigration
[Documentation] Fail Deploy automation composition.
SetParticipantSimFail
${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 VerifySubStatus ${compositionId} ${instanceId}
-
DeployAutomationComposition
[Documentation] Deploy automation composition.
${auth}= ClampAuth
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}= ClampAuth
- ${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 VerifySubStatus ${compositionId} ${instanceId}
-
CheckTimeoutAutomationComposition
[Documentation] Timeout Deploy automation composition.
Wait Until Keyword Succeeds 5 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} TIMEOUT
Should Be Equal As Strings ${resp.status_code} 200
Wait Until Keyword Succeeds 2 min 5 sec VerifyPropertiesUpdated ${compositionFromId} ${instanceMigrationId} MyTextToSend
+FailReviewAutomationCompositionMigrationFrom
+ [Documentation] Fail Review automation composition migration.
+ SetParticipantSimFail
+ ${auth}= ClampAuth
+ ${postjson}= Get file ${CURDIR}/data/ReviewAC.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
+
+ReviewAutomationCompositionMigrationFrom
+ [Documentation] Review automation composition migration.
+ SetParticipantSimSuccess
+ ${auth}= ClampAuth
+ ${postjson}= Get file ${CURDIR}/data/ReviewAC.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 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId}
+
AutomationCompositionUpdate
[Documentation] Update of an automation composition.
${auth}= ClampAuth
${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c37']['outProperties']['stage']}
Should Be Equal As Strings ${respstring} [0, 2]
+VerifyPrepareElementsRuntime
+ [Arguments] ${theCompositionId} ${theInstanceId}
+ [Documentation] Verify the Instance elements after Prepare
+ ${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
+ ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c34']['outProperties']['prepareStage']}
+ Should Be Equal As Strings ${respstring} [1, 2]
+ ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c35']['outProperties']['prepareStage']}
+ Should Be Equal As Strings ${respstring} [0, 1]
+ ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb79c6c36']['outProperties']['prepareStage']}
+ Should Be Equal As Strings ${respstring} [0, 2]
+
VerifyMigratedElementsSim
[Arguments] ${theInstanceId}
[Documentation] Query on Participant Simulator