summaryrefslogtreecommitdiffstats
path: root/docs/development/devtools/clamp-policy.rst
blob: a0e11152bbd00538b1b0f0fc7e7ec6429272a57d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
.. This work is licensed under a
.. Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

.. _clamp-pairwise-testing-label:

.. toctree::
   :maxdepth: 2

CLAMP <-> Policy Core
~~~~~~~~~~~~~~~~~~~~~

The pairwise testing is executed against a default ONAP installation in the OOM.
CLAMP-Control loop interacts with Policy framework to create and deploy policies.
This test verifies the interaction between policy and controlloop works as expected.

General Setup
*************

The kubernetes installation allocated all policy components across multiple worker node VMs.
The worker VM hosting the policy components has the following spec:

- 16GB RAM
- 8 VCPU
- 160GB Ephemeral Disk


The ONAP components used during the pairwise tests are:

- CLAMP control loop runtime, policy participant, kubernetes participant.
- DMaaP for the communication between Control loop runtime and participants.
- Policy API to create (and delete at the end of the tests) policies for each
  scenario under test.
- Policy PAP to deploy (and undeploy at the end of the tests) policies for each scenario under test.
- Policy Gui for instantiation and commissioning of control loops.


Testing procedure
*****************

The test set focused on the following use cases:

- creation/Deletion of policies
- Deployment/Undeployment of policies

Creation of the Control Loop:
-----------------------------
A Control Loop is created by commissioning a Tosca template with Control loop definitions and instantiating the Control Loop with the state "UNINITIALISED".

- Upload a TOSCA template from the POLICY GUI. The definitions includes a policy participant and a control loop element that creates and deploys required policies. :download:`Sample Tosca template <tosca/pairwise-testing.yml>`

  .. image:: images/cl-commission.png

  Verification: The template is commissioned successfully without errors.

- Instantiate the commissioned Control loop from the Policy Gui under 'Instantiation Management'.

  .. image:: images/create-instance.png

  Update instance properties of the Control Loop Elements if required.

  .. image:: images/update-instance.png

  Verification: The control loop is created with default state "UNINITIALISED" without errors.

  .. image:: images/cl-instantiation.png


Creation of policies:
---------------------
The Control Loop state is changed from "UNINITIALISED" to "PASSIVE" from the Policy Gui. Verify the POLICY API endpoint for the creation of policy types that are defined in the TOSCA template.

.. image:: images/cl-passive.png

Verification:

- The policy types defined in the tosca template is created by the policy participant and listed in the policy Api.
  Policy Api endpoint: `<https://<POLICY-API-IP>/policy/api/v1/policytypes>`

- The overall state of the Control Loop is changed to "PASSIVE" in the Policy Gui.

.. image:: images/cl-create.png


Deployment of policies:
-----------------------
The Control Loop state is changed from "PASSIVE" to "RUNNING" from the Policy Gui.

.. image:: images/cl-running.png

Verification:

- The policy participant deploys the policies of Tosca Control loop elements in Policy PAP for all the pdp groups.
  Policy PAP endpoint: `<https://<POLICY-PAP-IP>/policy/pap/v1/pdps>`

- The overall state of the Control Loop is changed to "RUNNING" in the Policy Gui.

.. image:: images/cl-running-state.png

Deletion of Policies:
---------------------
The Control Loop state is changed from "RUNNING" to "PASSIVE" from the Policy Gui.

Verification:

- The policy participant deletes the created policy types which can be verified on the Policy Api. The policy types created as part of the control loop should not be listed on the Policy Api.
  Policy Api endpoint: `<https://<POLICY-API-IP>/policy/api/v1/policytypes>`

- The overall state of the Control Loop is changed to "PASSIVE" in the Policy Gui.

.. image:: images/cl-create.png

Undeployment of policies:
-------------------------
The Control Loop state is changed from "PASSIVE" to "UNINITIALISED" from the Policy Gui.

Verification:

- The policy participant undeploys the policies of the control loop element from the pdp groups. The policies deployed as part of the control loop should not be listed on the Policy PAP.
  Policy PAP endpoint: `<https://<POLICY-PAP-IP>/policy/pap/v1/pdps>`

- The overall state of the Control Loop is changed to "UNINITIALISED" in the Policy Gui.

.. image:: images/cl-uninitialised-state.png