summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csit/tests/drools-pdp-test.robot25
-rw-r--r--policy-management/src/main/server-gen/bin/telemetry15
2 files changed, 25 insertions, 15 deletions
diff --git a/csit/tests/drools-pdp-test.robot b/csit/tests/drools-pdp-test.robot
index cf4d3cea..d819a808 100644
--- a/csit/tests/drools-pdp-test.robot
+++ b/csit/tests/drools-pdp-test.robot
@@ -1,17 +1,16 @@
*** Settings ***
-Library Collections
-Library RequestsLibrary
-Library OperatingSystem
-Library json
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
*** Test Cases ***
Alive
- [Documentation] Runs Policy PDP Alive Check
- ${auth}= Create List demo@people.osaaf.org demo123456!
- Log Creating session https://${POLICY_DROOLS_IP}:9696
- ${session}= Create Session policy https://${POLICY_DROOLS_IP}:9696 auth=${auth}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- ${resp}= Get Request policy /policy/pdp/engine 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()['alive']} True
+ [Documentation] Runs Policy PDP Alive Check
+ ${auth}= Create List demo@people.osaaf.org demo123456!
+ Log Creating session https://${POLICY_DROOLS_IP}:9696
+ ${session}= Create Session policy https://${POLICY_DROOLS_IP}:9696 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= GET On Session policy /policy/pdp/engine headers=${headers} expected_status=200
+ Log Received response from policy ${resp.text}
+ Should Be Equal As Strings ${resp.json()['alive']} True
diff --git a/policy-management/src/main/server-gen/bin/telemetry b/policy-management/src/main/server-gen/bin/telemetry
index b17a95b8..454f11ed 100644
--- a/policy-management/src/main/server-gen/bin/telemetry
+++ b/policy-management/src/main/server-gen/bin/telemetry
@@ -33,13 +33,24 @@ if ! "${POLICY_HOME}"/bin/policy-management-controller status >/dev/null 2>&1; t
exit 2
fi
+CREDENTIALS=
+if [ -n "${TELEMETRY_USER}" ]; then
+ CREDENTIALS="--auth ${TELEMETRY_USER}:${TELEMETRY_PASSWORD}"
+fi
+
+PROTOCOL="http"
+if egrep "^http\.server\.services\..*CONFIG\.https.*=.*true" ${POLICY_HOME}/config/engine.properties; then
+ PROTOCOL="https"
+fi
+
if [ ! -r "${TELEMETRY_SPEC}" ]; then
echo "generating new spec .."
- if ! http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" https://localhost:9696/swagger.json >${TELEMETRY_SPEC} 2>/dev/null; then
+ if ! http --verify=no ${CREDENTIALS} "${PROTOCOL}"://localhost:9696/swagger.json >${TELEMETRY_SPEC} 2>/dev/null; then
echo "error: cannot generate telemetry spec"
rm -f ${TELEMETRY_SPEC} 2>/dev/null
exit 3
fi
fi
-exec http-prompt https://localhost:9696/policy/pdp/engine --verify=no --auth "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" --spec ${TELEMETRY_SPEC}
+exec http-prompt "${PROTOCOL}"://localhost:9696/policy/pdp/engine --verify=no ${CREDENTIALS} --spec ${TELEMETRY_SPEC}
+