diff options
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/extensions')
3 files changed, 160 insertions, 55 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/rnc_definition.yaml b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/rnc_definition.yaml index c9d0901..8c98fc9 100644 --- a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/rnc_definition.yaml +++ b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/rnc_definition.yaml @@ -61,12 +61,14 @@ node_types: properties: activestatus: type: integer + required: false description: 1 for active or 0 for passive constraints: - valid_values: [ 0, 1 ] id: type: string defaule: MM + required: false description: > A identifier of this VDU within the scope of the VNFD, including version functional description and other @@ -77,6 +79,7 @@ node_types: properties: activestatus: type: integer + required: false description: 1 for active or 0 for passive constraints: - valid_values: [ 0, 1 ] diff --git a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml index 2617b4d..6517c4a 100644 --- a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml +++ b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml @@ -35,28 +35,28 @@ dsl_definitions: compute_props_os_DEF: &compute_props_os_DEF architecture: x86_64 type: Linux - distribution: Ubuntu - version: 14.10 + distribution: Cirros + version: 0.3.2 compute_props_host_MM: &compute_props_host_MM - disk_size: 20 GB + disk_size: 1 GB num_cpus: 2 - mem_size: 1024 MB + mem_size: 64 MB compute_props_host_CM: &compute_props_host_CM disk_size: 0 GB num_cpus: 2 - mem_size: 1024 MB + mem_size: 64 MB compute_props_host_DM: &compute_props_host_DM disk_size: 0 GB num_cpus: 2 - mem_size: 1024 MB + mem_size: 64 MB compute_props_host_LB: &compute_props_host_LB disk_size: 0 GB num_cpus: 2 - mem_size: 1024 MB + mem_size: 64 MB # topology template definition of the cloud application or service topology_template: @@ -67,7 +67,7 @@ topology_template: inputs: mm_storage_size: type: integer - default: 20 GB + default: 1 description: mm additional block storage size constraints: - in_range: [ 1, 200 ] @@ -84,6 +84,19 @@ topology_template: # definition of the node templates of the topology node_templates: MM_Active: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: MM_Active_Host + interfaces: + Standard: + create: + implementation: mm_install.sh + configure: + implementation: mm_active_configure.sh + + MM_Active_Host: type: rnc.nodes.compute.MM properties: activestatus: 1 @@ -101,14 +114,21 @@ topology_template: artifacts: #the VM image of MM vm_image: mm.image + + MM_Passive: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: MM_Passive_Host interfaces: Standard: create: implementation: mm_install.sh configure: - implementation: mm_active_configure.sh + implementation: mm_passvie_configure.sh - MM_Passive: + MM_Passive_Host: type: rnc.nodes.compute.MM properties: activestatus: 0 @@ -126,14 +146,21 @@ topology_template: artifacts: #the VM image of MM vm_image: mm.image + + CM_Active: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: CM_Active_Host interfaces: Standard: create: - implementation: mm_install.sh + implementation: cm_install.sh configure: - implementation: mm_passvie_configure.sh + implementation: cm_active_configure.sh - CM_Active: + CM_Active_Host: type: rnc.nodes.compute.CM properties: activestatus: 1 @@ -145,21 +172,28 @@ topology_template: scalable: properties: min_instances: 1 - max_instances: 126 + max_instances: 12 default_instances: 1 requirements: - high_availability: CM_Passive artifacts: #the VM image of CM vm_image: cm.image + + CM_Passive: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: CM_Passive_Host interfaces: Standard: create: implementation: cm_install.sh configure: - implementation: cm_active_configure.sh + implementation: cm_passvie_configure.sh - CM_Passive: + CM_Passive_Host: type: rnc.nodes.compute.CM properties: activestatus: 0 @@ -171,21 +205,28 @@ topology_template: scalable: properties: min_instances: 1 - max_instances: 126 + max_instances: 12 default_instances: 1 requirements: - high_availability: CM_Active artifacts: #the VM image of CM vm_image: mm.image + + DM: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: DM_Host interfaces: Standard: create: - implementation: cm_install.sh + implementation: dm_install.sh configure: - implementation: cm_passvie_configure.sh + implementation: dm_configure.sh - DM: + DM_Host: type: rnc.nodes.compute.DM capabilities: os: @@ -195,18 +236,25 @@ topology_template: scalable: properties: min_instances: 1 - max_instances: 120 + max_instances: 12 default_instances: 1 artifacts: vm_image: dm.image + + LB: + type: tosca.nodes.SoftwareComponent + properties: + component_version: 1.0 + requirements: + - host: LB_Host interfaces: Standard: create: - implementation: dm_install.sh + implementation: lb_install.sh configure: - implementation: dm_configure.sh + implementation: lb_configure.sh - LB: + LB_Host: type: rnc.nodes.compute.LB capabilities: os: @@ -216,17 +264,11 @@ topology_template: scalable: properties: min_instances: 1 - max_instances: 20 + max_instances: 2 default_instances: 1 artifacts: #the VM image of LB vm_image: lb.image - interfaces: - Standard: - create: - implementation: lb_install.sh - configure: - implementation: lb_configure.sh MM_BlockStorage: type: rnc.nodes.BlockStorage @@ -285,58 +327,112 @@ topology_template: segmentation_id: 101 dhcp_enabled: false - MM_Port_EMS: + MM_Active_Port_EMS: type: rnc.nodes.CP.MM properties: order: 0 is_default: true requirements: - - virtualBinding: MM_Active + - virtualBinding: MM_Active_Host + - virtualLink: EMS_Net + + MM_Active_Port_EXTERMEDIA: + type: rnc.nodes.CP.MM + properties: + order: 1 + is_default: true + requirements: + - virtualBinding: MM_Active_Host - virtualLink: EMS_Net - MM_Port_EMS: + MM_Active_Port_CTRL: + type: rnc.nodes.CP.MM + properties: + order: 2 + is_default: false + requirements: + - virtualBinding: MM_Active_Host + - virtualLink: CTRL_Net + + MM_Active_Port_INTERMEDIA: + type: rnc.nodes.CP.MM + properties: + order: 3 + is_default: false + requirements: + - virtualBinding: MM_Active_Host + - virtualLink: EXTERMEDIA_Net + + MM_Passive_Port_EMS: type: rnc.nodes.CP.MM properties: order: 0 is_default: true requirements: - - virtualBinding: MM_Active + - virtualBinding: MM_Passive_Host - virtualLink: EMS_Net - MM_Port_CTRL: + MM_Passive_Port_EXTERMEDIA: type: rnc.nodes.CP.MM properties: order: 1 + is_default: true + requirements: + - virtualBinding: MM_Passive_Host + - virtualLink: EMS_Net + + MM_Passive_Port_CTRL: + type: rnc.nodes.CP.MM + properties: + order: 2 is_default: false requirements: - - virtualBinding: MM_Active + - virtualBinding: MM_Passive_Host - virtualLink: CTRL_Net - MM_Port_EXTERMEDIA: + MM_Passive_Port_INTERMEDIA: type: rnc.nodes.CP.MM properties: - order: 2 + order: 3 is_default: false requirements: - - virtualBinding: MM_Active + - virtualBinding: MM_Passive_Host - virtualLink: EXTERMEDIA_Net - CM_Port_CTRL: + CM_Active_Port_CTRL: type: rnc.nodes.CP.CM properties: order: 0 is_default: true requirements: - - virtualBinding: CM_Active + - virtualBinding: CM_Active_Host - virtualLink: CTRL_Net - CM_Port_INTERMEDIA: + CM_Active_Port_INTERMEDIA: type: rnc.nodes.CP.CM properties: order: 1 is_default: false requirements: - - virtualBinding: CM_Active + - virtualBinding: CM_Active_Host + - virtualLink: INTERMEDIA_Net + + CM_Passive_Port_CTRL: + type: rnc.nodes.CP.CM + properties: + order: 0 + is_default: true + requirements: + - virtualBinding: CM_Passive_Host + - virtualLink: CTRL_Net + + CM_Passive_Port_INTERMEDIA: + type: rnc.nodes.CP.CM + properties: + order: 1 + is_default: false + requirements: + - virtualBinding: CM_Passive_Host - virtualLink: INTERMEDIA_Net DM_Port_CTRL: @@ -346,7 +442,7 @@ topology_template: is_default: true requirements: - virtualBinding: DM - - virtualLink: CTRL_Net + - virtualLink: CTRL_Net_Host DM_Port_INTERMEDIA: type: rnc.nodes.CP.DM @@ -354,7 +450,7 @@ topology_template: order: 1 is_default: false requirements: - - virtualBinding: DM + - virtualBinding: DM_Host - virtualLink: INTERMEDIA_Net LB_Port_CTRL: @@ -363,7 +459,7 @@ topology_template: order: 0 is_default: true requirements: - - virtualBinding: LB + - virtualBinding: LB_Host - virtualLink: CTRL_Net LB_Port_INTERMEDIA: @@ -372,7 +468,7 @@ topology_template: order: 1 is_default: false requirements: - - virtualBinding: LB + - virtualBinding: LB_Host - virtualLink: INTERMEDIA_Net LB_Port_EXTERMEDIA: @@ -381,7 +477,7 @@ topology_template: order: 2 is_default: false requirements: - - virtualBinding: LB + - virtualBinding: LB_Host - virtualLink: EXTERMEDIA_Net # definition of the relationship templates of the topology @@ -395,19 +491,19 @@ topology_template: outputs: private_ip_of_MM: description: The private IP address of the MM. - value: { get_attribute: [ MM_Active, private_address ] } + value: { get_attribute: [ MM_Active_Host, private_address ] } private_ip_of_CM: description: The private IP address of the CM. - value: { get_attribute: [ CM_Active, private_address ] } + value: { get_attribute: [ CM_Active_Host, private_address ] } private_ip_of_DM: description: The private IP address of the DM. - value: { get_attribute: [ DM, private_address ] } + value: { get_attribute: [ DM_Host, private_address ] } private_ip_of_LB: description: The private IP address of the LB. - value: { get_attribute: [ LB, private_address ] } + value: { get_attribute: [ LB_Host, private_address ] } # definition of logical groups of node templates within the topology # To be continue about this section diff --git a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/test_tosca_vRNC.py b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/test_tosca_vRNC.py index 46a5e29..c839626 100644 --- a/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/test_tosca_vRNC.py +++ b/tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/test_tosca_vRNC.py @@ -35,10 +35,16 @@ class ToscaVRNCTemplateTest(TestCase): def test_nodetemplates(self): expected_node_list = sorted( ["MM_Active", "MM_Passive", "MM_BlockStorage", + "MM_Active_Host", "MM_Passive_Host", "CM_Active", "CM_Passive", "DM", "LB", + "CM_Active_Host", "CM_Passive_Host", "DM_Host", "LB_Host", "EXTERMEDIA_Net", "INTERMEDIA_Net", "EMS_Net", "CTRL_Net", - "MM_Port_EMS", "MM_Port_CTRL", "MM_Port_EXTERMEDIA", - "CM_Port_CTRL", "CM_Port_INTERMEDIA", + "MM_Active_Port_EMS", "MM_Active_Port_CTRL", + "MM_Active_Port_EXTERMEDIA", "MM_Active_Port_INTERMEDIA", + "MM_Passive_Port_EMS", "MM_Passive_Port_CTRL", + "MM_Passive_Port_EXTERMEDIA", "MM_Passive_Port_INTERMEDIA", + "CM_Active_Port_CTRL", "CM_Active_Port_INTERMEDIA", + "CM_Passive_Port_CTRL", "CM_Passive_Port_INTERMEDIA", "DM_Port_CTRL", "DM_Port_INTERMEDIA", "LB_Port_INTERMEDIA", "LB_Port_EXTERMEDIA", "LB_Port_CTRL"]) |