aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot29
-rw-r--r--tests/policy/pap/pap-test.robot28
2 files changed, 52 insertions, 5 deletions
diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
index f65ef2b4..ccfa4968 100644
--- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
+++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot
@@ -1,14 +1,19 @@
*** Settings ***
Documentation Testing PM Mapper functionality
-Library RequestsLibrary
-Library OperatingSystem
+Resource ../../common.robot
Library Collections
+Library json
+Library OperatingSystem
+Library RequestsLibrary
+Library HttpLibrary.HTTP
+Library String
Library Process
*** Variables ***
-${GLOBAL_APPLICATION_ID} robot-ves
-${CLI_EXEC_CLI} curl http://${CBS_IP}:10000/service_component/pmmapper
+${BC_URL} http://${DMAAPBC_IP}:8080/webapi
+${CLI_EXEC_CLI} curl http://${CBS_IP}:10000/service_component/pmmapper
+${FEED1_DATA} { "feedName":"feed1", "feedVersion": "csit", "feedDescription":"generated for CSIT", "owner":"dgl", "asprClassification": "unclassified" }
*** Test Cases ***
@@ -18,4 +23,18 @@ Verify pmmapper configuration in consul through CBS
[Documentation] Verify pmmapper configuraiton in consul through CBS
${cli_cmd_output}= Run Process ${CLI_EXEC_CLI} shell=yes
Log ${cli_cmd_output.stdout}
- Should Contain ${cli_cmd_output.stdout} pm-mapper-filter \ No newline at end of file
+ Should Contain ${cli_cmd_output.stdout} pm-mapper-filter
+
+Create DR Feed through Bus Controller
+ [Tags] PM_MAPPER_02
+ [Documentation] Create Feed on Data Router through Bus Controller
+ ${resp}= PostCall ${BC_URL}/feeds ${FEED1_DATA}
+ Should Be Equal As Integers ${resp.status_code} 200
+
+*** Keywords ***
+
+PostCall
+ [Arguments] ${url} ${data}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests
+ [Return] ${resp} \ No newline at end of file
diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot
new file mode 100644
index 00000000..7dca5b4d
--- /dev/null
+++ b/tests/policy/pap/pap-test.robot
@@ -0,0 +1,28 @@
+*** Settings ***
+Library Collections
+Library RequestsLibrary
+Library OperatingSystem
+Library json
+
+*** Test Cases ***
+Healthcheck
+ [Documentation] Runs Policy PAP Health check
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${POLICY_PAP_IP}:6969
+ ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 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
+
+Statistics
+ [Documentation] Runs Policy PAP Statistics
+ ${auth}= Create List healthcheck zb!XztG34
+ Log Creating session https://${POLICY_PAP_IP}:6969
+ ${session}= Create Session policy https://${POLICY_PAP_IP}:6969 auth=${auth}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ ${resp}= Get Request policy /statistics 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