Automates 5.3.2 "Get a list of subscription resources" tests related to O2 Cloud... 54/14254/3
authorAlberto Losada <alosadag@redhat.com>
Mon, 10 Mar 2025 11:11:28 +0000 (12:11 +0100)
committerAlberto Losada <alosadag@redhat.com>
Wed, 16 Apr 2025 10:54:54 +0000 (12:54 +0200)
Change-Id: I306bae85e4499e5052a11b9fe1f93907411ec424
Signed-off-by: Alberto Losada <alosadag@redhat.com>
test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.2_Get_a_list_subscription_resources.robot [new file with mode: 0644]

diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.2_Get_a_list_subscription_resources.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.2_Get_a_list_subscription_resources.robot
new file mode 100644 (file)
index 0000000..aa65d39
--- /dev/null
@@ -0,0 +1,40 @@
+*** Settings ***
+Documentation  Get a list of subscription resources
+#Library  REST       ssl_verify=False    loglevel=DEBUG
+Library  REST       ssl_verify=False
+Variables              ${EXECDIR}${/}test_configs.yaml
+
+Suite Setup            Set REST Headers
+
+*** Variables ***
+${ORAN_HOST_EXTERNAL_IP}       ${ocloud.oran_o2_app.api.host}
+${ORAN_SERVICE_NODE_PORT}      ${ocloud.oran_o2_app.api.node_port}
+${GLOBAL_OCLOUD_ID1}           ${ocloud.oran_o2_app.g_ocloud_id}
+${SMO_TOKEN_DATA}              ${ocloud.oran_o2_app.smo_token_data}
+${globalLocationId}            ${ocloud.oran_o2_app.g_location_id}
+${ENDPOINT_URI}                ${ocloud.oran_o2_notification.endpoint_uri}
+${RESOURCE_ADDRESS}            ${ocloud.oran_o2_notification.resource_address}
+${PUBLISHER_EVENT_ENDPOINT}    ${ocloud.oran_o2_notification.publisher_endpoint}
+
+*** Test Cases ***
+s1, Return code is “200 OK”, with Response message body content containing an array of Subscriptioninfo
+    [documentation]  This test case verifies the capability to query the list of subscriptions for event notifications from event consumers.
+    [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Event_Subscription
+
+    # At least one subscription must exist so it can be queried.
+    ${subscriptionRequest}      input   {"EndpointUri": "${ENDPOINT_URI}", "ResourceAddress": "${RESOURCE_ADDRESS}"}
+    ${res}     POST   ${PUBLISHER_EVENT_ENDPOINT}       ${subscriptionRequest}
+
+    Clear Expectations
+    Expect Response Body        ${CURDIR}/schemas/subscriptions_resource_properties.json
+    ${res}     GET   ${PUBLISHER_EVENT_ENDPOINT}
+    Integer     response status    200
+    Array       response body
+    Array       $   minItems=1  uniqueItems=true
+
+*** Keywords ***
+Set REST Headers
+    Set Headers     {"accept": "application/json"}
+    Set Headers     {"Content-Type": "application/json"}
+    Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
+    Set Client Cert   ${CURDIR}/../certs/client.pem
\ No newline at end of file