diff options
author | 2020-10-23 14:33:09 +0530 | |
---|---|---|
committer | 2020-10-27 12:46:05 +0000 | |
commit | 4e76bd143c04d7f2adcc01255f3666e0d333414c (patch) | |
tree | db2e061a384574783127ef4543bebefeca0d3435 | |
parent | e50b1f4517d353e31626d06fa3a5bea079a07c44 (diff) |
[OOF] Add CSIT for NSI/NSSI selection
HAS Image version updated to 2.1.2
Issue-ID: OPTFRA-865
Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com>
Change-Id: I5cb8d62d1f7a280bcf3f5efa6b2d333909d9daed
-rw-r--r-- | scripts/optf-has/has/has-properties/conductor.conf.onap | 3 | ||||
-rwxr-xr-x | scripts/optf-has/has/has_script.sh | 2 | ||||
-rwxr-xr-x | scripts/optf-has/has/simulator_script.sh | 10 | ||||
-rw-r--r-- | tests/optf-has/has/data/nsi_selection_template_with_create.json | 168 | ||||
-rw-r--r-- | tests/optf-has/has/data/nsi_selection_template_with_nonsi.json | 168 | ||||
-rw-r--r-- | tests/optf-has/has/data/nsi_selection_template_with_reuse.json | 168 | ||||
-rw-r--r-- | tests/optf-has/has/data/nssi_selection_template.json | 84 | ||||
-rw-r--r-- | tests/optf-has/has/data/nssi_selection_template_unmatched.json | 84 | ||||
-rw-r--r-- | tests/optf-has/has/optf_has_test.robot | 164 |
9 files changed, 841 insertions, 10 deletions
diff --git a/scripts/optf-has/has/has-properties/conductor.conf.onap b/scripts/optf-has/has/has-properties/conductor.conf.onap index 6cf8fb29..3ce7fa05 100644 --- a/scripts/optf-has/has/has-properties/conductor.conf.onap +++ b/scripts/optf-has/has/has-properties/conductor.conf.onap @@ -296,6 +296,7 @@ concurrent = true # Time between checking for new plans. Default value is 1. (integer value) # Minimum value: 1 #polling_interval = 1 +opt_schema_file = /opt/has/conductor/etc/conductor/opt_schema.json # (integer value) # Minimum value: 1 @@ -335,7 +336,7 @@ concurrent = true # # Extensions list to use (list value) -#extensions = aai +extensions = aai,generator [messaging_server] diff --git a/scripts/optf-has/has/has_script.sh b/scripts/optf-has/has/has_script.sh index f851051c..3b24d47a 100755 --- a/scripts/optf-has/has/has_script.sh +++ b/scripts/optf-has/has/has_script.sh @@ -31,7 +31,7 @@ cd ${DIR} COND_CONF=/tmp/conductor/properties/conductor.conf LOG_CONF=/tmp/conductor/properties/log.conf IMAGE_NAME=nexus3.onap.org:10001/onap/optf-has -IMAGE_VER=2.0.2-SNAPSHOT-latest +IMAGE_VER=2.1.2-SNAPSHOT-latest BUNDLE=/tmp/conductor/properties/AAF_RootCA.cer mkdir -p /tmp/conductor/properties diff --git a/scripts/optf-has/has/simulator_script.sh b/scripts/optf-has/has/simulator_script.sh index ccb479b2..c52535cb 100755 --- a/scripts/optf-has/has/simulator_script.sh +++ b/scripts/optf-has/has/simulator_script.sh @@ -44,16 +44,10 @@ if [ ${USER} != 'jenkins' ]; then fi # prepare aaisim -cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/aaisim/ - -# check Dockerfile content -cat ./Dockerfile - -# build aaisim -docker build -t aaisim . +cd ${WORK_DIR}/has/conductor/conductor/tests/functional/simulators/ # run aaisim -docker run -d --name aaisim -p 8081:8081 aaisim +./run_aaisim.sh AAISIM_IP=`docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' aaisim` echo "AAISIM_IP=${AAISIM_IP}" diff --git a/tests/optf-has/has/data/nsi_selection_template_with_create.json b/tests/optf-has/has/data/nsi_selection_template_with_create.json new file mode 100644 index 00000000..6d659f9e --- /dev/null +++ b/tests/optf-has/has/data/nsi_selection_template_with_create.json @@ -0,0 +1,168 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + }, + { + "attribute": "coverage_area_ta_list", + "operator": "eq", + "threshold": { + "get_param": "coverage_area_ta_list" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, + "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + "coverage_area_ta_list": { + "values": [ + { + "get_param": "coverage_area_ta_list" + } + ] + }, + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "maximize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "coverage_area_ta_list": "Chennai", + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json b/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json new file mode 100644 index 00000000..1b5b99e4 --- /dev/null +++ b/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json @@ -0,0 +1,168 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + }, + { + "attribute": "coverage_area_ta_list", + "operator": "eq", + "threshold": { + "get_param": "coverage_area_ta_list" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "637762da-0764-43cc-8b9a-535085770821", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, + "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + "coverage_area_ta_list": { + "values": [ + { + "get_param": "coverage_area_ta_list" + } + ] + }, + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "coverage_area_ta_list": "Chennai", + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/tests/optf-has/has/data/nsi_selection_template_with_reuse.json b/tests/optf-has/has/data/nsi_selection_template_with_reuse.json new file mode 100644 index 00000000..ff66b2d2 --- /dev/null +++ b/tests/optf-has/has/data/nsi_selection_template_with_reuse.json @@ -0,0 +1,168 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "template": { + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + }, + { + "attribute": "coverage_area_ta_list", + "operator": "eq", + "threshold": { + "get_param": "coverage_area_ta_list" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "demands": { + "URLLC": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a", + "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22", + "service-role": "nsi" + }, + "inventory_provider": "aai", + "inventory_type": "nsi", + "unique": "true" + }, + { + "default_attributes": { + "creation_cost": 0.9 + }, + "filtering_attributes": { + "service_profile": { + "latency": {"value": {"get_param": "latency"}, "operator": "lte"}, + "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}, + "coverage_area_ta_list": {"value": {"get_param": "coverage_area_ta_list"}, "operator": "eq"} + }, + "subnets":{ + "core": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "core_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "core_reliability" + } + ] + } + }, + "ran": { + "coverage_area_ta_list": { + "values": [ + { + "get_param": "coverage_area_ta_list" + } + ] + }, + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "ran_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "ran_reliability" + } + ] + } + }, + "transport": { + "latency": { + "max": { + "get_param": "latency" + }, + "min": { + "get_param": "tn_latency" + }, + "steps": 1 + }, + "reliability": { + "values": [ + { + "get_param": "tn_reliability" + } + ] + } + } + } + }, + "inventory_provider": "generator", + "inventory_type": "slice_profiles", + "unique": "true" + } + ] + }, + "homing_template_version": "2020-08-13", + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "creation_cost", + "demand": "URLLC" + } + } + ], + "operator": "sum" + } + }, + "parameters": { + "core_latency": 10, + "core_reliability": 99.9, + "coverage_area_ta_list": "Chennai", + "latency": 30, + "ran_latency": 7, + "ran_reliability": 99.9, + "reliability": 99.9, + "tn_latency": 10, + "tn_reliability": 99.9 + } + }, + "timeout": 1200 +} diff --git a/tests/optf-has/has/data/nssi_selection_template.json b/tests/optf-has/has/data/nssi_selection_template.json new file mode 100644 index 00000000..a498ca0b --- /dev/null +++ b/tests/optf-has/has/data/nssi_selection_template.json @@ -0,0 +1,84 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "timeout": 1200, + "template": { + "homing_template_version": "2020-08-13", + "parameters": { + "coverage_area_ta_list": "Chennai", + "latency": 30, + "reliability": 99.9 + }, + "demands": { + "URLLC_core": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", + "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", + "service-role": "nssi" + }, + "inventory_provider": "aai", + "inventory_type": "nssi", + "unique": "true" + } + ] + }, + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC_core" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + }, + { + "attribute": "coverage_area_ta_list", + "operator": "eq", + "threshold": { + "get_param": "coverage_area_ta_list" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "latency", + "demand": "URLLC_core" + } + } + ], + "operator": "sum" + } + } + } +} diff --git a/tests/optf-has/has/data/nssi_selection_template_unmatched.json b/tests/optf-has/has/data/nssi_selection_template_unmatched.json new file mode 100644 index 00000000..49302801 --- /dev/null +++ b/tests/optf-has/has/data/nssi_selection_template_unmatched.json @@ -0,0 +1,84 @@ +{ + "files": {}, + "limit": 10, + "name": "urllc_sample", + "num_solution": "1", + "timeout": 1200, + "template": { + "homing_template_version": "2020-08-13", + "parameters": { + "coverage_area_ta_list": "Chennai", + "latency": 5, + "reliability": 99.9 + }, + "demands": { + "URLLC_core": [ + { + "default_attributes": { + "creation_cost": 0.1 + }, + "filtering_attributes": { + "service-function": "shared", + "model-invariant-id": "c343a533-c045-4ec0-bbb6-f30eb8eb5a41", + "model-version-id": "8d770214-d3e7-43ea-b7a6-9b235dcbcd34", + "service-role": "nssi" + }, + "inventory_provider": "aai", + "inventory_type": "nssi", + "unique": "true" + } + ] + }, + "constraints": { + "URLLC_Threshold": { + "demands": [ + "URLLC_core" + ], + "properties": { + "evaluate": [ + { + "attribute": "latency", + "operator": "lte", + "threshold": { + "get_param": "latency" + }, + "unit": "ms" + }, + { + "attribute": "reliability", + "operator": "gte", + "threshold": { + "get_param": "reliability" + }, + "unit": "" + }, + { + "attribute": "coverage_area_ta_list", + "operator": "eq", + "threshold": { + "get_param": "coverage_area_ta_list" + }, + "unit": "" + } + ] + }, + "type": "threshold" + } + }, + "optimization": { + "goal": "minimize", + "operation_function": { + "operands": [ + { + "function": "attribute", + "params": { + "attribute": "latency", + "demand": "URLLC_core" + } + } + ], + "operator": "sum" + } + } + } +} diff --git a/tests/optf-has/has/optf_has_test.robot b/tests/optf-has/has/optf_has_test.robot index 8bd313a9..9185fcea 100644 --- a/tests/optf-has/has/optf_has_test.robot +++ b/tests/optf-has/has/optf_has_test.robot @@ -522,6 +522,170 @@ GetPlanWithHpaScoreMultiObj Should Be Equal done ${resultStatus} Should Be Equal HPA-cloud_cloud-region-1 ${vim-id} +# NSI selection template +SendPlanWithNsiSelection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_reuse.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNsiSelection + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['instance_name']} + 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} + Should Be Equal nsi_test_0211 ${instance_name} + +SendPlanWithNsiSelectionSliceProfile + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_create.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNsiSelectionSliceProfile + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} + 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} + Should Be Equal slice_profiles ${candidate_type} + +SendPlanWithNoNsi + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nsi_selection_template_with_nonsi.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNoNsi + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${candidate_type}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC']['candidate']['inventory_type']} + 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} + Should Be Equal slice_profiles ${candidate_type} + +SendPlanWithNssiSelection + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNssiSelection + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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']} + ${instance_name}= Convert To String ${response_json['plans'][0]['recommendations'][0]['URLLC_core']['candidate']['instance_name']} + 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} + Should Be Equal nssi_test_0211 ${instance_name} + +SendPlanWithNssiSelectionUnmatched + [Documentation] It sends a POST request to conductor + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + ${data}= Get Binary File ${CURDIR}${/}data${/}nssi_selection_template_unmatched.json + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 + +GetPlanWithNssiSelectionUnmatched + [Documentation] It sends a REST GET request to capture recommendations + Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT} + &{headers}= Create Dictionary Authorization=${HAS_Auth} 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 *** |