Sim-ppnt-3 supports 2 element types.
Multiple element type test flow to test basic acm operations involving
both the element types.
Issue-ID: POLICY-5550
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
Change-Id: Ic14332b2af0b8f909075a5620e6a0a7ce12224a2
participantId: 101c62b3-8918-41b9-a747-d21eb79c6c92
applicationName: sim-ppnt-3
groupId: policy-clamp-ac-sim-ppnt-3
- supportedElementTypeName: org.onap.policy.clamp.acm.SimAutomationCompositionElement3
+ PARTICIPANT_INTERMEDIARYPARAMETERS_PARTICIPANTSUPPORTEDELEMENTTYPES_0_TYPENAME: org.onap.policy.clamp.acm.SimAutomationCompositionElement3
+ PARTICIPANT_INTERMEDIARYPARAMETERS_PARTICIPANTSUPPORTEDELEMENTTYPES_0_TYPEVERSION: 1.0.0
+ PARTICIPANT_INTERMEDIARYPARAMETERS_PARTICIPANTSUPPORTEDELEMENTTYPES_1_TYPENAME: org.onap.policy.clamp.acm.SimAutomationCompositionElement4
+ PARTICIPANT_INTERMEDIARYPARAMETERS_PARTICIPANTSUPPORTEDELEMENTTYPES_1_TYPEVERSION: 1.0.0
ports:
- ${SIM_PARTICIPANT3_PORT}:6969
Run Keyword If ${resp.status_code}==200 Should Match Regexp ${respstring} ${textToFind}
VerifyInternalStateElementsRuntime
- [Arguments] ${theCompositionId} ${theInstanceId} ${deploystate}
+ [Arguments] ${theCompositionId} ${theInstanceId} ${deploystate} ${elementId}
[Documentation] Verify the Instance elements during operation
${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()['deployState']} ${deploystate}
- ${respstring} Convert To String ${resp.json()['elements']['709c62b3-8918-41b9-a747-d21eb80c6c34']['outProperties']['InternalState']}
+ ${respstring} Convert To String ${resp.json()['elements']['${elementId}']['outProperties']['InternalState']}
Should Be Equal As Strings ${respstring} ${deploystate}
VerifyMigratedElementsRuntime
Should Be Equal As Strings ${resp.status_code} 200
SetParticipantSimDelay
+ [Arguments] ${domain}
[Documentation] Set Participant Simulator Delay.
${auth}= ParticipantAuth
${postjson}= Get file ${CURDIR}/data/SettingSimPropertiesDelay.json
- ${resp}= MakeJsonPutRequest participant ${HTTP_PARTICIPANT_SIM1_IP} /onap/policy/simparticipant/v2/parameters ${postjson} ${auth}
+ ${resp}= MakeJsonPutRequest participant ${domain} /onap/policy/simparticipant/v2/parameters ${postjson} ${auth}
Should Be Equal As Strings ${resp.status_code} 200
--- /dev/null
+*** Settings ***
+Name AC with participant supporting multiple element types Workflow
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library String
+Library json
+Library yaml
+Library Process
+Resource common-library.robot
+Resource clamp-common.robot
+
+*** Test Cases ***
+CommissionACMultipleElementTypes
+ [Documentation] Commission automation composition definition with multiple element types.
+ ${postyaml}= Get file ${CURDIR}/data/ac-definition-multiple.yaml
+ ${tmpCompositionId}= MakeCommissionAcDefinition ${postyaml}
+ set Suite variable ${compositionId} ${tmpCompositionId}
+
+PrimeACDefinition
+ [Documentation] Prime automation composition definition
+ ${postjson}= Get file ${CURDIR}/data/ACPriming.json
+ PrimeACDefinition ${postjson} ${compositionId}
+ Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionId} PRIMED
+
+InstantiateAutomationComposition
+ [Documentation] Instantiate automation composition.
+ ${postyaml}= Get file ${CURDIR}/data/ac-instance-multiple.yaml
+ ${tmpInstanceId}= MakeYamlInstantiateAutomationComposition ${compositionId} ${postyaml}
+ set Suite variable ${instanceId} ${tmpInstanceId}
+
+FailDeployAutomationComposition
+ [Documentation] Fail Deploy automation composition.
+ SetParticipantSimFail ${HTTP_PARTICIPANT_SIM3_IP}
+ ${postjson}= Get file ${CURDIR}/data/DeployAC.json
+ ChangeStatusAutomationComposition ${compositionId} ${instanceId} ${postjson}
+ Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionId} ${instanceId} FAILED
+
+UnDeployAutomationComposition
+ [Documentation] UnDeploy automation composition.
+ SetParticipantSimDelay ${HTTP_PARTICIPANT_SIM3_IP}
+ ${postjson}= Get file ${CURDIR}/data/UndeployAC.json
+ ChangeStatusAutomationComposition ${compositionId} ${instanceId} ${postjson}
+ Wait Until Keyword Succeeds 1 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} UNDEPLOYING
+ Wait Until Keyword Succeeds 1 min 5 sec VerifyInternalStateElementsRuntime ${compositionId} ${instanceId} UNDEPLOYING 709c62b3-8918-41b9-a747-d21eb80c6c41
+ Wait Until Keyword Succeeds 1 min 5 sec VerifyInternalStateElementsRuntime ${compositionId} ${instanceId} UNDEPLOYING 709c62b3-8918-41b9-a747-d21eb80c6c42
+ Wait Until Keyword Succeeds 3 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} UNDEPLOYED
+ VerifyInternalStateElementsRuntime ${compositionId} ${instanceId} UNDEPLOYED 709c62b3-8918-41b9-a747-d21eb80c6c41
+ VerifyInternalStateElementsRuntime ${compositionId} ${instanceId} UNDEPLOYED 709c62b3-8918-41b9-a747-d21eb80c6c42
+
+UnInstantiateAutomationComposition
+ [Documentation] Delete automation composition instance.
+ SetParticipantSimSuccess ${HTTP_PARTICIPANT_SIM3_IP}
+ DeleteAutomationComposition ${compositionId} ${instanceId}
+ Wait Until Keyword Succeeds 1 min 5 sec VerifyUninstantiated ${compositionId}
+
+DeleteACDefinition
+ [Documentation] DePrime and Delete automation composition definition.
+ DePrimeAndDeleteACDefinition ${compositionId}
UnDeployAutomationCompositionSimple
[Documentation] UnDeploy simple automation composition.
- SetParticipantSimDelay
+ SetParticipantSimDelay ${HTTP_PARTICIPANT_SIM1_IP}
${postjson}= Get file ${CURDIR}/data/UndeployAC.json
ChangeStatusAutomationComposition ${simpleCompositionId} ${simpleInstanceId} ${postjson}
Wait Until Keyword Succeeds 1 min 5 sec VerifyDeployStatus ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYING
- Wait Until Keyword Succeeds 1 min 5 sec VerifyInternalStateElementsRuntime ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYING
+ Wait Until Keyword Succeeds 1 min 5 sec VerifyInternalStateElementsRuntime ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYING 709c62b3-8918-41b9-a747-d21eb80c6c34
Wait Until Keyword Succeeds 3 min 5 sec VerifyDeployStatus ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYED
- VerifyInternalStateElementsRuntime ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYED
+ VerifyInternalStateElementsRuntime ${simpleCompositionId} ${simpleInstanceId} UNDEPLOYED 709c62b3-8918-41b9-a747-d21eb80c6c34
UnInstantiateAutomationCompositionSimple
[Documentation] Delete simple automation composition instance.
--- /dev/null
+# ============LICENSE_START=======================================================
+# Copyright (C) 2026 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+tosca_definitions_version: tosca_simple_yaml_1_3
+name: Multiple
+data_types:
+ onap.datatypes.ToscaConceptIdentifier:
+ derived_from: tosca.datatypes.Root
+ properties:
+ name:
+ type: string
+ required: true
+ version:
+ type: string
+ required: true
+
+node_types:
+ org.onap.policy.clamp.acm.Participant:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ org.onap.policy.clamp.acm.AutomationCompositionElement:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ metadata:
+ common: true
+ description: Specifies the organization that provides the automation composition element
+ startPhase:
+ type: integer
+ required: false
+ constraints:
+ - greater_or_equal: 0
+ metadata:
+ common: true
+ description: A value indicating the start phase in which this automation composition element will be started, the
+ first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped
+ in reverse start phase order. Automation Composition Elements with the same start phase are started and
+ stopped simultaneously
+ stage:
+ 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.
+
+ org.onap.policy.clamp.acm.AutomationComposition:
+ version: 1.0.1
+ derived_from: tosca.nodetypes.Root
+ properties:
+ provider:
+ type: string
+ required: false
+ metadata:
+ common: true
+ description: Specifies the organization that provides the automation composition element
+ elements:
+ type: list
+ required: true
+ metadata:
+ common: true
+ entry_schema:
+ type: onap.datatypes.ToscaConceptIdentifier
+ description: Specifies a list of automation composition element definitions that make up this automation composition definition
+
+ org.onap.policy.clamp.acm.SimAutomationCompositionElement3:
+ version: 1.0.0
+ derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement
+ properties:
+ baseUrl:
+ type: string
+ required: true
+ description: The base URL to be prepended to each path, identifies the host for the REST endpoints.
+ metadata:
+ sensitive: true
+ httpHeaders:
+ type: map
+ required: false
+ entry_schema:
+ type: string
+ description: HTTP headers to send on REST requests
+ configurationEntities:
+ type: map
+ required: true
+ entry_schema:
+ type: map
+ description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests
+
+ org.onap.policy.clamp.acm.SimAutomationCompositionElement4:
+ version: 1.0.0
+ derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement
+ properties:
+ baseUrl:
+ type: string
+ required: true
+ description: The base URL to be prepended to each path, identifies the host for the REST endpoints.
+ metadata:
+ sensitive: true
+ httpHeaders:
+ type: map
+ required: false
+ entry_schema:
+ type: string
+ description: HTTP headers to send on REST requests
+ configurationEntities:
+ type: map
+ required: true
+ entry_schema:
+ type: map
+ description: The connfiguration entities the Automation Composition Element is managing and their associated REST requests
+
+topology_template:
+
+ node_templates:
+
+ org.onap.policy.clamp.acm.SimParticipant:
+ version: 2.3.4
+ type: org.onap.policy.clamp.acm.Participant
+ type_version: 1.0.1
+ description: Participant Simulator
+ properties:
+ provider: ONAP
+
+ onap.policy.clamp.ac.element.type1.Sim_AutomationCompositionElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.acm.SimAutomationCompositionElement3
+ type_version: 1.0.0
+ description: Automation composition element
+ properties:
+ provider: ONAP
+ startPhase: 0
+
+ onap.policy.clamp.ac.element.type2.Sim_AutomationCompositionElement:
+ version: 1.2.3
+ type: org.onap.policy.clamp.acm.SimAutomationCompositionElement4
+ type_version: 1.0.0
+ description: Automation composition element
+ properties:
+ provider: ONAP
+ startPhase: 0
+
+ onap.policy.clamp.ac.element.AutomationCompositionDefinition:
+ version: 1.2.3
+ type: org.onap.policy.clamp.acm.AutomationComposition
+ type_version: 1.0.1
+ description: Automation composition for Demo
+ properties:
+ provider: ONAP
+ elements:
+ - name: onap.policy.clamp.ac.element.type1.Sim_AutomationCompositionElement
+ version: 1.2.3
+ - name: onap.policy.clamp.ac.element.type2.Sim_AutomationCompositionElement
+ version: 1.2.3
--- /dev/null
+# ============LICENSE_START=======================================================
+# Copyright (C) 2026 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an AS IS BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+name: Instance-Multiple
+version: 1.0.1
+compositionId: COMPOSITIONIDPLACEHOLDER
+description: Automation composition instance with multiple element types for a single participant
+elements:
+
+ 709c62b3-8918-41b9-a747-d21eb80c6c41:
+ id: 709c62b3-8918-41b9-a747-d21eb80c6c41
+ definition:
+ name: onap.policy.clamp.ac.element.type1.Sim_AutomationCompositionElement
+ version: 1.2.3
+ description: Automation Composition Element type 1 of the participant
+ properties:
+ deployTimeoutMs: 200000
+ undeployTimeoutMs: 150000
+ updateTimeoutMs: 200000
+ migrateTimeoutMs: 200000
+ deleteTimeoutMs: 100000
+ baseUrl: http://address:30800
+ httpHeaders:
+ Content-Type: application/json
+ Authorization: Basic YWNtVXNlcjp6YiFYenRHMzQ=
+ configurationEntities:
+ - configurationEntityId:
+ name: onap.policy.clamp.ac.starter
+ version: 1.0.0
+ restSequence:
+ - restRequestId:
+ name: request1
+ version: 1.0.1
+ httpMethod: POST
+ path: /onap/policy/clamp/acelement/v2/activate
+ body: '{ "receiverId": { "name": "onap.policy.clamp.ac.startertobridge", "version": "1.0.0" }, "timerMs": 20000, "elementType": "STARTER", "topicParameterGroup": { "server": "message-router:3904", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "AC_ELEMENT_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }'
+ expectedResponse: 201
+ myParameterToUpdate: text
+
+ 709c62b3-8918-41b9-a747-d21eb80c6c42:
+ id: 709c62b3-8918-41b9-a747-d21eb80c6c42
+ definition:
+ name: onap.policy.clamp.ac.element.type2.Sim_AutomationCompositionElement
+ version: 1.2.3
+ description: Automation Composition Element type 2 of the participant
+ properties:
+ deployTimeoutMs: 200000
+ undeployTimeoutMs: 150000
+ updateTimeoutMs: 200000
+ migrateTimeoutMs: 200000
+ deleteTimeoutMs: 100000
+ baseUrl: http://address:30800
+ httpHeaders:
+ Content-Type: application/json
+ Authorization: Basic YWNtVXNlcjp6YiFYenRHMzQ=
+ configurationEntities:
+ - configurationEntityId:
+ name: onap.policy.clamp.ac.starter
+ version: 1.0.0
+ restSequence:
+ - restRequestId:
+ name: request1
+ version: 1.0.1
+ httpMethod: POST
+ path: /onap/policy/clamp/acelement/v2/activate
+ body: '{ "receiverId": { "name": "onap.policy.clamp.ac.startertobridge", "version": "1.0.0" }, "timerMs": 20000, "elementType": "STARTER", "topicParameterGroup": { "server": "message-router:3904", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "AC_ELEMENT_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }'
+ expectedResponse: 201
+ myParameterToUpdate: text
}
function setup_clamp() {
- export ROBOT_FILES="clamp-health-check.robot clamp-db-restore.robot clamp-single-element-test.robot clamp-timeout-test.robot
+ export ROBOT_FILES="clamp-health-check.robot clamp-db-restore.robot clamp-single-element-test.robot clamp-multiple-element-type-test.robot clamp-timeout-test.robot
clamp-migrate-rollback.robot clamp-trace-test.robot clamp-slas.robot"
export TEST_ENV="docker"
export PROJECT="clamp"