summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBilal A <bilal@research.att.com>2019-05-06 14:00:57 -0400
committerBilal A <bilal@research.att.com>2019-05-06 17:00:21 -0400
commit461aa5b33b29ca1df212ba09a51e29dfcf1fe1bc (patch)
tree7defa6e67c4274fa78f8fbecfe708dd7f160b49d
parentb567010947db2cb80dab06cd0ca219fba068398b (diff)
Healthchecks for New Policy Components
Adds healthchecks for following new Policy components: 1- Policy API 2- Policy PAP 3- Policy Distribution 4- Policy APEX PDP 5- Policy XACML PDP Change-Id: If390add061957ea26222b2336b4d40874d913192 Issue-ID: POLICY-1630 Signed-off-by: Bilal A <bilal@research.att.com>
-rw-r--r--robot/resources/policy_interface.robot62
-rw-r--r--robot/testsuites/health-check.robot7
2 files changed, 68 insertions, 1 deletions
diff --git a/robot/resources/policy_interface.robot b/robot/resources/policy_interface.robot
index 91d0d98b..d4882811 100644
--- a/robot/resources/policy_interface.robot
+++ b/robot/resources/policy_interface.robot
@@ -13,6 +13,13 @@ ${POLICY_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLI
${POLICY_HEALTHCHECK_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_HEALTHCHECK_IP_ADDR}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
${POLICY_TEMPLATES} robot/assets/templates/policy
${DROOLS_ENDPOINT} ${GLOBAL_POLICY_SERVER_PROTOCOL}://${GLOBAL_INJECTED_POLICY_IP_ADDR}:${GLOBAL_DROOLS_SERVER_PORT}
+${POLICY_API_IP} ${GLOBAL_INJECTED_POLICY_API_IP_ADDR}
+${POLICY_PAP_IP} ${GLOBAL_INJECTED_POLICY_PAP_IP_ADDR}
+${POLICY_DISTRIBUTION_IP} ${GLOBAL_INJECTED_POLICY_DISTRIBUTION_IP_ADDR}
+${POLICY_PDPX_IP} ${GLOBAL_INJECTED_POLICY_PDPX_IP_ADDR}
+${POLICY_APEX_PDP_IP} ${GLOBAL_INJECTED_POLICY_APEX_PDP_IP_ADDR}
+${POLICY_HEALTHCHECK_USERNAME} ${GLOBAL_POLICY_HEALTHCHECK_USERNAME}
+${POLICY_HEALTHCHECK_PASSWORD} ${GLOBAL_POLICY_HEALTHCHECK_PASSWORD}
*** Keywords ***
@@ -190,3 +197,58 @@ Push vFirewall Policies To PDP Group
${resp}= Run Policy Post Request /policy/pap/v1/pdps/policies ${data}
Should Be Equal As Strings ${resp.status_code} 200
+Run Policy API Healthcheck
+ [Documentation] Runs Policy Api Health check
+ ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
+ Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_API_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /policy/api/v1/healthcheck headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['code']} 200
+
+Run Policy PAP Healthcheck
+ [Documentation] Runs Policy PAP Health check
+ ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
+ Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PAP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /policy/pap/v1/healthcheck headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['code']} 200
+
+Run Policy Distribution Healthcheck
+ [Documentation] Runs Policy Distribution Health check
+ ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
+ Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_DISTRIBUTION_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /healthcheck headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['code']} 200
+
+Run Policy XACML PDP Healthcheck
+ [Documentation] Runs Policy Xacml PDP Health check
+ ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
+ Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_PDPX_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /policy/pdpx/v1/healthcheck headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['code']} 200
+
+Run Policy APEX PDP Healthcheck
+ [Documentation] Runs Policy Apex PDP Health check
+ ${auth}= Create List ${POLICY_HEALTHCHECK_USERNAME} ${POLICY_HEALTHCHECK_PASSWORD}
+ Log Creating session ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_PROTOCOL}://${POLICY_APEX_PDP_IP}:${GLOBAL_POLICY_HEALTHCHECK_PORT} auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /policy/apex-pdp/v1/healthcheck headers=${headers}
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As Strings ${resp.json()['code']} 200
+
diff --git a/robot/testsuites/health-check.robot b/robot/testsuites/health-check.robot
index 2330b091..5b46f9fc 100644
--- a/robot/testsuites/health-check.robot
+++ b/robot/testsuites/health-check.robot
@@ -140,6 +140,11 @@ Basic OOF-CMSO Health Check
Basic Policy Health Check
[Tags] health medium health-policy
Run Policy Health Check
+ Run Policy API Healthcheck
+ Run Policy PAP Healthcheck
+ Run Policy Distribution Healthcheck
+ Run Policy XACML PDP Healthcheck
+ Run Policy APEX PDP Healthcheck
Basic Pomba AAI-context-builder Health Check
[Tags] health oom health-pomba
@@ -293,4 +298,4 @@ Basic Multicloud-fcaps API Health Check
Basic Modeling genericparser API Health Check
[Tags] health api health-modeling
- Run MSB Get Request /api/parser/v1/health_check \ No newline at end of file
+ Run MSB Get Request /api/parser/v1/health_check