aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2-services-slice-analysis-ms/testcases
diff options
context:
space:
mode:
authorNiranjana <niranjana.y60@wipro.com>2022-03-17 09:03:08 +0000
committerdecheng zhang <decheng.zhang@huawei.com>2022-04-26 12:24:15 -0400
commit9ed698d4522c487445a1ca048f29836c5f59c5e6 (patch)
tree2976ff365ecdfcb294c9f4d4d377ac23d12dfb83 /tests/dcaegen2-services-slice-analysis-ms/testcases
parent8f88f01b9fbbdd2af363a747ecf43b9de15a9b6e (diff)
Add new testcase for network slicing capacity in slice-analysis-ms
Issue-ID: DCAEGEN2-2942 Signed-off-by: Niranjana <niranjana.y60@wipro.com> Change-Id: I3842e57f094a996ea64423eab0790ac99927d751
Diffstat (limited to 'tests/dcaegen2-services-slice-analysis-ms/testcases')
-rw-r--r--tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json11
-rw-r--r--tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json1
-rw-r--r--tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot16
3 files changed, 25 insertions, 3 deletions
diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json
new file mode 100644
index 00000000..443e97de
--- /dev/null
+++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json
@@ -0,0 +1,11 @@
+{
+ "sliceIdentifiers": [
+ "09cad94e-fbb8-4c70-9c4d-74ec75e97683",
+ "50f418a6-804f-4453-bf70-21f0efaf6fcd"
+ ],
+ "configParams": [
+ "dLThptPerSlice",
+ "uLThptPerSlice",
+ "maxNumberOfConns"
+ ]
+}
diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json
new file mode 100644
index 00000000..7bc05164
--- /dev/null
+++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json
@@ -0,0 +1 @@
+{"sliceConfigDetails":[{"sliceIdentifiers":"09cad94e-fbb8-4c70-9c4d-74ec75e97683","aggregatedConfig":{"maxNumberOfConns":null,"dlthptPerSlice":131214207,"ulthptPerSlice":59642989}},{"sliceIdentifiers":"50f418a6-804f-4453-bf70-21f0efaf6fcd","aggregatedConfig":{"maxNumberOfConns":null,"dlthptPerSlice":190857028,"ulthptPerSlice":119285978}}]}
diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot
index 8c4d8e23..d57309cf 100644
--- a/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot
+++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot
@@ -9,11 +9,13 @@ Suite Teardown Delete All Sessions
*** Variables ***
${SLICE_ANALYSIS_MS_BASE_URL} http://${SLICE_ANALYSIS_MS_IP}:8080
+${SLICE_CONFIG_ENDPOINT} ${SLICE_ANALYSIS_MS_BASE_URL}/api/v1/slices-config
${HEALTHCHECK_ENDPOINT} /healthcheck
${DMAAP_URL} http://${DMAAP_IP}:3904/events
${unauthenticated.DCAE_CL_OUTPUT} /unauthenticated.DCAE_CL_OUTPUT/23/23
${POST_DMAAP_EVENT_FOR_ML_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.ML_RESPONSE_TOPIC
${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS
+&{headers} Content-Type=application/json
*** Test Cases ***
@@ -21,7 +23,7 @@ ${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthe
HealthCheck
Create Session sliceanalysisms ${SLICE_ANALYSIS_MS_BASE_URL}
- ${resp}= Get Request sliceanalysisms ${HEALTHCHECK_ENDPOINT}
+ ${resp}= Get On Session sliceanalysisms ${HEALTHCHECK_ENDPOINT}
Should Be Equal As Strings ${resp.status_code} 200
@@ -36,7 +38,7 @@ Post ml notification to dmaap
Verify ml notification trigger
Create Session dmaap ${DMAAP_URL}
FOR ${i} IN RANGE 30
- ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT}
+ ${result}= Get On Session dmaap ${unauthenticated.DCAE_CL_OUTPUT}
Exit For Loop If ${result.json()} != @{EMPTY}
Log Waiting for slice-analysis-ms to handle trigger... console=${True}
Sleep 5s
@@ -62,7 +64,7 @@ Post pm notification-1 to dmaap
Verify pm notification-1 trigger
Create Session dmaap ${DMAAP_URL}
FOR ${i} IN RANGE 20
- ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT}
+ ${result}= Get On Session dmaap ${unauthenticated.DCAE_CL_OUTPUT}
Exit For Loop If ${result.json()} != @{EMPTY}
Log Waiting for sliceanalysisms to handle trigger... console=${True}
Sleep 30s
@@ -76,3 +78,11 @@ Verify pm notification-1 trigger
${actual_payload}= Evaluate json.loads("""${actual_payload_str}""") json
set to dictionary ${expected_payload['additionalProperties']['nsiInfo']} nsiId=${actual_payload['additionalProperties']['nsiInfo']['nsiId']}
Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip()
+
+
+Verify slice utilization respose
+ ${data}= Get File ${TEST_ROBOT_DIR}/data/slice_config_request.json
+ ${result}= Evaluate requests.get('${SLICE_CONFIG_ENDPOINT}', data=$data, headers=${headers})
+ ${expected_slice_config}= Get File ${TEST_ROBOT_DIR}/data/slice_config_response.json
+ ${actual_slice_config}= Convert To String ${result.content}
+ Should Be True """${actual_slice_config}""".strip() == """${expected_slice_config}""".strip()