From 323e652696ceb2746ea571cf9854b1b4cfb56ce5 Mon Sep 17 00:00:00 2001 From: dliu5 Date: Wed, 22 Mar 2023 17:32:03 +0800 Subject: [PATCH] Add O2 IMS compliance automation test scripts. The O2IMS Compliance Test Specification: https://oranalliance.atlassian.net/wiki/download/attachments/2505408783/O-RAN.WG6-O-CLOUD_CONF_TEST-R003-v01.00.00.docx?api=v2 Added detailed test configuration user guide as comments to readme. Signed-off-by: dliu5 Change-Id: I993c4fcc4789b59d4827a2edd4781e8d3ce16e7c --- test_scripts/O2IMS_Compliance_Test/mock.sh | 95 +++ ...es_native_API_Profile)_access_information.robot | 84 +++ ...ventory_with_O2ims_APIs_and_correct_token.robot | 640 +++++++++++++++++++++ ...ion_and_succeeds_to_receive_notifications.robot | 215 +++++++ ...e_alarm_notification_and_query_alarm_list.robot | 284 +++++++++ ...7.3.5_Verify_general_aspects_of_O2ims_API.robot | 174 ++++++ ...ending_O2ims_APIs_with_unsupported_method.robot | 131 +++++ ...le_issuing_O2ims_APIs_with_incorrect_data.robot | 132 +++++ ...e_while_issuing_APIs_with_incorrect_token.robot | 68 +++ ...hile_issuing_requests_with_incorrect_APIs.robot | 64 +++ .../o2ims_compliance/__init__.robot | 35 ++ .../o2ims_compliance/oran-helm.robot | 42 ++ .../o2ims_compliance/oran-lcm.robot | 38 ++ .../o2ims_compliance/schemas/alarm_properties.json | 67 +++ .../alarm_subscription_allfields_properties.json | 30 + .../schemas/alarm_subscription_properties.json | 27 + .../schemas/alarm_subscriptions_properties.json | 30 + .../schemas/alarms_properties.json | 70 +++ .../schemas/client_errors_properties.json | 29 + .../deploymentManager_allfields_properties.json | 76 +++ .../schemas/deploymentManager_properties.json | 39 ++ .../schemas/deploymentManagers_properties.json | 53 ++ .../schemas/ocloud_allfields_properties.json | 37 ++ .../schemas/ocloud_properties.json | 36 ++ .../schemas/resourcePool_allfields_properties.json | 42 ++ .../schemas/resourcePool_properties.json | 44 ++ .../schemas/resourcePools_properties.json | 42 ++ .../schemas/resourceType_allfields_properties.json | 130 +++++ .../schemas/resourceType_properties.json | 134 +++++ .../resourceTypes_allfields_properties.json | 127 ++++ .../schemas/resourceTypes_field2_properties.json | 22 + .../schemas/resourceTypes_field3_properties.json | 40 ++ .../schemas/resourceTypes_field4_properties.json | 47 ++ .../schemas/resourceTypes_properties.json | 133 +++++ .../schemas/resource_allfields_properties.json | 54 ++ .../schemas/resource_properties.json | 49 ++ .../schemas/resources_properties.json | 52 ++ .../schemas/subscription_post_req_properties.json | 19 + .../schemas/subscription_post_resp_properties.json | 12 + .../schemas/subscription_properties.json | 21 + .../schemas/subscriptions_properties.json | 24 + .../schemas/unsupported_method_properties.json | 33 ++ .../o2ims_compliance/smo_server_mock.robot | 59 ++ .../o2ims_compliance/ssh_helper.robot | 42 ++ test_scripts/O2IMS_Compliance_Test/readme.md | 142 +++++ .../O2IMS_Compliance_Test/test_configs.yaml | 31 + 46 files changed, 3795 insertions(+) create mode 100644 test_scripts/O2IMS_Compliance_Test/mock.sh create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.10_SMO_succeeds_to_get_O2dms_(in_Kubernetes_native_API_Profile)_access_information.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.2_SMO_succeeds_to_query_inventory_with_O2ims_APIs_and_correct_token.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.3_SMO_succeeds_to_subscribe_for_O2ims_inventory_changes_notification_and_succeeds_to_receive_notifications.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.4_SMO_succeeds_to_create_alarmSubscription_receive_alarm_notification_and_query_alarm_list.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.5_Verify_general_aspects_of_O2ims_API.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.6_SMO_gets_405_while_sending_O2ims_APIs_with_unsupported_method.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.7_SMO_gets_400_405_while_issuing_O2ims_APIs_with_incorrect_data.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.9_SMO_get_correct_response_while_issuing_requests_with_incorrect_APIs.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/__init__.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-helm.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-lcm.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscriptions_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarms_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/client_errors_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManagers_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePools_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field2_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field3_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field4_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_allfields_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resources_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_req_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_resp_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscriptions_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/unsupported_method_properties.json create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/smo_server_mock.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/o2ims_compliance/ssh_helper.robot create mode 100644 test_scripts/O2IMS_Compliance_Test/readme.md create mode 100644 test_scripts/O2IMS_Compliance_Test/test_configs.yaml diff --git a/test_scripts/O2IMS_Compliance_Test/mock.sh b/test_scripts/O2IMS_Compliance_Test/mock.sh new file mode 100644 index 0000000..fd2f6ed --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/mock.sh @@ -0,0 +1,95 @@ +#!/bin/bash +# $1 mocker server host +# $2 mocker server port + +if [ "$#" -ne 2 ]; then + echo "need 2 arguments" + exit 1 +fi + +export mockserver_host=$1 +export mockserver_port=$2 +export SMO_ENDPOINT="https://${mockserver_host}:${mockserver_port}/mockserver" + +VALID_CLOUD_OBSERVER="{ + \"id\": \"mock_smo_registration\", + \"httpRequest\" : { + \"path\" : \"/mock_smo/v1/ocloud_observer\", + \"method\":\"POST\" + }, + \"httpResponse\" : { + \"statusCode\": 204, + \"body\" : { + \"status\": 204, + \"result\": \"Welcome to mocked smo server!\" + } + }, + \"priority\" : 10 +}" + +INVALID_CLOUD_OBSERVER="{ + \"id\": \"invalid_mock_smo_registration\", + \"httpRequest\" : { + \"path\" : \"/mock_smo/v1/invalid_ocloud_observer\", + \"method\":\"POST\" + }, + \"httpResponse\" : { + \"statusCode\": 500, + \"body\" : { + \"status\": 500, + \"result\": \"mocked smo server invalid\" + } + }, + \"priority\" : 10 +}" + +O2IMS_INVENTORY_OBSERVER="{ + \"id\": \"mock_smo_inventory_change_notification_endpoint_registration\", + \"httpRequest\" : { + \"path\" : \"/mock_smo/v1/o2ims_inventory_observer\", + \"method\":\"POST\" + }, + \"httpResponse\" : { + \"statusCode\": 204, + \"body\" : { + \"status\": 204, + \"result\": \"this is mocked inventory change notification callback\" + } + }, + \"priority\" : 10 +}" + +O2IMS_ALARM_OBSERVER="{ + \"id\": \"mock_smo_alarm_notification_endpoint_registration\", + \"httpRequest\" : { + \"path\" : \"/mock_smo/v1/o2ims_alarm_observer\", + \"method\":\"POST\" + }, + \"httpResponse\" : { + \"statusCode\": 204, + \"body\" : { + \"status\": 204, + \"result\": \"Welcome to mocked smo server alarm notification endpoint\" + } + }, + \"priority\" : 10 +}" + +curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \ +--header 'Accept: application/json' \ +-d "${VALID_CLOUD_OBSERVER}" + +curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \ +--header 'Accept: application/json' \ +-d "${INVALID_CLOUD_OBSERVER}" + +curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \ +--header 'Accept: application/json' \ +-d "${O2IMS_INVENTORY_OBSERVER}" + + +curl -s -k -X PUT $SMO_ENDPOINT/expectation --header 'Content-Type: application/json' \ +--header 'Accept: application/json' \ +-d "${O2IMS_ALARM_OBSERVER}" + +exit diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.10_SMO_succeeds_to_get_O2dms_(in_Kubernetes_native_API_Profile)_access_information.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.10_SMO_succeeds_to_get_O2dms_(in_Kubernetes_native_API_Profile)_access_information.robot new file mode 100644 index 0000000..fc5da56 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.10_SMO_succeeds_to_get_O2dms_(in_Kubernetes_native_API_Profile)_access_information.robot @@ -0,0 +1,84 @@ +*** Settings *** +Documentation Verify SMO succeeds to get O2dms (in kubernetes native API profile) access information +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +${deploymentManagerName} kubernetes + +*** Test Cases *** +s1, query deploymentManager list without filter + [documentation] This test case verifies query deploymentManager list without filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_DeploymentManager + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/deploymentManagers_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers + # Output Schema response body ${CURDIR}/schemas/.output/deploymentManagers_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + +s2, query deploymentManager list with filter + [documentation] This test case verifies query deploymentManager list with filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_DeploymentManager + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/deploymentManagers_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers?filter=(cont,name,${deploymentManagerName}) + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +s3, query a deploymentManager detail + [documentation] This test case verifies query a deploymentManager detail + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_DeploymentManager + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/deploymentManagers_properties.json + ${res1} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers?filter=(cont,name,${deploymentManagerName}) + # Clear Expectations + log ${res1} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + ${deploymentManagerId} output $[0].deploymentManagerId + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/deploymentManager_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers/${deploymentManagerId} + # Output Schema response body ${CURDIR}/schemas/.output/deploymentManager_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Object response body + + # all_fields + Expect Response Body ${CURDIR}/schemas/deploymentManager_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers/${deploymentManagerId}?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/deploymentManager_allfields_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.2_SMO_succeeds_to_query_inventory_with_O2ims_APIs_and_correct_token.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.2_SMO_succeeds_to_query_inventory_with_O2ims_APIs_and_correct_token.robot new file mode 100644 index 0000000..4058ef6 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.2_SMO_succeeds_to_query_inventory_with_O2ims_APIs_and_correct_token.robot @@ -0,0 +1,640 @@ +*** Settings *** +Documentation Verify SMO succeeds to query inventory with O2ims APIs and correct token +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +*** Test Cases *** +s1, query o-cloud detail + [documentation] This test case verifies Query OCloud Detail + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS + # Builtin.Set Log Level DEBUG + # Set SSL Verify False + # Set Headers {"accept": "application/json"} + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/ocloud_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Output Schema response body ${CURDIR}/schemas/.output/ocloud_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + # Object response body + String $.globalcloudId ${GLOBAL_OCLOUD_ID1} + String $.serviceUri ${ORAN_O2IMS_ENDPOINT} + + # all_fields + Expect Response Body ${CURDIR}/schemas/ocloud_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/ocloud_allfields_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + +s2, query resource type list without filter + [documentation] This test case verifies Query OCloud resourceTypes without filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourceTypes_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes + # Output Schema response body ${CURDIR}/schemas/.output/resourceTypes_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # all_fields + Expect Response Body ${CURDIR}/schemas/resourceTypes_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/resourceTypes_allfields_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + + +s3, query resource type list with filters + [documentation] This test case verifies Query OCloud resourceTypes with filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourceTypes_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 maxItems=1 + # String $[0].resourceTypeId + # String $[0].name + # String $[0].resourceKind + # String $[0].resourceClass + # String $[0].resourceTypeId + +s4, query resource type list with selectors + [documentation] This test case verifies query resource type list with selectors + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourceTypes_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=name,description + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +s5, query Resource Type detail + [documentation] This test case verifies Query OCloud resourceTypes detail + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourceType_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} + # Output Schema response body ${CURDIR}/schemas/.output/resourceType_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + # all_fields + Expect Response Body ${CURDIR}/schemas/resourceType_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/resourceType_allfields_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + String $.alarmDictionary.managementInterfaceId "O2IMS" + +s6, query Resource Pool list without filter + [documentation] This test case verifies Query OCloud resourcePools without filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourcePools_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # # all_fields + # # Expect Response Body ${CURDIR}/schemas/resourcePools_allfields_properties.json + # ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_allfields_properties.json + # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 200 + +s7, query Resource Pool list with filter + [documentation] This test case verifies Query OCloud resourcePools with filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + ${resourcePoolId} output $[0].resourcePoolId + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourcePools_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools?filter=(eq,resourcePoolId,${resourcePoolId}) + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 maxItems=1 + +s8, query Resource Pool list with selector + [documentation] This test case verifies query Resource Pool list with selector + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourcePools_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +s9, query Resource Pool detail + [documentation] This test case verifies Query OCloud resourcePools detail + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + ${resourcePoolId} output $[0].resourcePoolId + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourcePool_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId} + # Output Schema response body ${CURDIR}/schemas/.output/resourcePool_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + # all_fields + Expect Response Body ${CURDIR}/schemas/resourcePool_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/resourcePool_allfields_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + + +s10, query Resource list of a Resource Pool without filter + [documentation] This test case verifies Query OCloud Resource list without filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources + # Output Schema response body ${CURDIR}/schemas/.output/resources_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + END + + +s11, query Resource list of a Resource Pool with filter + [documentation] This test case verifies Query OCloud Resource list with filter + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + # Output Schema response body ${CURDIR}/schemas/.output/resources_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + END + + +s12, query Resource list of a Resource Pool with selector + [documentation] This test case verifies query Resource list of a Resource Pool with selector + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?exclude_default + # Output Schema response body ${CURDIR}/schemas/.output/resources_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + END + +s13, query Resource detail + [documentation] This test case verifies Query OCloud Resource Detail of pserver + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId} + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + # all_fields + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/resource_allfields_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + ${description} output $.description + should contain ${description} hostname: + should contain ${description} id: + should contain ${description} personality: + should contain ${description} subfunctions: + should contain ${description} max_cpu_mhz_allowed: + should contain ${description} install_state: + should contain ${description} operational: + should contain ${description} availability: + should contain ${description} administrative: + should contain ${description} boot_device: + should contain ${description} mgmt_mac: + should contain ${description} clock_synchronization: + should contain ${description} rootfs_device: + Object $.extensions + String $.extensions['hostname'] + Integer $.extensions['id'] + String $.extensions['personality'] + # String $.extensions['max_cpu_mhz_allowed'] + # String $.extensions['install_state'] + String $.extensions['operational'] + String $.extensions['availability'] + String $.extensions['administrative'] + String $.extensions['boot_device'] + String $.extensions['rootfs_device'] + String $.extensions['subfunctions'] + String $.extensions['mgmt_mac'] + String $.extensions['clock_synchronization'] + + BREAK + END + + +s14, query Resource detail of an accelerator + [documentation] This test case verifies Query OCloud Resource Detail of an accelerator + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_acc) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource of accelerator" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + ${description} output $.description + should contain ${description} name: + should contain ${description} pdevice: + should contain ${description} pciaddr: + should contain ${description} pvendor_id: + should contain ${description} pvendor: + should contain ${description} pclass_id: + should contain ${description} pclass: + should contain ${description} psvendor: + should contain ${description} psdevice: + should contain ${description} sriov_totalvfs: + should contain ${description} sriov_numvfs: + should contain ${description} numa_node: + # should contain ${description} name: + # should contain ${description} class: + # should contain ${description} vendor: + Object $.extensions + String $.extensions['name'] + String $.extensions['pdevice'] + String $.extensions['pciaddr'] + String $.extensions['pvendor_id'] + String $.extensions['pvendor'] + String $.extensions['pclass_id'] + String $.extensions['pclass'] + String $.extensions['psvendor'] + String $.extensions['psdevice'] + # Integer $.extensions['sriov_totalvfs'] + Integer $.extensions['sriov_numvfs'] + Integer $.extensions['numa_node'] + + BREAK + END + +s15, query Resource detail of an cpu + [documentation] This test case verifies Query OCloud Resource Detail of an cpu + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_cpu) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource of accelerator" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + ${description} output $.description + should contain ${description} core: + should contain ${description} thread: + should contain ${description} allocated_function: + should contain ${description} numa_node: + should contain ${description} cpu_model: + should contain ${description} cpu_family: + should contain ${description} cpu: + Object $.extensions + Integer $.extensions['cpu'] + Integer $.extensions['core'] + Integer $.extensions['thread'] + String $.extensions['allocated_function'] + Integer $.extensions['numa_node'] + String $.extensions['cpu_model'] + String $.extensions['cpu_family'] + + BREAK + END + + +s16, query Resource detail of an interface + [documentation] This test case verifies Query OCloud Resource Detail of an interface + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_if) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource of accelerator" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + ${description} output $.description + should contain ${description} ifname: + should contain ${description} iftype: + should contain ${description} imac: + should contain ${description} vlan_id: + should contain ${description} imtu: + should contain ${description} ifclass: + should contain ${description} uses: + should contain ${description} max_tx_rate: + should contain ${description} sriov_vf_driver: + should contain ${description} sriov_numvfs: + should contain ${description} ptp_role: + Object $.extensions + String $.extensions['ifname'] + String $.extensions['iftype'] + String $.extensions['imac'] + # Integer $.extensions['vlan_id'] + Integer $.extensions['imtu'] + # String $.extensions['ifclass'] + # String $.extensions['uses'] + # Integer $.extensions['max_tx_rate'] + # String $.extensions['sriov_vf_driver'] + # Integer $.extensions['sriov_numvfs'] + # String $.extensions['ptp_role'] + + BREAK + END + + +s17, query Resource detail of a memory + [documentation] This test case verifies Query OCloud Resource Detail of a memory + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_mem) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource of accelerator" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + ${description} output $.description + should contain ${description} memtotal_mib: + should contain ${description} memavail_mib: + should contain ${description} vm_hugepages_use_1G: + should contain ${description} vm_hugepages_possible_1G: + should contain ${description} hugepages_configured: + should contain ${description} vm_hugepages_avail_1G: + should contain ${description} vm_hugepages_nr_1G: + should contain ${description} vm_hugepages_nr_4K: + should contain ${description} vm_hugepages_nr_2M: + should contain ${description} numa_node: + should contain ${description} vm_hugepages_possible_2M: + should contain ${description} vm_hugepages_avail_2M: + should contain ${description} platform_reserved_mib: + Object $.extensions + Integer $.extensions['memtotal_mib'] + Integer $.extensions['memavail_mib'] + # String $.extensions['vm_hugepages_use_1G'] + Integer $.extensions['vm_hugepages_possible_1G'] + # String $.extensions['hugepages_configured'] + Integer $.extensions['vm_hugepages_avail_1G'] + Integer $.extensions['vm_hugepages_nr_1G'] + Integer $.extensions['vm_hugepages_nr_4K'] + Integer $.extensions['vm_hugepages_nr_2M'] + Integer $.extensions['vm_hugepages_possible_2M'] + Integer $.extensions['vm_hugepages_avail_2M'] + Integer $.extensions['platform_reserved_mib'] + Integer $.extensions['numa_node'] + + BREAK + END + +s18, query Resource detail of an ethernet port + [documentation] This test case verifies Query OCloud Resource Detail of an ethernet port + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_ethernet) + ${resourceTypeId} output $[0].resourceTypeId + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + @{resourcePools} output $ + FOR ${resourcePool} IN @{resourcePools} + # ${resourcePoolId} output $[0].resourcePoolId + ${resourcePoolId} input ${resourcePool}[resourcePoolId] + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + @{resources} output $ + ${length1}= Get Length ${resources} + IF ${length1} == 0 + log "resourcePool with id: ${resourcePoolId} has no resource of accelerator" + CONTINUE + END + ${resourceId} output $[0].resourceId + + Expect Response Body ${CURDIR}/schemas/resource_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources/${resourceId}?all_fields + + # Output Schema response body ${CURDIR}/schemas/.output/resource_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + ${description} output $.description + should contain ${description} name: + should contain ${description} pdevice: + should contain ${description} pciaddr: + should contain ${description} mac: + should contain ${description} dev_id: + should contain ${description} pclass: + should contain ${description} psvendor: + should contain ${description} psdevice: + should contain ${description} sriov_totalvfs: + should contain ${description} sriov_numvfs: + should contain ${description} numa_node: + should contain ${description} capabilities: + should contain ${description} type: + should contain ${description} driver: + Object $.extensions + String $.extensions['name'] + String $.extensions['pdevice'] + String $.extensions['pciaddr'] + String $.extensions['mac'] + Integer $.extensions['dev_id'] + String $.extensions['pclass'] + String $.extensions['psvendor'] + String $.extensions['psdevice'] + # Integer $.extensions['sriov_totalvfs'] + Integer $.extensions['sriov_numvfs'] + Integer $.extensions['numa_node'] + # Integer $.extensions['capabilities'] + String $.extensions['type'] + String $.extensions['driver'] + + BREAK + END + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.3_SMO_succeeds_to_subscribe_for_O2ims_inventory_changes_notification_and_succeeds_to_receive_notifications.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.3_SMO_succeeds_to_subscribe_for_O2ims_inventory_changes_notification_and_succeeds_to_receive_notifications.robot new file mode 100644 index 0000000..17f665a --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.3_SMO_succeeds_to_subscribe_for_O2ims_inventory_changes_notification_and_succeeds_to_receive_notifications.robot @@ -0,0 +1,215 @@ +*** Settings *** +Documentation Verify SMO succeeds to subscribe for O2ims inventory changes notification and succeeds to receive notifications +# Library REST ssl_verify=False loglevel=DEBUG +Library REST ssl_verify=False +Resource smo_server_mock.robot +Variables ${EXECDIR}${/}test_configs.yaml + +Suite Setup Set REST Headers And Clear Subscriptions +Suite Teardown Clear Subscriptions + +*** 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +${SMO_INV_OBSERVER_URL} ${smo.service.protocol}://${smo.service.host}:${smo.service.port}${smo.o2ims_inventory_observer.path} +${consumerSubscriptionId} 3F20D850-AF4F-A84F-FB5A-0AD585410361 + +# ${subscription_data} {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(neq,resourcePools.globalLocationId,${globalLocationId})" } + +# ${subscription_data} {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "" } + +*** Test Cases *** +s1, create a subscription + [documentation] This test case verifies ocloud inventory subscription management + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + ${invalid_subscription_data} input {"consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "" } + +# Check error input logic + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions ${invalid_subscription_data} + Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + + Clear Expectations + # Expect Request ${CURDIR}/schemas/subscription_post_resp_properties.json + # Expect Response Body ${CURDIR}/schemas/subscription_post_resp_properties.json + Expect Response Body ${CURDIR}/schemas/subscription_properties.json + Set Headers {"Content-Type": "application/json"} + ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceTypeInfo)" } + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceTypeInfo);(eq,resourceTypeId,id1234)" } + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceTypeInfo);(neq,resourceTypeId,id1234)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(neq,objectType,ResourceTypeInfo);(neq,resourceTypeId,id1234)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(neq,vendor,id1234)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,resourceId,resourceid1234)|(eq,objectType,ResourceTypeInfo);(neq,resourceTypeId, typeid1234)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceInfo);(neq,resourceId,resourceid1234)|(eq,objectType,ResourceTypeInfo);(neq,resourceTypeId, typeid1234)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceInfo);(eq,resourceId,bc175af1-b6ff-4002-80db-4ee3c2d4fce6) | (eq,objectType,ResourceInfo);(eq,resourceId,resourceid5678)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceInfo);(neq,resourceId,bc175af1-b6ff-4002-80db-4ee3c2d4fce6) | (eq,objectType,ResourceInfo);(eq,resourceId,resourceid5678)" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "[(eq,objectType,ResourceInfo);(neq,resourceId,bc175af1-b6ff-4002-80db-4ee3c2d4fce6) | (eq,objectType,ResourceInfo);(eq,resourceId,resourceid5678)]" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "[(eq,objectType,ResourceInfo);(eq,resourceId,resourceid1234)]" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "[()|()]" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "[]" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "()" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "();" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": ";()" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": ";();" } + + # ${subscription_data} input {"callback": "${SMO_INV_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,objectType,ResourceInfo);(eq,resourceId,resourceid1234);" } + + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions ${subscription_data} + # Output Schema request body ${CURDIR}/schemas/.output/subscription_post_req_properties.json + # Output Schema response body ${CURDIR}/schemas/.output/subscription_post_resp_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 201 + Object response body + +# s2, query subscription list without filter +# [documentation] This test case verifies Query OCloud resourceTypes without filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions + # Output Schema response body ${CURDIR}/schemas/.output/subscriptions_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions?all_fields + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +# s3, query subscription list with filter +# [documentation] This test case verifies Query OCloud resourceTypes with filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions?filter=(eq,consumerSubscriptionId,${consumerSubscriptionId}) + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 + +# s4, query a subscription detail +# [documentation] This test case verifies Query OCloud resourceTypes detail +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + Clear Expectations + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions + log ${res} level=INFO + ${subscriptionId} output $[0].subscriptionId + Set Global Variable ${subscriptionId} + Clear Expectations + #Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions/${subscriptionId} + # Output Schema response body ${CURDIR}/schemas/.output/resourceType_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Object response body + + +# Check duplication logic + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions ${subscription_data} + Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +# s5, smo receives notification upon o2ims inventory changes +# [documentation] This test case verifies Query OCloud resourcePools without filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions + #Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + ${verify_data} Output {"httpRequest": {"path": "${smo.o2ims_inventory_observer.path}"},"times": {"atLeast": 1}} + SMO called by IMS verification ${verify_data} + + +# s6, delete a subscription +# [documentation] This test case verifies Query OCloud resourcePools with filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + ${res} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions/${subscriptionId} + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + # Array response body + # Array $ minItems=1 maxItems=1 + +# s7, smo stop receiving notification upon o2ims inventory changes +# [documentation] This test case verifies Query OCloud resourcePools detail +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Inventory_Subscription + + # # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/subscriptions_properties.json + # ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions/${subscriptionId} + # # Output Schema response body ${CURDIR}/schemas/.output/resourcePool_properties.json + # Clear Expectations + # log ${res} level=INFO + # Integer response status 200 + # Object response body + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + +Clear Subscriptions + Clear Expectations + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions + log ${res} level=DEBUG + @{subs} output $ + FOR ${sub} IN @{subs} + ${subscriptionId}= input ${sub}[subscriptionId] + ${res2} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions/${subscriptionId} + log ${res2} level=DEBUG + END + +Set REST Headers And Clear Subscriptions + Set REST Headers + Clear Subscriptions diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.4_SMO_succeeds_to_create_alarmSubscription_receive_alarm_notification_and_query_alarm_list.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.4_SMO_succeeds_to_create_alarmSubscription_receive_alarm_notification_and_query_alarm_list.robot new file mode 100644 index 0000000..42a3364 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.4_SMO_succeeds_to_create_alarmSubscription_receive_alarm_notification_and_query_alarm_list.robot @@ -0,0 +1,284 @@ +*** Settings *** +Documentation Verify SMO succeeds to create alarmSubscription, receive alarm notification, and query alarm list +# Library REST ssl_verify=False loglevel=DEBUG +Library REST ssl_verify=False + +Resource ssh_helper.robot + +Variables ${EXECDIR}${/}test_configs.yaml + +# Suite Setup Set REST Headers +Suite Setup Set REST Headers And Clear Subscriptions +Suite Teardown Clear Subscriptions + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +${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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +${SMO_ALARM_OBSERVER_URL} ${smo.service.protocol}://${smo.service.host}:${smo.service.port}${smo.o2ims_alarm_observer.path} +${consumerSubscriptionId} 3F20D850-AF4F-A84F-FB5A-0AD585410361 + +# ${subscription_data} {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(neq,resourcePools.globalLocationId,${globalLocationId})" } + +# ${subscription_data} {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "" } + +*** Test Cases *** +s1, create alarmSubscription + [documentation] This test case verifies create alarmSubscription + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/alarm_subscription_post_resp_properties.json + Expect Response Body ${CURDIR}/schemas/alarm_subscription_properties.json + + Set Headers {"Content-Type": "application/json"} + ${subscription_data} input {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "" } + + # ${subscription_data} input {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,resourceTypeID,typeid1234)" } + + # ${subscription_data} input {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(neq,resourceTypeID,typeid1234)" } + + # ${subscription_data} input {"callback": "${SMO_ALARM_OBSERVER_URL}", "consumerSubscriptionId": "${consumerSubscriptionId}", "filter": "(eq,perceivedSeverity,1)" } + + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions ${subscription_data} + # Output Schema request body ${CURDIR}/schemas/.output/alarm_subscription_post_req_properties.json + # Output Schema response body ${CURDIR}/schemas/.output/alarm_subscription_post_resp_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 201 + Object response body + +# s2, query alarmSubscription list + # [documentation] This test case verifies query alarmSubscription list + # [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + Clear Expectations + Expect Response Body ${CURDIR}/schemas/alarm_subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions + # Output Schema response body ${CURDIR}/schemas/.output/alarm_subscriptions_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # all_fields + Expect Response Body ${CURDIR}/schemas/alarm_subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/alarm_subscriptions_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +# s?, query alarmSubscription list with filter +# [documentation] This test case verifies Query OCloud resourceTypes with filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/alarm_subscriptions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions?filter=(eq,consumerSubscriptionId,${consumerSubscriptionId}) + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 + +# s3, query alarmSubscription detail +# [documentation] This test case verifies Query OCloud resourceTypes detail +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + # Clear Expectations + # GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId} + ${subscriptionId} output $[0].alarmSubscriptionId + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/alarm_subscription_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId} + # Output Schema response body ${CURDIR}/schemas/.output/alarm_subscriptions_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Object response body + + # all_fields + Expect Response Body ${CURDIR}/schemas/alarm_subscription_allfields_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId}?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/alarm_subscription_allfields_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + +# Check duplication logic + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions ${subscription_data} + # Output Schema response body ${CURDIR}/schemas/.output/client_errors_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +# s4, Stx/WRCP generates an alarm change event and check SMO succeeds to receive a alarm change notification +# [documentation] This test case verifies Query OCloud resourcePools without filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + # ${stdout} ${stderr} ${rc}= Assert Alarm With Disk Usage + # log ${rc} level=DEBUG + # Should Be Equal ${rc} 0 + + +# s5, query alarm list without filter + + Clear Expectations + Expect Response Body ${CURDIR}/schemas/alarms_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms + # Output Schema response body ${CURDIR}/schemas/.output/alarms_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # # query with filter + # Expect Response Body ${CURDIR}/schemas/alarms_properties.json + # ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms?all_fields&filter=(eq,perceivedSeverity,1) + # # Output Schema response body ${CURDIR}/schemas/.output/alarms_properties.json + # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 200 + # Array response body + # Array $ minItems=1 uniqueItems=true + + # extract resourceTypeId for query with fitler test + ${resourceTypeId} output $[0].resourceTypeId + +# s6, query alarm list with filter + Clear Expectations + # GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + # ${resourceTypeId} output $[0].resourceTypeId + Expect Response Body ${CURDIR}/schemas/alarms_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms?filter=(eq,resourceTypeID,${resourceTypeId}) + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + Expect Response Body ${CURDIR}/schemas/alarms_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms {"filter": "(eq,resourceTypeID,${resourceTypeId};eq,alarmAcknowledged,false)"} + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + +# s7, query alarm detail + Expect Response Body ${CURDIR}/schemas/alarms_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms?all_fields + # Output Schema response body ${CURDIR}/schemas/.output/alarms_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # all fields + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms?all_fields + log ${res} level=DEBUG + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + # alarm detail + ${alarmEventRecordId} output $[0].alarmEventRecordId + Expect Response Body ${CURDIR}/schemas/alarm_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms/${alarmEventRecordId} + # Output Schema response body ${CURDIR}/schemas/.output/alarm_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + + # all fields + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms/${alarmEventRecordId}?all_fields + log ${res} level=DEBUG + Integer response status 200 + Object response body + Object $.extensions + # Boolean $.extensions['mgmt_affecting'] + String $.extensions['alarm_state'] + # Boolean $.extensions['degrade_affecting'] + # Boolean $.extensions['service_affecting'] + String $.extensions['alarm_type'] + String $.extensions['entity_type_id'] + String $.extensions['probable_cause'] + String $.extensions['alarm_id'] + String $.extensions['entity_instance_id'] + String $.extensions['proposed_repair_action'] + # Boolean $.extensions['suppression'] + String $.extensions['suppression_status'] + +# s8, delete the alarmSubscription +# [documentation] This test case verifies Query OCloud resourcePools with filter +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/alarm_subscriptions_properties.json + ${res} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId} + # Output Schema response body ${CURDIR}/schemas/.output/resourcePools_properties.json + Clear Expectations + log ${res} level=INFO + Integer response status 200 + # Array response body + # Array $ minItems=1 maxItems=1 + +# s9, Stx/WRCP generates an alarm change event and check SMO cannot receive any alarm change notification +# [documentation] This test case verifies Query OCloud resourcePools detail +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Alarm_Subscription + + # # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/alarm_subscriptions_properties.json + # ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId} + # # Output Schema response body ${CURDIR}/schemas/.output/resourcePool_properties.json + # Clear Expectations + # log ${res} level=INFO + # Integer response status 200 + # Object response body + +# clear the alarm condition + ${stdout} ${stderr} ${rc}= Clear Alarm With Disk Usage +# log ${rc} level=DEBUG +# Should Be Equal ${rc} 0 + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + +Clear Subscriptions + Clear Expectations + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions + log ${res} level=DEBUG + @{subs} output $ + FOR ${sub} IN @{subs} + ${subscriptionId}= input ${sub}[alarmSubscriptionId] + ${res2} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions/${subscriptionId} + log ${res2} level=DEBUG + END + +Set REST Headers And Clear Subscriptions + Set REST Headers + Clear Subscriptions diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.5_Verify_general_aspects_of_O2ims_API.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.5_Verify_general_aspects_of_O2ims_API.robot new file mode 100644 index 0000000..43f8b85 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.5_Verify_general_aspects_of_O2ims_API.robot @@ -0,0 +1,174 @@ +*** Settings *** +Documentation Verify general aspects of o2ims APIs +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + + +*** Test Cases *** +s1, query ApiVersionInformation of o2ims infrastructureInventory services + [documentation] This test case verifies query ApiVersionInformation of o2ims infrastructureInventory services + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/api_versions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/api_versions + # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/api_versions + # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + +s2, query ApiVersionInformation of o2ims infrastructureMonitoring services + [documentation] This test case verifies query ApiVersionInformation of o2ims infrastructureMonitoring services + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/api_versions_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/api_versions + # Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/api_versions + # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + +s3, query Resources with nextpage_opaque_marker + [documentation] This test case verifies query Resources with nextpage_opaque_marker + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect + + Clear Expectations + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + ${resourcePoolId} output $[0].resourcePoolId + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?nextpage_opaque_marker=2 + # Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +s4, query Resources with filters + [documentation] This test case verifies query Resources with filters + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect + + Clear Expectations + + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + ${resourcePoolId} output $[0].resourcePoolId + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId}) + # Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + @{resources} output $ + FOR ${resource} IN @{resources} + Should Be Equal ${resource}[resourceTypeId] ${resourceTypeId} + END + + # filter accelerator + ${substring1} input "Intel Corporation" + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(cont,description,${substring1}) + # Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + @{resources} output $ + FOR ${resource} IN @{resources} + should contain ${resource}[description] ${substring1} + END + + # filters combination + + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_ethernet) + ${resourceTypeId} output $[0].resourceTypeId + + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + ${resourcePoolId} output $[0].resourcePoolId + # Clear Expectations + ${substring1} input "Intel Corporation" + # Expect Response Body ${CURDIR}/schemas/resources_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources {"filter": "(eq,resourceTypeId,${resourceTypeId});(cont,description,${substring1})"} + # Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + @{resources} output $ + FOR ${resource} IN @{resources} + Should Be Equal ${resource}[resourceTypeId] ${resourceTypeId} + Should Contain ${resource}[description] ${substring1} + END + +s5, query Resources with attribute selector + [documentation] This test case verifies query Resources with attribute selector + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect + + # Clear Expectations + Expect Response Body ${CURDIR}/schemas/resourceTypes_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?all_fields + Clear Expectations + log ${res} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + Expect Response Body ${CURDIR}/schemas/resourceTypes_field2_properties.json + ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=extensions + Clear Expectations + log ${res2} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + Expect Response Body ${CURDIR}/schemas/resourceTypes_field3_properties.json + ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?exclude_fields=extensions + Clear Expectations + log ${res2} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + + Expect Response Body ${CURDIR}/schemas/resourceTypes_field4_properties.json + ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?exclude_default + Clear Expectations + log ${res2} level=INFO + Integer response status 200 + Array response body + Array $ minItems=1 uniqueItems=true + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.6_SMO_gets_405_while_sending_O2ims_APIs_with_unsupported_method.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.6_SMO_gets_405_while_sending_O2ims_APIs_with_unsupported_method.robot new file mode 100644 index 0000000..8e303b8 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.6_SMO_gets_405_while_sending_O2ims_APIs_with_unsupported_method.robot @@ -0,0 +1,131 @@ +*** Settings *** +Documentation Verify SMO get 405 while sending o2ims APIs with unsupported method +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + + +*** Test Cases *** +s1, Operate resourceTypes with unsupported method + [documentation] This test case verifies Operate resourceTypes with unsupported method + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Unsupported_Method + + # Clear Expectations + # Expect Response Body ${CURDIR}/schemas/unsupported_method_properties.json + # ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes + # # Output Schema response body ${CURDIR}/schemas/.output/unsupported_method_properties.json + # # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 405 + # Object response body + + # ${res} PUT ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes + # # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 405 + # Object response body + + # ${res} PATCH ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes + # # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 405 + # Object response body + + # ${res} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes + # # Clear Expectations + # log ${res} level=DEBUG + # Integer response status 405 + # Object response body + + ${resourceTypeId} input 3d19af47-e20d-40f9-ae74-f8cc988a045f + Expect Response Body ${CURDIR}/schemas/unsupported_method_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} + # Output Schema response body ${CURDIR}/schemas/.output/unsupported_method_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 404 + + ${resouceTypeData} input {'description': 'An ethernet resource of the physical server', 'name': '5af55345-enp61s0f0', 'parentId': '5af55345-134a-406c-93b6-c5e10318afa5', 'resourceId': '016977ee-c0c3-4e5d-9e53-2bf1d6448aa5', 'resourcePoolId': 'ce2eec13-24b0-4cca-aa54-548be6cc985b','resourceTypeId': '3d19af47-e20d-40f9-ae74-f8cc988a045f'} + + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} ${resouceTypeData} + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver) + ${resourceTypeId} output $[0].resourceTypeId + ${res} PUT ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + ${res} PATCH ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + ${res} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId} + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + + +# s2, Operate resourcePool with unsupported method +# [documentation] This test case verifies Operate resourcePool with unsupported method +# [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Unsupported_Method + +s2, Operate Ocloud with unsupported method + [documentation] This test case verifies Operate Ocloud with unsupported method + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Unsupported_Method + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/unsupported_method_properties.json + ${res} POST ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Output Schema response body ${CURDIR}/schemas/.output/unsupported_method_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + # ${res} PUT ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1 + + ${res} PUT ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + ${res} PATCH ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + ${res} DELETE ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Clear Expectations + log ${res} level=DEBUG + Integer response status 405 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Content-Type": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.7_SMO_gets_400_405_while_issuing_O2ims_APIs_with_incorrect_data.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.7_SMO_gets_400_405_while_issuing_O2ims_APIs_with_incorrect_data.robot new file mode 100644 index 0000000..747c6da --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.7_SMO_gets_400_405_while_issuing_O2ims_APIs_with_incorrect_data.robot @@ -0,0 +1,132 @@ +*** Settings *** +Documentation Verify SMO gets 4xx response while issuing o2ims APIs with incorrect data +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + + +*** Test Cases *** +s1, Operate resourceTypes with invalid data + [documentation] This test case verifies Operate resourceTypes with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,WrongAttrName,anyvalue) + # Output Schema response body ${CURDIR}/schemas/.output/client_errors_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=(resourceTypeId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s2, Operate resourcePool with invalid data + [documentation] This test case verifies Operate resourcePool with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools?fields=(resourceTypeId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s3, Operate Resource with invalid data + [documentation] This test case verifies Operate Resource with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools + # ${resourcePoolId} input $[0].resourcePoolId + ${resourcePoolId} output $[0].resourcePoolId + + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?fields=(resourceTypeId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s4, Operate DeploymentManager with invalid data + [documentation] This test case verifies Operate DeploymentManager with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers?fields=(deploymentManagerId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s5, Operate Ocloud with invalid data + [documentation] This test case verifies Operate Ocloud with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1?fields=(resourceId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s6, Operate Inventory Subscription with invalid data + [documentation] This test case verifies Operate Inventory Subscription with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/subscriptions?fields=(SubscriptionId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s7, Operate Alarm with invalid data + [documentation] This test case verifies Operate Alarm with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarms?fields=(AlarmId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + +s8, Operate Alarm Subscription with invalid data + [documentation] This test case verifies Operate Alarm Subscription with invalid data + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/alarmSubscriptions?fields=(AlarmSubscriptionId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 400 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Content-Type": "application/json"} + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot new file mode 100644 index 0000000..331f74d --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Verify SMO get security error response while issuing APIs with incorrect token +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +${SMO_TOKEN_DATA_INVALID} ${ocloud.oran_o2_app.smo_token_data}[10:]${ocloud.oran_o2_app.smo_token_data}[:10] + + +*** Test Cases *** +s1, Issue API Request without Authorization Bearer Token Header + [documentation] This test case verifies Issue API Request without Authorization Bearer Token Header + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Output Schema response body ${CURDIR}/schemas/.output/client_errors_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 401 + # Object response body + +s2, Issue API Request with Authorization Bearer Token Header and invalid token + [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and invalid token + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA_INVALID}"} + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=(resourceTypeId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 401 + # Object response body + +s3, Issue API Request with Authorization Bearer Token Header and valid token + [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and valid token + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + # Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}/schemas/ocloud_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1 + # Output Schema response body ${CURDIR}/schemas/.output/ocloud_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Content-Type": "application/json"} + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.9_SMO_get_correct_response_while_issuing_requests_with_incorrect_APIs.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.9_SMO_get_correct_response_while_issuing_requests_with_incorrect_APIs.robot new file mode 100644 index 0000000..aa4fa65 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.9_SMO_get_correct_response_while_issuing_requests_with_incorrect_APIs.robot @@ -0,0 +1,64 @@ +*** Settings *** +Documentation Verify SMO get security error response while issuing APIs with incorrect token +# 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} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + + + +*** Test Cases *** +s1, Verify query with wrong url got error code. + [documentation] Verify query with wrong url got error code. + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagersWrongURL + log ${res} level=DEBUG + Integer response status 404 + # Object response body + +s2, Verify query with wrong api version got error code. + [documentation] Verify query with wrong api version got error code. + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}${/}..${/}o2ims_compliance${/}schemas${/}client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v2/deploymentManagers + # Clear Expectations + log ${res} level=DEBUG + Integer response status 404 + # Object response body + +s3, Verify query with wrong deploymentManagersID got error code. + [documentation] Verify query with wrong deploymentManagersID got error code. + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + # Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}${/}..${/}o2ims_compliance${/}schemas${/}client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers/wrongDeploymentManagerID + Clear Expectations + log ${res} level=DEBUG + Integer response status 404 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Content-Type": "application/json"} + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/__init__.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/__init__.robot new file mode 100644 index 0000000..f63b09b --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/__init__.robot @@ -0,0 +1,35 @@ +*** Settings *** +Documentation This is Compliance Test to O-RAN O2 Spec. July 2022 +... +Variables ${EXECDIR}${/}test_configs.yaml +Resource oran-lcm.robot + +Library SSHLibrary +Suite Setup Setup Test Bed +Suite Teardown Tear Down Test Bed + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +*** Keywords *** +Setup Test Bed + # [Arguments] ${args} + Open Connection And Log In + # bring up smo mock server + # bring up oran o2 app + # Some Keyword ${args} + # Another Keyword + +Tear Down Test Bed + # [Arguments] ${args} + # tear down oran o2 app + # tear down smo mock server + Close All Connections + +Open Connection And Log In + Open Connection ${HOST} + Login ${USERNAME} ${PASSWORD} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-helm.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-helm.robot new file mode 100644 index 0000000..1989a46 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-helm.robot @@ -0,0 +1,42 @@ +*** Settings *** + +# Library SSHLibrary +Resource ssh_helper.robot + +Variables ${EXECDIR}${/}test_configs.yaml + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +${GLOBAL_OCLOUD_ID1} ${ocloud.oran_o2_app.g_ocloud_id} + +${mockserver_port} 1081 +${mockserver_endpoint} ${HOST}:${mockserver_port} +${testdir} ocloudtest +${override_cmd} cat <ocloudtest/override.yaml +... smo_endpoint: ${mockserver_endpoint}/mock_smo/v1/ocloud_observer +... global_ocloud_id: ${GLOBAL_OCLOUD_ID1} +... EOF + + +*** Keywords *** +Setup Oran O2 App + # [Arguments] ${args} + ${stdout} ${stderr} ${rc}= Execute Command docker run -d -p ${mockserver_port}:1080 --name ${mockserver_name} mockserver/mockserver + + +Tear Down Oran O2 App + # [Arguments] ${args} + # tear down oran o2 app + # tear down smo mock server + # Tear Down SMO Server + Close All Connections + +Open Connection And Log In + Open Connection ${HOST} + Login ${USERNAME} ${PASSWORD} + diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-lcm.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-lcm.robot new file mode 100644 index 0000000..78aa8ae --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/oran-lcm.robot @@ -0,0 +1,38 @@ +*** Settings *** + +Library SSHLibrary +Resource ssh_helper.robot +Resource smo_server_mock.robot + +Variables ${EXECDIR}${/}test_configs.yaml + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +*** Keywords *** +Setup Test Bed + # [Arguments] ${args} + # Set Log Level DEBUG + Open Connection And Log In + # bring up smo mock server + # Setup SMO Server + # ${stdout} Execute Command source ${OPENRC} && system host-list + # bring up oran o2 app + # Some Keyword ${args} + # Another Keyword + +Tear Down Test Bed + # [Arguments] ${args} + # tear down oran o2 app + # tear down smo mock server + # Tear Down SMO Server + Close All Connections + +Open Connection And Log In + Open Connection ${HOST} + Login ${USERNAME} ${PASSWORD} + diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_properties.json new file mode 100644 index 0000000..dcd0517 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_properties.json @@ -0,0 +1,67 @@ +{ + "type": "object", + "properties": { + "alarmEventRecordId": { + "type": "string" + }, + "resourceTypeId": { + "type": "string" + }, + "resourceTypeID": { + "type": "string" + }, + "resourceId": { + "type": "string" + }, + "resourceID": { + "type": "string" + }, + "alarmDefinitionId": { + "type": "string" + }, + "alarmDefinitionID": { + "type": "string" + }, + "probableCauseId": { + "type": "string" + }, + "probableCauseID": { + "type": "string" + }, + "alarmRaisedTime": { + "type": "string" + }, + "alarmChangedTime": { + "type": "string" + }, + "alarmAcknowledgeTime": { + "type": "string" + }, + "alarmAcknowledged": { + "type": "boolean" + }, + "perceivedSeverity": { + "type": "string" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + } + }, + "required": [ + "alarmEventRecordId", + "resourceTypeID", + "resourceID", + "alarmDefinitionID", + "probableCauseID", + "alarmRaisedTime", + "alarmChangedTime", + "alarmAcknowledgeTime", + "alarmAcknowledged", + "perceivedSeverity", + "extensions" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_allfields_properties.json new file mode 100644 index 0000000..510695d --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_allfields_properties.json @@ -0,0 +1,30 @@ +{ + "type": "object", + "properties": { + "alarmSubscriptionId": { + "type": "string", + "default": "" + }, + "callback": { + "type": "string", + "default": "" + }, + "consumerSubscriptionId": { + "type": [ + "null", + "string" + ] + }, + "filter": { + "type": [ + "null", + "string" + ], + "default": "" + } + }, + "required": [ + "alarmSubscriptionId", + "callback" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_properties.json new file mode 100644 index 0000000..8c70db3 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscription_properties.json @@ -0,0 +1,27 @@ +{ + "type": "object", + "properties": { + "alarmSubscriptionId": { + "type": "string" + }, + "callback": { + "type": "string" + }, + "consumerSubscriptionId": { + "type": [ + "null", + "string" + ] + }, + "filter": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "alarmSubscriptionId", + "callback" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscriptions_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscriptions_properties.json new file mode 100644 index 0000000..eeea97e --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarm_subscriptions_properties.json @@ -0,0 +1,30 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmSubscriptionId": { + "type": "string" + }, + "callback": { + "type": "string" + }, + "consumerSubscriptionId": { + "type": [ + "null", + "string" + ] + }, + "filter": { + "type": [ + "null", + "string" + ] + } + }, + "required": [ + "alarmSubscriptionId", + "callback" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarms_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarms_properties.json new file mode 100644 index 0000000..6d4aff5 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/alarms_properties.json @@ -0,0 +1,70 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmEventRecordId": { + "type": "string" + }, + "resourceTypeId": { + "type": "string" + }, + "resourceTypeID": { + "type": "string" + }, + "resourceId": { + "type": "string" + }, + "resourceID": { + "type": "string" + }, + "alarmDefinitionId": { + "type": "string" + }, + "alarmDefinitionID": { + "type": "string" + }, + "probableCauseId": { + "type": "string" + }, + "probableCauseID": { + "type": "string" + }, + "alarmRaisedTime": { + "type": "string" + }, + "alarmChangedTime": { + "type": "string" + }, + "alarmAcknowledgeTime": { + "type": "string" + }, + "alarmAcknowledged": { + "type": "boolean" + }, + "perceivedSeverity": { + "type": "string" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + } + }, + "required": [ + "alarmEventRecordId", + "resourceTypeID", + "resourceID", + "alarmDefinitionID", + "probableCauseID", + "alarmRaisedTime", + "alarmChangedTime", + "alarmAcknowledgeTime", + "alarmAcknowledged", + "perceivedSeverity", + "extensions" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/client_errors_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/client_errors_properties.json new file mode 100644 index 0000000..e751e17 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/client_errors_properties.json @@ -0,0 +1,29 @@ +{ + "type": "object", + "properties": { + "detail": { + "type": "string", + "default": "" + }, + "instance": { + "type": "array", + "default": [] + }, + "status": { + "type": "integer", + "default": 400 + }, + "title": { + "type": "string", + "default": "Bad Request" + }, + "type": { + "type": "string", + "default": "/o2ims-infrastructureMonitoring/v1/alarmSubscriptions" + } + }, + "required": [ + "detail", + "status" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_allfields_properties.json new file mode 100644 index 0000000..2b6af8b --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_allfields_properties.json @@ -0,0 +1,76 @@ +{ + "type": "object", + "properties": { + "deploymentManagerId": { + "type": "string", + "default": "a6f48e28-0c50-330c-934f-2c355bdaed98" + }, + "name": { + "type": "string", + "default": "5ffd1c7f-2af7-4dd4-8519-4cab54c561ef.kubernetes" + }, + "description": { + "type": "string", + "default": "A DMS" + }, + "oCloudId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "serviceUri": { + "type": "string", + "default": "https://128.224.115.23:6443" + }, + "extensions": { + "type": "object", + "properties": { + "profileName": { + "type": "string", + "default": "native_k8sapi" + }, + "profileData": { + "type": "object", + "properties": { + "cluster_api_endpoint": { + "type": "string", + "default": "" + }, + "cluster_ca_cert": { + "type": "string", + "default": "" + }, + "admin_user": { + "type": "string", + "default": "" + }, + "admin_client_cert": { + "type": "string", + "default": "" + }, + "admin_client_key": { + "type": "string", + "default": "" + } + }, + "required": [ + "admin_client_cert", + "admin_client_key", + "admin_user", + "cluster_api_endpoint", + "cluster_ca_cert" + ] + } + }, + "required": [ + ] + } + }, + "required": [ + "deploymentManagerId", + "description", + "extensions", + "name", + "oCloudId", + "serviceUri" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_properties.json new file mode 100644 index 0000000..9ec6b91 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManager_properties.json @@ -0,0 +1,39 @@ +{ + "type": "object", + "properties": { + "deploymentManagerId": { + "type": "string", + "default": "a6f48e28-0c50-330c-934f-2c355bdaed98" + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "oCloudId": { + "type": "string", + "default": "" + }, + "serviceUri": { + "type": "string", + "default": "" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + } + }, + "required": [ + "deploymentManagerId", + "description", + "name", + "oCloudId", + "serviceUri" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManagers_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManagers_properties.json new file mode 100644 index 0000000..696341f --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/deploymentManagers_properties.json @@ -0,0 +1,53 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "deploymentManagerId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "deploymentManagementServiceEndpoint": { + "type": "string" + }, + "supportedLocations": { + "type": "string" + }, + "capabilities": { + "type": "string" + }, + "capacity": { + "type": "string" + }, + "profileSupportList": { + "type": "array", + "items": { + "type": "string" + } + }, + "oCloudId": { + "type": "string" + }, + "serviceUri": { + "type": "string" + }, + "extensions": { + "type": "null", + "default": "" + } + }, + "required": [ + "deploymentManagerId", + "description", + "name", + "profileSupportList", + "oCloudId", + "serviceUri" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_allfields_properties.json new file mode 100644 index 0000000..c59b287 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_allfields_properties.json @@ -0,0 +1,37 @@ +{ + "type": "object", + "properties": { + "oCloudId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "globalcloudId": { + "type": "string", + "default": "3F20D850-AF4F-A84F-FB5A-0AD585410361" + }, + "name": { + "type": "string", + "default": "5ffd1c7f-2af7-4dd4-8519-4cab54c561ef" + }, + "description": { + "type": "string", + "default": "An ocloud" + }, + "serviceUri": { + "type": "string", + "default": "http://128.224.115.23:30205" + }, + "extensions": { + "type": "null", + "default": null + } + }, + "required": [ + "description", + "extensions", + "globalcloudId", + "name", + "oCloudId", + "serviceUri" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_properties.json new file mode 100644 index 0000000..c02d37c --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/ocloud_properties.json @@ -0,0 +1,36 @@ +{ + "type": "object", + "properties": { + "oCloudId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "globalcloudId": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "5ffd1c7f-2af7-4dd4-8519-4cab54c561ef" + }, + "description": { + "type": "string", + "default": "An ocloud" + }, + "infrastructureManagementServiceEndpoint": { + "type": "null", + "default": null + }, + "serviceUri": { + "type": "string", + "default": "" + } + }, + "required": [ + "description", + "globalcloudId", + "serviceUri", + "name", + "oCloudId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_allfields_properties.json new file mode 100644 index 0000000..d430509 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_allfields_properties.json @@ -0,0 +1,42 @@ +{ + "type": "object", + "properties": { + "resourcePoolId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "globalLocationId": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "5ffd1c7f-2af7-4dd4-8519-4cab54c561ef" + }, + "description": { + "type": "string", + "default": "A Resource Pool" + }, + "oCloudId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "location": { + "type": "string", + "default": "" + }, + "extensions": { + "type": "null", + "default": null + } + }, + "required": [ + "description", + "extensions", + "globalLocationId", + "location", + "name", + "oCloudId", + "resourcePoolId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_properties.json new file mode 100644 index 0000000..5bd0e1f --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePool_properties.json @@ -0,0 +1,44 @@ +{ + "type": "object", + "properties": { + "resourcePoolId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "name": { + "type": "string", + "default": "5ffd1c7f-2af7-4dd4-8519-4cab54c561ef" + }, + "globalLocationId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "location": { + "type": "string", + "default": "location" + }, + "description": { + "type": "string", + "default": "A Resource Pool" + }, + "oCloudId": { + "type": "string", + "default": "oCloudId" + }, + "resources": { + "type": "array", + "default": [] + }, + "extensions": { + "type": "null", + "default": null + } + }, + "required": [ + "description", + "globalLocationId", + "name", + "resourcePoolId", + "oCloudId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePools_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePools_properties.json new file mode 100644 index 0000000..4841c35 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourcePools_properties.json @@ -0,0 +1,42 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourcePoolId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "globalLocationId": { + "type": "string" + }, + "location": { + "type": "string" + }, + "description": { + "type": "string" + }, + "oCloudId": { + "type": "string", + "default": "oCloudId" + }, + "resources": { + "type": "array", + "default": [] + }, + "extensions": { + "type": "null", + "default": null + } + }, + "required": [ + "description", + "globalLocationId", + "name", + "resourcePoolId", + "oCloudId" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_allfields_properties.json new file mode 100644 index 0000000..522e8b9 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_allfields_properties.json @@ -0,0 +1,130 @@ +{ + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string", + "default": "60cba7be-e2cd-3b8c-a7ff-16e0f10573f9" + }, + "name": { + "type": "string", + "default": "pserver" + }, + "description": { + "type": "string", + "default": "The Physical Server resource type" + }, + "vendor": { + "type": "string", + "default": "" + }, + "model": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "alarmDictionary": { + "type": ["null", "object"], + "properties": { + "alarmDictionarySchemaVersion": { + "type": "string" + }, + "alarmDictionaryVersion": { + "type": "string" + }, + "entityType": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmDefinitionId": { + "type": "string" + }, + "alarmName": { + "type": "string" + }, + "alarmLastChange": { + "type": "string" + }, + "alarmChangeType": { + "type": "string" + }, + "alarmDescription": { + "type": "string" + }, + "proposedRepairActions": { + "type": "string" + }, + "clearingType": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmAdditionalFields": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDefinitionId", + "alarmName", + "alarmLastChange", + "alarmChangeType", + "alarmDescription", + "proposedRepairActions", + "clearingType", + "managementInterfaceId", + "pkNotificationField", + "alarmAdditionalFields" + ] + } + } + }, + "required": [ + "alarmDictionaryVersion", + "alarmDictionarySchemaVersion", + "entityType", + "vendor", + "managementInterfaceId", + "pkNotificationField", + "alarmDefinition" + ] + }, + "extensions": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDictionary", + "description", + "extensions", + "model", + "name", + "resourceTypeId", + "vendor", + "version" + ] +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_properties.json new file mode 100644 index 0000000..7ed366e --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceType_properties.json @@ -0,0 +1,134 @@ +{ + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string", + "default": "0769ceee-ed27-40fa-92cc-98bb4eac1f02" + }, + "name": { + "type": "string", + "default": "pserver_cpu" + }, + "vendor": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "model": { + "type": "string" + }, + "resourceKind": { + "type": "string" + }, + "resourceClass": { + "type": "string" + }, + "alarmDictionary": { + "type": ["null", "object"], + "properties": { + "alarmDictionarySchemaVersion": { + "type": "string" + }, + "alarmDictionaryVersion": { + "type": "string" + }, + "entityType": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmDefinitionId": { + "type": "string" + }, + "alarmName": { + "type": "string" + }, + "alarmLastChange": { + "type": "string" + }, + "alarmChangeType": { + "type": "string" + }, + "alarmDescription": { + "type": "string" + }, + "proposedRepairActions": { + "type": "string" + }, + "clearingType": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmAdditionalFields": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDefinitionId", + "alarmName", + "alarmLastChange", + "alarmChangeType", + "alarmDescription", + "proposedRepairActions", + "clearingType", + "managementInterfaceId", + "pkNotificationField", + "alarmAdditionalFields" + ] + } + } + }, + "required": [ + "alarmDictionaryVersion", + "alarmDictionarySchemaVersion", + "entityType", + "vendor", + "managementInterfaceId", + "pkNotificationField", + "alarmDefinition" + ] + }, + "extensions": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "description", + "name", + "resourceTypeId", + "vendor", + "version", + "model" + ], + "examples": [] +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_allfields_properties.json new file mode 100644 index 0000000..2d720e6 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_allfields_properties.json @@ -0,0 +1,127 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "model": { + "type": "string" + }, + "version": { + "type": "string" + }, + "alarmDictionary": { + "type": ["null", "object"], + "properties": { + "alarmDictionarySchemaVersion": { + "type": "string" + }, + "alarmDictionaryVersion": { + "type": "string" + }, + "entityType": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmDefinitionId": { + "type": "string" + }, + "alarmName": { + "type": "string" + }, + "alarmLastChange": { + "type": "string" + }, + "alarmChangeType": { + "type": "string" + }, + "alarmDescription": { + "type": "string" + }, + "proposedRepairActions": { + "type": "string" + }, + "clearingType": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmAdditionalFields": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDefinitionId", + "alarmName", + "alarmLastChange", + "alarmChangeType", + "alarmDescription", + "proposedRepairActions", + "clearingType", + "managementInterfaceId", + "pkNotificationField", + "alarmAdditionalFields" + ] + } + } + }, + "required": [ + "alarmDictionaryVersion", + "alarmDictionarySchemaVersion", + "entityType", + "vendor", + "managementInterfaceId", + "pkNotificationField", + "alarmDefinition" + ] + }, + "extensions": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDictionary", + "description", + "extensions", + "model", + "name", + "resourceTypeId", + "vendor", + "version" + ] + } +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field2_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field2_properties.json new file mode 100644 index 0000000..c4ea53e --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field2_properties.json @@ -0,0 +1,22 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "alarmDictionary": { + "type": ["null", "object"] + } + }, + "required": [ + "name", + "resourceTypeId" + ] + }, + "examples": [] +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field3_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field3_properties.json new file mode 100644 index 0000000..e475216 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field3_properties.json @@ -0,0 +1,40 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "model": { + "type": "string" + }, + "alarmDictionary": { + "type": "object" + }, + "resourceKind": { + "type": "string" + }, + "resourceClass": { + "type": "string" + }, + "extensions": { + "type": "null" + } + }, + "required": [ + "name", + "resourceTypeId", + "vendor", + "model", + "alarmDictionary" + ] + }, + "examples": [] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field4_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field4_properties.json new file mode 100644 index 0000000..accdc43 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_field4_properties.json @@ -0,0 +1,47 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "version": { + "type": "string" + }, + "description": { + "type": "string" + }, + "model": { + "type": "string" + }, + "alarmDictionary": { + "type": ["null", "object"] + }, + "resourceKind": { + "type": "string" + }, + "resourceClass": { + "type": "string" + }, + "extensions": { + "type": "object" + } + }, + "required": [ + "description", + "name", + "resourceTypeId", + "vendor", + "version", + "model" + ] + }, + "examples": [] +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_properties.json new file mode 100644 index 0000000..966d4ef --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resourceTypes_properties.json @@ -0,0 +1,133 @@ +{ + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "properties": { + "resourceTypeId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "version": { + "type": "string" + }, + "description": { + "type": "string" + }, + "model": { + "type": "string" + }, + "resourceKind": { + "type": "string" + }, + "resourceClass": { + "type": "string" + }, + "alarmDictionary": { + "type": ["null", "object"], + "properties": { + "alarmDictionarySchemaVersion": { + "type": "string" + }, + "alarmDictionaryVersion": { + "type": "string" + }, + "entityType": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmDefinition": { + "type": "array", + "items": { + "type": "object", + "properties": { + "alarmDefinitionId": { + "type": "string" + }, + "alarmName": { + "type": "string" + }, + "alarmLastChange": { + "type": "string" + }, + "alarmChangeType": { + "type": "string" + }, + "alarmDescription": { + "type": "string" + }, + "proposedRepairActions": { + "type": "string" + }, + "clearingType": { + "type": "string" + }, + "managementInterfaceId": { + "type": "string" + }, + "pkNotificationField": { + "type": "string" + }, + "alarmAdditionalFields": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "alarmDefinitionId", + "alarmName", + "alarmLastChange", + "alarmChangeType", + "alarmDescription", + "proposedRepairActions", + "clearingType", + "managementInterfaceId", + "pkNotificationField", + "alarmAdditionalFields" + ] + } + } + }, + "required": [ + "alarmDictionaryVersion", + "alarmDictionarySchemaVersion", + "entityType", + "vendor", + "managementInterfaceId", + "pkNotificationField", + "alarmDefinition" + ] + }, + "extensions": { + "type": [ + "null", + "object" + ] + } + }, + "required": [ + "description", + "name", + "resourceTypeId", + "vendor", + "version", + "model" + ] + }, + "examples": [] +} diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_allfields_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_allfields_properties.json new file mode 100644 index 0000000..55f4686 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_allfields_properties.json @@ -0,0 +1,54 @@ +{ + "type": "object", + "properties": { + "resourceId": { + "type": "string", + "default": "016977ee-c0c3-4e5d-9e53-2bf1d6448aa5" + }, + "resourceTypeId": { + "type": "string", + "default": "a75dab11-702f-3abd-a93c-47c53ca60295" + }, + "resourcePoolId": { + "type": "string", + "default": "ce2eec13-24b0-4cca-aa54-548be6cc985b" + }, + "globalAssetId": { + "type": "string", + "default": "" + }, + "parentId": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string", + "default": "" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + }, + "elements": { + "type": [ + "null", + "array" + ], + "default": null + } + }, + "required": [ + "description", + "elements", + "extensions", + "globalAssetId", + "resourceId", + "resourcePoolId", + "resourceTypeId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_properties.json new file mode 100644 index 0000000..41d27ce --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resource_properties.json @@ -0,0 +1,49 @@ +{ + "type": "object", + "properties": { + "resourceId": { + "type": "string" + }, + "resourceTypeId": { + "type": "string" + }, + "resourcePoolId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parentId": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string" + }, + "globalAssetId": { + "type": "string" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + }, + "elements": { + "type": [ + "null", + "array" + ], + "default": null + } + }, + "required": [ + "description", + "resourceId", + "resourcePoolId", + "resourceTypeId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resources_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resources_properties.json new file mode 100644 index 0000000..86aec84 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/resources_properties.json @@ -0,0 +1,52 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "resourceId": { + "type": "string" + }, + "resourceTypeId": { + "type": "string" + }, + "resourcePoolId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parentId": { + "type": [ + "null", + "string" + ] + }, + "description": { + "type": "string" + }, + "globalAssetId": { + "type": "string" + }, + "extensions": { + "type": [ + "null", + "object" + ], + "default": null + }, + "elements": { + "type": [ + "null", + "array" + ], + "default": null + } + }, + "required": [ + "description", + "resourceId", + "resourcePoolId", + "resourceTypeId" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_req_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_req_properties.json new file mode 100644 index 0000000..5fd1d21 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_req_properties.json @@ -0,0 +1,19 @@ +{ + "body": { + "type": "object", + "properties": { + "callback": { + "type": "string" + }, + "consumerSubscriptionId": { + "type": "string" + }, + "filter": { + "type": "string" + } + }, + "required": [ + "callback" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_resp_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_resp_properties.json new file mode 100644 index 0000000..55d314a --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_post_resp_properties.json @@ -0,0 +1,12 @@ +{ + "type": "object", + "properties": { + "subscriptionId": { + "type": "string", + "default": "6367384a-d9cf-43e3-8b18-2ffe31ca07b6" + } + }, + "required": [ + "subscriptionId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_properties.json new file mode 100644 index 0000000..8291311 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscription_properties.json @@ -0,0 +1,21 @@ +{ + "type": "object", + "properties": { + "subscriptionId": { + "type": "string" + }, + "callback": { + "type": "string" + }, + "consumerSubscriptionId": { + "type": "string" + }, + "filter": { + "type": "string" + } + }, + "required": [ + "callback", + "subscriptionId" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscriptions_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscriptions_properties.json new file mode 100644 index 0000000..56b0f20 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/subscriptions_properties.json @@ -0,0 +1,24 @@ +{ + "type": "array", + "items": { + "type": "object", + "properties": { + "subscriptionId": { + "type": "string" + }, + "callback": { + "type": "string" + }, + "consumerSubscriptionId": { + "type": "string" + }, + "filter": { + "type": "string" + } + }, + "required": [ + "callback", + "subscriptionId" + ] + } +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/unsupported_method_properties.json b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/unsupported_method_properties.json new file mode 100644 index 0000000..3b13b8e --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/schemas/unsupported_method_properties.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "properties": { + "detail": { + "type": "string", + "default": "" + }, + "instance": { + "type": "array", + "default": [] + }, + "status": { + "type": "integer", + "default": 405 + }, + "title": { + "type": "string", + "default": "" + }, + "type": { + "type": "string", + "default": "" + }, + "message": { + "type": "string", + "default": "" + } + }, + "required": [ + "detail", + "status" + ] +} \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/smo_server_mock.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/smo_server_mock.robot new file mode 100644 index 0000000..c378176 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/smo_server_mock.robot @@ -0,0 +1,59 @@ + +*** Settings *** + +# Library SSHLibrary +Resource ssh_helper.robot +Resource smo_server_mock.robot +Variables ${EXECDIR}${/}test_configs.yaml + + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +${mockserver_port} 1081 +${mockserver_name} smo1 + +${SMO_VERIFY_URL} ${smo.service.protocol}://${smo.service.host}:${smo.service.port}${smo.service.verify_endpoint} +${SMO_INV_OBSERVER_URL} ${smo.service.protocol}://${smo.service.host}:${smo.service.port}${smo.o2ims_inventory_observer.path} +*** Keywords *** +# export mockserver_host=128.224.115.23 +# export mockserver_port=1081 +# export mockserver_endpoint="http://${mockserver_host}:${mockserver_port}/mockserver" +# # docker run -d --rm -p --name smo 1080:1080 mockserver/mockserver +# sudo docker run -d -p ${mockserver_port}:1080 --name smo mockserver/mockserver + +Setup SMO Server + # [Arguments] ${args} + # Open Connection And Log In + # bring up smo mock server + ${stdout} ${stderr} ${rc}= Execute Command With Sudo docker run -d -p ${mockserver_port}:1080 --name ${mockserver_name} mockserver/mockserver + log ${stdout} level=DEBUG + log ${stderr} level=DEBUG + # ${stdout} Execute Command source ${OPENRC} && system host-list + # bring up oran o2 app + # Some Keyword ${args} + # Another Keyword + +Tear Down SMO Server + # [Arguments] ${args} + # tear down oran o2 app + # tear down smo mock server + ${stdout} ${stderr} ${rc}= Execute Command With Sudo docker stop ${mockserver_name} + log ${stdout} level=DEBUG + log ${stderr} level=DEBUG + ${stdout} ${stderr} ${rc}= Execute Command With Sudo docker rm ${mockserver_name} + log ${stdout} level=DEBUG + log ${stderr} level=DEBUG + # Close All Connections + + +SMO called by IMS verification + [Arguments] ${args} + Set Headers {"Content-Type": "application/json"} + ${res} put ${SMO_VERIFY_URL} ${args} + log ${res} level=DEBUG + Integer response status 406 diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/ssh_helper.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/ssh_helper.robot new file mode 100644 index 0000000..717bf74 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/ssh_helper.robot @@ -0,0 +1,42 @@ +*** Settings *** + +Library SSHLibrary +Variables ${EXECDIR}${/}test_configs.yaml + +*** Variables *** +${HOST} ${ocloud.ssh.host} +${PORT} ${ocloud.ssh.port} +${USERNAME} ${ocloud.ssh.username} +${PASSWORD} ${ocloud.ssh.password} +${OPENRC} ${ocloud.ssh.openrc} + +${DD_TEST_ASSERT_CMD} "dd if=/dev/zero of=/home/sysadmin/fullfill-8G.zeros bs=512M count=15" +${DD_TEST_CLEAR_CMD} "[ -e '/home/sysadmin/fullfill-8G.zeros' ] && rm /home/sysadmin/fullfill-8G.zeros " +${VERIFY_ALARM_ASSERTED} "fm alarm-list" + +*** Keywords *** +Open Connection And Log In + Open Connection ${HOST} port=${PORT} + Login ${USERNAME} ${PASSWORD} + +Execute Command With Sudo + [Documentation] Execute Command With Sudo and always return stderr and rc + [Arguments] ${cmd} + ${stdout} ${stderr} ${rc}= Execute Command ${cmd} sudo=True sudo_password=${PASSWORD} return_stderr=True return_rc=True + log rc = ${rc} level=DEBUG + Should Be Equal ${rc} 0 + RETURN ${stdout} ${stderr} ${rc} + +Assert Alarm With Disk Usage + [Documentation] Set up conditions to assert disk usage StarlingX Alarm + ${stdout} ${stderr} ${rc}= Execute Command ${DD_TEST_ASSERT_CMD} return_stderr=True return_rc=True + log rc = ${rc} level=DEBUG + Should Be Equal ${rc} 0 + RETURN ${stdout} ${stderr} ${rc} + +Clear Alarm With Disk Usage + [Documentation] Tear down conditions to clear disk usage StarlingX Alarm + ${stdout} ${stderr} ${rc}= Execute Command ${DD_TEST_CLEAR_CMD} return_stderr=True return_rc=True + log rc = ${rc} level=DEBUG +# Should Be Equal ${rc} 0 + RETURN ${stdout} ${stderr} ${rc} diff --git a/test_scripts/O2IMS_Compliance_Test/readme.md b/test_scripts/O2IMS_Compliance_Test/readme.md new file mode 100644 index 0000000..9406850 --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/readme.md @@ -0,0 +1,142 @@ +# Overview + +This folder includes the ORAN O2 IMS Compliance Automation Test Scripts, which used +Robot Framework to simulate SMO to issue API request towards O2IMS. + +The Mock server simulates the SMO to expose API endpoints for O-Clouds to deliver Notifications from O-Cloud to SMO. + +The detailed structure with comments is below. + +``` +O2IMS_Compliance_Test + |--o2ims_compliance # where all the compliance test cases related are here. + |--schemas # all the json schema used to validate the O2ims response body are put here. + |-- xxx.json #The json schema which used by automation test cases to validate the o2ims response body compliance to O-RAN Working Group 6 O2ims Interface Specification. + |--yyy.json # For example: Expect Response Body ${CURDIR}/schemas/alarm_subscription_properties.json + |-- …..json + |--__init__.robot #helper robot script where put common key words definition used by test cases scripts. + |--oran-helm.robot# same as above. + |--oran-lcm.robot # same as above. + |--smo_server_mock.robot # helper robot script where put smo server mock related common key words together. + |--ssh_helper.robot # ssh helper robot script used by test cases scripts. + |--7.3.2_SMO_succeeds_xxx.robot # The automation test cases which are in compliance to test spec, which you can find in reference doc [9] + |--7.3.3… #the same as above one. + |-- … + |--7.3.10 # same as above one. + |--mock.sh # The sample script to help input smo mock endpoints in mock server + |--readme.md #Overall explaination about this folder mainly about how to compose test env and run robot test cases etc. + |--test_configs.yaml # The config file used by robot framework and test cases script with comments. + +``` + +## Test Environment Preparation + +### Prepare robot framework with virtualenv + +``` +virtualenv .robot +source .robot/bin/activate +pip3 install --upgrade robotframework +pip3 install --upgrade RESTinstance +pip3 install --upgrade robotframework-sshlibrary + +robot --version + +``` +### Prepare SMO Mock Server + +Please see reference doc [8] to set up mock server. + +Use the sample shell script to add mock expectations to mock server. + +``` +bash sample.sh 127.0.0.1 1080 +``` + +Use the sample command below to check can get the expected response from mockserver. + +For one example on local test env. + +``` + + curl -v -k -X POST http://127.0.0.1:1080/mock_smo/v1/ocloud_observer +* Trying 127.0.0.1... +* Connected to 127.0.0.1 (127.0.0.1) port 1080 (#0) +> POST /mock_smo/v1/ocloud_observer HTTP/1.1 +> Host: 127.0.0.1:1080 +> User-Agent: curl/7.47.0 +> Accept: */* +> +< HTTP/1.1 204 No Content +< connection: keep-alive +< content-type: application/json; charset=utf-8 +< +* Connection #0 to host 127.0.0.1 left intact +``` + +And other test sample expectations are the same way. + +### Test Configuration File Guide. + +The test_configs.yaml is the configuration file for the test script to get environment variables for issuing requests to O2 IMS service, to +install INF O2 Service, please reference doc [10] and [11], after installation and provisioning O2 IMS services, the corresponding O2 IMS parameters +should be input into below config files correspondingly before running automation test. + +The sample config file parameters explaination in details as below. +``` +ocloud: # O Cloud side configuration. + ssh: #olcoud ssh info + host: 192.168.112.12 # API Host Floating IP. + port: 22 #ssh server port + username: username + password: passwd + openrc: /etc/platform/openrc + oran_o2_app: + g_location_id: testlocation_1 # global location id from SMO. + g_ocloud_id: 18f2dc90-b375-47dd-b8dc-ae80072e6cdb # global ocloud id from SMO. + smo_token_data: put_smo_token_data_here # smo token, currently generated by o2ims and deliver to SMO side by O-Cloud available notification, refer to doc [0] + api: + host: 192.168.112.15 # O2 IMS API Host Floating IP. + node_port: 30205 # O2 IMS port + protocol: https #O2 IMS application protocol. + +smo: #smo mock server ip and callback endpoints + service: + protocol: https # SMO application protocol. + host: 192.168.112.16 # SMO Host IP. + port: 1080 # SMO Service Port. + verify_endpoint: /mockserver/verify # Test tool verification, refer to [1] + ocloud_observer: # Simulate SMO O Cloud Registration callback Endpoint. + path: /mock_smo/v1/ocloud_observer + o2ims_inventory_observer: #Simulate SMO inventory notification callback endpoint. + path: /mock_smo/v1/o2ims_inventory_observer + o2ims_alarm_observer: #Simulate SMO alarm notification callback endpoint. + path: /mock_smo/v1/o2ims_alarm_observer +``` +After finish input the parameters, user is ready to run the automation test cases. + +### Run Test Scripts + +``` +robot -L debug -d ./.reports ./o2ims_compliance +``` + +### Debug tips + +Please check the mock server dashboard to help debug your request status. + +http://mockserverip:1081/mockserver/dashboard + +## Reference +0. [https://oranalliance.atlassian.net/wiki/download/attachments/2612854785/O-RAN.WG6.O2IMS-INTERFACE-v03.00.pdf?api=v2] +1. [https://mock-server.com/] +2. [https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html] +3. [http://robotframework.org/robotframework/2.6.1/libraries/BuiltIn.html] +4. [https://robotframework.org/?tab=1#getting-started] +5. [https://asyrjasalo.github.io/RESTinstance] +6. [https://pypi.org/project/RESTinstance/] +7. [http://robotframework.org/SSHLibrary/] +8. [https://www.mock-server.com/where/docker.html] +9. [https://oranalliance.atlassian.net/wiki/download/attachments/2505408783/O-RAN.WG6-O-CLOUD_CONF_TEST-R003-v01.00.00.docx?api=v2] +10. [https://docs.o-ran-sc.org/projects/o-ran-sc-pti-o2/en/latest/installation-guide.html] +11. [https://docs.o-ran-sc.org/projects/o-ran-sc-pti-o2/en/latest/user-guide.html] \ No newline at end of file diff --git a/test_scripts/O2IMS_Compliance_Test/test_configs.yaml b/test_scripts/O2IMS_Compliance_Test/test_configs.yaml new file mode 100644 index 0000000..166ffda --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/test_configs.yaml @@ -0,0 +1,31 @@ +#olcoud ssh info +ocloud: + ssh: + host: 192.168.112.12 + port: 22 + username: username + password: passwd + openrc: /etc/platform/openrc + #oran_o2_ims_info + oran_o2_app: + g_location_id: testlocation_1 + g_ocloud_id: 18f2dc90-b375-47dd-b8dc-ae80072e6cdb + smo_token_data: put_smo_token_data_here + api: + host: 192.168.112.15 + node_port: 30205 + protocol: https +#smo mock server ip and callback endpoints +smo: + service: + protocol: https + host: 192.168.112.16 + port: 1080 + verify_endpoint: /mockserver/verify + ocloud_observer: + path: /mock_smo/v1/ocloud_observer + o2ims_inventory_observer: + path: /mock_smo/v1/o2ims_inventory_observer + o2ims_alarm_observer: + path: /mock_smo/v1/o2ims_alarm_observer + -- 2.16.6