blob: 09ab453f93852f01058dc96b8db086bb40302ea6 [file] [log] [blame]
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
liamfallon516e6722021-10-29 12:00:21 +01002.. _clamp-participant-protocol-smoke-tests:
3
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +01004CLAMP Participant Protocol Smoke Tests
liamfallon516e6722021-10-29 12:00:21 +01005--------------------------------------
6
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010071. Introduction
8***************
liamfallon516e6722021-10-29 12:00:21 +01009
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010010The CLAMP Automation Composition Participant protocol is an asynchronous protocol that is used by the CLAMP runtime
11to coordinate life cycle management of Automation Composition instances.
lapentafd45ce6552022-04-12 11:23:22 +010012This document will serve as a guide to do smoke tests on the different use cases that are involved when
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010013working with the Participant protocol and outline how they operate.
14It will also show a developer how to set up their environment for carrying out smoke tests on the participants.
15
162. Setup Guide
17**************
liamfallon516e6722021-10-29 12:00:21 +010018
19This section will show the developer how to set up their environment to start testing participants with some
lapentafd45ce6552022-04-12 11:23:22 +010020instructions on how to carry out the tests. There are several prerequisites. Note that this guide is written by a
liamfallon516e6722021-10-29 12:00:21 +010021Linux user - although the majority of the steps show will be exactly the same in Windows or other systems.
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010022
232.1 Prerequisites
24=================
liamfallon516e6722021-10-29 12:00:21 +010025
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010026- Java 11
27- Docker
28- Maven 3
29- Git
30- Refer to this guide for basic environment setup `Setting up dev environment <https://wiki.onap.org/display/DW/Setting+Up+Your+Development+Environment>`_
31
322.2 Setting up the components
33=============================
liamfallon516e6722021-10-29 12:00:21 +010034
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010035- Automation Composition runtime component docker image is started and running.
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010036- Participant docker images policy-clamp-cl-pf-ppnt, policy-clamp-cl-http-ppnt, policy-clamp-cl-k8s-ppnt are started and running.
37- Dmaap simulator for communication between components.
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010038- mariadb docker container for policy and clampacm database.
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010039- policy-api for communication between policy participant and policy-framework
liamfallon516e6722021-10-29 12:00:21 +010040
41In this setup guide, we will be setting up all the components technically required for a working convenient
lapentafd45ce6552022-04-12 11:23:22 +010042dev environment. We will not be setting up all the participants - we will setup only the policy participant as an
liamfallon516e6722021-10-29 12:00:21 +010043example.
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010044
452.2.1 MariaDB Setup
46===================
liamfallon516e6722021-10-29 12:00:21 +010047
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010048We will be using Docker to run our mariadb instance. It will have a total of two databases running in it.
liamfallon516e6722021-10-29 12:00:21 +010049
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010050- clampacm: the runtime-clampacm db
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010051- policyadmin: the policy-api db
52
533. Running Tests of protocol dialogues
54**************************************
liamfallon516e6722021-10-29 12:00:21 +010055
56loop type definitions and common property values for participant types.
57
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010058In this section, we will run through the functionalities mentioned at the start of this document is section 1. Each functionality will be tested and we will confirm that they were carried out successfully. There is a tosca service template that can be used for this test
59:download:`Tosca Service Template <tosca/tosca-for-gui-smoke-tests.yaml>`
60
613.1 Participant Registration
62============================
liamfallon516e6722021-10-29 12:00:21 +010063
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010064Action: Bring up the participant
liamfallon516e6722021-10-29 12:00:21 +010065
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010066Test result:
liamfallon516e6722021-10-29 12:00:21 +010067
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010068- Observe PARTICIPANT_REGISTER going from participant to runtime
69- Observe PARTICIPANT_REGISTER_ACK going from runtime to participant
70- Observe PARTICIPANT_UPDATE going from runtime to participant
71
723.2 Participant Deregistration
73==============================
liamfallon516e6722021-10-29 12:00:21 +010074
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010075Action: Bring down the participant
76Test result:
liamfallon516e6722021-10-29 12:00:21 +010077
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010078- Observe PARTICIPANT_DEREGISTER going from participant to runtime
79- Observe PARTICIPANT_DEREGISTER_ACK going from runtime to participant
80
813.3 Participant Priming
82=======================
liamfallon516e6722021-10-29 12:00:21 +010083
lapentafd45ce6552022-04-12 11:23:22 +010084When an automation composition is primed, the portion of the Automation Composition Type Definition and Common Property values for the participants
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010085of each participant type mentioned in the Automation Composition Definition are sent to the participants.
86Action: Invoke a REST API to prime acm type definitions and set values of common properties
liamfallon516e6722021-10-29 12:00:21 +010087
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010088Test result:
liamfallon516e6722021-10-29 12:00:21 +010089
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010090- Observe PARTICIPANT_UPDATE going from runtime to participant with acm type definitions and common property values for participant types
91- Observe that the acm type definitions and common property values for participant types are stored on ParticipantHandler
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +010092- Observe PARTICIPANT_UPDATE_ACK going from runtime to participant
93
943.4 Participant DePriming
95=========================
liamfallon516e6722021-10-29 12:00:21 +010096
lapentafd45ce6552022-04-12 11:23:22 +010097When an automation composition is de-primed, the portion of the Automation Composition Type Definition and Common Property values for the participants
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +010098of each participant type mentioned in the Automation Composition Definition are deleted on participants.
99Action: Invoke a REST API to deprime acm type definitions
liamfallon516e6722021-10-29 12:00:21 +0100100
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100101Test result:
liamfallon516e6722021-10-29 12:00:21 +0100102
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100103- If acm instances exist in runtime database, return a response for the REST API with error response saying "Cannot decommission acm type definition"
104- If no acm instances exist in runtime database, Observe PARTICIPANT_UPDATE going from runtime to participant with definitions as null
105- Observe that the acm type definitions and common property values for participant types are removed on ParticipantHandler
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100106- Observe PARTICIPANT_UPDATE_ACK going from runtime to participant
107
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001083.5 Automation Composition Update
109=================================
liamfallon516e6722021-10-29 12:00:21 +0100110
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100111Automation Composition Update handles creation, change, and deletion of automation compositions on participants.
112Action: Trigger acm instantiation from GUI
liamfallon516e6722021-10-29 12:00:21 +0100113
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100114Test result:
liamfallon516e6722021-10-29 12:00:21 +0100115
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100116- Observe AUTOMATION_COMPOSITION_UPDATE going from runtime to participant
117- Observe that the acm type instances and respective property values for participant types are stored on AutomationCompositionHandler
118- Observe that the acm state is UNINITIALISED
119- Observe AUTOMATION_COMPOSITION_UPDATE_ACK going from participant to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100120
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001213.6 Automation Composition state change to PASSIVE
122==================================================
liamfallon516e6722021-10-29 12:00:21 +0100123
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100124Automation Composition Update handles creation, change, and deletion of automation compositions on participants.
125Action: Change state of the acm to PASSIVE
liamfallon516e6722021-10-29 12:00:21 +0100126
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100127Test result:
liamfallon516e6722021-10-29 12:00:21 +0100128
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100129- Observe AUTOMATION_COMPOSITION_STATE_CHANGE going from runtime to participant
130- Observe that the AutomationCompositionElements state is PASSIVE
131- Observe that the acm state is PASSIVE
132- Observe AUTOMATION_COMPOSITION_STATE_CHANGE_ACK going from participant to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100133
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001343.7 Automation Composition state change to RUNNING
135==================================================
liamfallon516e6722021-10-29 12:00:21 +0100136
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100137Automation Composition Update handles creation, change, and deletion of automation compositions on participants.
138Action: Change state of the acm to RUNNING
liamfallon516e6722021-10-29 12:00:21 +0100139
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100140Test result:
liamfallon516e6722021-10-29 12:00:21 +0100141
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100142- Observe AUTOMATION_COMPOSITION_STATE_CHANGE going from runtime to participant
143- Observe that the AutomationCompositionElements state is RUNNING
144- Observe that the acm state is RUNNING
145- Observe AUTOMATION_COMPOSITION_STATE_CHANGE_ACK going from participant to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100146
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001473.8 Automation Composition state change to PASSIVE
148==================================================
liamfallon516e6722021-10-29 12:00:21 +0100149
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100150Automation Composition Update handles creation, change, and deletion of automation compositions on participants.
151Action: Change state of the acm to PASSIVE
liamfallon516e6722021-10-29 12:00:21 +0100152
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100153Test result:
liamfallon516e6722021-10-29 12:00:21 +0100154
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100155- Observe AUTOMATION_COMPOSITION_STATE_CHANGE going from runtime to participant
156- Observe that the AutomationCompositionElements state is PASSIVE
157- Observe that the acm state is PASSIVE
158- Observe AUTOMATION_COMPOSITION_STATE_CHANGE_ACK going from participant to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100159
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001603.9 Automation Composition state change to UNINITIALISED
161========================================================
liamfallon516e6722021-10-29 12:00:21 +0100162
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100163Automation Composition Update handles creation, change, and deletion of automation compositions on participants.
164Action: Change state of the acm to UNINITIALISED
liamfallon516e6722021-10-29 12:00:21 +0100165
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100166Test result:
liamfallon516e6722021-10-29 12:00:21 +0100167
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100168- Observe AUTOMATION_COMPOSITION_STATE_CHANGE going from runtime to participant
169- Observe that the AutomationCompositionElements state is UNINITIALISED
170- Observe that the acm state is UNINITIALISED
171- Observe that the AutomationCompositionElements undeploy the instances from respective frameworks
172- Observe that the automation composition instances are removed from participants
173- Observe AUTOMATION_COMPOSITION_STATE_CHANGE_ACK going from participant to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100174
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +01001753.10 Automation Composition monitoring and reporting
176====================================================
liamfallon516e6722021-10-29 12:00:21 +0100177
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100178This dialogue is used as a heartbeat mechanism for participants, to monitor the status of Automation Composition Elements, and to gather statistics on automation compositions. The ParticipantStatus message is sent periodically by each participant. The reporting interval for sending the message is configurable
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100179Action: Bring up participant
liamfallon516e6722021-10-29 12:00:21 +0100180
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100181Test result:
liamfallon516e6722021-10-29 12:00:21 +0100182
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100183- Observe that PARTICIPANT_STATUS message is sent from participants to runtime in a regular interval
Sirisha_Manchikanti49b59ca2022-04-03 15:02:43 +0100184- Trigger a PARTICIPANT_STATUS_REQ from runtime and observe a PARTICIPANT_STATUS message with tosca definitions of automation composition type definitions sent
liamfallon516e6722021-10-29 12:00:21 +0100185 from all the participants to runtime
Sirisha_Manchikanti0f409502021-10-19 13:16:02 +0100186
187This concluded the required smoke tests
188