diff options
Diffstat (limited to 'tests')
94 files changed, 4237 insertions, 699 deletions
diff --git a/tests/ccsdk-oran/polmansuite/__init__.robot b/tests/ccsdk-oran/polmansuite/__init__.robot new file mode 100644 index 00000000..bf52713b --- /dev/null +++ b/tests/ccsdk-oran/polmansuite/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Non-RT RIC Policy Management - polmansuite diff --git a/tests/ccsdk-oran/polmansuite/test.robot b/tests/ccsdk-oran/polmansuite/test.robot new file mode 100644 index 00000000..eebe478b --- /dev/null +++ b/tests/ccsdk-oran/polmansuite/test.robot @@ -0,0 +1,23 @@ +*** Settings *** +Library OperatingSystem +Library Process + +*** Test Cases *** + +Functional Test Case 1 + [Documentation] Functional Test Case 1 - FTC1 + Start Process ${AUTOTEST_ROOT}/FTC1.sh remote auto-clean --env-file ${TEST_ENV} shell=true cwd=${AUTOTEST_ROOT} + ${cli_cmd_output}= Wait For Process timeout=3600 + Should Be Equal as Integers ${cli_cmd_output.rc} 0 + ${ResultFileContent}= Get File ${AUTOTEST_ROOT}/.resultFTC1.txt + Should Be Equal As Integers ${ResultFileContent} 0 + +Functional Test Case 2 + [Documentation] Functional Test Case 2 - FTC150 + Start Process ${AUTOTEST_ROOT}/FTC150.sh remote auto-clean --env-file ${TEST_ENV} shell=true cwd=${AUTOTEST_ROOT} + ${cli_cmd_output}= Wait For Process timeout=3600 + Should Be Equal as Integers ${cli_cmd_output.rc} 0 + ${ResultFileContent}= Get File ${AUTOTEST_ROOT}/.resultFTC150.txt + Should Be Equal As Integers ${ResultFileContent} 0 + + diff --git a/tests/ccsdk/healthcheck/test1.robot b/tests/ccsdk/healthcheck/test1.robot index 3c81d705..fea86c3d 100644 --- a/tests/ccsdk/healthcheck/test1.robot +++ b/tests/ccsdk/healthcheck/test1.robot @@ -4,7 +4,7 @@ Library Process *** Variables *** -${health_check} ${SCRIPTS}/health_check.sh +${health_check} ${SCRIPTS}/ccsdk/healthcheck/health_check.sh *** Test Cases *** diff --git a/tests/ccsdk/oran/suite1/__init__.robot b/tests/ccsdk/oran/suite1/__init__.robot deleted file mode 100644 index 09aa0315..00000000 --- a/tests/ccsdk/oran/suite1/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation Ccsdk Oran - Suite 1 diff --git a/tests/ccsdk/oran/suite1/test1.robot b/tests/ccsdk/oran/suite1/test1.robot deleted file mode 100644 index 10e68521..00000000 --- a/tests/ccsdk/oran/suite1/test1.robot +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary - -*** Variables *** -${MESSAGE} Hello, world! - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if google.com can be reached - CheckUrl http://www.google.com - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${url} - Create Session session ${url} - ${resp}= Get Request session / - Should Be Equal As Integers ${resp.status_code} 200 diff --git a/tests/ccsdk/oran/suite2/__init__.robot b/tests/ccsdk/oran/suite2/__init__.robot deleted file mode 100644 index c9bbad32..00000000 --- a/tests/ccsdk/oran/suite2/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation Ccsdk Oran - Suite 2 diff --git a/tests/ccsdk/oran/suite2/test1.robot b/tests/ccsdk/oran/suite2/test1.robot deleted file mode 100644 index 5d354dde..00000000 --- a/tests/ccsdk/oran/suite2/test1.robot +++ /dev/null @@ -1,30 +0,0 @@ -*** Settings *** -Library OperatingSystem -Library RequestsLibrary - -*** Variables *** -${MESSAGE} Hello, world! - -*** Test Cases *** -String Equality Test - Should Be Equal ${MESSAGE} Hello, world! - -Dir Test - [Documentation] Check if /tmp exists - Log ${MESSAGE} - CheckDir /tmp - -Url Test - [Documentation] Check if www.onap.org can be reached - Create Session openo http://www.onap.org - CheckUrl openo / - -*** Keywords *** -CheckDir - [Arguments] ${path} - Directory Should Exist ${path} - -CheckUrl - [Arguments] ${session} ${path} - ${resp}= Get Request ${session} ${path} - Should Be Equal As Integers ${resp.status_code} 200 diff --git a/tests/ccsdk/oran/vCPE/__init__.robot b/tests/ccsdk/oran/vCPE/__init__.robot deleted file mode 100644 index f6230ae5..00000000 --- a/tests/ccsdk/oran/vCPE/__init__.robot +++ /dev/null @@ -1,2 +0,0 @@ -*** Settings *** -Documentation Ccsdk Oran - vCPE diff --git a/tests/ccsdk/oran/vCPE/test1.robot b/tests/ccsdk/oran/vCPE/test1.robot deleted file mode 100644 index d07bf6e4..00000000 --- a/tests/ccsdk/oran/vCPE/test1.robot +++ /dev/null @@ -1,60 +0,0 @@ -*** Settings *** -Suite Setup Suite Setup -Suite Teardown Suite Teardown -Library OperatingSystem -Library RequestsLibrary -Library Process -Library ONAPLibrary.Utilities - -*** Variables *** -${GLOBAL_APPLICATION_ID} csit-vCPE -${GLOBAL_MSO_USERNAME} InfraPortalClient -${GLOBAL_MSO_PASSWORD} password1$ - -*** Test Cases *** -SO ServiceInstance health check - ${auth}= Create List ${GLOBAL_MSO_USERNAME} ${GLOBAL_MSO_PASSWORD} - ${session}= Create Session so http://${SO_IP}:8080 - ${uuid}= Generate UUID4 - ${headers}= Create Dictionary Accept=text/html Content-Type=text/html X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} - ${resp}= Get Request so /ecomp/mso/infra/globalhealthcheck headers=${headers} - &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json - ${resp}= Get Request so /ecomp/mso/infra/orchestrationRequests/v2 headers=${headers} - Should Not Contain ${resp.content} null - -*** Keywords *** -Run Docker - [Arguments] ${image} ${name} ${parameters}=${EMPTY} - ${result}= Run Process docker run --name ${name} ${parameters} -d ${image} shell=True - Should Be Equal As Integers ${result.rc} 0 - Log ${result.stdout} - ${result}= Run Process docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${name} shell=True - Should Be Equal As Integers ${result.rc} 0 - Log ${result.stdout} - [Return] ${result.stdout} - -Kill Docker - [Arguments] ${name} - ${result}= Run Process docker logs ${name} shell=True - Should Be Equal As Integers ${result.rc} 0 - Log ${result.stdout} - ${result}= Run Process docker kill ${name} shell=True - Should Be Equal As Integers ${result.rc} 0 - Log ${result.stdout} - ${result}= Run Process docker rm ${name} shell=True - Should Be Equal As Integers ${result.rc} 0 - Log ${result.stdout} - -CheckUrl - [Arguments] ${url} - Create Session session ${url} disable_warnings=True - ${resp}= Get Request session / - Should Be Equal As Integers ${resp.status_code} 200 - -Suite Setup - ${SO_IP}= Run Docker nexus3.onap.org:10001/openecomp/mso i-so - Wait Until Keyword Succeeds 1 min 5 sec CheckUrl http://${SO_IP}:8080 - Set Suite Variable ${SO_IP} - -Suite Teardown - Kill Docker i-so diff --git a/tests/cli/startup/startup_check.robot b/tests/cli/startup/startup_check.robot index 18788ddd..c71870b2 100644 --- a/tests/cli/startup/startup_check.robot +++ b/tests/cli/startup/startup_check.robot @@ -5,96 +5,20 @@ Library Process *** Variables *** ${cli_exec} docker exec cli onap -${cli_exec_cli_10_help} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap --help" -${cli_exec_cli_10_version} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap --version" -${cli_exec_cli_10_schema_refresh} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-refresh" -${cli_exec_cli_10_schema_validate} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate -i -l schema-refresh.yaml" -${cli_exec_cli_10_schema_validate_invalid} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate -i -l invalid-yaml-path.yaml" -${cli_exec_cli_10_schema_validate_empty} docker exec cli bash -c "export CLI_PRODUCT_VERSION=cli-1.0 && onap schema-validate" - -${cli_exec_onap_11} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap" -${cli_exec_onap_11_microservice_create} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-create --service-name test-service --service-version v1 --service-url /api/test/v1 --host-url http://${MSB_IAG_IP}:80 23.14.15.156 80" -${cli_exec_onap_11_microservice_list} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-list --host-url http://${MSB_IAG_IP}:80 --long" -${cli_exec_onap_11_microservice_show} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-show --service-name test-service --service-version v1 --host-url http://${MSB_IAG_IP}:80" -${cli_exec_onap_11_microservice_delete} docker exec cli bash -c "export CLI_PRODUCT_VERSION=onap-1.1 && onap microservice-delete --service-name test-service --service-version v1 --host-url http://${MSB_IAG_IP}:80 --node-ip 23.14.15.156 --node-port 80" +${cli_exec_cli_10_version} docker exec cli bash -c "export OPEN_CLI_PRODUCT_IN_USE=open-cli && onap --version" *** Test Cases *** Liveness Test [Documentation] Check cli liveness check - Create Session cli http://${CLI_IP}:8080 + Create Session cli https://${CLI_IP}:443 CheckUrl cli / -Check Cli help - [Documentation] check cli help command - ${cli_cmd_output}= Run Process ${cli_exec_cli_10_help} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} CLI version - Check Cli Version Default [Documentation] check cli default version ${cli_cmd_output}= Run Process ${cli_exec_cli_10_version} shell=yes Log ${cli_cmd_output.stdout} Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} : cli-1.0 - -Check Cli Scheam Refresh - [Documentation] check cli schema-refresh command - ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_refresh} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} sl-no - Should Contain ${cli_cmd_output.stdout} command - Should Contain ${cli_cmd_output.stdout} product-version - Should Contain ${cli_cmd_output.stdout} schema - Should Contain ${cli_cmd_output.stdout} version - -Check Cli Schema Validate With Valid Path - [Documentation] check cli schema-validate command with valid path - ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - Should Contain ${cli_cmd_output.stdout} sl-no - Should Contain ${cli_cmd_output.stdout} error - -Check Cli Scheam Validate With Invalid Path - [Documentation] check cli schema-validate command with invalid path - ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_invalid} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 1 - Should Contain ${cli_cmd_output.stdout} 0xb001 - -Check Cli Scheam Validate Empty Argument - [Documentation] check cli schema-validate with empty argument - ${cli_cmd_output}= Run Process ${cli_exec_cli_10_schema_validate_empty} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 1 - Should Contain ${cli_cmd_output.stdout} 0x7003 - -Check Cli create microservice - [Documentation] check create microservice - ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_create} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - -Check Cli list microservice - [Documentation] check list microservice - ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_list} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - -Check Cli show microservice - [Documentation] check show microservice - ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_show} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - -Check Cli delete microservice - [Documentation] check delete microservice - ${cli_cmd_output}= Run Process ${cli_exec_onap_11_microservice_delete} shell=yes - Log ${cli_cmd_output.stdout} - Should Be Equal As Strings ${cli_cmd_output.rc} 0 - + Should Contain ${cli_cmd_output.stdout} : open-cli *** Keywords *** diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json index bad79d5f..b67c0cb1 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -20,13 +20,15 @@ "fileBasedGP": 15, "fileLocation": "/pm/pm.xml", "nfFilter": { - "swVersions": [ - "1.0.0", - "1.0.1" - ], "nfNames": [ "^pnf.*", "^vnf.*" + ], + "modelInvariantUUIDs": [ + "7129e420-d396-4efb-af02-6b83499b12f8" + ], + "modelVersionIDs": [ + ] }, "measurementGroups": [ diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json index 860672f4..b433892a 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json @@ -14,7 +14,7 @@ ] }, "body": [ - "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"orchestration-status\":\"Active\"}}" + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"UPDATE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\",\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"orchestration-status\":\"Active\"}}" ] }, "times": { diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json index 8dd58188..3df66a61 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json @@ -14,7 +14,7 @@ ] }, "body": [ - "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"orchestration-status\":\"Active\"}}" + "{\"cambria.partition\":\"AAI\",\"event-header\":{\"severity\":\"NORMAL\",\"entity-type\":\"pnf\",\"top-entity-type\":\"pnf\",\"entity-link\":\"/aai/v16/network/pnfs/pnf/pnf_newly_discovered\",\"event-type\":\"AAI-EVENT\",\"domain\":\"dev\",\"action\":\"DELETE\",\"sequence-number\":\"0\",\"id\":\"db09e090-196e-4f84-9645-e449b1cd3640\",\"source-name\":\"dcae-curl\",\"version\":\"v16\",\"timestamp\":\"20200203-15:14:08:807\"},\"entity\":{\"ipaddress-v4-oam\":\"10.10.10.37\",\"nf-role\":\"gNB\",\"equip-type\":\"val8\",\"relationship-list\":{\"relationship\":[{\"related-to\":\"service-instance\",\"relationship-data\":[{\"relationship-value\":\"Demonstration\",\"relationship-key\":\"customer.global-customer-id\"},{\"relationship-value\":\"vCPE\",\"relationship-key\":\"service-subscription.service-type\"},{\"relationship-value\":\"2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-key\":\"service-instance.service-instance-id\"}],\"related-link\":\"/aai/v16/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vCPE/service-instances/service-instance/2c03b2a8-e31a-4749-9e99-3089ab441400\",\"relationship-label\":\"org.onap.relationships.inventory.ComposedOf\",\"related-to-property\":[{\"property-key\":\"service-instance.service-instance-name\",\"property-value\":\"Svc6_1\"}]}]},\"equip-vendor\":\"Ericsson\",\"serial-number\":\"6061ZW3\",\"ipaddress-v6-oam\":\"2001:0db8:0:0:0:0:1428:57ab\",\"equip-model\":\"val6\",\"in-maint\":false,\"resource-version\":\"1578668956804\",\"sw-version\":\"val7\",\"pnf-id\":\"eabcfaf7-b7f3-45fb-94e7-e6112fb3e8b8\",\"pnf-name\":\"pnf_newly_discovered\",\"model-invariant-id\":\"7129e420-d396-4efb-af02-6b83499b12f8\",\"model-version-id\":\"e80a6ae3-cafd-4d24-850d-e14c084a5ca9\",\"orchestration-status\":\"Active\"}}" ] }, "times": { diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index def53caa..2f0e5bf6 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -55,7 +55,6 @@ Verify PNF detected in AAI when administrative state unlocked ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['subscription_status']} UNLOCKED Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_name']} pnf-existing - Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['orchestration_status']} Active Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} PENDING_CREATE Verify Policy response on MR is handled @@ -75,7 +74,6 @@ Verify AAI event on MR detailing new PNF being detected is handled Sleep 31 seconds Ensure AAI event on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered - Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['orchestration_status']} Active Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_sub_status']} PENDING_CREATE Verify AAI event on MR detailing PNF being deleted is handled diff --git a/tests/dcaegen2/testcases/03__stndDefined_tests.robot b/tests/dcaegen2/testcases/03__stndDefined_tests.robot index ddd11fa8..08970ef2 100644 --- a/tests/dcaegen2/testcases/03__stndDefined_tests.robot +++ b/tests/dcaegen2/testcases/03__stndDefined_tests.robot @@ -85,3 +85,29 @@ Publish Single VES Event With Incorrect StndDefined Data [Documentation] Post single event with incorrect stndDefined data Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_INVALID_TYPE_DATA} 202 +############################################################################################ +## Section for tests with stndDefined validation ON and schemas with refernce to other files +############################################################################################ +Add refeerence to other schemas + [Tags] DCAE-VESC-R1 DCAE-VESC-HC DCAE-VESC-STNDDEFINED + [Documentation] Add refeerence to other schemas and Run Health Check + Override Collector Properties ${VES_ADD_REFERENCE_TO_OTHER_SCHEMAS} + Run Healthcheck ${https_basic_auth_session} + + +Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS and valid reference to other file + [Tags] DCAE-VESC-R1 DCAE-VESC-HC DCAE-VESC-STNDDEFINED + [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and valid reference to ther file and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_WITH_RFERENCE_TO_VALID_SCHEMA} 202 stndDefined-gNB-Nokia-PowerLost + + +Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS and invalid reference to other schema file + [Tags] DCAE-VESC-R1 DCAE-VESC-HC DCAE-VESC-STNDDEFINED + [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and invalid reference to other schema file and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_FILE_REF} 400 + + +Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS and invalid internal schema reference + [Tags] DCAE-VESC-R1 DCAE-VESC-HC DCAE-VESC-STNDDEFINED + [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and invalid internal schema reference and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_INTERNAL_REF} 400 diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json index 99b7ce37..f31b9c7e 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_file_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_file_ref.json new file mode 100644 index 00000000..0b976024 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_file_ref.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_internal_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_internal_ref.json new file mode 100644 index 00000000..7a4875a0 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_internal_ref.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json new file mode 100644 index 00000000..f31b9c7e --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json index 0d749f30..fd1ce98d 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json index 414904f5..ed4d748d 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json index 8e1f697f..7ec3a3a0 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json index bb37d1e2..de233004 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json index 963d8763..4667b52e 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": {}, "stndDefinedFieldsVersion": "1.0" } diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json index 49812e80..909214a5 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json index bacc7a51..3359ea61 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/invalid-ref.json", + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/invalid-ref.json", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json index 5e9a8b35..5d7b683a 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json index a5a16d12..60554fc2 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json @@ -14,7 +14,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "schemaReference": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json index 4fee7a1e..1a317574 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json @@ -15,7 +15,7 @@ "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/invalid-ref.json", + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/invalid-ref.json", "data": { "href": 1, "uri": "1", diff --git a/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/comDefs.yaml b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/comDefs.yaml new file mode 100644 index 00000000..5289940b --- /dev/null +++ b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/comDefs.yaml @@ -0,0 +1,129 @@ +openapi: 3.0.1 +info: + title: Common Type Definitions + version: 16.5.0 + description: >- + OAS 3.0.1 specification of common type definitions in the Generic NRM + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 28.623 V16.5.0; Generic NRM, Common Type Definitions + url: http://www.3gpp.org/ftp/Specs/archive/28_series/28.623/ +paths: {} +components: + schemas: + Long: + type: number + format: long + Float: + type: number + format: float + DateTime: + type: string + format: date-Time + Dn: + type: string + DnList: + type: array + items: + $ref: '#/components/schemas/Dn' + Mcc: + type: string + pattern: '^[0-9]{3}$' + Mnc: + type: string + pattern: '^[0-9]{2,3}$' + Fqdn: + type: string + Uri: + type: string + Ipv4Addr: + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$' + example: '198.51.100.1' + Ipv6Addr: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))$' + example: '2001:db8:85a3::8a2e:370:7334' + Ipv6Prefix: + type: string + allOf: + - pattern: '^((:|(0?|([1-9a-f][0-9a-f]{0,3}))):)((0?|([1-9a-f][0-9a-f]{0,3})):){0,6}(:|(0?|([1-9a-f][0-9a-f]{0,3})))(\/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))$' + - pattern: '^((([^:]+:){7}([^:]+))|((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))(\/.+)$' + example: '2001:db8:abcd:12::0/64' + AdministrativeState: + type: string + enum: + - LOCKED + - UNLOCKED + OperationalState: + type: string + enum: + - ENABLED + - DISABLED + UsageState: + type: string + enum: + - IDEL + - ACTIVE + - BUSY + AttributeNameValuePairSet: + type: object + minProperties: 1 + AttributeValueChangeSet: + description: >- + The key in this map is the attribute name. The value of each key is an array. + When only one item is present in the array, it carries the new attribute + value. If two items are present, then the first item carries the old value + and the second item the new value. The items can be of any type including null. + type: object + additionalProperties: + type: array + minItems: 1 + maxItems: 2 + items: + nullable: true + Filter: + type: string + SystemDN: + type: string + NotificationId: + type: integer + NotificationType: + oneOf: + - $ref: 'faultMnS1.yaml#/components/schemas/AlarmNotificationType' + # more to be added + NotificationHeader: + description: >- + Header used for all notifications types + type: object + required: + - uri + - notificationId + - notificationType + - eventTime + - systemDN + properties: + uri: + $ref: '#/components/schemas/Uri' + notificationId: + $ref: '#/components/schemas/NotificationId' + notificationType: + $ref: '#/components/schemas/NotificationType' + eventTime: + $ref: '#/components/schemas/DateTime' + systemDN: + $ref: '#/components/schemas/SystemDN' + ErrorResponse: + description: >- + Default schema for the response message body in case the request + is not successful. + type: object + properties: + error: + type: object + properties: + errorInfo: + type: string diff --git a/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS1.yaml b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS1.yaml new file mode 100644 index 00000000..8b324921 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS1.yaml @@ -0,0 +1,1063 @@ +openapi: 3.0.1 +info: + title: Fault Supervision MnS + version: 16.5.0 + description: >- + OAS 3.0.1 definition of the Fault Supervision MnS + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 28.532 V16.5.0; Generic management services + url: http://www.3gpp.org/ftp/Specs/archive/28_series/28.532/ +servers: + - url: '{MnSRoot}/FaultSupervisionMnS/{version}' + variables: + MnSRoot: + description: See subclause 4.4.3 of TS 32.158 + default: http://example.com/3GPPManagement + version: + description: Version number of the OpenAPI definition + default: XXX +paths: + /alarms: + get: + summary: Retrieve multiple alarms + description: >- + Retrieves the alarms identified by alarmAckState, baseObjectInstance + and filter. + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: baseObjectInstance + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Dn' + - name: filter + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Filter' + responses: + '200': + description: >- + Success case ("200 OK"). + Returns the alarms identified in the request. The alarmId is the key + of the map. + content: + application/json: + schema: + type: object + additionalProperties: + type: object + allOf: + - type: object + properties: + lastNotificationHeader: + $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - $ref: '#/components/schemas/AlarmRecord' + - type: object + properties: + comments: + $ref: '#/components/schemas/Comments' + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + patch: + summary: 'Clear, acknowledge or unacknowledge multiple alarms' + description: >- + Clears, acknowledges or unacknowledges multiple alarms using patch. Depending + on which action is to be performed, different merge patch documents need + to be used. + requestBody: + description: >- + Patch documents for acknowledging and unacknowledging, or clearing multiple + alarms. The keys in the map are the alarmIds to be patched. + content: + application/merge-patch+json: + schema: + oneOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case ("204 No content"). + The response message body is empty. + default: + description: Response in case of error. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FailedAlarm' + /alarms/alarmCount: + get: + summary: Get the alarm count per perceived severity + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: filter + in: query + required: false + schema: + type: string + responses: + '200': + description: >- + Success case ("200 OK"). + The alarm count per perceived severity is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmCount' + default: + description: Response in case of error. The error case needs rework. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}: + patch: + summary: 'Clear, acknowledge or unacknowledge a single alarm' + description: >- + Clears, acknowledges or uncknowldeges a single alarm by patching the alarm + information. A conditional acknowledge request based on the perceived + severity is not supported. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to be patched. + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + oneOf: + - $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case (204 No content). + The response message body is absent. + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}/comments: + post: + summary: Add a comment to a single alarm + description: >- + Adds a comment to an alarm identified by alarmId. The id of the new comment + is allocated by the producer. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to which the comment shall be added. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + responses: + '201': + description: >- + Success case (201 Created). + The representation of the newly created comment resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + headers: + Location: + description: URI of the newly created comment resource. + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + + /subscriptions: + post: + summary: Create a subscription + description: >- + To create a subscription the representation of the subscription is + POSTed on the /subscriptions collection resource. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + responses: + '201': + description: >- + Success case ("201 Created"). + The representation of the newly created subscription resource shall + be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + headers: + Location: + description: URI of the newly created subscription resource + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + callbacks: + notifyNewAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyNewAlarm' + - $ref: '#/components/schemas/NotifyNewSecAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyClearedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyClearedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChangedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarmGeneral: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyChangedAlarmGeneral' + - $ref: '#/components/schemas/NotifyChangedSecAlarmGeneral' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyCorrelatedNotificationChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyCorrelatedNotificationChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAckStateChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAckStateChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyComments: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyComments' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyPotentialFaultyAlarmList: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyPotentialFaultyAlarmList' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAlarmListRebuilt: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAlarmListRebuilt' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /subscriptions/{subscriptionId}: + delete: + summary: Delete a subscription + description: >- + The subscription is deleted by deleting the corresponding subscription + resource. The resource to be deleted is identified with the path + component of the URI. + parameters: + - name: subscriptionId + in: path + description: Identifies the subscription to be deleted. + required: true + schema: + type: string + responses: + '204': + description: >- + Success case ("204 No Content"). + The subscription resource has been deleted. The response message body + is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + +components: + schemas: + + #---- Definition of AlarmRecord ----------------------------------------------------# + + AlarmId: + type: string + AlarmType: + type: string + enum: + - COMMUNICATIONS_ALARM + - QUALITY_OF_SERVICE_ALARM + - PROCESSING_ERROR_ALARM + - EQUIPMENT_ALARM + - ENVIRONMENTAL_ALARM + - INTEGRITY_VIOLATION + - OPERATIONAL_VIOLATION + - PHYSICAL_VIOLATION + - SECURITY_SERVICE_OR_MECHANISM_VIOLATION + - TIME_DOMAIN_VIOLATION + ProbableCause: + description: >- + The value of the probable cause may be a specific standardized string, or any + vendor provided string. Probable cause strings are not standardized in the + present document. They may be added in a future version. Up to then the + mapping of the generic probable cause strings "PROBABLE_CAUSE_001" to + "PROBABLE_CAUSE_005" is vendor specific. + The value of the probable cause may also be an integer. The mapping of integer + values to probable causes is vendor specific. + oneOf: + - anyOf: + - type: string + enum: + - PROBABLE_CAUSE_001 + - PROBABLE_CAUSE_002 + - PROBABLE_CAUSE_003 + - PROBABLE_CAUSE_004 + - PROBABLE_CAUSE_005 + - type: string + - type: integer + SpecificProblem: + oneOf: + - type: string + - type: integer + PerceivedSeverity: + type: string + enum: + - INDETERMINATE + - CRITICAL + - MAJOR + - MINOR + - WARNING + - CLEARED + TrendIndication: + type: string + enum: + - MORE_SEVERE + - NO_CHANGE + - LESS_SEVERE + ThresholdHysteresis: + type: object + required: + - high + properties: + high: + oneOf: + - type: integer + - $ref: 'comDefs.yaml#/components/schemas/Float' + low: + $ref: 'comDefs.yaml#/components/schemas/Float' + ThresholdLevelInd: + type: object + required: + - up + properties: + up: + $ref: '#/components/schemas/ThresholdHysteresis' + low: + $ref: '#/components/schemas/ThresholdHysteresis' + ThresholdInfo: + type: object + required: + - observedMeasurement + - observedValue + properties: + observedMeasurement: + type: string + observedValue: + type: integer + oneOf: + - $ref: 'comDefs.yaml#/components/schemas/Float' + thresholdLevelInd: + $ref: '#/components/schemas/ThresholdLevelInd' + armTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + CorrelatedNotification: + type: object + required: + - source + - notificationId + properties: + sourceObjectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationIds: + type: array + items: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + CorrelatedNotifications: + type: array + items: + $ref: '#/components/schemas/CorrelatedNotification' + AckState: + type: string + enum: + - ACKNOWLEDGED + - UNACKNOWLEDGED + + AlarmRecord: + description: >- + The alarmId is not a property of an alarm record. It is used as key + in the map of alarm records instead. + type: object + properties: + # alarmId: + # $ref: '#/components/schemas/AlarmId' + objectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationId: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + alarmRaisedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmChangedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmClearedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdinfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + + rootCauseIndicator: + type: boolean + + ackTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + + clearUserId: + type: string + clearSystemId: + type: string + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + + #---- Definition of alarm notifications --------------------------------------------# + + AlarmNotificationType: + type: string + enum: + - notifyNewAlarm + - notifyChangedAlarm + - notifyChangedAlarmGeneral + - notifyAckStateChanged + - notifyCorrelatedNotificationChanged + - notifyComments + - notifyClearedAlarm + - notifyAlarmListRebuiltAlarm + - notifyPotentialFaultyAlarmList + AlarmListAlignmentRequirement: + type: string + enum: + - ALIGNMENT_REQUIRED + - ALIGNMENT_NOT_REQUIRED + + NotifyNewAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + NotifyNewSecAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + NotifyClearedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + clearUserId: + type: string + clearSystemId: + type: string + NotifyChangedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + NotifyChangedAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyChangedSecAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyCorrelatedNotificationChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - correlatedNotifications + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + rootCauseIndicator: + type: boolean + NotifyAckStateChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - ackState + - ackUserId + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + ackState: + $ref: '#/components/schemas/AckState' + ackUserId: + type: string + ackSystemId: + type: string + NotifyComments: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - comments + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + comments: + $ref: '#/components/schemas/Comments' + NotifyPotentialFaultyAlarmList: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + NotifyAlarmListRebuilt: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + alarmListAlignmentRequirement: + $ref: '#/components/schemas/AlarmListAlignmentRequirement' + + #---- Definition of query parameters -----------------------------------------------# + + AlarmAckState: + type: string + enum: + - ALL_ALARMS + - ALL_ACTIVE_ALARMS + - ALL_ACTIVE_AND_ACKNOWLEDGED_ALARMS + - ALL_ACTIVE_AND_UNACKNOWLEDGED_ALARMS + - ALL_CLEARED_AND_UNACKNOWLEDGED_ALARMS + - ALL_UNACKNOWLEDGED_ALARMS + + #---- Definition of patch documents ------------------------------------------------# + + MergePatchAcknowledgeAlarm: + description: >- + Patch document acknowledging or unacknowledging a single alarm. For + acknowleding an alarm the value of ackState is ACKNOWLEDGED, for unacknowleding + an alarm the value of ackState is UNACKNOWLEDGED. + type: object + required: + - ackUserId + - ackState + properties: + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + MergePatchClearAlarm: + description: Patch document for clearing a single alarm + type: object + required: + - clearUserId + - perceivedSeverity + properties: + clearUserId: + type: string + clearSystemId: + type: string + perceivedSeverity: + type: string + enum: + - CLEARED + + #---- Definition of method responses -----------------------------------------------# + + FailedAlarm: + type: object + required: + - alarmId + - failureReason + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + failureReason: + type: string + + #---- Definition of resources ------------------------------------------------------# + + AlarmCount: + type: object + required: + - criticalCount + - majorCount + - minorCount + - warningCount + - indeterminateCount + - clearedCount + properties: + criticalCount: + type: integer + majorCount: + type: integer + minorCount: + type: integer + warningCount: + type: integer + indeterminateCount: + type: integer + clearedCount: + type: integer + Comment: + type: object + properties: + commentTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + commentUserId: + type: string + commentSystemId: + type: string + commentText: + type: string + Comments: + description: >- + Collection of comments. The comment identifiers are allocated by the + MnS producer and used as key in the map. + type: object + additionalProperties: + $ref: '#/components/schemas/Comment' + Subscription: + type: object + properties: + consumerReference: + $ref: 'comDefs.yaml#/components/schemas/Uri' + timeTick: + $ref: 'comDefs.yaml#/components/schemas/Long' + filter: + $ref: 'comDefs.yaml#/components/schemas/Filter'
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml new file mode 100644 index 00000000..f17b0995 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml @@ -0,0 +1,1063 @@ +openapi: 3.0.1 +info: + title: Fault Supervision MnS + version: 16.5.0 + description: >- + OAS 3.0.1 definition of the Fault Supervision MnS + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 28.532 V16.5.0; Generic management services + url: http://www.3gpp.org/ftp/Specs/archive/28_series/28.532/ +servers: + - url: '{MnSRoot}/FaultSupervisionMnS/{version}' + variables: + MnSRoot: + description: See subclause 4.4.3 of TS 32.158 + default: http://example.com/3GPPManagement + version: + description: Version number of the OpenAPI definition + default: XXX +paths: + /alarms: + get: + summary: Retrieve multiple alarms + description: >- + Retrieves the alarms identified by alarmAckState, baseObjectInstance + and filter. + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: baseObjectInstance + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Dn' + - name: filter + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Filter' + responses: + '200': + description: >- + Success case ("200 OK"). + Returns the alarms identified in the request. The alarmId is the key + of the map. + content: + application/json: + schema: + type: object + additionalProperties: + type: object + allOf: + - type: object + properties: + lastNotificationHeader: + $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - $ref: '#/components/schemas/AlarmRecord' + - type: object + properties: + comments: + $ref: '#/components/schemas/Comments' + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + patch: + summary: 'Clear, acknowledge or unacknowledge multiple alarms' + description: >- + Clears, acknowledges or unacknowledges multiple alarms using patch. Depending + on which action is to be performed, different merge patch documents need + to be used. + requestBody: + description: >- + Patch documents for acknowledging and unacknowledging, or clearing multiple + alarms. The keys in the map are the alarmIds to be patched. + content: + application/merge-patch+json: + schema: + oneOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case ("204 No content"). + The response message body is empty. + default: + description: Response in case of error. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FailedAlarm' + /alarms/alarmCount: + get: + summary: Get the alarm count per perceived severity + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: filter + in: query + required: false + schema: + type: string + responses: + '200': + description: >- + Success case ("200 OK"). + The alarm count per perceived severity is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmCount' + default: + description: Response in case of error. The error case needs rework. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}: + patch: + summary: 'Clear, acknowledge or unacknowledge a single alarm' + description: >- + Clears, acknowledges or uncknowldeges a single alarm by patching the alarm + information. A conditional acknowledge request based on the perceived + severity is not supported. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to be patched. + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + oneOf: + - $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case (204 No content). + The response message body is absent. + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}/comments: + post: + summary: Add a comment to a single alarm + description: >- + Adds a comment to an alarm identified by alarmId. The id of the new comment + is allocated by the producer. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to which the comment shall be added. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + responses: + '201': + description: >- + Success case (201 Created). + The representation of the newly created comment resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + headers: + Location: + description: URI of the newly created comment resource. + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + + /subscriptions: + post: + summary: Create a subscription + description: >- + To create a subscription the representation of the subscription is + POSTed on the /subscriptions collection resource. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + responses: + '201': + description: >- + Success case ("201 Created"). + The representation of the newly created subscription resource shall + be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + headers: + Location: + description: URI of the newly created subscription resource + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + callbacks: + notifyNewAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyNewAlarm' + - $ref: '#/components/schemas/NotifyNewSecAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyClearedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyClearedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChangedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarmGeneral: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyChangedAlarmGeneral' + - $ref: '#/components/schemas/NotifyChangedSecAlarmGeneral' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyCorrelatedNotificationChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyCorrelatedNotificationChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAckStateChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAckStateChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyComments: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyComments' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyPotentialFaultyAlarmList: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyPotentialFaultyAlarmList' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAlarmListRebuilt: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAlarmListRebuilt' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /subscriptions/{subscriptionId}: + delete: + summary: Delete a subscription + description: >- + The subscription is deleted by deleting the corresponding subscription + resource. The resource to be deleted is identified with the path + component of the URI. + parameters: + - name: subscriptionId + in: path + description: Identifies the subscription to be deleted. + required: true + schema: + type: string + responses: + '204': + description: >- + Success case ("204 No Content"). + The subscription resource has been deleted. The response message body + is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + +components: + schemas: + + #---- Definition of AlarmRecord ----------------------------------------------------# + + AlarmId: + type: string + AlarmType: + type: string + enum: + - COMMUNICATIONS_ALARM + - QUALITY_OF_SERVICE_ALARM + - PROCESSING_ERROR_ALARM + - EQUIPMENT_ALARM + - ENVIRONMENTAL_ALARM + - INTEGRITY_VIOLATION + - OPERATIONAL_VIOLATION + - PHYSICAL_VIOLATION + - SECURITY_SERVICE_OR_MECHANISM_VIOLATION + - TIME_DOMAIN_VIOLATION + ProbableCause: + description: >- + The value of the probable cause may be a specific standardized string, or any + vendor provided string. Probable cause strings are not standardized in the + present document. They may be added in a future version. Up to then the + mapping of the generic probable cause strings "PROBABLE_CAUSE_001" to + "PROBABLE_CAUSE_005" is vendor specific. + The value of the probable cause may also be an integer. The mapping of integer + values to probable causes is vendor specific. + oneOf: + - anyOf: + - type: string + enum: + - PROBABLE_CAUSE_001 + - PROBABLE_CAUSE_002 + - PROBABLE_CAUSE_003 + - PROBABLE_CAUSE_004 + - PROBABLE_CAUSE_005 + - type: string + - type: integer + SpecificProblem: + oneOf: + - type: string + - type: integer + PerceivedSeverity: + type: string + enum: + - INDETERMINATE + - CRITICAL + - MAJOR + - MINOR + - WARNING + - CLEARED + TrendIndication: + type: string + enum: + - MORE_SEVERE + - NO_CHANGE + - LESS_SEVERE + ThresholdHysteresis: + type: object + required: + - high + properties: + high: + oneOf: + - type: integer + - $ref: 'comDefs.yaml#/components/schemas/Float' + low: + $ref: 'comDefs.yaml#/components/schemas/Float' + ThresholdLevelInd: + type: object + required: + - up + properties: + up: + $ref: '#/components/schemas/ThresholdHysteresis' + low: + $ref: '#/components/schemas/ThresholdHysteresis' + ThresholdInfo: + type: object + required: + - observedMeasurement + - observedValue + properties: + observedMeasurement: + type: string + observedValue: + type: integer + oneOf: + - $ref: 'comDefs.yaml#/components/schemas/Float' + thresholdLevelInd: + $ref: '#/components/schemas/ThresholdLevelInd' + armTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + CorrelatedNotification: + type: object + required: + - source + - notificationId + properties: + sourceObjectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationIds: + type: array + items: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + CorrelatedNotifications: + type: array + items: + $ref: '#/components/schemas/CorrelatedNotification' + AckState: + type: string + enum: + - ACKNOWLEDGED + - UNACKNOWLEDGED + + AlarmRecord: + description: >- + The alarmId is not a property of an alarm record. It is used as key + in the map of alarm records instead. + type: object + properties: + # alarmId: + # $ref: '#/components/schemas/AlarmId' + objectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationId: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + alarmRaisedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmChangedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmClearedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdinfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + + rootCauseIndicator: + type: boolean + + ackTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + + clearUserId: + type: string + clearSystemId: + type: string + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + + #---- Definition of alarm notifications --------------------------------------------# + + AlarmNotificationType: + type: string + enum: + - notifyNewAlarm + - notifyChangedAlarm + - notifyChangedAlarmGeneral + - notifyAckStateChanged + - notifyCorrelatedNotificationChanged + - notifyComments + - notifyClearedAlarm + - notifyAlarmListRebuiltAlarm + - notifyPotentialFaultyAlarmList + AlarmListAlignmentRequirement: + type: string + enum: + - ALIGNMENT_REQUIRED + - ALIGNMENT_NOT_REQUIRED + + NotifyNewAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + NotifyNewSecAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + NotifyClearedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + clearUserId: + type: string + clearSystemId: + type: string + NotifyChangedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + NotifyChangedAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyChangedSecAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyCorrelatedNotificationChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - correlatedNotifications + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + rootCauseIndicator: + type: boolean + NotifyAckStateChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - ackState + - ackUserId + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + ackState: + $ref: '#/components/schemas/AckState' + ackUserId: + type: string + ackSystemId: + type: string + NotifyComments: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - comments + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + comments: + $ref: '#/components/schemas/Comments' + NotifyPotentialFaultyAlarmList: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + NotifyAlarmListRebuilt: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + alarmListAlignmentRequirement: + $ref: '#/components/schemas/AlarmListAlignmentRequirement' + + #---- Definition of query parameters -----------------------------------------------# + + AlarmAckState: + type: string + enum: + - ALL_ALARMS + - ALL_ACTIVE_ALARMS + - ALL_ACTIVE_AND_ACKNOWLEDGED_ALARMS + - ALL_ACTIVE_AND_UNACKNOWLEDGED_ALARMS + - ALL_CLEARED_AND_UNACKNOWLEDGED_ALARMS + - ALL_UNACKNOWLEDGED_ALARMS + + #---- Definition of patch documents ------------------------------------------------# + + MergePatchAcknowledgeAlarm: + description: >- + Patch document acknowledging or unacknowledging a single alarm. For + acknowleding an alarm the value of ackState is ACKNOWLEDGED, for unacknowleding + an alarm the value of ackState is UNACKNOWLEDGED. + type: object + required: + - ackUserId + - ackState + properties: + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + MergePatchClearAlarm: + description: Patch document for clearing a single alarm + type: object + required: + - clearUserId + - perceivedSeverity + properties: + clearUserId: + type: string + clearSystemId: + type: string + perceivedSeverity: + type: string + enum: + - CLEARED + + #---- Definition of method responses -----------------------------------------------# + + FailedAlarm: + type: object + required: + - alarmId + - failureReason + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + failureReason: + type: string + + #---- Definition of resources ------------------------------------------------------# + + AlarmCount: + type: object + required: + - criticalCount + - majorCount + - minorCount + - warningCount + - indeterminateCount + - clearedCount + properties: + criticalCount: + type: integer + majorCount: + type: integer + minorCount: + type: integer + warningCount: + type: integer + indeterminateCount: + type: integer + clearedCount: + type: integer + Comment: + type: object + properties: + commentTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + commentUserId: + type: string + commentSystemId: + type: string + commentText: + type: string + Comments: + description: >- + Collection of comments. The comment identifiers are allocated by the + MnS producer and used as key in the map. + type: object + additionalProperties: + $ref: '#/components/schemas/Comment' + Subscription: + type: object + properties: + consumerReference: + $ref: 'comDefs1.yaml#/components/schemas/Uri' + timeTick: + $ref: 'comDefs1.yaml#/components/schemas/Long' + filter: + $ref: 'comDefs1.yaml#/components/schemas/Filter'
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml new file mode 100644 index 00000000..576ddeb6 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml @@ -0,0 +1,1063 @@ +openapi: 3.0.1 +info: + title: Fault Supervision MnS + version: 16.5.0 + description: >- + OAS 3.0.1 definition of the Fault Supervision MnS + © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). + All rights reserved. +externalDocs: + description: 3GPP TS 28.532 V16.5.0; Generic management services + url: http://www.3gpp.org/ftp/Specs/archive/28_series/28.532/ +servers: + - url: '{MnSRoot}/FaultSupervisionMnS/{version}' + variables: + MnSRoot: + description: See subclause 4.4.3 of TS 32.158 + default: http://example.com/3GPPManagement + version: + description: Version number of the OpenAPI definition + default: XXX +paths: + /alarms: + get: + summary: Retrieve multiple alarms + description: >- + Retrieves the alarms identified by alarmAckState, baseObjectInstance + and filter. + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: baseObjectInstance + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Dn' + - name: filter + in: query + required: false + schema: + $ref: 'comDefs.yaml#/components/schemas/Filter' + responses: + '200': + description: >- + Success case ("200 OK"). + Returns the alarms identified in the request. The alarmId is the key + of the map. + content: + application/json: + schema: + type: object + additionalProperties: + type: object + allOf: + - type: object + properties: + lastNotificationHeader: + $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - $ref: '#/components/schemas/AlarmRecord' + - type: object + properties: + comments: + $ref: '#/components/schemas/Comments' + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + patch: + summary: 'Clear, acknowledge or unacknowledge multiple alarms' + description: >- + Clears, acknowledges or unacknowledges multiple alarms using patch. Depending + on which action is to be performed, different merge patch documents need + to be used. + requestBody: + description: >- + Patch documents for acknowledging and unacknowledging, or clearing multiple + alarms. The keys in the map are the alarmIds to be patched. + content: + application/merge-patch+json: + schema: + oneOf: + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - type: object + additionalProperties: + $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case ("204 No content"). + The response message body is empty. + default: + description: Response in case of error. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/FailedAlarm' + /alarms/alarmCount: + get: + summary: Get the alarm count per perceived severity + parameters: + - name: alarmAckState + in: query + required: false + schema: + $ref: '#/components/schemas/AlarmAckState' + - name: filter + in: query + required: false + schema: + type: string + responses: + '200': + description: >- + Success case ("200 OK"). + The alarm count per perceived severity is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/AlarmCount' + default: + description: Response in case of error. The error case needs rework. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}: + patch: + summary: 'Clear, acknowledge or unacknowledge a single alarm' + description: >- + Clears, acknowledges or uncknowldeges a single alarm by patching the alarm + information. A conditional acknowledge request based on the perceived + severity is not supported. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to be patched. + required: true + schema: + type: string + requestBody: + required: true + content: + application/merge-patch+json: + schema: + oneOf: + - $ref: '#/components/schemas/MergePatchAcknowledgeAlarm' + - $ref: '#/components/schemas/MergePatchClearAlarm' + responses: + '204': + description: >- + Success case (204 No content). + The response message body is absent. + default: + description: Response in case of error. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /alarms/{alarmId}/comments: + post: + summary: Add a comment to a single alarm + description: >- + Adds a comment to an alarm identified by alarmId. The id of the new comment + is allocated by the producer. + parameters: + - name: alarmId + in: path + description: Identifies the alarm to which the comment shall be added. + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + responses: + '201': + description: >- + Success case (201 Created). + The representation of the newly created comment resource shall be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' + headers: + Location: + description: URI of the newly created comment resource. + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + + /subscriptions: + post: + summary: Create a subscription + description: >- + To create a subscription the representation of the subscription is + POSTed on the /subscriptions collection resource. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + responses: + '201': + description: >- + Success case ("201 Created"). + The representation of the newly created subscription resource shall + be returned. + content: + application/json: + schema: + $ref: '#/components/schemas/Subscription' + headers: + Location: + description: URI of the newly created subscription resource + required: true + schema: + type: string + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + callbacks: + notifyNewAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyNewAlarm' + - $ref: '#/components/schemas/NotifyNewSecAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyClearedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyClearedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarm: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyChangedAlarm' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyChangedAlarmGeneral: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/NotifyChangedAlarmGeneral' + - $ref: '#/components/schemas/NotifyChangedSecAlarmGeneral' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyCorrelatedNotificationChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyCorrelatedNotificationChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAckStateChanged: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAckStateChanged' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyComments: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyComments' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyPotentialFaultyAlarmList: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyPotentialFaultyAlarmList' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + notifyAlarmListRebuilt: + '{request.body#/consumerReference}': + post: + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyAlarmListRebuilt' + responses: + '204': + description: >- + Success case ("204 No Content"). + The notification is successfully delivered. The response message + body is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + /subscriptions/{subscriptionId}: + delete: + summary: Delete a subscription + description: >- + The subscription is deleted by deleting the corresponding subscription + resource. The resource to be deleted is identified with the path + component of the URI. + parameters: + - name: subscriptionId + in: path + description: Identifies the subscription to be deleted. + required: true + schema: + type: string + responses: + '204': + description: >- + Success case ("204 No Content"). + The subscription resource has been deleted. The response message body + is absent. + default: + description: Error case. + content: + application/json: + schema: + $ref: 'comDefs.yaml#/components/schemas/ErrorResponse' + +components: + schemas: + + #---- Definition of AlarmRecord ----------------------------------------------------# + + AlarmId: + type: string + AlarmType: + type: string + enum: + - COMMUNICATIONS_ALARM + - QUALITY_OF_SERVICE_ALARM + - PROCESSING_ERROR_ALARM + - EQUIPMENT_ALARM + - ENVIRONMENTAL_ALARM + - INTEGRITY_VIOLATION + - OPERATIONAL_VIOLATION + - PHYSICAL_VIOLATION + - SECURITY_SERVICE_OR_MECHANISM_VIOLATION + - TIME_DOMAIN_VIOLATION + ProbableCause: + description: >- + The value of the probable cause may be a specific standardized string, or any + vendor provided string. Probable cause strings are not standardized in the + present document. They may be added in a future version. Up to then the + mapping of the generic probable cause strings "PROBABLE_CAUSE_001" to + "PROBABLE_CAUSE_005" is vendor specific. + The value of the probable cause may also be an integer. The mapping of integer + values to probable causes is vendor specific. + oneOf: + - anyOf: + - type: string + enum: + - PROBABLE_CAUSE_001 + - PROBABLE_CAUSE_002 + - PROBABLE_CAUSE_003 + - PROBABLE_CAUSE_004 + - PROBABLE_CAUSE_005 + - type: string + - type: integer + SpecificProblem: + oneOf: + - type: string + - type: integer + PerceivedSeverity: + type: string + enum: + - INDETERMINATE + - CRITICAL + - MAJOR + - MINOR + - WARNING + - CLEARED + TrendIndication: + type: string + enum: + - MORE_SEVERE + - NO_CHANGE + - LESS_SEVERE + ThresholdHysteresis: + type: object + required: + - high + properties: + high: + oneOf: + - type: integer + - $ref: 'comDefs.yaml#/components/schemas/Float' + low: + $ref: 'comDefs.yaml#/components/schemas/Float' + ThresholdLevelInd: + type: object + required: + - up + properties: + up: + $ref: '#/components/schemas/ThresholdHysteresis' + low: + $ref: '#/components/schemas/ThresholdHysteresis' + ThresholdInfo: + type: object + required: + - observedMeasurement + - observedValue + properties: + observedMeasurement: + type: string + observedValue: + type: integer + oneOf: + - $ref: 'comDefs.yaml#/components/schemas/Float' + thresholdLevelInd: + $ref: '#/components/schemas/ThresholdLevelInd' + armTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + CorrelatedNotification: + type: object + required: + - source + - notificationId + properties: + sourceObjectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationIds: + type: array + items: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + CorrelatedNotifications: + type: array + items: + $ref: '#/components/schemas/CorrelatedNotification' + AckState: + type: string + enum: + - ACKNOWLEDGED + - UNACKNOWLEDGED + + AlarmRecord: + description: >- + The alarmId is not a property of an alarm record. It is used as key + in the map of alarm records instead. + type: object + properties: + # alarmId: + # $ref: '#/components/schemas/AlarmId' + objectInstance: + $ref: 'comDefs.yaml#/components/schemas/Dn' + notificationId: + $ref: 'comDefs.yaml#/components/schemas/NotificationId' + alarmRaisedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmChangedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmClearedTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdinfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + + rootCauseIndicator: + type: boolean + + ackTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + + clearUserId: + type: string + clearSystemId: + type: string + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + + #---- Definition of alarm notifications --------------------------------------------# + + AlarmNotificationType: + type: string + enum: + - notifyNewAlarm + - notifyChangedAlarm + - notifyChangedAlarmGeneral + - notifyAckStateChanged + - notifyCorrelatedNotificationChanged + - notifyComments + - notifyClearedAlarm + - notifyAlarmListRebuiltAlarm + - notifyPotentialFaultyAlarmList + AlarmListAlignmentRequirement: + type: string + enum: + - ALIGNMENT_REQUIRED + - ALIGNMENT_NOT_REQUIRED + + NotifyNewAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + NotifyNewSecAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + NotifyClearedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + clearUserId: + type: string + clearSystemId: + type: string + NotifyChangedAlarm: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + NotifyChangedAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + specificProblem: + $ref: '#/components/schemas/SpecificProblem' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + backedUpStatus: + type: boolean + backUpObject: + $ref: 'comDefs.yaml#/components/schemas/Dn' + trendIndication: + $ref: '#/components/schemas/TrendIndication' + thresholdInfo: + $ref: '#/components/schemas/ThresholdInfo' + stateChangeDefinition: + $ref: 'comDefs.yaml#/components/schemas/AttributeValueChangeSet' + monitoredAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + proposedRepairActions: + type: string + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyChangedSecAlarmGeneral: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - serviceUser + - serviceProvider + - securityAlarmDetector + - changedAlarmAttributes + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + additionalText: + type: string + additionalInformation: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + rootCauseIndicator: + type: boolean + serviceUser: + type: string + serviceProvider: + type: string + securityAlarmDetector: + type: string + changedAlarmAttributes: + $ref: 'comDefs.yaml#/components/schemas/AttributeNameValuePairSet' + NotifyCorrelatedNotificationChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - correlatedNotifications + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + correlatedNotifications: + $ref: '#/components/schemas/CorrelatedNotifications' + rootCauseIndicator: + type: boolean + NotifyAckStateChanged: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - ackState + - ackUserId + properties: + alarmId: + $ref: '#/components/schemas/AlarmI' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + ackState: + $ref: '#/components/schemas/AckState' + ackUserId: + type: string + ackSystemId: + type: string + NotifyComments: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - alarmId + - alarmType + - probableCause + - perceivedSeverity + - comments + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + alarmType: + $ref: '#/components/schemas/AlarmType' + probableCause: + $ref: '#/components/schemas/ProbableCause' + perceivedSeverity: + $ref: '#/components/schemas/PerceivedSeverity' + comments: + $ref: '#/components/schemas/Comments' + NotifyPotentialFaultyAlarmList: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + NotifyAlarmListRebuilt: + allOf: + - $ref: 'comDefs.yaml#/components/schemas/NotificationHeader' + - type: object + required: + - reason + properties: + reason: + type: string + alarmListAlignmentRequirement: + $ref: '#/components/schemas/AlarmListAlignmentRequirement' + + #---- Definition of query parameters -----------------------------------------------# + + AlarmAckState: + type: string + enum: + - ALL_ALARMS + - ALL_ACTIVE_ALARMS + - ALL_ACTIVE_AND_ACKNOWLEDGED_ALARMS + - ALL_ACTIVE_AND_UNACKNOWLEDGED_ALARMS + - ALL_CLEARED_AND_UNACKNOWLEDGED_ALARMS + - ALL_UNACKNOWLEDGED_ALARMS + + #---- Definition of patch documents ------------------------------------------------# + + MergePatchAcknowledgeAlarm: + description: >- + Patch document acknowledging or unacknowledging a single alarm. For + acknowleding an alarm the value of ackState is ACKNOWLEDGED, for unacknowleding + an alarm the value of ackState is UNACKNOWLEDGED. + type: object + required: + - ackUserId + - ackState + properties: + ackUserId: + type: string + ackSystemId: + type: string + ackState: + $ref: '#/components/schemas/AckState' + MergePatchClearAlarm: + description: Patch document for clearing a single alarm + type: object + required: + - clearUserId + - perceivedSeverity + properties: + clearUserId: + type: string + clearSystemId: + type: string + perceivedSeverity: + type: string + enum: + - CLEARED + + #---- Definition of method responses -----------------------------------------------# + + FailedAlarm: + type: object + required: + - alarmId + - failureReason + properties: + alarmId: + $ref: '#/components/schemas/AlarmId' + failureReason: + type: string + + #---- Definition of resources ------------------------------------------------------# + + AlarmCount: + type: object + required: + - criticalCount + - majorCount + - minorCount + - warningCount + - indeterminateCount + - clearedCount + properties: + criticalCount: + type: integer + majorCount: + type: integer + minorCount: + type: integer + warningCount: + type: integer + indeterminateCount: + type: integer + clearedCount: + type: integer + Comment: + type: object + properties: + commentTime: + $ref: 'comDefs.yaml#/components/schemas/DateTime' + commentUserId: + type: string + commentSystemId: + type: string + commentText: + type: string + Comments: + description: >- + Collection of comments. The comment identifiers are allocated by the + MnS producer and used as key in the map. + type: object + additionalProperties: + $ref: '#/components/schemas/Comment' + Subscription: + type: object + properties: + consumerReference: + $ref: 'comDefs.yaml#/components/schemas/Uri' + timeTick: + $ref: 'comDefs.yaml#/components/schemas/Long' + filter: + $ref: 'comDefs.yaml#/components/schemas/Filter'
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/schema-map.json b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/schema-map.json new file mode 100644 index 00000000..389e5a69 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/test_schemas/externalRepo/schema-map.json @@ -0,0 +1,14 @@ +[ + { + "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json", + "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json" + }, + { + "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml", + "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_file_reference.yaml" + }, + { + "publicURL": "https://forge.3gpp.org/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml", + "localURL": "3gpp/rep/sa5/MnS/blob/SA88-Rel16/OpenAPI/faultMnS_wrong_internal_reference.yaml" + } +]
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties b/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties new file mode 100644 index 00000000..cd417635 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties @@ -0,0 +1,73 @@ +############################################################################### +## +## Collector Server config +## +## - Default values are shown as commented settings. +## +############################################################################### +## +## HTTP(S) service +## +## Normally: +## +## - 8080 is http service +## - https is disabled by default +## +## - At this time, the server always binds to 0.0.0.0 +## +## +collector.service.port=8080 + +## Authentication is only supported via secure port +## When enabled - require valid keystore defined +collector.service.secure.port=8443 + +# auth.method flags: +# +# noAuth - default option - no security (http) +# certBasicAuth - auth by certificate and basic auth username / password (https) +auth.method=certBasicAuth + +## Combination of userid,hashPassword encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +## Password is generated by crypt-password library using BCrypt algorithm stored in dcaegen2/sdk package +## or https://nexus.onap.org/#nexus-search;quick~crypt-password +header.authlist=sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6 + +## The keystore must be setup per installation when secure port is configured +collector.keystore.file.location=etc/keystore +collector.keystore.passwordfile=etc/passwordfile + +collector.cert.subject.matcher=etc/certSubjectMatcher.properties + +## The truststore must be setup per installation when mutual tls support is configured +collector.truststore.file.location=etc/truststore +collector.truststore.passwordfile=etc/trustpasswordfile + +## Schema Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schemafile location must be specified +collector.schema.checkflag=1 +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2_ONAP.json\"} + +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.checkflag=1 +collector.externalSchema.schemasLocation=./etc/externalRepo/ +collector.externalSchema.mappingFileLocation=./etc/externalRepo/schema-map.json +event.externalSchema.schemaRefPath=/event/stndDefinedFields/schemaReference +event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance +collector.dmaapfile=./etc/DmaapConfig.json + +## Event transformation Flag - when set expects configurable transformation +## defined under ./etc/eventTransform.json +## Enabled by default; to disable set to 0 +event.transform.flag=1 + +# Describes at what frequency (measured in minutes) should application try to fetch config from CBS +collector.dynamic.config.update.frequency=5 diff --git a/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/tests/dcaegen2/testcases/resources/dcae_keywords.robot index b45ee57d..660f1451 100644 --- a/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -171,8 +171,9 @@ Send Request And Expect Error [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${error_type} @{error_content} ${evtdata}= Get Data From File ${evtjson} ${err_msg}= Run Keyword And Expect Error ${error_type} ${keyword} ${session} ${evtpath} ${evtdata} - :FOR ${content} IN @{error_content} - \ Should Contain ${err_msg} ${content} + FOR ${content} IN @{error_content} + Should Contain ${err_msg} ${content} + END Log Recieved error message ${err_msg} Run Healthcheck diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index 65eba841..2ae46f92 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -60,6 +60,10 @@ ${VES_STND_DEFINED_NO_VALUE} %{WORKSPACE}/tests/dcaegen2/testcases/a ${VES_STND_DEFINED_INVALID_TYPE_DATA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json ${VES_CERT_BASIC_AUTH_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_basic_auth.properties ${VES_DISABLED_STNDDEFINED_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties +${VES_ADD_REFERENCE_TO_OTHER_SCHEMAS} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties +${VES_VALID_JSON_WITH_RFERENCE_TO_VALID_SCHEMA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json +${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_FILE_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_file_ref.json +${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_INTERNAL_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_internal_ref.json #DCAE Health Check ${CONFIG_BINDING_URL} http://localhost:8443 diff --git a/tests/dcaegen2/testcases/resources/override_collector_properties_with_new_files.sh b/tests/dcaegen2/testcases/resources/override_collector_properties_with_new_files.sh new file mode 100755 index 00000000..f185ac39 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/override_collector_properties_with_new_files.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Copyright (C) 2020 Nokia. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +if [ $# -ne 1 ]; then + echo "Incorrect number of parameters" + exit 1 +fi + +LOCAL_COLLECTOR_PROPERTIES_PATH=$1 +FILENAME=$(basename $LOCAL_COLLECTOR_PROPERTIES_PATH) +TEST_FILES_PATH=$2 +ETC_PATH=/opt/app/VESCollector/etc +APP_CONTROLLER_PATH=/opt/app/VESCollector/bin/appController.sh + +docker exec vesc $APP_CONTROLLER_PATH stop +sleep 2 +docker cp $LOCAL_COLLECTOR_PROPERTIES_PATH vesc:$ETC_PATH +sleep 10 +docker cp $TEST_FILES_PATH vesc:$ETC_PATH +sleep 10 +docker exec vesc mv $ETC_PATH/$FILENAME $ETC_PATH/collector.properties +docker exec vesc $APP_CONTROLLER_PATH start +sleep 5 +echo "VES Collector Restarted with overridden collector.properties" diff --git a/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks b/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks Binary files differnew file mode 100644 index 00000000..390f2410 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks diff --git a/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks.bak b/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks.bak Binary files differnew file mode 100644 index 00000000..390f2410 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/expected_keystores/keystore.jks.bak diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks b/tests/oom-platform-cert-service/postprocessor/assets/expected_truststores/jksAndPemAndP12.jks Binary files differindex 1c9f111a..1c9f111a 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks +++ b/tests/oom-platform-cert-service/postprocessor/assets/expected_truststores/jksAndPemAndP12.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem b/tests/oom-platform-cert-service/postprocessor/assets/expected_truststores/pemAndP12.pem index 978e682d..978e682d 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem +++ b/tests/oom-platform-cert-service/postprocessor/assets/expected_truststores/pemAndP12.pem diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_different_lists_size.env index 9edfaa41..9edfaa41 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_different_lists_size.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_duplicated_aliases.env index f98b3366..f98b3366 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_duplicated_aliases.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_certs.env index 95c00fc2..95c00fc2 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_certs.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_file.env index e69de29b..e69de29b 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_file.env diff --git a/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_keystore_destination_path.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_keystore_destination_path.env new file mode 100644 index 00000000..526357b0 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_keystore_destination_path.env @@ -0,0 +1,3 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass::/var/certs/truststoreP12.pass +KEYSTORE_SOURCE_PATHS=/var/certs/external/keystore13.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_passwords.env index 840728bb..840728bb 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_empty_passwords.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_extension.env index 5b971616..5b971616 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_extension.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_file_password_pair.env index 1a195116..1a195116 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_file_password_pair.env diff --git a/tests/oom-platform-cert-service/postprocessor/assets/invalid_keystore_source_paths.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_keystore_source_paths.env new file mode 100644 index 00000000..7090151c --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_keystore_source_paths.env @@ -0,0 +1,4 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass::/var/certs/truststoreP12.pass +KEYSTORE_SOURCE_PATHS=/var/certs/external/keystore13.jks +KEYSTORE_DESTINATION_PATHS=/var/certs/cert.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_password_path.env index b397f9ac..b397f9ac 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_password_path.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env b/tests/oom-platform-cert-service/postprocessor/assets/invalid_truststore_paths.env index 52fa88c6..52fa88c6 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/invalid_truststore_paths.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/empty.pem b/tests/oom-platform-cert-service/postprocessor/assets/truststores/empty.pem index e69de29b..e69de29b 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/empty.pem +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/empty.pem diff --git a/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.jks b/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.jks Binary files differnew file mode 100644 index 00000000..390f2410 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.jks diff --git a/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.pass b/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.pass new file mode 100644 index 00000000..8b11c5b6 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/external/keystore.pass @@ -0,0 +1 @@ +wgg2_fLSQ8I4sLfyUOCC7uYn
\ No newline at end of file diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.jks Binary files differindex 3bd85a06..3bd85a06 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.p12 Binary files differindex 3a98c4a2..3a98c4a2 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.p12 diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.pem index 8815d6cb..8815d6cb 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststore.pem diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststoreJks.pass index 817b6194..817b6194 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststoreJks.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreP12.pass b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststoreP12.pass index 48036abd..48036abd 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreP12.pass +++ b/tests/oom-platform-cert-service/postprocessor/assets/truststores/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/postprocessor/assets/valid_envs_and_extra_optional.env b/tests/oom-platform-cert-service/postprocessor/assets/valid_envs_and_extra_optional.env new file mode 100644 index 00000000..928bf637 --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/assets/valid_envs_and_extra_optional.env @@ -0,0 +1,4 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=:/var/certs/truststoreP12.pass +KEYSTORE_SOURCE_PATHS=/var/certs/external/keystore.jks:/var/certs/external/keystore.pass +KEYSTORE_DESTINATION_PATHS=/var/certs/keystore.jks:/var/certs/keystore.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env b/tests/oom-platform-cert-service/postprocessor/assets/valid_jks_pem_p12.env index 4afa1a27..4afa1a27 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/valid_jks_pem_p12.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env b/tests/oom-platform-cert-service/postprocessor/assets/valid_pem_p12.env index e0240a74..e0240a74 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/valid_pem_p12.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env b/tests/oom-platform-cert-service/postprocessor/assets/valid_single_truststore.env index 66b6f66f..66b6f66f 100644 --- a/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env +++ b/tests/oom-platform-cert-service/postprocessor/assets/valid_single_truststore.env diff --git a/tests/oom-platform-cert-service/postprocessor/certservice-postprocessor-test.robot b/tests/oom-platform-cert-service/postprocessor/certservice-postprocessor-test.robot new file mode 100644 index 00000000..338f16ff --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/certservice-postprocessor-test.robot @@ -0,0 +1,88 @@ +*** Settings *** + +Documentation Certifcate Post Processors test case scenarios +Library RequestsLibrary +Resource ./resources/test-keywords.robot + +*** Test Cases *** + +Cert Post Processor fails when file extension is invalid (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with invalid truststore extension env and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_FILE_EXTENSION} ${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION} + +Cert Post Processor fails when a variable is empty (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with empty truststore password path env and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_EMPTY_PASSWORDS} ${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION} + +Cert Post Processor fails when truststore and passwords envs not provided (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with invalid empty envs and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_EMPTY} ${EXITCODE_CONFIGURATION_EXCEPTION} + +Cert Post Processor fails when list sizes are different (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with different truststore and password envs size and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_FILE_LIST_SIZE} ${EXITCODE_CONFIGURATION_EXCEPTION} + +Cert Post Processor fails when truststore paths are invalid (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with invalid truststore path and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_TRUSTSTORE_PATHS} ${EXITCODE_TRUSTSTORE_FILE_FACTORY_EXCEPTION} + +Cert Post Processor fails when password path is invalid (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with invalid password path and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_PASSWORD_PATHS} ${EXITCODE_PASSWORD_READER_EXCEPTION} + +Cert Post Processor fails when password file pair is invalid (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with incorrect password env and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_PASSWORD} ${EXITCODE_TRUSTSTORE_LOAD_FILE_EXCEPTION} + +Cert Post Processor fails when pem does not contain cert (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with empty pem truststore and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_EMPTY_CERTS} ${EXITCODE_MISSING_TRUSTSTORE_EXCEPTIONSUCCESS} + +Cert Post Processor fails when aliases are duplicated (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with duplicated aliases in truststores and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_DUPLICATED_ALIASES} ${EXITCODE_ALIAS_CONFLICT_EXCEPTION} + +Cert Post Processor merges successfully jks pem p12 (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with valid env file and expect merged certs from jks, pem and p12 + Run Cert Service Post Processor And Merge Truststore Files To Jks ${ENV_FILE_JKS_PEM_P12} ${EXITCODE_SUCCESS} ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${JKS_TRUSTSTORE_EXPECTED_PATH} + +Cert Post Processor merges successfully pem p12 (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with valid env file and expect merged certs from pem and p12 + Run Cert Service Post Processor And Merge Truststore Files To Pem ${ENV_FILE_PEM_P12} ${EXITCODE_SUCCESS} ${PEM_TRUSTSTORE_MOUNT_PATH} ${PEM_TRUSTSTORE_EXPECTED_PATH} + +Cert Post Processor ends successfully with single truststore (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with one truststore in env file and expect code 0 + Run Cert Service Post Processor And Merge Truststore Files To Jks ${ENV_FILE_SINGLE_TRUSTSTORE} ${EXITCODE_SUCCESS} ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${TRUSTSTORE_JKS} + +Cert Post Processor fails when file to copy does not exist (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with invalid extra optional env as a path to file and expect error code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_INVALID_KEYSTORE_SOURCE_PATHS} ${EXITCODE_KEYSTORE_NOT_EXIST_EXCEPTION} + +Cert Post Processor fails when only one extra optional env is set (merger) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with empty extra optional env and expect code + Run Cert Service Post Processor And Expect Error ${ENV_FILE_EMPTY_KEYSTORE_DESTINATION_PATH} ${EXITCODE_CONFIGURATION_EXCEPTION} + +Cert Post Processor successfully backs up files (copier) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with valid env file and expect successfully backed up file + Run Cert Service Post Processor And Check Copied Keystore Files ${ENV_FILE_EXTRA_OPTIONAL_ENVS} ${EXITCODE_SUCCESS} ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKSBAK_KEYSTORE_EXPECTED_PATH} + +Cert Post Processor successfully copies file (copier) + [Tags] OOM-CERTSERVICE-POST-PROCESSOR + [Documentation] Run with valid env file and expect successfully copied file + Run Cert Service Post Processor And Check Copied Keystore Files ${ENV_FILE_EXTRA_OPTIONAL_ENVS} ${EXITCODE_SUCCESS} ${JKS_KEYSTORE_MOUNT_PATH} ${KEYSTORE_JKS_PASS} ${JKS_KEYSTORE_EXPECTED_PATH} + diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/EnvsReader.py b/tests/oom-platform-cert-service/postprocessor/libraries/EnvsReader.py index cc60eed6..cc60eed6 100644 --- a/tests/oom-platform-cert-service/truststoremerger/libraries/EnvsReader.py +++ b/tests/oom-platform-cert-service/postprocessor/libraries/EnvsReader.py diff --git a/tests/oom-platform-cert-service/postprocessor/libraries/JksValidator.py b/tests/oom-platform-cert-service/postprocessor/libraries/JksValidator.py new file mode 100644 index 00000000..983f66bb --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/libraries/JksValidator.py @@ -0,0 +1,28 @@ + +import jks + +class JksValidator: + + def get_jks_entries(self, jks_path, password_path): + store = jks.KeyStore.load(jks_path, open(password_path, 'rb').read()) + return store.entries + + def assert_jks_truststores_equal(self, result_truststore_path, password_path, expected_truststore_path): + result_keys = self.get_jks_entries(result_truststore_path, password_path) + expected_keys = self.get_jks_entries(expected_truststore_path, password_path) + if len(result_keys) != len(expected_keys): + return False + for k in result_keys: + if not (k in expected_keys and result_keys[k].cert == expected_keys[k].cert): + return False + return True + + def assert_jks_keystores_equal(self, result_keystore_path, password_path, expected_keystore_path): + result_keys = self.get_jks_entries(result_keystore_path, password_path) + expected_keys = self.get_jks_entries(expected_keystore_path, password_path) + if len(result_keys) != len(expected_keys): + return False + for k in result_keys: + if not (k in expected_keys and result_keys[k].pkey == expected_keys[k].pkey): + return False + return True diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/PemTruststoreValidator.py b/tests/oom-platform-cert-service/postprocessor/libraries/PemTruststoreValidator.py index 8dc9623d..8dc9623d 100644 --- a/tests/oom-platform-cert-service/truststoremerger/libraries/PemTruststoreValidator.py +++ b/tests/oom-platform-cert-service/postprocessor/libraries/PemTruststoreValidator.py diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/TrustMergerManager.py b/tests/oom-platform-cert-service/postprocessor/libraries/PostProcessorDockerContainerUtils.py index f7a493c4..e0563b3f 100644 --- a/tests/oom-platform-cert-service/truststoremerger/libraries/TrustMergerManager.py +++ b/tests/oom-platform-cert-service/postprocessor/libraries/PostProcessorDockerContainerUtils.py @@ -7,20 +7,20 @@ from docker.types import Mount ARCHIVES_PATH = os.getenv("WORKSPACE") + "/archives/" -class TrustMergerManager: +class PostProcessorDockerContainerUtils: def __init__(self, mount_path, truststores_path): self.mount_path = mount_path self.truststores_path = truststores_path - def run_merger_container(self, merger_image, merger_name, path_to_env): + def run_container(self, docker_image, image_name, path_to_env): self.remove_mount_dir() shutil.copytree(self.truststores_path, self.mount_path) client = docker.from_env() environment = EnvsReader().read_env_list_from_file(path_to_env) container = client.containers.run( - image=merger_image, - name=merger_name, + image=docker_image, + name=image_name, environment=environment, user='root', # Run container as root to avoid permission issues with volume mount access mounts=[Mount(target='/var/certs', source=self.mount_path, type='bind')], @@ -37,10 +37,10 @@ class TrustMergerManager: if os.path.exists(self.mount_path): shutil.rmtree(self.mount_path) - def remove_merger_container_and_save_logs(self, container_name, log_file_name): + def remove_container_and_save_logs(self, container_name, log_file_name): client = docker.from_env() container = client.containers.get(container_name) - text_file = open(ARCHIVES_PATH + "merger_container_" + log_file_name + ".log", "w") + text_file = open(ARCHIVES_PATH + "certservice_postprocessor_container_" + log_file_name + ".log", "w") text_file.write(container.logs()) text_file.close() container.remove() diff --git a/tests/oom-platform-cert-service/postprocessor/resources/test-keywords.robot b/tests/oom-platform-cert-service/postprocessor/resources/test-keywords.robot new file mode 100644 index 00000000..404ec0ae --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/resources/test-keywords.robot @@ -0,0 +1,44 @@ +*** Settings *** + +Resource ../../../common.robot +Resource ./test-properties.robot +Library ../libraries/PostProcessorDockerContainerUtils.py ${MOUNT_PATH} ${TRUSTSTORES_PATH} +Library ../libraries/JksValidator.py +Library ../libraries/PemTruststoreValidator.py + +*** Keywords *** + +Run Cert Service Post Processor And Expect Error + [Documentation] Run Cert Service Post Processor Container And Validate Exit Code + [Arguments] ${env_file} ${expected_exit_code} + ${exit_code}= Run Container ${CERT_POST_PROCESSOR_DOCKER_IMAGE} ${CERT_POST_PROCESSOR_CONTAINER_NAME} ${env_file} + Remove Container And Save Logs ${CERT_POST_PROCESSOR_CONTAINER_NAME} negative_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + +Run Cert Service Post Processor And Merge Truststore Files To Jks + [Documentation] Run Cert Service Post Processor Container And Validate Exit Code And Provided Truststore Files + [Arguments] ${env_file} ${expected_exit_code} ${jks_path} ${jks_password} ${expected_jks_path} + ${exit_code}= Run Container ${CERT_POST_PROCESSOR_DOCKER_IMAGE} ${CERT_POST_PROCESSOR_CONTAINER_NAME} ${env_file} + ${files_equal}= Assert Jks Truststores Equal ${jks_path} ${jks_password} ${expected_jks_path} + Remove Container And Save Logs ${CERT_POST_PROCESSOR_CONTAINER_NAME} positive_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + Should Be True ${files_equal} + +Run Cert Service Post Processor And Check Copied Keystore Files + [Documentation] Run Cert Service Post Processor Container And Validate Exit Code And Provided Keystore Files + [Arguments] ${env_file} ${expected_exit_code} ${jks_path} ${jks_password} ${expected_jks_path} + ${exit_code}= Run Container ${CERT_POST_PROCESSOR_DOCKER_IMAGE} ${CERT_POST_PROCESSOR_CONTAINER_NAME} ${env_file} + ${files_equal}= Assert Jks Keystores Equal ${jks_path} ${jks_password} ${expected_jks_path} + Remove Container And Save Logs ${CERT_POST_PROCESSOR_CONTAINER_NAME} positive_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + Should Be True ${files_equal} + +Run Cert Service Post Processor And Merge Truststore Files To Pem + [Documentation] Run Cert Service Post Processor Container And Validate Exit Code And Files + [Arguments] ${env_file} ${expected_exit_code} ${pem_path} ${expected_pem_path} + ${exit_code}= Run Container ${CERT_POST_PROCESSOR_DOCKER_IMAGE} ${CERT_POST_PROCESSOR_CONTAINER_NAME} ${env_file} + ${files_equal}= Assert Pem Truststores Equal ${pem_path} ${expected_pem_path} + Remove Container And Save Logs ${CERT_POST_PROCESSOR_CONTAINER_NAME} positive_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + Should Be True ${files_equal} + diff --git a/tests/oom-platform-cert-service/postprocessor/resources/test-properties.robot b/tests/oom-platform-cert-service/postprocessor/resources/test-properties.robot new file mode 100644 index 00000000..80fc06af --- /dev/null +++ b/tests/oom-platform-cert-service/postprocessor/resources/test-properties.robot @@ -0,0 +1,62 @@ +*** Variables *** + +${CERT_POST_PROCESSOR_DOCKER_IMAGE} nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-certservice-post-processor:latest +${CERT_POST_PROCESSOR_CONTAINER_NAME} %{CertServicePostProcessorContainerName} +${BASE_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/postprocessor +${MOUNT_PATH} ${BASE_PATH}/tmp +${TRUSTSTORES_PATH} ${BASE_PATH}/assets/truststores +${EXPECTED_TRUSTSTORES_PATH} ${BASE_PATH}/assets/expected_truststores + +${JKS_TRUSTSTORE_MOUNT_PATH} ${BASE_PATH}/tmp/truststore.jks +${JKS_PASSWORD_MOUNT_PATH} ${BASE_PATH}/tmp/truststoreJks.pass +${P12_TRUSTSTORE_MOUNT_PATH} ${BASE_PATH}/tmp/truststore.p12 +${P12_PASSWORD_MOUNT_PATH} ${BASE_PATH}/tmp/truststoreP12.pass +${PEM_TRUSTSTORE_MOUNT_PATH} ${BASE_PATH}/tmp/truststore.pem +${JKS_KEYSTORE_MOUNT_PATH} ${BASE_PATH}/tmp/external/keystore.jks + +${JKS_TRUSTSTORE_EXPECTED_PATH} ${BASE_PATH}/assets/expected_truststores/jksAndPemAndP12.jks +${PEM_TRUSTSTORE_EXPECTED_PATH} ${BASE_PATH}/assets/expected_truststores/pemAndP12.pem +${JKSBAK_KEYSTORE_EXPECTED_PATH} ${BASE_PATH}/assets/expected_keystores/keystore.jks.bak +${JKS_KEYSTORE_EXPECTED_PATH} ${BASE_PATH}/assets/expected_keystores/keystore.jks + +${ENV_FILE_EMPTY} ${BASE_PATH}/assets/invalid_empty_file.env +${ENV_FILE_INVALID_FILE_LIST_SIZE} ${BASE_PATH}/assets/invalid_different_lists_size.env +${ENV_FILE_EMPTY_PASSWORDS} ${BASE_PATH}/assets/invalid_empty_passwords.env +${ENV_FILE_INVALID_PASSWORD_PATHS} ${BASE_PATH}/assets/invalid_password_path.env +${ENV_FILE_INVALID_TRUSTSTORE_PATHS} ${BASE_PATH}/assets/invalid_truststore_paths.env +${ENV_FILE_INVALID_PASSWORD} ${BASE_PATH}/assets/invalid_file_password_pair.env +${ENV_FILE_INVALID_FILE_EXTENSION} ${BASE_PATH}/assets/invalid_extension.env +${ENV_FILE_DUPLICATED_ALIASES} ${BASE_PATH}/assets/invalid_duplicated_aliases.env +${ENV_FILE_EMPTY_CERTS} ${BASE_PATH}/assets/invalid_empty_certs.env +${ENV_FILE_JKS_PEM_P12} ${BASE_PATH}/assets/valid_jks_pem_p12.env +${ENV_FILE_PEM_P12} ${BASE_PATH}/assets/valid_pem_p12.env +${ENV_FILE_SINGLE_TRUSTSTORE} ${BASE_PATH}/assets/valid_single_truststore.env +${ENV_FILE_INVALID_KEYSTORE_SOURCE_PATHS} ${BASE_PATH}/assets/invalid_keystore_source_paths.env +${ENV_FILE_EMPTY_KEYSTORE_DESTINATION_PATH} ${BASE_PATH}/assets/invalid_empty_keystore_destination_path.env +${ENV_FILE_EXTRA_OPTIONAL_ENVS} ${BASE_PATH}/assets/valid_envs_and_extra_optional.env + +${KEYSTORE_JKS} ${BASE_PATH}/assets/truststores/external/keystore.jks +${KEYSTORE_JKS_PASS} ${BASE_PATH}/assets/truststores/external/keystore.pass +${TRUSTSTORE_JKS} ${BASE_PATH}/assets/truststores/truststore.jks +${TRUSTSTORE_JKS_PASS} ${BASE_PATH}/assets/truststores/truststoreJks.pass +${TRUSTSTORE_P12} ${BASE_PATH}/assets/truststores/truststore.p12 +${TRUSTSTORE_P12_PASS} ${BASE_PATH}/assets/truststores/truststore.pass +${TRUSTSTORE_PEM} ${BASE_PATH}/assets/truststores/truststore.pem + +${EXITCODE_SUCCESS} 0 +${EXITCODE_CERTIFICATES_PATHS_VALIDATION_EXCEPTION} 1 +${EXITCODE_CONFIGURATION_EXCEPTION} 2 +${EXITCODE_TRUSTSTORE_FILE_FACTORY_EXCEPTION} 3 +${EXITCODE_PASSWORD_READER_EXCEPTION} 4 +${EXITCODE_CREATE_BACKUP_EXCEPTION} 5 +${EXITCODE_KEYSTORE_INSTANCE_EXCEPTION} 6 +${EXITCODE_TRUSTSTORE_LOAD_FILE_EXCEPTION} 7 +${EXITCODE_TRUSTSTORE_DATA_OPERATION_EXCEPTION} 8 +${EXITCODE_MISSING_TRUSTSTORE_EXCEPTIONSUCCESS} 9 +${EXITCODE_ALIAS_CONFLICT_EXCEPTION} 10 +${EXITCODE_WRITE_TRUSTSTORE_FILE_EXCEPTION} 11 +${EXITCODE_KEYSTORE_FILE_COPY_EXCEPTION} 12 +${EXITCODE_KEYSTORE_NOT_EXIST_EXCEPTION} 13 +${EXITCODE_UNEXPECTED_EXCEPTION} 99 + + diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py b/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py deleted file mode 100644 index e18ca12c..00000000 --- a/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py +++ /dev/null @@ -1,18 +0,0 @@ - -import jks - -class JksTruststoreValidator: - - def get_truststore(self, truststore_path, password_path): - truststore = jks.KeyStore.load(truststore_path, open(password_path, 'rb').read()) - return truststore.certs - - def assert_jks_truststores_equal(self, result_truststore_path, password_path, expected_truststore_path): - result_certs = self.get_truststore(result_truststore_path, password_path) - expected_certs = self.get_truststore(expected_truststore_path, password_path) - if len(result_certs) != len(expected_certs): - return False - for k in result_certs: - if not (k in expected_certs and result_certs[k].cert == expected_certs[k].cert): - return False - return True diff --git a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot deleted file mode 100644 index 1040afab..00000000 --- a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot +++ /dev/null @@ -1,34 +0,0 @@ -*** Settings *** - -Resource ../../../common.robot -Resource ./trust-merger-properties.robot -Library ../libraries/TrustMergerManager.py ${MOUNT_PATH} ${TRUSTSTORES_PATH} -Library ../libraries/JksTruststoreValidator.py -Library ../libraries/PemTruststoreValidator.py - -*** Keywords *** - -Run Trust Merger And Expect Error - [Documentation] Run Truststore Merger Container And Validate Exit Code - [Arguments] ${env_file} ${expected_exit_code} - ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} - Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} negative_path - Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} - -Run Trust Merger And Merge Truststore Files To Jks - [Documentation] Run Truststore Merger Container And Validate Exit Code And Files - [Arguments] ${env_file} ${expected_exit_code} ${jks_path} ${jks_password} ${expected_jks_path} - ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} - ${files_equal}= Assert Jks Truststores Equal ${jks_path} ${jks_password} ${expected_jks_path} - Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} positive_path - Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} - Should Be True ${files_equal} - -Run Trust Merger And Merge Truststore Files To Pem - [Documentation] Run Truststore Merger Container And Validate Exit Code And Files - [Arguments] ${env_file} ${expected_exit_code} ${pem_path} ${expected_pem_path} - ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} - ${files_equal}= Assert Pem Truststores Equal ${pem_path} ${expected_pem_path} - Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} positive_path - Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} - Should Be True ${files_equal} diff --git a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot deleted file mode 100644 index d356f604..00000000 --- a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot +++ /dev/null @@ -1,35 +0,0 @@ -*** Variables *** - -${DOCKER_MERGER_IMAGE} nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest -${MERGER_CONTAINER_NAME} %{MergerContainerName} -${MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp -${TRUSTSTORES_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores -${EXPECTED_TRUSTSTORES_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores - -${JKS_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.jks -${JKS_PASSWORD_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststoreJks.pass -${P12_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.p12 -${P12_PASSWORD_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststoreP12.pass -${PEM_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.pem - -${JKS_TRUSTSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks -${PEM_TRUSTSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem - -${INVALID_ENV_EMPTY_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env -${INVALID_ENV_LIST_SIZE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env -${INVALID_ENV_EMPTY_PASSWORDS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env -${INVALID_PASSWORD_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env -${INVALID_ENV_TRUSTSTORE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env -${INVALID_ENV_FILE_PASSWORD} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env -${INVALID_ENV_EXTENSION} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env -${INVALID_ENV_DUPLICATED_ALIASES} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env -${INVALID_ENV_EMPTY_CERTS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env -${VALID_ENV_JKS_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env -${VALID_ENV_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env -${VALID_ENV_SINGLE_TRUSTSTORE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env - -${TRUSTSTORE_JKS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks -${TRUSTSTORE_JKS_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass -${TRUSTSTORE_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 -${TRUSTSTORE_P12_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pass -${TRUSTSTORE_PEM} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem diff --git a/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot b/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot deleted file mode 100644 index 966a4243..00000000 --- a/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot +++ /dev/null @@ -1,67 +0,0 @@ -*** Settings *** - -Documentation Truststore merger test case scenarios -Library RequestsLibrary -Resource ./resources/trust-merger-keywords.robot - -*** Test Cases *** - -Trust Merger fails when file extension is invalid - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with invalid truststore extension env and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_EXTENSION} 1 - -Trust Merger fails when truststore and passwords envs not provided - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with invalid empty envs and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_FILE} 1 - -Trust Merger fails when list sizes are different - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with different truststore and password envs size and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_LIST_SIZE} 2 - -Trust Merger fails when a variable is empty - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with empty truststore password path env and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_PASSWORDS} 2 - -Trust Merger fails when truststore paths are invalid - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with invalid truststore path and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_TRUSTSTORE_PATHS} 3 - -Trust Merger fails when password path is invalid - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with invalid password path and expect error code - Run Trust Merger And Expect Error ${INVALID_PASSWORD_PATHS} 4 - -Trust Merger fails when password file pair is invalid - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with incorrect password env and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_FILE_PASSWORD} 7 - -Trust Merger fails when pem does not contain cert - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with empty pem truststore and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_CERTS} 9 - -Trust Merger fails when aliases are duplicated - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with duplicated aliases in truststores and expect error code - Run Trust Merger And Expect Error ${INVALID_ENV_DUPLICATED_ALIASES} 10 - -Trust Merger merges successfully jks pem p12 - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with valid env file and expect merged certs from jks, pem and p12 - Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_JKS_PEM_P12} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${JKS_TRUSTSTORE_EXPECTED_PATH} - -Trust Merger merges successfully pem p12 - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with valid env file and expect merged certs from pem and p12 - Run Trust Merger And Merge Truststore Files To Pem ${VALID_ENV_PEM_P12} 0 ${PEM_TRUSTSTORE_MOUNT_PATH} ${PEM_TRUSTSTORE_EXPECTED_PATH} - -Trust Merger ends successfully with single truststore - [Tags] OOM-TRUST-STORE-MERGER - [Documentation] Run with one truststore in env file and expect code 0 - Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_SINGLE_TRUSTSTORE} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${TRUSTSTORE_JKS} diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot index c229bcf5..2f5c6972 100644 --- a/tests/policy/api/api-test.robot +++ b/tests/policy/api/api-test.robot @@ -78,7 +78,7 @@ RetrieveMonitoringPolicyTypes CreateNewMonitoringPolicyV1 [Documentation] Create a new Monitoring TCA policy version 1 ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -92,7 +92,7 @@ CreateNewMonitoringPolicyV1 SimpleCreateNewMonitoringPolicyV1 [Documentation] Create a new Monitoring TCA policiy version 1 using simple endpoint. Trying to create an existing policy with any change and same version should cause error. ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1_2.json + ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v1_2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -103,7 +103,7 @@ SimpleCreateNewMonitoringPolicyV1 SimpleCreateNewMonitoringPolicyV2 [Documentation] Create a new Monitoring TCA policiy version 2 using simple endpoint ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v2.json + ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -117,7 +117,7 @@ SimpleCreateNewMonitoringPolicyV2 RetrievePoliciesOfType [Documentation] Retrieve all Policies Created for a specific Policy Type ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -131,7 +131,7 @@ RetrievePoliciesOfType RetrieveAllPolicies [Documentation] Retrieve all Policies ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -144,7 +144,7 @@ RetrieveAllPolicies RetrieveSpecificPolicy [Documentation] Retrieve a specific Policy named 'onap.restart.tca' and version '1.0.0' ${auth}= Create List healthcheck zb!XztG34 - ${expjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.v1.json + ${expjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json deleted file mode 100644 index d57a64cb..00000000 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.restart.tca": { - "type": "onap.policies.monitoring.tcagen2", - "version": "1.0.0", - "type_version": "1.0.0", - "metadata": { - "policy-id": "onap.restart.tca" - }, - "properties": { - "tca.policy" : { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "Measurement_vGMUX", - "controlLoopSchemaType": "VNF", - "policyScope": "DCAE", - "policyName": "DCAE.Config_tca-hi-lo", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "EQUAL", - "severity": "MAJOR", - "closedLoopEventStatus": "ABATED" - }, - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "GREATER", - "severity": "CRITICAL", - "closedLoopEventStatus": "ONSET" - } - ] - } - ] - } - } - } - } - ] - } -} diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json deleted file mode 100644 index 12e066ea..00000000 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.restart.tca": { - "type": "onap.policies.monitoring.tcagen2", - "version": "1.0.0", - "type_version": "1.0.0", - "description": "monitoring policy", - "metadata": { - "policy-id": "onap.restart.tca" - }, - "properties": { - "tca.policy" : { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "Measurement_vGMUX", - "controlLoopSchemaType": "VNF", - "policyScope": "DCAE", - "policyName": "DCAE.Config_tca-hi-lo", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "EQUAL", - "severity": "MAJOR", - "closedLoopEventStatus": "ABATED" - }, - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "GREATER", - "severity": "CRITICAL", - "closedLoopEventStatus": "ONSET" - } - ] - } - ] - } - } - } - } - ] - } -} diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json deleted file mode 100644 index cd4be203..00000000 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.restart.tca": { - "type": "onap.policies.monitoring.tcagen2", - "version": "2.0.0", - "type_version": "1.0.0", - "metadata": { - "policy-id": "onap.restart.tca" - }, - "properties": { - "tca.policy" : { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "Measurement_vGMUX", - "controlLoopSchemaType": "VNF", - "policyScope": "DCAE", - "policyName": "DCAE.Config_tca-hi-lo", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "EQUAL", - "severity": "MAJOR", - "closedLoopEventStatus": "ABATED" - }, - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "GREATER", - "severity": "CRITICAL", - "closedLoopEventStatus": "ONSET" - } - ] - } - ] - } - } - } - } - ] - } -} diff --git a/tests/policy/drools-applications/drools-applications-test.robot b/tests/policy/drools-applications/drools-applications-test.robot index a1ca5e20..0b73ccf8 100644 --- a/tests/policy/drools-applications/drools-applications-test.robot +++ b/tests/policy/drools-applications/drools-applications-test.robot @@ -35,10 +35,10 @@ Controller Log Creating session https://${DROOLS_IP}:9696 ${session}= Create Session policy https://${DROOLS_IP}:9696 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/pdp/engine/controllers/frankfurt/drools/facts headers=${headers} + ${resp}= Get Request policy /policy/pdp/engine/controllers/usecases/drools/facts headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 - Should Be Equal As Strings ${resp.json()['frankfurt']} 0 + Should Be Equal As Strings ${resp.json()['usecases']} 0 MakeTopics [Documentation] Creates the Policy topics diff --git a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json deleted file mode 100644 index 8ec03fe5..00000000 --- a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.restart.tca": { - "type": "onap.policies.monitoring.tcagen2", - "version": "1.0.0", - "type_version": "1.0.0", - "metadata": { - "policy-id": "onap.restart.tca" - }, - "properties": { - "tca.policy": { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "Measurement_vGMUX", - "controlLoopSchemaType": "VNF", - "policyScope": "DCAE", - "policyName": "DCAE.Config_tca-hi-lo", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "EQUAL", - "severity": "MAJOR", - "closedLoopEventStatus": "ABATED" - }, - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "GREATER", - "severity": "CRITICAL", - "closedLoopEventStatus": "ONSET" - } - ] - } - ] - } - } - } - } - ] - } -} diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot index 5387e85f..3e8bc211 100644 --- a/tests/policy/pap/pap-test.robot +++ b/tests/policy/pap/pap-test.robot @@ -11,7 +11,7 @@ LoadPolicy Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json + ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} Log Received response from API ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json b/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json index d30e0e27..3833a241 100644 --- a/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json +++ b/tests/policy/xacml-pdp/data/onap.policy.naming.decision.request.json @@ -1,6 +1,6 @@ { "ONAPName": "SDNC", - "ONAPComponent": "SNDC-component", + "ONAPComponent": "SDNC-component", "ONAPInstance": "SDNC-component-instance", "requestId": "unique-request-sdnc-1", "action": "naming", diff --git a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json deleted file mode 100644 index 8ec03fe5..00000000 --- a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "tosca_definitions_version": "tosca_simple_yaml_1_1_0", - "topology_template": { - "policies": [ - { - "onap.restart.tca": { - "type": "onap.policies.monitoring.tcagen2", - "version": "1.0.0", - "type_version": "1.0.0", - "metadata": { - "policy-id": "onap.restart.tca" - }, - "properties": { - "tca.policy": { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "Measurement_vGMUX", - "controlLoopSchemaType": "VNF", - "policyScope": "DCAE", - "policyName": "DCAE.Config_tca-hi-lo", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "EQUAL", - "severity": "MAJOR", - "closedLoopEventStatus": "ABATED" - }, - { - "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value", - "thresholdValue": 0, - "direction": "GREATER", - "severity": "CRITICAL", - "closedLoopEventStatus": "ONSET" - } - ] - } - ] - } - } - } - } - ] - } -} diff --git a/tests/sdc-workflow-d/__init__.robot b/tests/sdc-workflow-d/__init__.robot new file mode 100644 index 00000000..0ee6767d --- /dev/null +++ b/tests/sdc-workflow-d/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation sdc-workflow-D diff --git a/tests/sdc-workflow-d/global_properties.robot b/tests/sdc-workflow-d/global_properties.robot new file mode 100644 index 00000000..03de4c41 --- /dev/null +++ b/tests/sdc-workflow-d/global_properties.robot @@ -0,0 +1,43 @@ +*** Settings *** +Documentation store all properties that can change or are used in multiple places here +... format is all caps with underscores between words and prepended with GLOBAL +... make sure you prepend them with GLOBAL so that other files can easily see it is from this file. + + +*** Variables *** +${GLOBAL_APPLICATION_ID} robot-ete +${GLOBAL_SO_STATUS_PATH} /onap/so/infra/orchestrationRequests/v6/ +${GLOBAL_SELENIUM_BROWSER} chrome +${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} Create Dictionary +${GLOBAL_SELENIUM_DELAY} 0 +${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} 5 +${GLOBAL_SELENIUM_BROWSER_WAIT_TIMEOUT} 15 +${GLOBAL_OPENSTACK_HEAT_SERVICE_TYPE} orchestration +${GLOBAL_OPENSTACK_CINDER_SERVICE_TYPE} volume +${GLOBAL_OPENSTACK_NOVA_SERVICE_TYPE} compute +${GLOBAL_OPENSTACK_NEUTRON_SERVICE_TYPE} network +${GLOBAL_OPENSTACK_GLANCE_SERVICE_TYPE} image +${GLOBAL_OPENSTACK_KEYSTONE_SERVICE_TYPE} identity +${GLOBAL_OPENSTACK_STACK_DEPLOYMENT_TIMEOUT} 600s +${GLOBAL_AAI_CLOUD_OWNER} CloudOwner +${GLOBAL_AAI_CLOUD_OWNER_DEFINED_TYPE} OwnerType +${GLOBAL_AAI_COMPLEX_NAME} clli1 +${GLOBAL_AAI_PHYSICAL_LOCATION_ID} clli1 +${GLOBAL_AAI_AVAILABILITY_ZONE_NAME} nova +${GLOBAL_BUILD_NUMBER} 0 +${GLOBAL_OWNING_ENTITY_NAME} OE-Demonstration +${GLOBAL_VID_UI_TIMEOUT_SHORT} 20s +${GLOBAL_VID_UI_TIMEOUT_MEDIUM} 60s +${GLOBAL_VID_UI_TIMEOUT_LONG} 120s +${GLOBAL_AAI_INDEX_PATH} /aai/v14 +${GLOBAL_AAI_ZONE_ID} nova1 +${GLOBAL_AAI_ZONE_NAME} nova +${GLOBAL_AAI_DESIGN_TYPE} integration +${GLOBAL_AAI_ZONE_CONTEXT} labs +${GLOBAL_TEMPLATE_FOLDER} robot/assets/templates +${GLOBAL_ASSETS_FOLDER} robot/assets +${GLOBAL_SERVICE_MAPPING_DIRECTORY} ./demo/service_mapping +${GLOBAL_SO_HEALTH_CHECK_PATH} /manage/health +${GLOBAL_SO_CLOUD_CONFIG_PATH} /cloudSite +${GLOBAL_SO_CLOUD_CONFIG_TEMPLATE} so/create_cloud_config.jinja +${GLOBAL_SO_ORCHESTRATION_REQUESTS_PATH} /onap/so/infra/orchestrationRequests/v7 diff --git a/tests/sdc-workflow-d/test1.robot b/tests/sdc-workflow-d/test1.robot new file mode 100644 index 00000000..6217f2a9 --- /dev/null +++ b/tests/sdc-workflow-d/test1.robot @@ -0,0 +1,112 @@ +*** Settings *** +Documentation This is the basic test for workflow designer +Library RequestsLibrary +Library Collections +Library SeleniumLibrary +Resource global_properties.robot + +*** Variables *** +${HOMEPAGE} http://localhost:8285 +${HEADLESS} True + +***Keywords*** + +Open SDC GUI + [Documentation] Logs in to SDC GUI + [Arguments] ${PATH} + ## Setup Browever now being managed by the test case + ##Setup Browser + Go To ${HOMEPAGE}${PATH} + Maximize Browser Window + + # Set Browser Implicit Wait ${GLOBAL_SELENIUM_BROWSER_IMPLICIT_WAIT} + # Log Logging in to ${SDC_FE_ENDPOINT}${PATH} + Wait Until Page Contains Jimmy + # Log Logged in to ${SDC_FE_ENDPOINT}${PATH} + +Setup Browser + [Documentation] Sets up browser based upon the value of ${GLOBAL_SELENIUM_BROWSER} + Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'firefox' Setup Browser Firefox + Run Keyword If '${GLOBAL_SELENIUM_BROWSER}' == 'chrome' Setup Browser Chrome + Log Running with ${GLOBAL_SELENIUM_BROWSER} + +Setup Browser Firefox + ${caps}= Evaluate sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX sys + Set To Dictionary ${caps} marionette= + Set To Dictionary ${caps} elementScrollBehavior 1 + ${wd}= Create WebDriver Firefox capabilities=${caps} + Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${caps} + + +Setup Browser Chrome + ${chrome options}= Evaluate sys.modules['selenium.webdriver'].ChromeOptions() sys + Call Method ${chrome options} add_argument no-sandbox + Call Method ${chrome options} add_argument ignore-certificate-errors + Run Keyword If ${HEADLESS}==True Call Method ${chrome options} add_argument headless + ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.CHROME sys, selenium.webdriver + Set To Dictionary ${dc} elementScrollBehavior 1 + Set To Dictionary ${dc} ACCEPT_SSL_CERTS True + Create Webdriver Chrome chrome_options=${chrome_options} desired_capabilities=${dc} + Set Global Variable ${GLOBAL_SELENIUM_BROWSER_CAPABILITIES} ${dc} + +Input Username + [Arguments] ${username} + Input Text name=userId ${username} + +Input Password + [Arguments] ${password} + Input Text name=password ${password} + +Input Name + [Arguments] ${workflowName} + Input Text id=workflowName ${workflowName} + +Input Description + [Arguments] ${description} + Input Text xpath=/html/body/div[2]/div/div[2]/div/form/div/div[1]/div[2]/div/textarea ${description} + +Input WFdescription + [Arguments] ${description} + Input Text xpath=//*[@id="root"]/div[1]/div/div[2]/div[2]/div/div[1]/div/textarea + +Submit Login Button + Click Element xpath=/html/body/form/input[3] + +Submit WorkFlow Button + Click Element xpath=/html/body/div/home-page/div/top-nav/nav/ul/li[5]/a + +Add WorkFlow + Click Element xpath=//*[@id="root"]/div[1]/div/div[2]/div/div[2]/div[1] + # Click Element xpath=//*[@id="root"]/div[1]/div/div[2]/div/div[2]/div[1]/div[1]/div/svg + +Create Workflow + Click Element xpath=/html/body/div[2]/div/div[2]/div/form/div/div[2]/button[1] + +Goto Frame + Select Frame xpath=/html/body/div/plugin-tab-view/div/plugin-frame/div/div/iframe + +Save WorkFlow + Click Element xpath=//*[@id="root"]/div[1]/div/div[1]/div[2]/div[2]/div/div/div[2]/div/div/span + +*** Test Cases *** +Workflow Designer Testing + [Documentation] User can homepage and see the tag line + Setup Browser + Open SDC GUI /login + Input Username cs0008 + Input Password 123123a + Submit Login Button + Wait Until Page Contains WORKFLOW + Submit WorkFlow Button + BuiltIn.Sleep 5s + Goto Frame + Add WorkFlow + BuiltIn.Sleep 5s + Input Name testing7 + Input Description first test through selenium + Create Workflow + # Wait Until Page Contains General + # Input Description2 write some dummy description + # Save WorkFlow + # BuiltIn.Sleep 5s + Close Browser
\ No newline at end of file diff --git a/tests/so/etsi/etsi_tests.robot b/tests/so/etsi/etsi_tests.robot index 49670d96..6aebd137 100644 --- a/tests/so/etsi/etsi_tests.robot +++ b/tests/so/etsi/etsi_tests.robot @@ -30,16 +30,17 @@ Invoke Service Instantiation SET GLOBAL VARIABLE ${service_instance_Id} ${actual_request_state}= Set Variable "" - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ log to console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ Log To Console Received actual repsonse status:${actual_request_state} - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + log to console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + Log To Console Received actual repsonse status:${actual_request_state} + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + log to console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END Log To Console final repsonse status received: ${actual_request_state} Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result @@ -63,30 +64,22 @@ Invoke VNF Instantiation ${vnf_instance_Id}= Set Variable ${vnf_instantiate_json_response}[requestReferences][instanceId] SET GLOBAL VARIABLE ${vnf_instance_Id} - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ Log To Console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + Log To Console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""", strict=False) json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END ${service_instance_Id}= SET VARIABLE ${orchestration_json_response}[request][instanceReferences][serviceInstanceId] Log To Console final repsonse status received: ${actual_request_state} Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result Should Be Equal As Strings '${actual_request_state}' 'COMPLETE' -Invoke VNF Notification for SOL002 - Create Session ve-vnfm-adapter-session http://${REPO_IP}:9098 - ${data}= Get Binary File ${CURDIR}${/}data${/}notification.json - &{headers}= Create Dictionary Content-Type=application/json Accept=application/json Authorization=Basic YWRtaW46YTRiM2MyZDE= - ${notification_request}= Post Request ve-vnfm-adapter-session /lcm/v1/vnf/instances/notifications data=${data} headers=${headers} - Log To Console ${notification_request} - Run Keyword If '${notification_request.status_code}' == '200' Log To Console \nexecuted with expected result - Should Be Equal As Strings '${notification_request.status_code}' '200' - Delete VNF Instance Run Keyword If "${vnf_instance_Id}" != "${EMPTY}" Log to Console VNF Instance ID :${vnf_instance_Id} received ... ELSE Fail Log to Console Invalid VNF Instance ID :${vnf_instance_Id} recieved @@ -102,15 +95,16 @@ Delete VNF Instance ${request_ID}= Set Variable ${vnf_delete_json_response}[requestReferences][requestId] ${actual_request_state}= Set Variable "" - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ Log To Console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + Log To Console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END Log To Console final repsonse status received: ${actual_request_state} Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result @@ -130,15 +124,16 @@ Delete Service Instance ${request_ID}= Set Variable ${service_delete_json_response}[requestReferences][requestId] ${actual_request_state}= Set Variable "" - : FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} - \ ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} - \ Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result - \ Log To Console ${orchestration_status_request.content} - \ ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json - \ ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] - \ RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop - \ Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds - \ SLEEP ${SLEEP_INTERVAL_SEC}s + FOR ${INDEX} IN RANGE ${MAXIMUM_ATTEMPTS_BEFORE_TIMEOUT} + ${orchestration_status_request}= Get Request api_handler_session /onap/so/infra/orchestrationRequests/v7/${request_ID} + Run Keyword If '${orchestration_status_request.status_code}' == '200' log to console \nexecuted with expected result + Log To Console ${orchestration_status_request.content} + ${orchestration_json_response}= Evaluate json.loads(r"""${orchestration_status_request.content}""") json + ${actual_request_state}= SET VARIABLE ${orchestration_json_response}[request][requestStatus][requestState] + RUN KEYWORD IF '${actual_request_state}' == 'COMPLETE' or '${actual_request_state}' == 'FAILED' Exit For Loop + Log To Console Will try again after ${SLEEP_INTERVAL_SEC} seconds + SLEEP ${SLEEP_INTERVAL_SEC}s + END Log To Console final repsonse status received: ${actual_request_state} Run Keyword If '${actual_request_state}' == 'COMPLETE' log to console \nexecuted with expected result diff --git a/tests/vnfsdk-refrepo/csar/invalid_pm_dictionary.csar b/tests/vnfsdk-refrepo/csar/invalid_pm_dictionary.csar Binary files differnew file mode 100644 index 00000000..81a0e23a --- /dev/null +++ b/tests/vnfsdk-refrepo/csar/invalid_pm_dictionary.csar diff --git a/tests/vnfsdk-refrepo/csar/valid_no_security.csar b/tests/vnfsdk-refrepo/csar/valid_no_security.csar Binary files differnew file mode 100644 index 00000000..11d19453 --- /dev/null +++ b/tests/vnfsdk-refrepo/csar/valid_no_security.csar diff --git a/tests/vnfsdk-refrepo/csar_validation_tests.robot b/tests/vnfsdk-refrepo/csar_validation_tests.robot new file mode 100644 index 00000000..9994d567 --- /dev/null +++ b/tests/vnfsdk-refrepo/csar_validation_tests.robot @@ -0,0 +1,68 @@ +*** Settings *** +Resource ./resources/vnfsdk_keywords.robot + +*** Test Cases *** + +Perform vnf refrepo healthcheck + [Documentation] Check if vnf refrepo is up and running + + Create Session refrepo ${base_url} + ${response}= Get Request refrepo /PackageResource/healthcheck + Should Be Equal As Strings ${response.status_code} 200 + +Validate correct, no security CSAR + [Documentation] Valid CSAR with no security should PASS validation and should return no error + + ${response}= Validate CSAR usign Post request ${csar_valid_no_security} ${execute_no_security_csar_validation} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\" + ${json_response}= evaluate json.loads('''${response}''') json + Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} PASS + FOR ${resault} IN @{json_response[0]["results"]["results"]} + Should Be Equal As Strings ${resault["errors"]} [] + Should Be Equal As Strings ${resault["passed"]} True + END + + +Validate CSAR using rule r130206 and use get method to receive outcome + [Documentation] Validate CSAR with invalid PM_Dictionary (r130206) using rule r130206 , then use get method with validation id to receive valdiation outcome + + ${response}= Validate CSAR usign Post request ${csar_invalid_pm_dictionary} ${execute_invalid_pm_dictionary_r130206_validation} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\" + ${json_response}= evaluate json.loads('''${response}''') json + + ${get_response}= Get validation result using GET request ${json_response[0]["executionId"]} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${get_response}= Remove String ${get_response} \\\\ \\u0027 + ${json_get_response}= evaluate json.loads('''${get_response}''') json + Should Be Equal As Strings ${json_get_response[0]["status"]} failed + ${errors_number}= Get Length ${json_get_response[0]["results"]} + Should Be Equal As Strings ${errors_number} 4 + FOR ${error} IN @{json_get_response[0]["results"]} + Should Contain ${error["code"]} R130206 + END + +Validate CSAR using all rule and use get method to receive outcome + [Documentation] Validate CSAR with invalid PM_Dictionary (r130206) using all rules, then use get method with validation id to receive valdiation outcome + + ${response}= Validate CSAR usign Post request ${csar_invalid_pm_dictionary} ${execute_invalid_pm_dictionary_validation} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${response}= Remove String ${response} \\\\ \\u003c \\u003e \\" + ${json_response}= evaluate json.loads('''${response}''') json + + ${get_response}= Get validation result using GET request ${json_response[0]["executionId"]} + # Removing strings that are causing errors during evaluation, + # those strings are dependent on validation response and may need to be changed if vnf refrepo response changes + ${get_response}= Remove String ${get_response} \\\\ \\u0027 \\u003c \\u003e \\" + ${json_get_response}= evaluate json.loads('''${get_response}''') json + Should Be Equal As Strings ${json_response[0]["results"]["criteria"]} FAILED + FOR ${resault} IN @{json_response[0]["results"]["results"]} + Should Be Equal As Strings ${resault["warnings"]} [] + Run keyword if "${resault["vnfreqName"]}" == "r130206" + ... Should Be Equal As Strings ${resault["passed"]} False + END diff --git a/tests/vnfsdk-refrepo/resources/vnfsdk_keywords.robot b/tests/vnfsdk-refrepo/resources/vnfsdk_keywords.robot new file mode 100644 index 00000000..11bb6015 --- /dev/null +++ b/tests/vnfsdk-refrepo/resources/vnfsdk_keywords.robot @@ -0,0 +1,25 @@ +*** Settings *** +Resource ./vnfsdk_properties.robot + +Library OperatingSystem +Library Process +Library String +Library Collections +Library RequestsLibrary +Library json + +*** Keywords *** + +Validate CSAR usign Post request + [Documentation] Perform POST Request to vnfsdk marketplace with CSAR and execution options, in order to perfvorm CSAR validation + [Arguments] ${csar_name} ${execution_json} + ${response}= Run curl -s --location --request POST '${base_url}/vtp/executions' --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form 'file=@${csarpath}/${csar_name}' --form 'executions=${execution_json}' + ${response}= String.Replace String ${response} \\n ${SPACE} + [Return] ${response} + +Get validation result using GET request + [Documentation] Perform GET request to vnfsdk marketplace with request id or execution id, in order to get that request/execution result + [Arguments] ${requestId} + ${response}= Run curl -s --location --request GET '${base_url}/vtp/executions?requestId=${requestId}' --header 'Accept: application/json' + ${response}= String.Replace String ${response} \\n ${SPACE} + [Return] ${response} diff --git a/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot new file mode 100644 index 00000000..e46eba6f --- /dev/null +++ b/tests/vnfsdk-refrepo/resources/vnfsdk_properties.robot @@ -0,0 +1,12 @@ +*** Variables *** +${base_url}= http://${REFREPO_IP}:8702/onapapi/vnfsdk-marketplace/v1 + +${csarpath}= ${SCRIPTS}/../tests/vnfsdk-refrepo/csar + +${csar_valid_no_security}= valid_no_security.csar +${execute_no_security_csar_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_valid_no_security}","pnf":"true"}}] + +${csar_invalid_pm_dictionary}= invalid_pm_dictionary.csar +${execute_invalid_pm_dictionary_r130206_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate-r130206","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}] +${execute_invalid_pm_dictionary_validation}= [{"scenario": "onap-dublin","testSuiteName": "validation","testCaseName": "csar-validate","parameters": {"csar": "file://${csar_invalid_pm_dictionary}","pnf":"true"}}] + |