From 22bc923a68f695bddb839c25e83c6dd5babf2e29 Mon Sep 17 00:00:00 2001 From: kaihlavi Date: Wed, 31 Jul 2019 19:54:49 +0300 Subject: Replace json_templater usage Remove project-specific json_templater.robot file and adjust the tests to use ONAPLibrary.Templating instead following the example here: https://gerrit.onap.org/r/#/c/integration/csit/+/90264/ Issue-ID: TEST-181 Signed-off-by: kaihlavi Change-Id: I29edbbbb054f100fdb92981cc4c1e44402d7cad7 --- tests/sdc-dcae-d/dcaed/asdc_interface.robot | 48 +- .../sdc-dcae-d/dcaed/assets/artifact_upload.jinja | 8 + .../dcaed/assets/artifact_upload.template | 8 - .../sdc-dcae-d/dcaed/assets/catalog_service.jinja | 42 + .../dcaed/assets/catalog_service.template | 42 - .../dcaed/assets/component_catalog_resource.jinja | 41 + .../assets/component_catalog_resource.template | 41 - tests/sdc-dcae-d/dcaed/assets/create_vfcmt.jinja | 4 + .../sdc-dcae-d/dcaed/assets/create_vfcmt.template | 4 - .../sdc-dcae-d/dcaed/assets/dcae_composition.jinja | 849 +++++++++++++++++++++ .../dcaed/assets/dcae_composition.template | 849 --------------------- .../assets/dcae_monitoring_configuration.jinja | 11 + .../assets/dcae_monitoring_configuration.template | 11 - .../dcaed/assets/resource_instance.jinja | 10 + .../dcaed/assets/resource_instance.template | 10 - tests/sdc-dcae-d/dcaed/assets/user_remarks.jinja | 1 + .../sdc-dcae-d/dcaed/assets/user_remarks.template | 1 - tests/sdc-dcae-d/dcaed/dcaed_interface.robot | 18 +- tests/sdc-dcae-d/dcaed/json_templater.robot | 20 - 19 files changed, 1004 insertions(+), 1014 deletions(-) create mode 100755 tests/sdc-dcae-d/dcaed/assets/artifact_upload.jinja delete mode 100755 tests/sdc-dcae-d/dcaed/assets/artifact_upload.template create mode 100755 tests/sdc-dcae-d/dcaed/assets/catalog_service.jinja delete mode 100755 tests/sdc-dcae-d/dcaed/assets/catalog_service.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.jinja delete mode 100644 tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/create_vfcmt.jinja delete mode 100644 tests/sdc-dcae-d/dcaed/assets/create_vfcmt.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/dcae_composition.jinja delete mode 100644 tests/sdc-dcae-d/dcaed/assets/dcae_composition.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.jinja delete mode 100755 tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/resource_instance.jinja delete mode 100644 tests/sdc-dcae-d/dcaed/assets/resource_instance.template create mode 100644 tests/sdc-dcae-d/dcaed/assets/user_remarks.jinja delete mode 100644 tests/sdc-dcae-d/dcaed/assets/user_remarks.template delete mode 100644 tests/sdc-dcae-d/dcaed/json_templater.robot (limited to 'tests/sdc-dcae-d') diff --git a/tests/sdc-dcae-d/dcaed/asdc_interface.robot b/tests/sdc-dcae-d/dcaed/asdc_interface.robot index 88053e88..c01dc097 100644 --- a/tests/sdc-dcae-d/dcaed/asdc_interface.robot +++ b/tests/sdc-dcae-d/dcaed/asdc_interface.robot @@ -3,7 +3,7 @@ Library Collections Library OperatingSystem Library RequestsLibrary Library ONAPLibrary.Utilities - +Library ONAPLibrary.Templating WITH NAME Templating Resource common.robot ***Variables *** @@ -14,14 +14,11 @@ ${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} /resourceInstance ${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH} /distribution-state ${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} /approve -${ASDC_CATALOG_RESOURCE_TEMPLATE} ${ASSETS_DIR}component_catalog_resource.template -${ASDC_CATALOG_SERVICE_TEMPLATE} ${ASSETS_DIR}catalog_service.template -${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${ASSETS_DIR}artifact_upload.template -${ASDC_USER_REMARKS_TEMPLATE} ${ASSETS_DIR}user_remarks.template -${DCAE_VFCMT_TEMPLATE} ${ASSETS_DIR}create_vfcmt.template -${DCAE_COMPOSITION_TEMPLATE} ${ASSETS_DIR}dcae_composition.template -${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${ASSETS_DIR}dcae_monitoring_configuration.template -${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${ASSETS_DIR}resource_instance.template +${SDC_CATALOG_RESOURCE_TEMPLATE} component_catalog_resource.jinja +${SDC_CATALOG_SERVICE_TEMPLATE} catalog_service.jinja +${SDC_ARTIFACT_UPLOAD_TEMPLATE} artifact_upload.jinja +${SDC_USER_REMARKS_TEMPLATE} user_remarks.jinja +${SDC_RESOURCE_INSTANCE_TEMPLATE} resource_instance.jinja ${ASDC_BE_ENDPOINT} http://localhost:8080 @@ -31,7 +28,8 @@ Create Catalog Resource Data [Documentation] Creates and returns data for ASDC Catalog Resource [Arguments] ${resource_name} ${vendor_name} ${map}= Create Dictionary resource_name=${resource_name} vendor_name=${vendor_name} - ${data}= json_templater.Fill JSON Template File ${ASDC_CATALOG_RESOURCE_TEMPLATE} ${map} + Templating.Create Environment sdc_catalog_resource ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_catalog_resource ${SDC_CATALOG_RESOURCE_TEMPLATE} ${map} [Return] ${data} # Based on testsuite/robot/resources/asdc_interface.robot's 'Post ASDC Resource Request' keyword @@ -59,13 +57,15 @@ Run ASDC MD5 Post Request Unauthenticated [Documentation] Runs an ASDC post request with MD5 Checksum header without authentication and returns the HTTP response [Arguments] ${data_path} ${data} ${user}=${ASDC_DESIGNER_USER_ID} ${MY_ASDC_BE_ENDPOINT}=${ASDC_BE_ENDPOINT} Log Creating session ${MY_ASDC_BE_ENDPOINT} + # This is needed to ensure that the data is in dict format - otherwise the checksum will not match + ${dict_data}= evaluate json.loads('''${data}''') json ${session}= Create Session asdc ${MY_ASDC_BE_ENDPOINT} ${uuid}= Generate UUID4 - ${data_string}= Evaluate json.dumps(${data}) json + ${data_string}= Evaluate json.dumps(${dict_data}) json ${md5checksum}= Evaluate md5.new('''${data_string}''').hexdigest() modules=md5 ${base64md5checksum}= Evaluate base64.b64encode("${md5checksum}") modules=base64 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json USER_ID=${user} X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Content-MD5=${base64md5checksum} - ${resp}= Post Request asdc ${data_path} data=${data} headers=${headers} + ${resp}= Post Request asdc ${data_path} data=${dict_data} headers=${headers} Log Received response from asdc: ${resp.text} [Return] ${resp} @@ -76,7 +76,8 @@ Add Tosca Artifact To Resource ${blueprint_data} OperatingSystem.Get File ${ASSETS_DIR}${artifact}.yaml ${payloadData}= Evaluate base64.b64encode('''${blueprint_data}'''.encode('utf-8')) modules=base64 ${dict}= Create Dictionary artifactLabel=${artifact} artifactName=${artifact}.yaml artifactType=DCAE_TOSCA artifactGroupType=DEPLOYMENT description=${artifact}.yaml payloadData=${payloadData} - ${data}= Fill JSON Template File ${ASDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict} + Templating.Create Environment sdc_artifact_upload ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_artifact_upload ${SDC_ARTIFACT_UPLOAD_TEMPLATE} ${dict} # POST artifactUpload to resource ${resp}= Run ASDC MD5 Post Request Unauthenticated ${ASDC_CATALOG_RESOURCES_PATH}/${vf_id}/artifacts ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 @@ -87,7 +88,8 @@ Certify ASDC Catalog Resource [Documentation] Certifies an ASDC Catalog Resource by its id and returns the new id [Arguments] ${catalog_resource_id} ${user_id}=${ASDC_TESTER_USER_ID} ${map}= Create Dictionary user_remarks=Robot remarks - ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} + Templating.Create Environment sdc_user_remarks ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_user_remarks ${SDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_RESOURCES_PATH}/${catalog_resource_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${user_id} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uniqueId']} ${resp.json()['uuid']} @@ -96,7 +98,8 @@ Add Catalog Service For Monitoring Template [Documentation] Creates an ASDC Catalog Service for Monitoring Template with given name [Arguments] ${service_name} ${map}= Create Dictionary service_name=${service_name} - ${data}= Fill JSON Template File ${ASDC_CATALOG_SERVICE_TEMPLATE} ${map} + Templating.Create Environment sdc_catalog_service ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_catalog_service ${SDC_CATALOG_SERVICE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH} ${data} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} ${resp.json()['uuid']} @@ -109,7 +112,8 @@ Add ASDC Resource Instance ${xoffset}= Set Variable ${xoffset+306} ${yoffset}= Set Variable ${yoffset+248} ${map}= Create Dictionary catalog_resource_id=${catalog_resource_id} catalog_resource_name=${catalog_resource_name} milli_timestamp=${milli_timestamp} posX=${xoffset} posY=${yoffset} originType=${resourceType} - ${data}= Fill JSON Template File ${ASDC_RESOURCE_INSTANCE_TEMPLATE} ${map} + Templating.Create Environment sdc_resource_instance ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_resource_instance ${SDC_RESOURCE_INSTANCE_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_RESOURCE_INSTANCE_PATH} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 201 [Return] ${resp.json()['uniqueId']} ${resp.json()['name']} @@ -120,7 +124,8 @@ Checkin ASDC Catalog Service [Documentation] Checks in an ASDC Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks - ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} + Templating.Create Environment sdc_user_remarks ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_user_remarks ${SDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/checkin ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} @@ -129,7 +134,8 @@ Request Certify ASDC Catalog Service [Documentation] Requests certification of an ASDC Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks - ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} + Templating.Create Environment sdc_user_remarks ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_user_remarks ${SDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certificationRequest ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} @@ -145,7 +151,8 @@ Certify ASDC Catalog Service [Documentation] Certifies an ASDC Catalog Service by its id and returns the new id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks - ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} + Templating.Create Environment sdc_user_remarks ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_user_remarks ${SDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_LIFECYCLE_PATH}/certify ${data} ${ASDC_TESTER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uniqueId']} @@ -154,7 +161,8 @@ Approve ASDC Catalog Service [Documentation] Approves an ASDC Catalog Service by its id [Arguments] ${catalog_service_id} ${map}= Create Dictionary user_remarks=Robot remarks - ${data}= Fill JSON Template File ${ASDC_USER_REMARKS_TEMPLATE} ${map} + Templating.Create Environment sdc_user_remarks ${ASSETS_DIR} + ${data}= Templating.Apply Template sdc_user_remarks ${SDC_USER_REMARKS_TEMPLATE} ${map} ${resp}= Run ASDC Post Request Unauthenticated ${ASDC_CATALOG_SERVICES_PATH}/${catalog_service_id}${ASDC_CATALOG_SERVICE_DISTRIBUTION_STATE_PATH}${ASDC_DISTRIBUTION_STATE_APPROVE_PATH} ${data} ${ASDC_GOVERNOR_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()} diff --git a/tests/sdc-dcae-d/dcaed/assets/artifact_upload.jinja b/tests/sdc-dcae-d/dcaed/assets/artifact_upload.jinja new file mode 100755 index 00000000..80e6fc63 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/artifact_upload.jinja @@ -0,0 +1,8 @@ +{ + "artifactLabel":"{{artifactLabel}}", + "artifactName": "{{artifactName}}", + "artifactType": "{{artifactType}}", + "artifactGroupType": "{{artifactGroupType}}", + "description": "{{description}}", + "payloadData": "{{payloadData}}" +} diff --git a/tests/sdc-dcae-d/dcaed/assets/artifact_upload.template b/tests/sdc-dcae-d/dcaed/assets/artifact_upload.template deleted file mode 100755 index 9be6ca04..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/artifact_upload.template +++ /dev/null @@ -1,8 +0,0 @@ -{ - "artifactLabel":"${artifactLabel}", - "artifactName": "${artifactName}", - "artifactType": "${artifactType}", - "artifactGroupType": "${artifactGroupType}", - "description": "${description}", - "payloadData": "${payloadData}" -} diff --git a/tests/sdc-dcae-d/dcaed/assets/catalog_service.jinja b/tests/sdc-dcae-d/dcaed/assets/catalog_service.jinja new file mode 100755 index 00000000..3cd326e4 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/catalog_service.jinja @@ -0,0 +1,42 @@ +{ + "artifacts": {}, + "toscaArtifacts": {}, + "contactId": "cs0008", + "categories": [ + { + "name": "Network L4+", + "normalizedName": "network l4+", + "uniqueId": "serviceNewCategory.network l4+", + "icons": [ + "network_l_4" + ], + "subcategories": null, + "version": null, + "ownerId": null, + "empty": false, + "type": null + } + ], + "description": "Created by robot for monitoring template", + "icon": "defaulticon", + "componentInstancesProperties": {}, + "componentInstancesAttributes": {}, + "name": "{{service_name}}", + "tags": [ + "robot-ete", + "{{service_name}}" + ], + "capabilities": {}, + "requirements": {}, + "deploymentArtifacts": {}, + "componentType": "SERVICE", + "projectCode": "123456", + "componentInstances": [], + "properties": [], + "attributes": [], + "forwardingPaths": {}, + "ecompGeneratedNaming": true, + "serviceApiArtifacts": {}, + "instantiationType": "A-la-carte", + "environmentContext": "General_Revenue-Bearing" +} diff --git a/tests/sdc-dcae-d/dcaed/assets/catalog_service.template b/tests/sdc-dcae-d/dcaed/assets/catalog_service.template deleted file mode 100755 index 56085025..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/catalog_service.template +++ /dev/null @@ -1,42 +0,0 @@ -{ - "artifacts": {}, - "toscaArtifacts": {}, - "contactId": "cs0008", - "categories": [ - { - "name": "Network L4+", - "normalizedName": "network l4+", - "uniqueId": "serviceNewCategory.network l4+", - "icons": [ - "network_l_4" - ], - "subcategories": null, - "version": null, - "ownerId": null, - "empty": false, - "type": null - } - ], - "description": "Created by robot for monitoring template", - "icon": "defaulticon", - "componentInstancesProperties": {}, - "componentInstancesAttributes": {}, - "name": "${service_name}", - "tags": [ - "robot-ete", - "${service_name}" - ], - "capabilities": {}, - "requirements": {}, - "deploymentArtifacts": {}, - "componentType": "SERVICE", - "projectCode": "123456", - "componentInstances": [], - "properties": [], - "attributes": [], - "forwardingPaths": {}, - "ecompGeneratedNaming": true, - "serviceApiArtifacts": {}, - "instantiationType": "A-la-carte", - "environmentContext": "General_Revenue-Bearing" -} diff --git a/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.jinja b/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.jinja new file mode 100644 index 00000000..a3661b36 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.jinja @@ -0,0 +1,41 @@ +{ + "artifacts": {}, + "toscaArtifacts": {}, + "contactId": "cs0008", + "categories": [ + { + "name": "DCAE Component", + "normalizedName": "dcaecomponent", + "uniqueId": "resourceNewCategory.dcaecomponent", + "subcategories": [ + { + "name": "Microservice", + "normalizedName": "microservice", + "uniqueId": "resourceNewCategory.dcaecomponent.microservice", + "icons": [ + "dcae_microservice" + ] + } + ] + } + ], + "description": "virtual function", + "icon": "defaulticon", + "componentInstancesProperties": {}, + "componentInstancesAttributes": {}, + "name": "{{resource_name}}", + "tags": [ + "{{resource_name}}" + ], + "capabilities": {}, + "requirements": {}, + "deploymentArtifacts": {}, + "componentType": "RESOURCE", + "vendorName": "{{vendor_name}}", + "vendorRelease": "1.0", + "componentInstances": [], + "properties": [], + "attributes": [], + "groups": [], + "resourceType": "VF" +} diff --git a/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.template b/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.template deleted file mode 100644 index cb6c402c..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/component_catalog_resource.template +++ /dev/null @@ -1,41 +0,0 @@ -{ - "artifacts": {}, - "toscaArtifacts": {}, - "contactId": "cs0008", - "categories": [ - { - "name": "DCAE Component", - "normalizedName": "dcaecomponent", - "uniqueId": "resourceNewCategory.dcaecomponent", - "subcategories": [ - { - "name": "Microservice", - "normalizedName": "microservice", - "uniqueId": "resourceNewCategory.dcaecomponent.microservice", - "icons": [ - "dcae_microservice" - ] - } - ] - } - ], - "description": "virtual function", - "icon": "defaulticon", - "componentInstancesProperties": {}, - "componentInstancesAttributes": {}, - "name": "${resource_name}", - "tags": [ - "${resource_name}" - ], - "capabilities": {}, - "requirements": {}, - "deploymentArtifacts": {}, - "componentType": "RESOURCE", - "vendorName": "${vendor_name}", - "vendorRelease": "1.0", - "componentInstances": [], - "properties": [], - "attributes": [], - "groups": [], - "resourceType": "VF" -} diff --git a/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.jinja b/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.jinja new file mode 100644 index 00000000..d399e25e --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.jinja @@ -0,0 +1,4 @@ +{ +"name":"{{vfcmtName}}", +"description":"{{description}}" +} diff --git a/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.template b/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.template deleted file mode 100644 index 19ce2117..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/create_vfcmt.template +++ /dev/null @@ -1,4 +0,0 @@ -{ -"name":"${vfcmtName}", -"description":"${description}" -} diff --git a/tests/sdc-dcae-d/dcaed/assets/dcae_composition.jinja b/tests/sdc-dcae-d/dcaed/assets/dcae_composition.jinja new file mode 100644 index 00000000..c2557ca2 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/dcae_composition.jinja @@ -0,0 +1,849 @@ +{ + "cid": "{{cid}}", + "flowType": "TCA Hi Lo", + "inputs": [], + "nodes": [ + { + "capabilities": [ + { + "name": "feature", + "type": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "description": "/sdc/v1/catalog/resources/{{vf_id}}/toscaModel/", + "id": "{{vf_id}}", + "name": "tca-docker", + "ndata": { + "label": "tca-docker", + "name": "n.1559041944060.0", + "ports": [], + "px": 364, + "py": 437, + "radius": 30, + "x": 365, + "y": 438 + }, + "nid": "n.1559041944060.0", + "properties": [ + { + "default": 10000, + "name": "cpu_period", + "required": true, + "type": "integer" + }, + { + "default": 30000, + "name": "cpu_quota", + "required": true, + "type": "integer" + }, + { + "default": 256, + "name": "cpu_shares", + "required": true, + "type": "integer" + }, + { + "name": "image", + "required": true, + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + "name": "location_id", + "required": true, + "type": "string", + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + { + "default": "500m", + "name": "mem_limit", + "required": true, + "type": "string" + }, + { + "default": "on-failure", + "name": "restart_policy.Name", + "required": true, + "type": "string" + }, + { + "default": 3, + "name": "restart_policy.max_retry_counts", + "required": true, + "type": "integer" + }, + { + "name": "service_component_type", + "required": true, + "type": "string" + } + ], + "requirements": [ + { + "capability": { + "id": "template.yaml/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "name": "stream_subscribe_0", + "node": "topic0", + "relationship": { + "type": "dcae.relationships.subscribe_to_events" + } + }, + { + "capability": { + "id": "template.yaml/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "name": "stream_publish_0", + "node": "topic1", + "relationship": { + "type": "dcae.relationships.publish_events" + } + }, + { + "capability": { + "id": "template.yaml/dcae.capabilities.dockerHost", + "name": "dcae.capabilities.dockerHost" + }, + "name": "host", + "relationship": { + "type": "dcae.relationships.component_contained_in" + } + }, + { + "capability": { + "id": "template.yaml/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "name": "composition" + }, + { + "capability": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "name": "dependency", + "node": "tosca.nodes.Root", + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ], + "type": { + "name": "tosca.dcae.nodes.dockerApp.tca-docker" + }, + "typeinfo": { + "capabilities": [ + { + "name": "feature", + "type": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "hierarchy": [ + { + "id": "{{vf_id}}/tosca.dcae.nodes.dockerApp", + "name": "tosca.dcae.nodes.dockerApp" + }, + { + "id": "{{vf_id}}/tosca.dcae.nodes.Root", + "name": "tosca.dcae.nodes.Root" + }, + { + "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", + "id": "{{vf_id}}/tosca.nodes.Root", + "name": "tosca.nodes.Root" + } + ], + "id": "{{vf_id}}/tosca.dcae.nodes.dockerApp.tca-docker", + "itemId": "{{vf_id}}/tosca.dcae.nodes.dockerApp.tca-docker", + "name": "tosca.dcae.nodes.dockerApp.tca-docker", + "requirements": [ + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "id": "{{vf_id}}/stream_subscribe_0", + "name": "stream_subscribe_0", + "node": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "relationship": { + "type": "dcae.relationships.subscribe_to_events" + } + }, + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "id": "{{vf_id}}/stream_publish_0", + "name": "stream_publish_0", + "node": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + }, + "relationship": { + "type": "dcae.relationships.publish_events" + } + }, + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.dockerHost", + "name": "dcae.capabilities.dockerHost" + }, + "id": "{{vf_id}}/host", + "name": "host", + "node": { + "id": "{{vf_id}}/dcae.capabilities.dockerHost", + "name": "dcae.capabilities.dockerHost" + }, + "relationship": { + "type": "dcae.relationships.component_contained_in" + } + }, + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "id": "{{vf_id}}/composition", + "name": "composition", + "node": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + } + }, + { + "capability": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "id": "{{vf_id}}/dependency", + "name": "dependency", + "node": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ] + } + }, + { + "capabilities": [ + { + "name": "topic", + "properties": [ + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "aaf_password" + ] + } + }, + "name": "aaf_password", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "aaf_username" + ] + } + }, + "name": "aaf_username", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "client_role" + ] + } + }, + "name": "client_role", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "location" + ] + } + }, + "name": "location", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "node_name" + ] + } + }, + "name": "node_name", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "topic_name" + ] + } + }, + "name": "topic_name", + "type": "string" + } + ], + "type": { + "id": "template.yaml/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + } + }, + { + "name": "feature", + "type": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "description": "/sdc/v1/catalog/resources/{{vf_id}}/toscaModel/", + "id": "{{vf_id}}", + "name": "topic0", + "ndata": { + "label": "topic0", + "name": "n.1559041944077.1", + "ports": [], + "px": 414, + "py": 430.9243296300162, + "radius": 30, + "x": 415, + "y": 431.9243296300162 + }, + "nid": "n.1559041944077.1", + "properties": [ + { + "assignment": { + "value": { + "get_input": "topic0_aaf_password" + } + }, + "name": "aaf_password", + "type": "string", + "value": { + "get_input": "topic0_aaf_password" + } + }, + { + "assignment": { + "value": { + "get_input": "topic0_aaf_username" + } + }, + "name": "aaf_username", + "type": "string", + "value": { + "get_input": "topic0_aaf_username" + } + }, + { + "assignment": { + "value": { + "get_input": "topic0_client_role" + } + }, + "name": "client_role", + "type": "string", + "value": { + "get_input": "topic0_client_role" + } + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + "name": "location", + "type": "string", + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + { + "assignment": { + "value": "__GET_NODE_NAME__" + }, + "name": "node_name", + "type": "string", + "value": "__GET_NODE_NAME__" + }, + { + "assignment": { + "value": "" + }, + "name": "topic_name", + "type": "string" + } + ], + "requirements": [ + { + "capability": { + "id": "template.yaml/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "name": "composition" + }, + { + "capability": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "name": "dependency", + "node": "tosca.nodes.Root", + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ], + "type": { + "name": "tosca.dcae.nodes.dmaap.topic" + }, + "typeinfo": { + "capabilities": [ + { + "name": "topic", + "type": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + } + }, + { + "name": "feature", + "type": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "hierarchy": [ + { + "id": "{{vf_id}}/tosca.dcae.nodes.Root", + "name": "tosca.dcae.nodes.Root" + }, + { + "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", + "id": "{{vf_id}}/tosca.nodes.Root", + "name": "tosca.nodes.Root" + } + ], + "id": "{{vf_id}}/tosca.dcae.nodes.dmaap.topic", + "itemId": "{{vf_id}}/tosca.dcae.nodes.dmaap.topic", + "name": "tosca.dcae.nodes.dmaap.topic", + "requirements": [ + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "id": "{{vf_id}}/composition", + "name": "composition", + "node": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + } + }, + { + "capability": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "id": "{{vf_id}}/dependency", + "name": "dependency", + "node": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ] + } + }, + { + "capabilities": [ + { + "name": "topic", + "properties": [ + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "aaf_password" + ] + } + }, + "name": "aaf_password", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "aaf_username" + ] + } + }, + "name": "aaf_username", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "client_role" + ] + } + }, + "name": "client_role", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "location" + ] + } + }, + "name": "location", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "node_name" + ] + } + }, + "name": "node_name", + "type": "string" + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "topic_name" + ] + } + }, + "name": "topic_name", + "type": "string" + } + ], + "type": { + "id": "template.yaml/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + } + }, + { + "name": "feature", + "type": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "description": "/sdc/v1/catalog/resources/{{vf_id}}/toscaModel/", + "id": "{{vf_id}}", + "name": "topic1", + "ndata": { + "label": "topic1", + "name": "n.1559041944083.2", + "ports": [], + "px": 464, + "py": 451.6297431929615, + "radius": 30, + "x": 465, + "y": 452.6297431929615 + }, + "nid": "n.1559041944083.2", + "properties": [ + { + "assignment": { + "value": { + "get_input": "topic1_aaf_password" + } + }, + "name": "aaf_password", + "type": "string", + "value": { + "get_input": "topic1_aaf_password" + } + }, + { + "assignment": { + "value": { + "get_input": "topic1_aaf_username" + } + }, + "name": "aaf_username", + "type": "string", + "value": { + "get_input": "topic1_aaf_username" + } + }, + { + "assignment": { + "value": { + "get_input": "topic1_client_role" + } + }, + "name": "client_role", + "type": "string", + "value": { + "get_input": "topic1_client_role" + } + }, + { + "assignment": { + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + "name": "location", + "type": "string", + "value": { + "get_property": [ + "SELF", + "composition", + "location_id" + ] + } + }, + { + "assignment": { + "value": "__GET_NODE_NAME__" + }, + "name": "node_name", + "type": "string", + "value": "__GET_NODE_NAME__" + }, + { + "assignment": { + "value": "" + }, + "name": "topic_name", + "type": "string" + } + ], + "requirements": [ + { + "capability": { + "id": "template.yaml/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "name": "composition" + }, + { + "capability": { + "id": "template.yaml/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "name": "dependency", + "node": "tosca.nodes.Root", + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ], + "type": { + "name": "tosca.dcae.nodes.dmaap.topic" + }, + "typeinfo": { + "capabilities": [ + { + "name": "topic", + "type": { + "id": "{{vf_id}}/dcae.capabilities.dmmap.topic", + "name": "dcae.capabilities.dmmap.topic" + } + }, + { + "name": "feature", + "type": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + } + } + ], + "hierarchy": [ + { + "id": "{{vf_id}}/tosca.dcae.nodes.Root", + "name": "tosca.dcae.nodes.Root" + }, + { + "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", + "id": "{{vf_id}}/tosca.nodes.Root", + "name": "tosca.nodes.Root" + } + ], + "id": "{{vf_id}}/tosca.dcae.nodes.dmaap.topic", + "itemId": "{{vf_id}}/tosca.dcae.nodes.dmaap.topic", + "name": "tosca.dcae.nodes.dmaap.topic", + "requirements": [ + { + "capability": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + }, + "id": "{{vf_id}}/composition", + "name": "composition", + "node": { + "id": "{{vf_id}}/dcae.capabilities.composition.host", + "name": "dcae.capabilities.composition.host" + } + }, + { + "capability": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "id": "{{vf_id}}/dependency", + "name": "dependency", + "node": { + "id": "{{vf_id}}/tosca.capabilities.Node", + "name": "tosca.capabilities.Node" + }, + "occurrences": [ + 0, + "UNBOUNDED" + ], + "relationship": { + "type": "tosca.relationships.DependsOn" + } + } + ] + } + } + ], + "outputs": [], + "relations": [ + { + "meta": { + "n1": "n.1559041944060.0", + "n2": "n.1559041944077.1", + "p1": "stream_subscribe_0", + "p2": "topic", + "relationship": [ + "tca-docker", + null, + "stream_subscribe_0" + ] + }, + "n1": "n.1559041944060.0", + "n2": "n.1559041944077.1", + "name1": "tca-docker", + "name2": "topic0", + "rid": "lnk.1559041944098.3" + }, + { + "meta": { + "n1": "n.1559041944060.0", + "n2": "n.1559041944083.2", + "p1": "stream_publish_0", + "p2": "topic", + "relationship": [ + "tca-docker", + null, + "stream_publish_0" + ] + }, + "n1": "n.1559041944060.0", + "n2": "n.1559041944083.2", + "name1": "tca-docker", + "name2": "topic1", + "rid": "lnk.1559041944104.4" + } + ], + "version": 0 +} diff --git a/tests/sdc-dcae-d/dcaed/assets/dcae_composition.template b/tests/sdc-dcae-d/dcaed/assets/dcae_composition.template deleted file mode 100644 index 81be7893..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/dcae_composition.template +++ /dev/null @@ -1,849 +0,0 @@ -{ - "cid": "${cid}", - "flowType": "TCA Hi Lo", - "inputs": [], - "nodes": [ - { - "capabilities": [ - { - "name": "feature", - "type": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "description": "/sdc/v1/catalog/resources/${vf_id}/toscaModel/", - "id": "${vf_id}", - "name": "tca-docker", - "ndata": { - "label": "tca-docker", - "name": "n.1559041944060.0", - "ports": [], - "px": 364, - "py": 437, - "radius": 30, - "x": 365, - "y": 438 - }, - "nid": "n.1559041944060.0", - "properties": [ - { - "default": 10000, - "name": "cpu_period", - "required": true, - "type": "integer" - }, - { - "default": 30000, - "name": "cpu_quota", - "required": true, - "type": "integer" - }, - { - "default": 256, - "name": "cpu_shares", - "required": true, - "type": "integer" - }, - { - "name": "image", - "required": true, - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - "name": "location_id", - "required": true, - "type": "string", - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - { - "default": "500m", - "name": "mem_limit", - "required": true, - "type": "string" - }, - { - "default": "on-failure", - "name": "restart_policy.Name", - "required": true, - "type": "string" - }, - { - "default": 3, - "name": "restart_policy.max_retry_counts", - "required": true, - "type": "integer" - }, - { - "name": "service_component_type", - "required": true, - "type": "string" - } - ], - "requirements": [ - { - "capability": { - "id": "template.yaml/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "name": "stream_subscribe_0", - "node": "topic0", - "relationship": { - "type": "dcae.relationships.subscribe_to_events" - } - }, - { - "capability": { - "id": "template.yaml/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "name": "stream_publish_0", - "node": "topic1", - "relationship": { - "type": "dcae.relationships.publish_events" - } - }, - { - "capability": { - "id": "template.yaml/dcae.capabilities.dockerHost", - "name": "dcae.capabilities.dockerHost" - }, - "name": "host", - "relationship": { - "type": "dcae.relationships.component_contained_in" - } - }, - { - "capability": { - "id": "template.yaml/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "name": "composition" - }, - { - "capability": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "name": "dependency", - "node": "tosca.nodes.Root", - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ], - "type": { - "name": "tosca.dcae.nodes.dockerApp.tca-docker" - }, - "typeinfo": { - "capabilities": [ - { - "name": "feature", - "type": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "hierarchy": [ - { - "id": "${vf_id}/tosca.dcae.nodes.dockerApp", - "name": "tosca.dcae.nodes.dockerApp" - }, - { - "id": "${vf_id}/tosca.dcae.nodes.Root", - "name": "tosca.dcae.nodes.Root" - }, - { - "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", - "id": "${vf_id}/tosca.nodes.Root", - "name": "tosca.nodes.Root" - } - ], - "id": "${vf_id}/tosca.dcae.nodes.dockerApp.tca-docker", - "itemId": "${vf_id}/tosca.dcae.nodes.dockerApp.tca-docker", - "name": "tosca.dcae.nodes.dockerApp.tca-docker", - "requirements": [ - { - "capability": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "id": "${vf_id}/stream_subscribe_0", - "name": "stream_subscribe_0", - "node": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "relationship": { - "type": "dcae.relationships.subscribe_to_events" - } - }, - { - "capability": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "id": "${vf_id}/stream_publish_0", - "name": "stream_publish_0", - "node": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - }, - "relationship": { - "type": "dcae.relationships.publish_events" - } - }, - { - "capability": { - "id": "${vf_id}/dcae.capabilities.dockerHost", - "name": "dcae.capabilities.dockerHost" - }, - "id": "${vf_id}/host", - "name": "host", - "node": { - "id": "${vf_id}/dcae.capabilities.dockerHost", - "name": "dcae.capabilities.dockerHost" - }, - "relationship": { - "type": "dcae.relationships.component_contained_in" - } - }, - { - "capability": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "id": "${vf_id}/composition", - "name": "composition", - "node": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - } - }, - { - "capability": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "id": "${vf_id}/dependency", - "name": "dependency", - "node": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ] - } - }, - { - "capabilities": [ - { - "name": "topic", - "properties": [ - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "aaf_password" - ] - } - }, - "name": "aaf_password", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "aaf_username" - ] - } - }, - "name": "aaf_username", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "client_role" - ] - } - }, - "name": "client_role", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "location" - ] - } - }, - "name": "location", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "node_name" - ] - } - }, - "name": "node_name", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "topic_name" - ] - } - }, - "name": "topic_name", - "type": "string" - } - ], - "type": { - "id": "template.yaml/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - } - }, - { - "name": "feature", - "type": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "description": "/sdc/v1/catalog/resources/${vf_id}/toscaModel/", - "id": "${vf_id}", - "name": "topic0", - "ndata": { - "label": "topic0", - "name": "n.1559041944077.1", - "ports": [], - "px": 414, - "py": 430.9243296300162, - "radius": 30, - "x": 415, - "y": 431.9243296300162 - }, - "nid": "n.1559041944077.1", - "properties": [ - { - "assignment": { - "value": { - "get_input": "topic0_aaf_password" - } - }, - "name": "aaf_password", - "type": "string", - "value": { - "get_input": "topic0_aaf_password" - } - }, - { - "assignment": { - "value": { - "get_input": "topic0_aaf_username" - } - }, - "name": "aaf_username", - "type": "string", - "value": { - "get_input": "topic0_aaf_username" - } - }, - { - "assignment": { - "value": { - "get_input": "topic0_client_role" - } - }, - "name": "client_role", - "type": "string", - "value": { - "get_input": "topic0_client_role" - } - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - "name": "location", - "type": "string", - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - { - "assignment": { - "value": "__GET_NODE_NAME__" - }, - "name": "node_name", - "type": "string", - "value": "__GET_NODE_NAME__" - }, - { - "assignment": { - "value": "" - }, - "name": "topic_name", - "type": "string" - } - ], - "requirements": [ - { - "capability": { - "id": "template.yaml/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "name": "composition" - }, - { - "capability": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "name": "dependency", - "node": "tosca.nodes.Root", - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ], - "type": { - "name": "tosca.dcae.nodes.dmaap.topic" - }, - "typeinfo": { - "capabilities": [ - { - "name": "topic", - "type": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - } - }, - { - "name": "feature", - "type": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "hierarchy": [ - { - "id": "${vf_id}/tosca.dcae.nodes.Root", - "name": "tosca.dcae.nodes.Root" - }, - { - "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", - "id": "${vf_id}/tosca.nodes.Root", - "name": "tosca.nodes.Root" - } - ], - "id": "${vf_id}/tosca.dcae.nodes.dmaap.topic", - "itemId": "${vf_id}/tosca.dcae.nodes.dmaap.topic", - "name": "tosca.dcae.nodes.dmaap.topic", - "requirements": [ - { - "capability": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "id": "${vf_id}/composition", - "name": "composition", - "node": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - } - }, - { - "capability": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "id": "${vf_id}/dependency", - "name": "dependency", - "node": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ] - } - }, - { - "capabilities": [ - { - "name": "topic", - "properties": [ - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "aaf_password" - ] - } - }, - "name": "aaf_password", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "aaf_username" - ] - } - }, - "name": "aaf_username", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "client_role" - ] - } - }, - "name": "client_role", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "location" - ] - } - }, - "name": "location", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "node_name" - ] - } - }, - "name": "node_name", - "type": "string" - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "topic_name" - ] - } - }, - "name": "topic_name", - "type": "string" - } - ], - "type": { - "id": "template.yaml/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - } - }, - { - "name": "feature", - "type": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "description": "/sdc/v1/catalog/resources/${vf_id}/toscaModel/", - "id": "${vf_id}", - "name": "topic1", - "ndata": { - "label": "topic1", - "name": "n.1559041944083.2", - "ports": [], - "px": 464, - "py": 451.6297431929615, - "radius": 30, - "x": 465, - "y": 452.6297431929615 - }, - "nid": "n.1559041944083.2", - "properties": [ - { - "assignment": { - "value": { - "get_input": "topic1_aaf_password" - } - }, - "name": "aaf_password", - "type": "string", - "value": { - "get_input": "topic1_aaf_password" - } - }, - { - "assignment": { - "value": { - "get_input": "topic1_aaf_username" - } - }, - "name": "aaf_username", - "type": "string", - "value": { - "get_input": "topic1_aaf_username" - } - }, - { - "assignment": { - "value": { - "get_input": "topic1_client_role" - } - }, - "name": "client_role", - "type": "string", - "value": { - "get_input": "topic1_client_role" - } - }, - { - "assignment": { - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - "name": "location", - "type": "string", - "value": { - "get_property": [ - "SELF", - "composition", - "location_id" - ] - } - }, - { - "assignment": { - "value": "__GET_NODE_NAME__" - }, - "name": "node_name", - "type": "string", - "value": "__GET_NODE_NAME__" - }, - { - "assignment": { - "value": "" - }, - "name": "topic_name", - "type": "string" - } - ], - "requirements": [ - { - "capability": { - "id": "template.yaml/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "name": "composition" - }, - { - "capability": { - "id": "template.yaml/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "name": "dependency", - "node": "tosca.nodes.Root", - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ], - "type": { - "name": "tosca.dcae.nodes.dmaap.topic" - }, - "typeinfo": { - "capabilities": [ - { - "name": "topic", - "type": { - "id": "${vf_id}/dcae.capabilities.dmmap.topic", - "name": "dcae.capabilities.dmmap.topic" - } - }, - { - "name": "feature", - "type": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - } - } - ], - "hierarchy": [ - { - "id": "${vf_id}/tosca.dcae.nodes.Root", - "name": "tosca.dcae.nodes.Root" - }, - { - "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", - "id": "${vf_id}/tosca.nodes.Root", - "name": "tosca.nodes.Root" - } - ], - "id": "${vf_id}/tosca.dcae.nodes.dmaap.topic", - "itemId": "${vf_id}/tosca.dcae.nodes.dmaap.topic", - "name": "tosca.dcae.nodes.dmaap.topic", - "requirements": [ - { - "capability": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - }, - "id": "${vf_id}/composition", - "name": "composition", - "node": { - "id": "${vf_id}/dcae.capabilities.composition.host", - "name": "dcae.capabilities.composition.host" - } - }, - { - "capability": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "id": "${vf_id}/dependency", - "name": "dependency", - "node": { - "id": "${vf_id}/tosca.capabilities.Node", - "name": "tosca.capabilities.Node" - }, - "occurrences": [ - 0, - "UNBOUNDED" - ], - "relationship": { - "type": "tosca.relationships.DependsOn" - } - } - ] - } - } - ], - "outputs": [], - "relations": [ - { - "meta": { - "n1": "n.1559041944060.0", - "n2": "n.1559041944077.1", - "p1": "stream_subscribe_0", - "p2": "topic", - "relationship": [ - "tca-docker", - null, - "stream_subscribe_0" - ] - }, - "n1": "n.1559041944060.0", - "n2": "n.1559041944077.1", - "name1": "tca-docker", - "name2": "topic0", - "rid": "lnk.1559041944098.3" - }, - { - "meta": { - "n1": "n.1559041944060.0", - "n2": "n.1559041944083.2", - "p1": "stream_publish_0", - "p2": "topic", - "relationship": [ - "tca-docker", - null, - "stream_publish_0" - ] - }, - "n1": "n.1559041944060.0", - "n2": "n.1559041944083.2", - "name1": "tca-docker", - "name2": "topic1", - "rid": "lnk.1559041944104.4" - } - ], - "version": 0 -} diff --git a/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.jinja b/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.jinja new file mode 100644 index 00000000..27a5d020 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.jinja @@ -0,0 +1,11 @@ +{ + "name": "{{name}}", + "description": "Created by robot", + "templateUuid": "{{template_uuid}}", + "vfiName": "{{vfi_name}}", + "serviceUuid": "{{service_uuid}}", + "contextType": "SERVICE", + "flowType": "TCA Hi Lo", + "cloneVFCMT": true, + "updateFlowType": false +} diff --git a/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.template b/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.template deleted file mode 100755 index f42e4685..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/dcae_monitoring_configuration.template +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "${name}", - "description": "Created by robot", - "templateUuid": "${template_uuid}", - "vfiName": "${vfi_name}", - "serviceUuid": "${service_uuid}", - "contextType": "SERVICE", - "flowType": "TCA Hi Lo", - "cloneVFCMT": true, - "updateFlowType": false -} diff --git a/tests/sdc-dcae-d/dcaed/assets/resource_instance.jinja b/tests/sdc-dcae-d/dcaed/assets/resource_instance.jinja new file mode 100644 index 00000000..18b71685 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/resource_instance.jinja @@ -0,0 +1,10 @@ +{ + "uniqueId": "{{catalog_resource_id}}{{milli_timestamp}}", + "posX": {{posX}}, + "posY": {{posY}}, + "name": "{{catalog_resource_name}}", + "componentVersion": "1.0", + "originType": "{{originType}}", + "icon": "defaulticon", + "componentUid": "{{catalog_resource_id}}" +} diff --git a/tests/sdc-dcae-d/dcaed/assets/resource_instance.template b/tests/sdc-dcae-d/dcaed/assets/resource_instance.template deleted file mode 100644 index 18cf34c7..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/resource_instance.template +++ /dev/null @@ -1,10 +0,0 @@ -{ - "uniqueId": "${catalog_resource_id}${milli_timestamp}", - "posX": ${posX}, - "posY": ${posY}, - "name": "${catalog_resource_name}", - "componentVersion": "1.0", - "originType": "${originType}", - "icon": "defaulticon", - "componentUid": "${catalog_resource_id}" -} diff --git a/tests/sdc-dcae-d/dcaed/assets/user_remarks.jinja b/tests/sdc-dcae-d/dcaed/assets/user_remarks.jinja new file mode 100644 index 00000000..ea01a249 --- /dev/null +++ b/tests/sdc-dcae-d/dcaed/assets/user_remarks.jinja @@ -0,0 +1 @@ +{"userRemarks":"{{user_remarks}}"} \ No newline at end of file diff --git a/tests/sdc-dcae-d/dcaed/assets/user_remarks.template b/tests/sdc-dcae-d/dcaed/assets/user_remarks.template deleted file mode 100644 index 465115e6..00000000 --- a/tests/sdc-dcae-d/dcaed/assets/user_remarks.template +++ /dev/null @@ -1 +0,0 @@ -{"userRemarks":"${user_remarks}"} \ No newline at end of file diff --git a/tests/sdc-dcae-d/dcaed/dcaed_interface.robot b/tests/sdc-dcae-d/dcaed/dcaed_interface.robot index e3aa4b91..fb1e7b43 100644 --- a/tests/sdc-dcae-d/dcaed/dcaed_interface.robot +++ b/tests/sdc-dcae-d/dcaed/dcaed_interface.robot @@ -1,16 +1,15 @@ *** Settings *** Library json Library ONAPLibrary.Utilities - -Resource json_templater.robot +Library ONAPLibrary.Templating WITH NAME Templating Resource common.robot *** Variables *** ${DCAE_PATH} /dcae ${DCAE_CREATE_BLUEPRINT_PATH} /SERVICE/createBluePrint -${DCAE_VFCMT_TEMPLATE} ${ASSETS_DIR}create_vfcmt.template -${DCAE_COMPOSITION_TEMPLATE} ${ASSETS_DIR}dcae_composition.template -${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${ASSETS_DIR}dcae_monitoring_configuration.template +${DCAE_VFCMT_TEMPLATE} create_vfcmt.jinja +${DCAE_COMPOSITION_TEMPLATE} dcae_composition.jinja +${DCAE_MONITORING_CONFIGURATION_TEMPLATE} dcae_monitoring_configuration.jinja ${DCAE_BE_ENDPOINT} http://localhost:8082 *** Keywords *** @@ -19,7 +18,8 @@ Add VFCMT To DCAE-DS [Documentation] Create VFCMT with the given name and return its uuid [Arguments] ${vfcmt_name} ${map}= Create Dictionary vfcmtName=${vfcmt_name} description=VFCMT created by robot - ${data}= Fill JSON Template File ${DCAE_VFCMT_TEMPLATE} ${map} + Create Environment create_vfcmt ${ASSETS_DIR} + ${data}= Apply Template create_vfcmt ${DCAE_VFCMT_TEMPLATE} ${map} ${resp}= Run DCAE-DS Post Request ${DCAE_PATH}/createVFCMT ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['uuid']} @@ -49,7 +49,8 @@ Run DCAE-DS Put Request Save Composition [Arguments] ${vfcmt_uuid} ${vf_uuid} ${map}= Create Dictionary cid=${vfcmt_uuid} vf_id=${vf_uuid} - ${data}= Fill JSON Template File ${DCAE_COMPOSITION_TEMPLATE} ${map} + Create Environment dcae_composition ${ASSETS_DIR} + ${data}= Apply Template dcae_composition ${DCAE_COMPOSITION_TEMPLATE} ${map} ${resp}= Run DCAE-DS Post Request ${DCAE_PATH}/saveComposition/${vfcmt_uuid} ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 @@ -62,7 +63,8 @@ Certify VFCMT Add Monitoring Configuration To DCAE-DS [Arguments] ${vfcmt_uuid} ${cs_uuid} ${vfi_name} ${mc_name} ${map}= Create Dictionary template_uuid=${vfcmt_uuid} service_uuid=${cs_uuid} vfi_name=${vfi_name} name=${mc_name} - ${data}= Fill JSON Template File ${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${map} + Create Environment dcae_monitoring_configuration ${ASSETS_DIR} + ${data}= Apply Template dcae_monitoring_configuration ${DCAE_MONITORING_CONFIGURATION_TEMPLATE} ${map} ${resp}= Run DCAE-DS Post Request ${DCAE_PATH}/importMC ${data} ${ASDC_DESIGNER_USER_ID} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp.json()['vfcmt']['uuid']} diff --git a/tests/sdc-dcae-d/dcaed/json_templater.robot b/tests/sdc-dcae-d/dcaed/json_templater.robot deleted file mode 100644 index 33e8baa4..00000000 --- a/tests/sdc-dcae-d/dcaed/json_templater.robot +++ /dev/null @@ -1,20 +0,0 @@ -*** Settings *** -Documentation This resource is filling out json string templates and returning the json back -Library RequestsLibrary -Library ONAPLibrary.TemplatingKeywords -Library OperatingSystem - -*** Keywords *** -Fill JSON Template - [Documentation] Runs substitution on template to return a filled in json - [Arguments] ${json} ${arguments} - ${returned_string}= Template String ${json} ${arguments} - ${returned_json}= To Json ${returned_string} - [Return] ${returned_json} - -Fill JSON Template File - [Documentation] Runs substitution on template to return a filled in json - [Arguments] ${json_file} ${arguments} - ${json}= OperatingSystem.Get File ${json_file} - ${returned_json}= Fill JSON Template ${json} ${arguments} - [Return] ${returned_json} -- cgit 1.2.3-korg