Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | *** Test Cases *** |
| 8 | |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 9 | CommissionAutomationCompositionV1 |
| 10 | [Documentation] Commission automation composition. |
| 11 | ${auth}= Create List runtimeUser zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 12 | Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969 |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 13 | ${postyaml}= Get file ${CURDIR}/data/PMSHMultipleACTosca.yaml |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 14 | ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 15 | ${headers}= Create Dictionary Accept=application/yaml Content-Type=application/yaml |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 16 | ${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_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 18 | Should Be Equal As Strings ${resp.status_code} 200 |
| 19 | |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 20 | InstantiateAutomationCompositionV1 |
| 21 | [Documentation] Instantiate automation composition. |
| 22 | ${auth}= Create List runtimeUser zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 23 | Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969 |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 24 | ${postjson}= Get file ${CURDIR}/data/InstantiateAC.json |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 25 | ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 26 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 27 | ${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_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 29 | Should Be Equal As Strings ${resp.status_code} 200 |
| 30 | |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 31 | PassivateAutomationComposition |
| 32 | [Documentation] Passivate automation composition. |
| 33 | ${auth}= Create List runtimeUser zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 34 | Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969 |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 35 | ${postjson}= Get file ${CURDIR}/data/PassivateAC.json |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 36 | ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 37 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 38 | ${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_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 40 | Should Be Equal As Strings ${resp.status_code} 202 |
| 41 | |
| 42 | QueryPolicies |
| 43 | [Documentation] Runs Policy Participant Query New Policies |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 44 | ${auth}= Create List policyadmin zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 45 | Log Creating session http://${POLICY_API_IP}:6969 |
| 46 | ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 47 | ${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 | |
| 52 | QueryPolicyTypes |
| 53 | [Documentation] Runs Policy Participant Query New Policy Types |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 54 | ${auth}= Create List policyadmin zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 55 | Log Creating session http://${POLICY_API_IP}:6969 |
| 56 | ${session}= Create Session policy http://${POLICY_API_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 57 | ${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_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 62 | StateChangeRunningAutomationComposition |
| 63 | [Documentation] AutomationComposition State Change to RUNNING. |
| 64 | ${auth}= Create List runtimeUser zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 65 | Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969 |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 66 | ${postjson}= Get file ${CURDIR}/data/StateChangeRunningAC.json |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 67 | ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 68 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 69 | ${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_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 71 | |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 72 | QueryInstantiatedACs |
| 73 | [Documentation] Get Instantiated AutomationCompositions |
| 74 | ${auth}= Create List runtimeUser zb!XztG34 |
liamfallon | faac45b | 2022-09-01 12:05:47 +0100 | [diff] [blame^] | 75 | Log Creating session http://${POLICY_RUNTIME_ACM_IP}:6969 |
| 76 | ${session}= Create Session policy http://${POLICY_RUNTIME_ACM_IP}:6969 auth=${auth} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 77 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 78 | ${resp}= GET On Session policy /onap/policy/clamp/acm/v2/instantiation headers=${headers} |
| 79 | Log Received response from runtime acm ${resp.text} |
Sirisha_Manchikanti | 4d0a1d7 | 2021-06-08 09:28:21 +0100 | [diff] [blame] | 80 | Should Be Equal As Strings ${resp.status_code} 200 |
Sirisha_Manchikanti | b71490f | 2022-02-17 17:55:21 +0000 | [diff] [blame] | 81 | Should Be Equal As Strings ${resp.json()['automationCompositionList'][0]['state']} UNINITIALISED2PASSIVE |
| 82 | Should Be Equal As Strings ${resp.json()['automationCompositionList'][0]['orderedState']} RUNNING |