blob: f819d2d24211d9135c33c88e38bb6b3a6cd6c0b0 [file] [log] [blame]
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +01001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6
7*** Test Cases ***
8
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +00009CommissionAutomationCompositionV1
10 [Documentation] Commission automation composition.
11 ${auth}= Create List runtimeUser zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010012 Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000013 ${postyaml}= Get file ${CURDIR}/data/PMSHMultipleACTosca.yaml
liamfallonfaac45b2022-09-01 12:05:47 +010014 ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010015 ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000016 ${resp}= POST On Session policy /onap/policy/clamp/acm/v2/commission data=${postyaml} headers=${headers}
17 Log Received response from runtime acm ${resp.text}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010018 Should Be Equal As Strings ${resp.status_code} 200
19
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000020InstantiateAutomationCompositionV1
21 [Documentation] Instantiate automation composition.
22 ${auth}= Create List runtimeUser zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010023 Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000024 ${postjson}= Get file ${CURDIR}/data/InstantiateAC.json
liamfallonfaac45b2022-09-01 12:05:47 +010025 ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010026 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000027 ${resp}= POST On Session policy /onap/policy/clamp/acm/v2/instantiation data=${postjson} headers=${headers}
28 Log Received response from runtime acm ${resp.text}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010029 Should Be Equal As Strings ${resp.status_code} 200
30
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000031PassivateAutomationComposition
32 [Documentation] Passivate automation composition.
33 ${auth}= Create List runtimeUser zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010034 Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000035 ${postjson}= Get file ${CURDIR}/data/PassivateAC.json
liamfallonfaac45b2022-09-01 12:05:47 +010036 ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010037 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000038 ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/instantiation/command data=${postjson} headers=${headers}
39 Log Received response from runtime acm ${resp.text}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010040 Should Be Equal As Strings ${resp.status_code} 202
41
42QueryPolicies
43 [Documentation] Runs Policy Participant Query New Policies
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000044 ${auth}= Create List policyadmin zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010045 Log Creating session http://${POLICY_API_IP}:6969
46 ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010047 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
48 ${resp}= GET On Session policy /policy/api/v1/policies headers=${headers}
49 Log Received response from policy-api {resp.text}
50 Should Be Equal As Strings ${resp.status_code} 200
51
52QueryPolicyTypes
53 [Documentation] Runs Policy Participant Query New Policy Types
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000054 ${auth}= Create List policyadmin zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010055 Log Creating session http://${POLICY_API_IP}:6969
56 ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010057 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
58 ${resp}= GET On Session policy /policy/api/v1/policytypes headers=${headers}
59 Log Received response from policy-api ${resp.text}
60 Should Be Equal As Strings ${resp.status_code} 200
61
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000062StateChangeRunningAutomationComposition
63 [Documentation] AutomationComposition State Change to RUNNING.
64 ${auth}= Create List runtimeUser zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010065 Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000066 ${postjson}= Get file ${CURDIR}/data/StateChangeRunningAC.json
liamfallonfaac45b2022-09-01 12:05:47 +010067 ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010068 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000069 ${resp}= PUT On Session policy /onap/policy/clamp/acm/v2/instantiation/command data=${postjson} headers=${headers} expected_status=406
70 Log Received response from runtime acm ${resp.text}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010071
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000072QueryInstantiatedACs
73 [Documentation] Get Instantiated AutomationCompositions
74 ${auth}= Create List runtimeUser zb!XztG34
liamfallonfaac45b2022-09-01 12:05:47 +010075 Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969
76 ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010077 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000078 ${resp}= GET On Session policy /onap/policy/clamp/acm/v2/instantiation headers=${headers}
79 Log Received response from runtime acm ${resp.text}
Sirisha_Manchikanti4d0a1d72021-06-08 09:28:21 +010080 Should Be Equal As Strings ${resp.status_code} 200
Sirisha_Manchikantib71490f2022-02-17 17:55:21 +000081 Should Be Equal As Strings ${resp.json()['automationCompositionList'][0]['state']} UNINITIALISED2PASSIVE
82 Should Be Equal As Strings ${resp.json()['automationCompositionList'][0]['orderedState']} RUNNING