From: Alberto Losada Date: Wed, 12 Mar 2025 10:01:02 +0000 (+0100) Subject: Automates 5.3.4 "Delete individual subscription resources" tests related to O2 Cloud... X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=41eab04d1c3c66fd8b5a7cc51759d9d5b406a41c;p=it%2Ftest.git Automates 5.3.4 "Delete individual subscription resources" tests related to O2 Cloud Notification API. Change-Id: Id199d4cb7cbeec3986527f09a3b5302c5a5bbb46 Signed-off-by: Alberto Losada --- diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.4_Delete_individual_subscription_resources.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.4_Delete_individual_subscription_resources.robot new file mode 100644 index 0000000..fd155e8 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/5.3.4_Delete_individual_subscription_resources.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Delete individual 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, The return code is “204 DELETE”, without Response message body content. + [documentation] This test case verifies the capability to delete a subscription of event notifications. + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Event_Subscription + + # At least one subscription must exist so it can be deleted. + ${subscriptionRequest} input {"EndpointUri": "${ENDPOINT_URI}", "ResourceAddress": "${RESOURCE_ADDRESS}"} + ${res} POST ${PUBLISHER_EVENT_ENDPOINT} ${subscriptionRequest} + + # Obtain subscriptionId of the first subscription event + Clear Expectations + ${res} GET ${PUBLISHER_EVENT_ENDPOINT} + @{res} output $ + Expect Response Body ${CURDIR}/schemas/subscriptions_resource_properties.json + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + ${subscriptionId} input ${res}[0][SubscriptionId] + + Clear Expectations + ${res} DELETE ${PUBLISHER_EVENT_ENDPOINT}/${subscriptionId} + log ${res} level=DEBUG + Integer response status 204 + +*** 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