aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-04-12 18:34:22 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-12 18:34:22 +0000
commit954096c23115faa633ba91f61c0e5d247cb47e20 (patch)
treea2e3447aaa34cdb9f09462752168c92d9cc83b90 /test
parentc95de5096426da46d5ef5e17609c752222a3d6ac (diff)
parentc8c6422f9980299886e3b03d08a532ad5a39caf2 (diff)
Merge "Optimization Policy CSIT tests"
Diffstat (limited to 'test')
-rwxr-xr-xtest/csit/scripts/policy/script1.sh2
-rw-r--r--test/csit/tests/policy/suite1/Policy-CSIT.robot50
-rw-r--r--test/csit/tests/policy/suite1/getoofpolicy.template6
-rw-r--r--test/csit/tests/policy/suite1/oofpolicy_HPA_R1.template6
4 files changed, 62 insertions, 2 deletions
diff --git a/test/csit/scripts/policy/script1.sh b/test/csit/scripts/policy/script1.sh
index a09fa5f24..0db34f080 100755
--- a/test/csit/scripts/policy/script1.sh
+++ b/test/csit/scripts/policy/script1.sh
@@ -123,7 +123,7 @@ echo ${NEXUS_IP}
MARIADB_IP=`docker inspect --format '{{ .NetworkSettings.Networks.docker_default.IPAddress}}' mariadb`
echo ${MARIADB_IP}
-sleep 1m
+sleep 5m
netstat -tnl
diff --git a/test/csit/tests/policy/suite1/Policy-CSIT.robot b/test/csit/tests/policy/suite1/Policy-CSIT.robot
index fd5e23048..5909abd29 100644
--- a/test/csit/tests/policy/suite1/Policy-CSIT.robot
+++ b/test/csit/tests/policy/suite1/Policy-CSIT.robot
@@ -16,10 +16,12 @@ ${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
${CREATE_OPS_VFW_TEMPLATE} ${CURDIR}/opspolicy_VFW_R1.template
+${CREATE_OOF_HPA_TEMPLATE} ${CURDIR}/oofpolicy_HPA_R1.template
${PUSH_POLICY_TEMPLATE} ${CURDIR}/pushpolicy.template
${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
${CONFIG_POLICY_VFW_NAME} vFirewall
${CONFIG_POLICY_VFW_TYPE} MicroService
${CONFIG_POLICY_VDNS_NAME} vLoadBalancer
@@ -34,6 +36,8 @@ ${OPS_POLICY_VCPE_NAME} vCPE
${OPS_POLICY_VCPE_TYPE} BRMS_PARAM
${OPS_POLICY_VOLTE_NAME} VoLTE
${OPS_POLICY_VOLTE_TYPE} BRMS_PARAM
+${OOF_POLICY_HPA_NAME} HPA
+${OOF_POLICY_HPA_TYPE} Optimization
${file_path} ../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl
${RESOURCE_PATH_UPLOAD} /pdp/api/policyEngineImport?importParametersJson=%7B%22serviceName%22%3A%22Manyu456%22%2C%20%22serviceType%22%3A%22BRMSPARAM%22%7D
${CREATE_OPS_VCPE_TEMPLATE} ${CURDIR}/opspolicy_vCPE_R1.template
@@ -75,6 +79,12 @@ VOLTE Ops Policy
${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy
Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE}
#VOLTE Policy Tests
+
+HPA OOF Policy
+ ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy
+ Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE}
+ #HPA Policy Tests
+
VFW Get Configs Policy
Sleep 5s
Get Configs VFW Policy
@@ -87,6 +97,10 @@ VCPE Get Configs Policy
Sleep 5s
Get Configs VCPE Policy
+HPA Get OOF Policy
+ Sleep 5s
+ Get OOF HPA Policy
+
*** Keywords ***
VFW Policy Tests
@@ -114,6 +128,11 @@ VOLTE Policy Tests
${OPS_POLICY_VOLTE_NAME}= Create Ops VOLTE Policy
Push Ops Policy ${OPS_POLICY_VOLTE_NAME} ${OPS_POLICY_VOLTE_TYPE}
+HPA Policy Tests
+ ${OOF_POLICY_HPA_NAME}= Create OOF HPA Policy
+ Push Config Policy ${OOF_POLICY_HPA_NAME} ${OOF_POLICY_HPA_TYPE}
+ Get OOF HPA Policy
+
Get Configs VFW Policy
[Documentation] Get Config Policy for VFW
${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VFW_NAME}*
@@ -122,6 +141,26 @@ Get Configs VFW Policy
${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output}
Should Be Equal As Strings ${get_resp.status_code} 200
+Create OOF HPA Policy
+ [Documentation] Create OOF Policy
+ ${randompolicyname} = Create Policy Name
+ ${policyname1}= Catenate com.${randompolicyname}_HPA
+ ${OOF_POLICY_HPA_NAME}= Set Test Variable ${policyname1}
+ ${hpapolicy}= Create Dictionary policy_name=${policyname1}
+ ${output} = Fill JSON Template File ${CREATE_OOF_HPA_TEMPLATE} ${hpapolicy}
+ ${put_resp} = Run Policy Put Request ${RESOURCE_PATH_CREATE} ${output}
+ Log ${put_resp}
+ Should Be Equal As Strings ${put_resp.status_code} 200
+ [Return] ${policyname1}
+
+Get OOF HPA Policy
+ [Documentation] Get OOF Policy for HPA
+ ${gethpapolicy}= Catenate .*${OOF_POLICY_HPA_NAME}*
+ ${hpapolicy_name}= Create Dictionary oof_policy_name=${gethpapolicy}
+ ${output} = Fill JSON Template File ${GETOOF_TEMPLATE} ${hpapolicy_name}
+ ${get_resp} = Run Policy Get Configs Request ${RESOURCE_PATH_GET_CONFIG} ${output}
+ Should Be Equal As Strings ${get_resp.status_code} 200
+
Create Config VFW Policy
[Documentation] Create Config Policy
${randompolicyname} = Create Policy Name
@@ -186,6 +225,15 @@ Delete Config Policy
${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output}
Should Be Equal As Strings ${put_resp.status_code} 200
+Delete OOF Policy
+ [Documentation] Delete OOF Policy
+ [Arguments] ${policy_name}
+ ${policyname3}= Catenate com.Config_OOF_${policy_name}.1.xml
+ ${dict}= Create Dictionary policy_name=${policyname3}
+ ${output} = Fill JSON Template ${DEL_POLICY_TEMPLATE} ${dict}
+ ${put_resp} = Run Policy Delete Request ${RESOURCE_PATH_CREATE_DELETE} ${output}
+ Should Be Equal As Strings ${put_resp.status_code} 200
+
Get Configs VDNS Policy
[Documentation] Get Config Policy for VDNS
${getconfigpolicy}= Catenate .*${CONFIG_POLICY_VDNS_NAME}*
@@ -267,4 +315,4 @@ Upload DRL file
# ${files2} = {'file': open('../testsuite/robot/assets/templates/ControlLoopDemo__closedLoopControlName.drl', 'rb')}
# ${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 \ No newline at end of file
+ Should Be Equal As Strings ${put_resp.status_code} 200
diff --git a/test/csit/tests/policy/suite1/getoofpolicy.template b/test/csit/tests/policy/suite1/getoofpolicy.template
new file mode 100644
index 000000000..37fe0471b
--- /dev/null
+++ b/test/csit/tests/policy/suite1/getoofpolicy.template
@@ -0,0 +1,6 @@
+{
+ "configAttributes" : {
+ },
+ "policyName" : "${oof_policy_name}",
+ "unique" : false
+}
diff --git a/test/csit/tests/policy/suite1/oofpolicy_HPA_R1.template b/test/csit/tests/policy/suite1/oofpolicy_HPA_R1.template
new file mode 100644
index 000000000..3a170b207
--- /dev/null
+++ b/test/csit/tests/policy/suite1/oofpolicy_HPA_R1.template
@@ -0,0 +1,6 @@
+{
+ "configBody": "{\"service\":\"hpaPolicy\",\"policyName\":\"testWorkingTOSCA\",\"description\":\"testing\",\"templateVersion\":\"OpenSource.version.1\",\"version\":\"CSIT\",\"priority\":\"5\",\"riskType\":\"SampleRiskType\",\"riskLevel\":\"3\",\"guard\":\"False\",\"content\":{\"identity\":\"testIdentity\",\"policyScope\":[\"test1\",\"test2\",\"test3\"],\"policyType\":\"hpaPolicy\",\"resources\":\"testResources1\",\"flavorFeatures\":[{\"flavorLabel\":\"testFlavor\",\"flavorProperties\":[{\"score\":\"testScore\",\"featureAttributes\":[{\"unit\":\"testUnit\",\"attribute\":\"teatFeatureAttribute\",\"value\":\"testValue\",\"operator\":\"any\"}],\"mandatory\":\"testMandatory\",\"hpaFeature\":\"testHAPFeature\",\"architecture\":\"testArch\"}]}]}}",
+ "policyConfigType": "Optimization",
+ "policyName": "${policy_name}",
+ "onapName": "OOF"
+}