4 Library RequestsLibrary
5 Library OperatingSystem
11 [Documentation] Runs Policy PDP Alive Check
12 ${auth}= Create List demo@people.osaaf.org demo123456!
13 Log Creating session https://${DROOLS_IP}:9696
14 ${session}= Create Session policy https://${DROOLS_IP}:9696 auth=${auth}
15 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
16 ${resp}= Get Request policy /policy/pdp/engine headers=${headers}
17 Log Received response from policy ${resp.text}
18 Should Be Equal As Strings ${resp.status_code} 200
19 Should Be Equal As Strings ${resp.json()['alive']} True
22 [Documentation] Runs Policy PDP-D Health check
23 ${auth}= Create List demo@people.osaaf.org demo123456!
24 Log Creating session https://${DROOLS_IP}:6969/healthcheck
25 ${session}= Create Session policy https://${DROOLS_IP}:6969 auth=${auth}
26 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
27 ${resp}= Get Request policy /healthcheck headers=${headers}
28 Log Received response from policy ${resp.text}
29 Should Be Equal As Strings ${resp.status_code} 200
30 Should Be Equal As Strings ${resp.json()['healthy']} True
33 [Documentation] Checks controller is up
34 ${auth}= Create List demo@people.osaaf.org demo123456!
35 Log Creating session https://${DROOLS_IP}:9696
36 ${session}= Create Session policy https://${DROOLS_IP}:9696 auth=${auth}
37 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
38 ${resp}= Get Request policy /policy/pdp/engine/controllers/frankfurt/drools/facts headers=${headers}
39 Log Received response from policy ${resp.text}
40 Should Be Equal As Strings ${resp.status_code} 200
41 Should Be Equal As Strings ${resp.json()['frankfurt']} 0
44 [Documentation] Creates the Policy topics
45 ${result}= Run Process ${SCR2}/make_topic.sh POLICY-PDP-PAP
46 Should Be Equal As Integers ${result.rc} 0
47 ${result}= Run Process ${SCR2}/make_topic.sh POLICY-CL-MGT
48 Should Be Equal As Integers ${result.rc} 0
51 [Documentation] Activates the Policies
52 ${result}= Run Process ${SCR2}/manage.sh ${SCR2}/policies.json
53 Should Be Equal As Integers ${result.rc} 0
54 ${result}= Run Process ${SCR2}/manage.sh ${SCR2}/activate.drools.json
55 Should Be Equal As Integers ${result.rc} 0
56 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP
57 ... responseTo drools ACTIVE
58 Log Received status ${result.stdout}
60 Should Be Equal As Integers ${result.rc} 0
61 Should Contain ${result.stdout} operational.restart
62 Should Contain ${result.stdout} operational.scale.up
63 Should Contain ${result.stdout} operational.modifyconfig
66 [Documentation] Executes VCPE Policy
67 ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vcpeOnset.json
68 Should Be Equal As Integers ${result.rc} 0
69 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
70 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
71 Log Received notification ${result.stdout}
72 Should Be Equal As Integers ${result.rc} 0
73 Should Contain ${result.stdout} ACTIVE
74 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
75 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
76 Log Received notification ${result.stdout}
77 Should Be Equal As Integers ${result.rc} 0
78 Should Contain ${result.stdout} OPERATION
79 Should Contain ${result.stdout} Sending guard query for APPC Restart
80 Should Be Equal As Integers ${result.rc} 0
81 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
82 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
83 Log Received notification ${result.stdout}
84 Should Be Equal As Integers ${result.rc} 0
85 Should Contain ${result.stdout} OPERATION
86 Should Contain ${result.stdout} Guard result for APPC Restart is Permit
87 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
88 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
89 Log Received notification ${result.stdout}
90 Should Be Equal As Integers ${result.rc} 0
91 Should Contain ${result.stdout} OPERATION
92 Should Contain ${result.stdout} actor=APPC,operation=Restart
93 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
94 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
95 Log Received notification ${result.stdout}
96 Should Be Equal As Integers ${result.rc} 0
97 Should Contain ${result.stdout} OPERATION: SUCCESS
98 Should Contain ${result.stdout} actor=APPC,operation=Restart
99 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
100 ... ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e
101 Log Received notification ${result.stdout}
102 Should Be Equal As Integers ${result.rc} 0
103 Should Contain ${result.stdout} FINAL: SUCCESS
104 Should Contain ${result.stdout} APPC
105 Should Contain ${result.stdout} Restart
108 [Documentation] Executes VDNS Policy
109 ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vdnsOnset.json
110 Should Be Equal As Integers ${result.rc} 0
111 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
112 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
113 Log Received notification ${result.stdout}
114 Should Be Equal As Integers ${result.rc} 0
115 Should Contain ${result.stdout} ACTIVE
116 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
117 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
118 Log Received notification ${result.stdout}
119 Should Be Equal As Integers ${result.rc} 0
120 Should Contain ${result.stdout} OPERATION
121 Should Contain ${result.stdout} Sending guard query for SO VF Module Create
122 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
123 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
124 Log Received notification ${result.stdout}
125 Should Be Equal As Integers ${result.rc} 0
126 Should Contain ${result.stdout} OPERATION
127 Should Contain ${result.stdout} Guard result for SO VF Module Create is Permit
128 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
129 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
130 Log Received notification ${result.stdout}
131 Should Be Equal As Integers ${result.rc} 0
132 Should Contain ${result.stdout} OPERATION
133 Should Contain ${result.stdout} actor=SO,operation=VF Module Create
134 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
135 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
136 Log Received notification ${result.stdout}
137 Should Be Equal As Integers ${result.rc} 0
138 Should Contain ${result.stdout} OPERATION: SUCCESS
139 Should Contain ${result.stdout} actor=SO,operation=VF Module Create
140 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
141 ... ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3
142 Log Received notification ${result.stdout}
143 Should Be Equal As Integers ${result.rc} 0
144 Should Contain ${result.stdout} FINAL: SUCCESS
145 Should Contain ${result.stdout} SO
146 Should Contain ${result.stdout} VF Module Create
149 [Documentation] Executes VFW Policy
150 ${result}= Run Process ${SCR2}/onset.sh ${SCR2}/vfwOnset.json
151 Should Be Equal As Integers ${result.rc} 0
152 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
153 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
154 Log Received notification ${result.stdout}
155 Should Be Equal As Integers ${result.rc} 0
156 Should Contain ${result.stdout} ACTIVE
157 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
158 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
159 Log Received notification ${result.stdout}
160 Should Be Equal As Integers ${result.rc} 0
161 Should Contain ${result.stdout} OPERATION
162 Should Contain ${result.stdout} Sending guard query for APPC ModifyConfig
163 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
164 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
165 Log Received notification ${result.stdout}
166 Should Be Equal As Integers ${result.rc} 0
167 Should Contain ${result.stdout} OPERATION
168 Should Contain ${result.stdout} Guard result for APPC ModifyConfig is Permit
169 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
170 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
171 Log Received notification ${result.stdout}
172 Should Be Equal As Integers ${result.rc} 0
173 Should Contain ${result.stdout} OPERATION
174 Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig
175 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
176 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
177 Log Received notification ${result.stdout}
178 Should Be Equal As Integers ${result.rc} 0
179 Should Contain ${result.stdout} OPERATION: SUCCESS
180 Should Contain ${result.stdout} actor=APPC,operation=ModifyConfig
181 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-CL-MGT
182 ... ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a
183 Log Received notification ${result.stdout}
184 Should Be Equal As Integers ${result.rc} 0
185 Should Contain ${result.stdout} FINAL: SUCCESS
186 Should Contain ${result.stdout} APPC
187 Should Contain ${result.stdout} ModifyConfig