diff options
author | Leonardo Bellini <leonardo.bellini@att.com> | 2018-04-20 08:22:16 -0500 |
---|---|---|
committer | Leonardo Bellini <leonardo.bellini@att.com> | 2018-04-20 08:23:42 -0500 |
commit | 85ca1cace1741dc6d69346d69553154e14706468 (patch) | |
tree | 28706162cfff596e28b46bc13bc7d076a6cbd4b4 /test/csit/tests | |
parent | 90d878da9543fa90eb889291110c3964e7195034 (diff) |
Add HPA and VimFit test cases
Issue-ID: OPTFRA-220
Change-Id: I58cb98817b1dfa3674e93cd97c29b6898ee843fa
Signed-off-by: Leonardo Bellini <leonardo.bellini@att.com>
Diffstat (limited to 'test/csit/tests')
7 files changed, 1132 insertions, 0 deletions
diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa.json b/test/csit/tests/optf-has/has/data/plan_with_hpa.json new file mode 100644 index 000000000..bf314a9cb --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa.json @@ -0,0 +1,230 @@ +{ + "name":"vCPE-with-HPA", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"4", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"cpuPinning", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"logicalCpuThreadPinningPolicy", + "hpa-attribute-value":"prefer", + "operator":"=" + }, + { + "hpa-attribute-key":"logicalCpuPinningPolicy", + "hpa-attribute-value":"dedicated", + "operator":"=" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"8", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"16", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json new file mode 100644 index 000000000..80685ae8e --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_mandatory.json @@ -0,0 +1,165 @@ +{ + "name":"vCPE-with-HPA-requirement-mandatory", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"64", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"32", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"128", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json new file mode 100644 index 000000000..4672349d2 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_requirements_optionals.json @@ -0,0 +1,217 @@ +{ + "name":"vCPE-HPA-Requirement-Optional", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"8", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"instructionSetExtensions", + "hpa-version":"v1", + "architecture":"Intel64", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"instructionSetExtensions", + "hpa-attribute-value":["aes", "sse", "avx", "smt"], + "operator":"ALL", + "unit":"" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"False", + "score":"3", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"4", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"8", + "operator":">=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score":"5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + }, + { + "hpa-feature":"numa", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"False", + "score":"3", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numaNodes", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-0", + "hpa-attribute-value":"2", + "operator":"=" + }, + { + "hpa-attribute-key":"numaCpu-1", + "hpa-attribute-value":"4", + "operator":"=" + }, + { + "hpa-attribute-key":"numaMem-0", + "hpa-attribute-value":"2", + "operator":"=", + "unit":"GB" + }, + { + "hpa-attribute-key":"numaMem-1", + "hpa-attribute-value":"4", + "operator":"=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json new file mode 100644 index 000000000..25b226280 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_simple.json @@ -0,0 +1,129 @@ +{ + "name":"vCPE-with-HPA", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"32", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + }, + { + "hpa-feature":"ovsDpdk", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"dataProcessingAccelerationLibrary", + "hpa-attribute-value":"v18.02", + "operator":"=" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "False", + "score": "5", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"8", + "operator":">=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"16", + "operator":">=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json b/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json new file mode 100644 index 000000000..8a3198566 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_hpa_unmatched.json @@ -0,0 +1,117 @@ +{ + "name":"vCPE-with-HPA-unmatched-requirements", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vgmux_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "hpa_constraint":{ + "type":"hpa", + "demands":[ + "vG" + ], + "properties":{ + "evaluate":[ + { + "flavorLabel":"flavor_label_1", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory": "True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"60", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"64", + "operator":"=", + "unit":"GB" + } + ] + } + ] + }, + { + "flavorLabel":"flavor_label_2", + "flavorProperties":[ + { + "hpa-feature":"basicCapabilities", + "hpa-version":"v1", + "architecture":"generic", + "mandatory":"True", + "hpa-feature-attributes":[ + { + "hpa-attribute-key":"numVirtualCpu", + "hpa-attribute-value":"30", + "operator":"=" + }, + { + "hpa-attribute-key":"virtualMemSize", + "hpa-attribute-value":"128", + "operator":"=", + "unit":"GB" + } + ] + } + ] + } + ] + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json b/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json new file mode 100644 index 000000000..00a599125 --- /dev/null +++ b/test/csit/tests/optf-has/has/data/plan_with_vim_fit.json @@ -0,0 +1,89 @@ +{ + "name":"vCPE-Sanity1", + "template":{ + "homing_template_version":"2017-10-10", + "parameters":{ + "service_name":"Residential vCPE", + "service_id":"vcpe_service_id", + "customer_lat":45.395968, + "customer_long":-71.135344, + "REQUIRED_MEM":4, + "REQUIRED_DISK":100, + "pnf_id":"some_pnf_id" + }, + "locations":{ + "customer_loc":{ + "latitude":{ + "get_param":"customer_lat" + }, + "longitude":{ + "get_param":"customer_long" + } + } + }, + "demands":{ + "vG":[ + { + "inventory_provider":"aai", + "inventory_type":"cloud" + } + ] + }, + "constraints":{ + "constraint_vg_customer":{ + "type":"distance_to_location", + "demands":[ + "vG" + ], + "properties":{ + "distance":"< 100 km", + "location":"customer_loc" + } + }, + "check_cloud_capacity":{ + "type":"vim_fit", + "demands":[ + "vG" + ], + "properties":{ + "controller":"multicloud", + "request":{ + "vCPU":10, + "Memory":{ + "quantity":{ + "get_param":"REQUIRED_MEM" + }, + "unit":"GB" + }, + "Storage":{ + "quantity":{ + "get_param":"REQUIRED_DISK" + }, + "unit":"GB" + } + } + } + } + }, + "optimization":{ + "minimize":{ + "sum":[ + { + "distance_between":[ + "customer_loc", + "vG" + ] + }, + { + "distance_between":[ + "customer_loc", + "vG" + ] + } + ] + } + } + }, + "timeout":5, + "limit":3 +} diff --git a/test/csit/tests/optf-has/has/optf_has_test.robot b/test/csit/tests/optf-has/has/optf_has_test.robot index 62db10774..815ffa850 100644 --- a/test/csit/tests/optf-has/has/optf_has_test.robot +++ b/test/csit/tests/optf-has/has/optf_has_test.robot @@ -295,6 +295,191 @@ GetPlanWithShortDistanceConstraint Should Be Equal As Integers ${resp.status_code} 200 Should Be Equal not found ${resultStatus} +SendPlanWithVimFit + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_vim_fit.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithVimFit + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpa + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpa + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaSimple + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_simple.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaSimple + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaMandatory + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_mandatory.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaMandatory + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaOptionals + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_requirements_optionals.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaOptionals + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal done ${resultStatus} + +SendPlanWithHpaUnmatched + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}plan_with_hpa_unmatched.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Post Request optf-cond /v1/plans data=${data} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + Log To Console body = ${resp.text} + ${response_json} json.loads ${resp.content} + ${generatedPlanId}= Convert To String ${response_json['id']} + Set Global Variable ${generatedPlanId} + Log To Console generatedPlanId = ${generatedPlanId} + Should Be Equal As Integers ${resp.status_code} 201 + Sleep 60s Wait Plan Resolution + +GetPlanWithHpaUnmatched + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= Get Request optf-cond /v1/plans/${generatedPlanId} headers=${headers} + Log To Console ********************* + Log To Console response = ${resp} + ${response_json} json.loads ${resp.content} + ${resultStatus}= Convert To String ${response_json['plans'][0]['status']} + Set Global Variable ${resultStatus} + Log To Console resultStatus = ${resultStatus} + Log To Console body = ${resp.text} + Should Be Equal As Integers ${resp.status_code} 200 + Should Be Equal not found ${resultStatus} *** Keywords *** |