From: FrancescoFioraEst Date: Fri, 6 Jun 2025 10:11:35 +0000 (+0100) Subject: Update CSIT for configurable timeout for operations X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=1e361efcd8a4b3caab4f41f34078024e85ac9d73;p=policy%2Fdocker.git Update CSIT for configurable timeout for operations Issue-ID: POLICY-5386 Change-Id: I2e80e253697099a208ea014a7bb5e642ea27b255 Signed-off-by: FrancescoFioraEst --- diff --git a/csit/resources/tests/data/ac-definition-migration-from.yaml b/csit/resources/tests/data/ac-definition-migration-from.yaml index 2ed23d25..99ce31ff 100644 --- a/csit/resources/tests/data/ac-definition-migration-from.yaml +++ b/csit/resources/tests/data/ac-definition-migration-from.yaml @@ -17,6 +17,9 @@ # ============LICENSE_END========================================================= tosca_definitions_version: tosca_simple_yaml_1_3 name: Migration-From +metadata: + primeTimeoutMs: 200000 + deprimeTimeoutMs: 100000 data_types: onap.datatypes.ToscaConceptIdentifier: derived_from: tosca.datatypes.Root diff --git a/csit/resources/tests/data/ac-definition-timeout.yaml b/csit/resources/tests/data/ac-definition-timeout.yaml new file mode 100644 index 00000000..edfa7b0e --- /dev/null +++ b/csit/resources/tests/data/ac-definition-timeout.yaml @@ -0,0 +1,172 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 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. +# 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: Timeout +metadata: + primeTimeoutMs: 200 + deprimeTimeoutMs: 10000 +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.SimAutomationCompositionElement: + 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.Sim_StarterAutomationCompositionElement: + version: 1.2.3 + type: org.onap.policy.clamp.acm.SimAutomationCompositionElement + type_version: 1.0.0 + description: Automation composition element for the http requests of AC Element Starter microservice + properties: + provider: ONAP + startPhase: 0 + stage: + prepare: [1,2] + migrate: [1,2] + + onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement: + version: 1.2.3 + type: org.onap.policy.clamp.acm.SimAutomationCompositionElement + type_version: 1.0.0 + description: Automation composition element for the http requests of AC Element Bridge microservice + properties: + provider: ONAP + startPhase: 0 + stage: + prepare: [0,1] + migrate: [0,1] + + onap.policy.clamp.ac.element.Sim_SinkAutomationCompositionElement: + version: 1.2.3 + type: org.onap.policy.clamp.acm.SimAutomationCompositionElement + type_version: 1.0.0 + description: Automation composition element for the http requests of AC Element Sink microservice + properties: + provider: ONAP + startPhase: 0 + stage: + prepare: [0,2] + migrate: [0,2] + + 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.Sim_StarterAutomationCompositionElement + version: 1.2.3 + - name: onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement + version: 1.2.3 + - name: onap.policy.clamp.ac.element.Sim_SinkAutomationCompositionElement + version: 1.2.3 diff --git a/csit/resources/tests/data/ac-instance-migration-from.yaml b/csit/resources/tests/data/ac-instance-migration-from.yaml index 76858e4e..e20b9450 100644 --- a/csit/resources/tests/data/ac-instance-migration-from.yaml +++ b/csit/resources/tests/data/ac-instance-migration-from.yaml @@ -1,5 +1,5 @@ # ============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. @@ -28,6 +28,11 @@ elements: version: 1.2.3 description: Starter Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 baseUrl: http://address:30800 httpHeaders: Content-Type: application/json @@ -53,6 +58,11 @@ elements: version: 1.2.3 description: Bridge Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 baseUrl: http://address:30801 httpHeaders: Content-Type: application/json @@ -78,6 +88,11 @@ elements: version: 1.2.3 description: Sink Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 baseUrl: http://address:30802 httpHeaders: Content-Type: application/json diff --git a/csit/resources/tests/data/ac-instance-migration-to.yaml b/csit/resources/tests/data/ac-instance-migration-to.yaml index 68a31a59..ec6de189 100644 --- a/csit/resources/tests/data/ac-instance-migration-to.yaml +++ b/csit/resources/tests/data/ac-instance-migration-to.yaml @@ -1,5 +1,5 @@ # ============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. @@ -30,6 +30,11 @@ elements: version: 1.2.4 description: Starter Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 baseUrl: http://10.101.0.249:30800 configurationEntities: - configurationEntityId: @@ -42,6 +47,11 @@ elements: version: 1.2.4 description: Bridge Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 baseUrl: http://10.101.0.249:30801 configurationEntities: - configurationEntityId: @@ -54,6 +64,11 @@ elements: version: 1.2.4 description: Sink Automation Composition Element for the Demo properties: + deployTimeoutMs: 200000 + undeployTimeoutMs: 150000 + updateTimeoutMs: 200000 + migrateTimeoutMs: 200000 + deleteTimeoutMs: 100000 configurationEntities: - configurationEntityId: myParameterToUpdate: text updated for migration diff --git a/csit/resources/tests/data/ac-instance-timeout.yaml b/csit/resources/tests/data/ac-instance-timeout.yaml new file mode 100644 index 00000000..64331154 --- /dev/null +++ b/csit/resources/tests/data/ac-instance-timeout.yaml @@ -0,0 +1,112 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 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. +# 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-Timeout +version: 1.0.1 +compositionId: COMPOSITIONIDPLACEHOLDER +description: Demo automation composition instance timeout +elements: + + 709c62b3-8918-41b9-a747-d21eb79c6c34: + id: 709c62b3-8918-41b9-a747-d21eb79c6c34 + definition: + name: onap.policy.clamp.ac.element.Sim_StarterAutomationCompositionElement + version: 1.2.3 + description: Starter Automation Composition Element for the Demo + properties: + deployTimeoutMs: 200 + undeployTimeoutMs: 150 + updateTimeoutMs: 200 + migrateTimeoutMs: 200 + deleteTimeoutMs: 100 + 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-d21eb79c6c35: + id: 709c62b3-8918-41b9-a747-d21eb79c6c35 + definition: + name: onap.policy.clamp.ac.element.Sim_BridgeAutomationCompositionElement + version: 1.2.3 + description: Bridge Automation Composition Element for the Demo + properties: + deployTimeoutMs: 200 + undeployTimeoutMs: 150 + updateTimeoutMs: 200 + migrateTimeoutMs: 200 + deleteTimeoutMs: 100 + baseUrl: http://address:30801 + httpHeaders: + Content-Type: application/json + Authorization: Basic YWNtVXNlcjp6YiFYenRHMzQ= + configurationEntities: + - configurationEntityId: + name: onap.policy.clamp.ac.bridge + version: 1.0.0 + restSequence: + - restRequestId: + name: request2 + version: 1.0.1 + httpMethod: POST + path: /onap/policy/clamp/acelement/v2/activate + body: '{ "receiverId": { "name": "onap.policy.clamp.ac.bridgetosink", "version": "1.0.0" }, "timerMs": 20000, "elementType": "BRIDGE", "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-d21eb79c6c36: + id: 709c62b3-8918-41b9-a747-d21eb79c6c36 + definition: + name: onap.policy.clamp.ac.element.Sim_SinkAutomationCompositionElement + version: 1.2.3 + description: Sink Automation Composition Element for the Demo + properties: + deployTimeoutMs: 200 + undeployTimeoutMs: 150 + updateTimeoutMs: 200 + migrateTimeoutMs: 200 + deleteTimeoutMs: 100 + baseUrl: http://address:30802 + httpHeaders: + Content-Type: application/json + Authorization: Basic YWNtVXNlcjp6YiFYenRHMzQ= + configurationEntities: + - configurationEntityId: + name: onap.policy.clamp.ac.sink + version: 1.0.0 + restSequence: + - restRequestId: + name: request3 + version: 1.0.1 + httpMethod: POST + path: /onap/policy/clamp/acelement/v2/activate + body: '{ "receiverId": { "name": "onap.policy.clamp.ac.sink", "version": "1.0.0" }, "timerMs": 20000, "elementType": "SINK", "topicParameterGroup": { "server": "message-router", "listenerTopic": "POLICY_UPDATE_MSG", "publisherTopic": "AC_ELEMENT_MSG", "fetchTimeout": 15000, "topicCommInfrastructure": "dmaap" } }' + expectedResponse: 201 + myParameterToUpdate: text diff --git a/csit/resources/tests/policy-clamp-test.robot b/csit/resources/tests/policy-clamp-test.robot index cca01df0..23a220f8 100644 --- a/csit/resources/tests/policy-clamp-test.robot +++ b/csit/resources/tests/policy-clamp-test.robot @@ -37,65 +37,69 @@ RegisterParticipants Log Received response from runtime acm ${resp.text} Should Be Equal As Strings ${resp.status_code} 202 +CommissionAcDefinitionTimeout + [Documentation] Commission automation composition definition Timeout. + ${postyaml}= Get file ${CURDIR}/data/ac-definition-timeout.yaml + ${tmpCompositionId}= MakeCommissionAcDefinition ${postyaml} + set Suite variable ${compositionTimeoutId} ${tmpCompositionId} + +TimeoutPrimeACDefinition + [Documentation] Prime automation composition definition Timeout. + SetParticipantSimTimeout + ${postjson}= Get file ${CURDIR}/data/ACPriming.json + PrimeACDefinition ${postjson} ${compositionTimeoutId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResultPriming ${compositionTimeoutId} TIMEOUT + +DeleteACDefinitionTimeout + [Documentation] DePrime and Delete automation composition definition Timeout. + SetParticipantSimSuccess + ${postjson}= Get file ${CURDIR}/data/ACDepriming.json + PrimeACDefinition ${postjson} ${compositionTimeoutId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionTimeoutId} COMMISSIONED + DeleteACDefinition ${compositionTimeoutId} + CommissionAutomationComposition [Documentation] Commission automation composition definition. - ${auth}= ClampAuth ${postyaml}= Get file ${CURDIR}/data/acelement-usecase.yaml - ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions ${postyaml} ${auth} - ${respyaml}= yaml.Safe Load ${resp.text} - set Suite variable ${compositionId} ${respyaml["compositionId"]} - Should Be Equal As Strings ${resp.status_code} 201 + ${tmpCompositionId}= MakeCommissionAcDefinition ${postyaml} + set Suite variable ${compositionId} ${tmpCompositionId} CommissionAcDefinitionMigrationFrom [Documentation] Commission automation composition definition From. - ${auth}= ClampAuth ${postyaml}= Get file ${CURDIR}/data/ac-definition-migration-from.yaml - ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions ${postyaml} ${auth} - ${respyaml}= yaml.Safe Load ${resp.text} - set Suite variable ${compositionFromId} ${respyaml["compositionId"]} - Should Be Equal As Strings ${resp.status_code} 201 + ${tmpCompositionId}= MakeCommissionAcDefinition ${postyaml} + set Suite variable ${compositionFromId} ${tmpCompositionId} CommissionAcDefinitionMigrationTo [Documentation] Commission automation composition definition To. - ${auth}= ClampAuth ${postyaml}= Get file ${CURDIR}/data/ac-definition-migration-to.yaml - ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions ${postyaml} ${auth} - ${respyaml}= yaml.Safe Load ${resp.text} - set Suite variable ${compositionToId} ${respyaml["compositionId"]} - Should Be Equal As Strings ${resp.status_code} 201 + ${tmpCompositionId}= MakeCommissionAcDefinition ${postyaml} + set Suite variable ${compositionToId} ${tmpCompositionId} PrimeACDefinitions [Documentation] Prime automation composition definition - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACPriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionId} PRIMED FailPrimeACDefinitionFrom - [Documentation] Prime automation composition definition Migration From. + [Documentation] Prime automation composition definition Migration From with Fail. SetParticipantSimFail - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACPriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 2 min 5 sec VerifyFailedPriming ${compositionFromId} + PrimeACDefinition ${postjson} ${compositionFromId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResultPriming ${compositionFromId} FAILED PrimeACDefinitionFrom [Documentation] Prime automation composition definition Migration From. SetParticipantSimSuccess - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACPriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionFromId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionFromId} PRIMED PrimeACDefinitionTo [Documentation] Prime automation composition definition Migration To. - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACPriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionToId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionToId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionToId} PRIMED DeleteUndeployedInstantiateAutomationComposition @@ -114,60 +118,63 @@ InstantiateAutomationComposition ... ELSE set Suite variable ${instantiationfile} AcDocker.json ${postjson}= Get file ${CURDIR}/data/${instantiationfile} - ${instanceId}= MakeJsonInstantiateAutomationComposition ${compositionId} ${postjson} + ${tmpInstanceId}= MakeJsonInstantiateAutomationComposition ${compositionId} ${postjson} + Set Suite Variable ${instanceId} ${tmpInstanceId} + +InstantiateAutomationCompositionTimeout + [Documentation] Instantiate automation composition timeout. + ${postyaml}= Get file ${CURDIR}/data/ac-instance-timeout.yaml + ${tmpInstanceId}= MakeYamlInstantiateAutomationComposition ${compositionFromId} ${postyaml} + set Suite variable ${instanceTimeoutId} ${tmpInstanceId} + +DeployAutomationCompositionTimeout + [Documentation] Deploy automation composition timeout. + SetParticipantSimTimeout + ${postjson}= Get file ${CURDIR}/data/DeployAC.json + ChangeStatusAutomationComposition ${compositionFromId} ${instanceTimeoutId} ${postjson} + Wait Until Keyword Succeeds 5 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceTimeoutId} TIMEOUT + +DeleteAutomationCompositionTimeout + [Documentation] Delete automation composition timeout. + SetParticipantSimSuccess + ${postjson}= Get file ${CURDIR}/data/UndeployAC.json + ChangeStatusAutomationComposition ${compositionFromId} ${instanceTimeoutId} ${postjson} + Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionFromId} ${instanceTimeoutId} UNDEPLOYED + DeleteAutomationComposition ${compositionFromId} ${instanceTimeoutId} + Wait Until Keyword Succeeds 1 min 5 sec VerifyUninstantiated ${compositionFromId} InstantiateAutomationCompositionMigrationFrom [Documentation] Instantiate automation composition migration. - ${auth}= ClampAuth ${postyaml}= Get file ${CURDIR}/data/ac-instance-migration-from.yaml - ${updatedpostyaml}= Replace String ${postyaml} COMPOSITIONIDPLACEHOLDER ${compositionFromId} - ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId}/instances ${updatedpostyaml} ${auth} - ${respyaml}= yaml.Safe Load ${resp.text} - set Suite variable ${instanceMigrationId} ${respyaml["instanceId"]} - Should Be Equal As Strings ${resp.status_code} 201 + ${tmpInstanceId}= MakeYamlInstantiateAutomationComposition ${compositionFromId} ${postyaml} + set Suite variable ${instanceMigrationId} ${tmpInstanceId} 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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} 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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId} VerifyPrepareElementsRuntime ${compositionFromId} ${instanceMigrationId} 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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} 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 - DeployAutomationComposition [Documentation] Deploy automation composition. - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/DeployAC.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 + ChangeStatusAutomationComposition ${compositionId} ${instanceId} ${postjson} Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} DEPLOYED CheckTraces @@ -227,17 +234,11 @@ QueryPolicyTypes Should Be Equal As Strings ${resp.status_code} 200 List Should Contain Value ${resp.json()['policy_types']} onap.policies.native.Apex -CheckTimeoutAutomationComposition - [Documentation] Timeout Deploy automation composition. - Wait Until Keyword Succeeds 5 min 5 sec VerifyStateChangeResult ${compositionFromId} ${instanceMigrationId} TIMEOUT - DeployAutomationCompositionMigration [Documentation] Deploy automation composition. SetParticipantSimSuccess - ${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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} Wait Until Keyword Succeeds 2 min 5 sec VerifyDeployStatus ${compositionFromId} ${instanceMigrationId} DEPLOYED SendOutPropertiesToRuntime @@ -259,19 +260,15 @@ SendOutPropertiesToRuntime 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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} 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 + ChangeStatusAutomationComposition ${compositionFromId} ${instanceMigrationId} ${postjson} Wait Until Keyword Succeeds 10 min 5 sec VerifySubStatus ${compositionFromId} ${instanceMigrationId} AutomationCompositionUpdate @@ -331,45 +328,35 @@ FailAutomationCompositionMigration FailDePrimeACDefinitionsFrom [Documentation] Fail DePrime automation composition definition migration From. SetParticipantSimFail - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACDepriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 - Wait Until Keyword Succeeds 2 min 5 sec VerifyFailedPriming ${compositionFromId} + PrimeACDefinition ${postjson} ${compositionFromId} + Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResultPriming ${compositionFromId} FAILED DePrimeACDefinitionsFrom [Documentation] DePrime automation composition definition migration From. SetParticipantSimSuccess - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACDepriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionFromId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionFromId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionFromId} COMMISSIONED UnDeployAutomationComposition [Documentation] UnDeploy automation composition. - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/UndeployAC.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 + ChangeStatusAutomationComposition ${compositionId} ${instanceId} ${postjson} Wait Until Keyword Succeeds 10 min 5 sec VerifyDeployStatus ${compositionId} ${instanceId} UNDEPLOYED FailUnDeployAutomationCompositionMigrationTo [Documentation] Fail UnDeploy automation composition migrated. SetParticipantSimFail - ${auth}= ClampAuth ${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 + ChangeStatusAutomationComposition ${compositionToId} ${instanceMigrationId} ${postjson} Wait Until Keyword Succeeds 2 min 5 sec VerifyStateChangeResult ${compositionToId} ${instanceMigrationId} FAILED UnDeployAutomationCompositionMigrationTo [Documentation] UnDeploy automation composition migrated. SetParticipantSimSuccess - ${auth}= ClampAuth ${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 + ChangeStatusAutomationComposition ${compositionToId} ${instanceMigrationId} ${postjson} Wait Until Keyword Succeeds 2 min 5 sec VerifyDeployStatus ${compositionToId} ${instanceMigrationId} UNDEPLOYED UnInstantiateAutomationComposition @@ -391,50 +378,27 @@ UnInstantiateAutomationCompositionMigrationTo DePrimeACDefinitions [Documentation] DePrime automation composition definition - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACDepriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionId} COMMISSIONED DePrimeACDefinitionsTo [Documentation] DePrime automation composition definition migration To. - ${auth}= ClampAuth ${postjson}= Get file ${CURDIR}/data/ACDepriming.json - ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionToId} ${postjson} ${auth} - Should Be Equal As Strings ${resp.status_code} 202 + PrimeACDefinition ${postjson} ${compositionToId} Wait Until Keyword Succeeds 2 min 5 sec VerifyPriming ${compositionToId} COMMISSIONED -DeleteACDefinition +DeleteACDefinitions [Documentation] Delete automation composition definition. - ${auth}= ClampAuth - Log Creating session http://${POLICY_RUNTIME_ACM_IP} - ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= DELETE On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId} headers=${headers} - Log Received response from runtime acm ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 + DeleteACDefinition ${compositionId} DeleteACDefinitionFrom [Documentation] Delete automation composition definition migration From. - ${auth}= ClampAuth - Log Creating session http://${POLICY_RUNTIME_ACM_IP} - ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= DELETE On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionFromId} headers=${headers} - Log Received response from runtime acm ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 + DeleteACDefinition ${compositionFromId} DeleteACDefinitionTo [Documentation] Delete automation composition definition migration To. - ${auth}= ClampAuth - Log Creating session http://${POLICY_RUNTIME_ACM_IP} - ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth} - ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml - ${resp}= DELETE On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionToId} headers=${headers} - Log Received response from runtime acm ${resp.text} - Should Be Equal As Strings ${resp.status_code} 200 - + DeleteACDefinition ${compositionToId} *** Keywords *** @@ -459,13 +423,13 @@ VerifyPriming Should Be Equal As Strings ${resp.json()['stateChangeResult']} NO_ERROR Run Keyword If ${resp.status_code}==200 Should Be Equal As Strings ${resp.json()['state']} ${primestate} -VerifyFailedPriming - [Arguments] ${theCompositionId} +VerifyStateChangeResultPriming + [Arguments] ${theCompositionId} ${stateChangeResult} [Documentation] Verify the AC definitions are primed to the participants ${auth}= ClampAuth ${resp}= MakeGetRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${theCompositionId} ${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} VerifyDeployStatus [Arguments] ${theCompositionId} ${theInstanceId} ${deploystate} @@ -587,15 +551,53 @@ ParticipantAuth ${auth}= Create List participantUser zb!XztG34 RETURN ${auth} +MakeCommissionAcDefinition + [Arguments] ${postyaml} + ${auth}= ClampAuth + ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions ${postyaml} ${auth} + ${respyaml}= yaml.Safe Load ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + RETURN ${respyaml["compositionId"]} + +PrimeACDefinition + [Arguments] ${postjson} ${compositionId} + ${auth}= ClampAuth + ${resp}= MakeJsonPutRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId} ${postjson} ${auth} + Should Be Equal As Strings ${resp.status_code} 202 + +DeleteACDefinition + [Arguments] ${compositionId} + ${auth}= ClampAuth + Log Creating session http://${POLICY_RUNTIME_ACM_IP} + ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP} auth=${auth} + ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml + ${resp}= DELETE On Session policy /onap/policy/clamp/acm/v2/compositions/${compositionId} headers=${headers} + Log Received response from runtime acm ${resp.text} + Should Be Equal As Strings ${resp.status_code} 200 + MakeJsonInstantiateAutomationComposition [Arguments] ${compositionId} ${postjson} ${auth}= ClampAuth ${updatedpostjson}= Replace String ${postjson} COMPOSITIONIDPLACEHOLDER ${compositionId} ${resp}= MakeJsonPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances ${updatedpostjson} ${auth} ${respyaml}= yaml.Safe Load ${resp.text} - set Suite variable ${instanceId} ${respyaml["instanceId"]} Should Be Equal As Strings ${resp.status_code} 201 - RETURN ${instanceId} + RETURN ${respyaml["instanceId"]} + +MakeYamlInstantiateAutomationComposition + [Arguments] ${compositionId} ${postyaml} + ${auth}= ClampAuth + ${updatedpostyaml}= Replace String ${postyaml} COMPOSITIONIDPLACEHOLDER ${compositionId} + ${resp}= MakeYamlPostRequest ACM ${POLICY_RUNTIME_ACM_IP} /onap/policy/clamp/acm/v2/compositions/${compositionId}/instances ${updatedpostyaml} ${auth} + ${respyaml}= yaml.Safe Load ${resp.text} + Should Be Equal As Strings ${resp.status_code} 201 + RETURN ${respyaml["instanceId"]} + +ChangeStatusAutomationComposition + [Arguments] ${compositionId} ${instanceId} ${postjson} + ${auth}= ClampAuth + ${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 DeleteAutomationComposition [Arguments] ${compositionId} ${instanceId}