aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/policy/suite1/Policy-CSIT.robot14
-rw-r--r--tests/policy/suite1/listpolicy.template3
-rw-r--r--tests/policy/suite1/policy_interface.robot14
3 files changed, 29 insertions, 2 deletions
diff --git a/tests/policy/suite1/Policy-CSIT.robot b/tests/policy/suite1/Policy-CSIT.robot
index 785619f9..7855b76b 100644
--- a/tests/policy/suite1/Policy-CSIT.robot
+++ b/tests/policy/suite1/Policy-CSIT.robot
@@ -12,6 +12,7 @@ ${RESOURCE_PATH_CREATE} /pdp/api/createPolicy
${RESOURCE_PATH_CREATE_PUSH} /pdp/api/pushPolicy
${RESOURCE_PATH_CREATE_DELETE} /pdp/api/deletePolicy
${RESOURCE_PATH_GET_CONFIG} /pdp/api/getConfig
+${RESOURCE_PATH_LISTPOLICY} /pdp/api/listPolicy
${CREATE_CONFIG_VFW_TEMPLATE} ${CURDIR}/configpolicy_vFW_R1.template
${CREATE_CONFIG_VDNS_TEMPLATE} ${CURDIR}/configpolicy_vDNS_R1.template
${CREATE_CONFIG_VCPE_TEMPLATE} ${CURDIR}/configpolicy_vCPE_R1.template
@@ -24,6 +25,7 @@ ${CREATE_OPS_VDNS_TEMPLATE} ${CURDIR}/opspolicy_VDNS_R1.template
${DEL_POLICY_TEMPLATE} ${CURDIR}/deletepolicy.template
${GETCONFIG_TEMPLATE} ${CURDIR}/getconfigpolicy.template
${GETOOF_TEMPLATE} ${CURDIR}/getoofpolicy.template
+${LISTPOLICY_TEMPLATE} ${CURDIR}/listpolicy.template
${CONFIG_POLICY_VFW_NAME} vFirewall
${CONFIG_POLICY_VFW_TYPE} MicroService
${CONFIG_POLICY_VDNS_NAME} vLoadBalancer
@@ -115,6 +117,9 @@ HPA Get OOF Policy
Sleep 5s
Get OOF HPA Policy
+ListPolicy
+ ListPolicy test com.Config_Sample.1.xml
+
*** Keywords ***
VFW Policy Tests
@@ -358,3 +363,12 @@ Upload DRL file
# ${files}= Create Dictionary file ${file_data}
${put_resp} = Run Policy Post form Request ${RESOURCE_PATH_UPLOAD} ${files}
Should Be Equal As Strings ${put_resp.status_code} 200
+
+ListPolicy test
+ [Documentation] Listing Config Policies
+ [Arguments] ${policy_name}
+ ${dict}= Create Dictionary policy_name=${policy_name}
+ ${output} = Fill JSON Template File ${LISTPOLICY_TEMPLATE} ${dict}
+ ${put_resp} = policy_interface.Run Policy Post Request ${RESOURCE_PATH_LISTPOLICY} ${output}
+ Should Be Equal As Strings ${put_resp.status_code} 200
+
diff --git a/tests/policy/suite1/listpolicy.template b/tests/policy/suite1/listpolicy.template
new file mode 100644
index 00000000..aef17a23
--- /dev/null
+++ b/tests/policy/suite1/listpolicy.template
@@ -0,0 +1,3 @@
+{
+ "policyName": "${policy_name}"
+}
diff --git a/tests/policy/suite1/policy_interface.robot b/tests/policy/suite1/policy_interface.robot
index 79178708..745f7817 100644
--- a/tests/policy/suite1/policy_interface.robot
+++ b/tests/policy/suite1/policy_interface.robot
@@ -38,7 +38,17 @@ Run Policy Put Request
${resp}= Put Request policy ${data_path} data=${data} headers=${headers}
Log Received response from policy ${resp.text}
[Return] ${resp}
-
+
+Run Policy Post Request
+ [Documentation] Runs Policy Post request
+ [Arguments] ${data_path} ${data}
+ Log Creating session ${GLOBAL_POLICY_SERVER_URL}
+ ${session}= Create Session policy ${GLOBAL_POLICY_SERVER_URL}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH} Environment=TEST
+ ${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
+ Log Received response from policy ${resp.text}
+ [Return] ${resp}
+
Run Policy Delete Request
[Documentation] Runs Policy Delete request
[Arguments] ${data_path} ${data}
@@ -57,4 +67,4 @@ Run Policy Get Configs Request
${headers}= Create Dictionary Accept=application/json Content-Type=application/json Authorization=Basic ${GLOBAL_POLICY_AUTH} ClientAuth=${GLOBAL_POLICY_CLIENTAUTH}
${resp}= Post Request policy ${data_path} data=${data} headers=${headers}
Log Received response from policy ${resp.text}
- [Return] ${resp} \ No newline at end of file
+ [Return] ${resp}