aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2021-03-08 08:48:41 +0000
committerGerrit Code Review <gerrit@onap.org>2021-03-08 08:48:41 +0000
commitaa686f94515f61d89652a587b92447c8f3dbe2d2 (patch)
tree32a27ce7e67c6d79fc08968e128be940828ad39e /tests
parent0cbd3333945b636aab635a219c34d7f1420047fe (diff)
parentac6c8501503d272c691b71a98078cc3fab1cc8c9 (diff)
Merge "CSIT for NST selection enhancements"
Diffstat (limited to 'tests')
-rw-r--r--tests/optf-has/has/data/nsi_selection_template_with_create.json19
-rw-r--r--tests/optf-has/has/data/nsi_selection_template_with_nonsi.json19
-rw-r--r--tests/optf-has/has/data/nsi_selection_template_with_reuse.json20
-rw-r--r--tests/optf-has/has/data/nssi_selection_template.json9
-rw-r--r--tests/optf-has/has/data/nssi_selection_template_unmatched.json10
-rw-r--r--tests/optf-has/has/data/nst_selection_template.json55
-rw-r--r--tests/optf-has/has/optf_has_test.robot34
7 files changed, 94 insertions, 72 deletions
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
index 6d659f9e..acf53ff6 100644
--- a/tests/optf-has/has/data/nsi_selection_template_with_create.json
+++ b/tests/optf-has/has/data/nsi_selection_template_with_create.json
@@ -26,14 +26,6 @@
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
@@ -63,8 +55,7 @@
"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"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
@@ -86,13 +77,6 @@
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
"latency": {
"max": {
"get_param": "latency"
@@ -155,7 +139,6 @@
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
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
index 1b5b99e4..b4e625a2 100644
--- a/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json
+++ b/tests/optf-has/has/data/nsi_selection_template_with_nonsi.json
@@ -26,14 +26,6 @@
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
@@ -63,8 +55,7 @@
"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"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
@@ -86,13 +77,6 @@
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
"latency": {
"max": {
"get_param": "latency"
@@ -155,7 +139,6 @@
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
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
index ff66b2d2..3cce5f9c 100644
--- a/tests/optf-has/has/data/nsi_selection_template_with_reuse.json
+++ b/tests/optf-has/has/data/nsi_selection_template_with_reuse.json
@@ -26,14 +26,6 @@
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
@@ -63,8 +55,7 @@
"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"}
+ "reliability": {"value": {"get_param": "reliability"}, "operator": "gte"}
},
"subnets":{
"core": {
@@ -86,13 +77,7 @@
}
},
"ran": {
- "coverage_area_ta_list": {
- "values": [
- {
- "get_param": "coverage_area_ta_list"
- }
- ]
- },
+
"latency": {
"max": {
"get_param": "latency"
@@ -155,7 +140,6 @@
"parameters": {
"core_latency": 10,
"core_reliability": 99.9,
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"ran_latency": 7,
"ran_reliability": 99.9,
diff --git a/tests/optf-has/has/data/nssi_selection_template.json b/tests/optf-has/has/data/nssi_selection_template.json
index a498ca0b..e1656949 100644
--- a/tests/optf-has/has/data/nssi_selection_template.json
+++ b/tests/optf-has/has/data/nssi_selection_template.json
@@ -7,7 +7,6 @@
"template": {
"homing_template_version": "2020-08-13",
"parameters": {
- "coverage_area_ta_list": "Chennai",
"latency": 30,
"reliability": 99.9
},
@@ -51,14 +50,6 @@
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
]
},
diff --git a/tests/optf-has/has/data/nssi_selection_template_unmatched.json b/tests/optf-has/has/data/nssi_selection_template_unmatched.json
index 49302801..23500c5b 100644
--- a/tests/optf-has/has/data/nssi_selection_template_unmatched.json
+++ b/tests/optf-has/has/data/nssi_selection_template_unmatched.json
@@ -7,7 +7,6 @@
"template": {
"homing_template_version": "2020-08-13",
"parameters": {
- "coverage_area_ta_list": "Chennai",
"latency": 5,
"reliability": 99.9
},
@@ -51,15 +50,8 @@
"get_param": "reliability"
},
"unit": ""
- },
- {
- "attribute": "coverage_area_ta_list",
- "operator": "eq",
- "threshold": {
- "get_param": "coverage_area_ta_list"
- },
- "unit": ""
}
+
]
},
"type": "threshold"
diff --git a/tests/optf-has/has/data/nst_selection_template.json b/tests/optf-has/has/data/nst_selection_template.json
new file mode 100644
index 00000000..41819141
--- /dev/null
+++ b/tests/optf-has/has/data/nst_selection_template.json
@@ -0,0 +1,55 @@
+{
+ "name":"urllc_sample",
+ "files":{
+
+ },
+ "limit":10,
+ "num_solution":"1",
+ "timeout":1200,
+ "template":{
+ "homing_template_version":"2020-08-13",
+ "demands":{
+ "nst_demand":[
+ {
+ "inventory_provider":"aai",
+ "inventory_type":"nst",
+ "unique":"true",
+ "region":"RegionOne",
+ "filtering_attributes":{
+ "model-role":"nst"
+ }
+ }
+ ]
+ },
+ "constraints":{
+ "nst_Threshold":{
+ "type":"threshold",
+ "demands":[
+ "nst_demand"
+ ],
+ "properties":{
+ "evaluate":[
+ {
+ "attribute":"latency",
+ "operator":"lte",
+ "threshold":30,
+ "unit":"ms"
+ }
+ ]
+ }
+ } },
+ "optimization":{
+ "goal": "minimize",
+ "operation_function": {
+ "operator": "sum",
+ "operands": [{
+ "function": "attribute",
+ "params": {
+ "demand": "nst_demand",
+ "attribute": "latency"
+ }
+ }]
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/tests/optf-has/has/optf_has_test.robot b/tests/optf-has/has/optf_has_test.robot
index 9185fcea..6085bcea 100644
--- a/tests/optf-has/has/optf_has_test.robot
+++ b/tests/optf-has/has/optf_has_test.robot
@@ -686,6 +686,40 @@ GetPlanWithNssiSelectionUnmatched
Should Be Equal As Integers ${resp.status_code} 200
Should Be Equal not found ${resultStatus}
+# NST selection template
+SendPlanWithNSTSelection
+ [Documentation] It sends a POST request to conductor
+ Create Session optf-cond ${COND_HOSTNAME}:${COND_PORT}
+ ${data}= Get Binary File ${CURDIR}${/}data${/}nst_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
+
+GetPlanWithNsTSelection
+ [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]['nst_demand']['candidate']['model_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 EmbbNst ${instance_name}
+
*** Keywords ***