Merge " Adding Tacker functional tests with parameterization using tosca template"

This commit is contained in:
Jenkins
2016-08-02 13:00:40 +00:00
committed by Gerrit Code Review
3 changed files with 126 additions and 4 deletions
@@ -0,0 +1,10 @@
{
image_name: 'cirros-0.3.4-x86_64-uec',
flavor: 'm1.tiny',
zone: 'nova',
network: 'net_mgmt',
management: 'true',
pkt_in_network: 'net0',
pkt_out_network: 'net1',
vendor: 'tacker'
}
@@ -0,0 +1,101 @@
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: VNF TOSCA template with input parameters
metadata:
template_name: sample-tosca-vnfd
topology_template:
inputs:
image_name:
type: string
description: Image Name
flavor:
type: string
description: Flavor Information
zone:
type: string
description: Zone Information
network:
type: string
description: mgmt network
management:
type: string
description: management network
pkt_in_network:
type: string
description: In network
pkt_out_network:
type: string
description: Out network
vendor:
type: string
description: Vendor information
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
properties:
image: { get_input: image_name}
flavor: {get_input: flavor}
availability_zone: { get_input: zone }
mgmt_driver: noop
config: |
param0: key1
param1: key2
CP1:
type: tosca.nodes.nfv.CP.Tacker
properties:
management: { get_input: management }
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL1
- virtualBinding:
node: VDU1
CP2:
type: tosca.nodes.nfv.CP.Tacker
properties:
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL2
- virtualBinding:
node: VDU1
CP3:
type: tosca.nodes.nfv.CP.Tacker
properties:
anti_spoofing_protection: false
requirements:
- virtualLink:
node: VL3
- virtualBinding:
node: VDU1
VL1:
type: tosca.nodes.nfv.VL
properties:
network_name: { get_input: network }
vendor: {get_input: vendor}
VL2:
type: tosca.nodes.nfv.VL
properties:
network_name: { get_input: pkt_in_network }
vendor: {get_input: vendor}
VL3:
type: tosca.nodes.nfv.VL
properties:
network_name: { get_input: pkt_out_network }
vendor: {get_input: vendor}
@@ -89,10 +89,6 @@ class VnfmTestParam(base.BaseTackerTest):
except Exception:
assert True, "Vnf Delete success" + str(vfn_d) + str(Exception)
def test_vnfd_param(self):
vnfd_instance = self._test_vnfd_create('sample_cirros_vnf_param.yaml')
self._test_vnfd_delete(vnfd_instance)
def test_vnf_param(self):
vnfd_instance = self._test_vnfd_create('sample_cirros_vnf_param.yaml')
vnf_instance = self._test_vnf_create(vnfd_instance,
@@ -103,3 +99,18 @@ class VnfmTestParam(base.BaseTackerTest):
self.addCleanup(self.client.delete_vnfd, vnfd_instance['vnfd']['id'])
self.addCleanup(self.wait_until_vnf_delete, vnf_id,
constants.VNF_CIRROS_DELETE_TIMEOUT)
def test_vnfd_param_tosca_template(self):
vnfd_instance = self._test_vnfd_create('sample-tosca-vnfd-param.yaml')
self._test_vnfd_delete(vnfd_instance)
def test_vnf_param_tosca_template(self):
vnfd_instance = self._test_vnfd_create('sample-tosca-vnfd-param.yaml')
vnf_instance = self._test_vnf_create(vnfd_instance,
'test_vnf_with_parameters_tosca_template',
'sample-tosca-vnf-values.yaml')
self._test_vnf_delete(vnf_instance)
vnf_id = vnf_instance['vnf']['id']
self.addCleanup(self.client.delete_vnfd, vnfd_instance['vnfd']['id'])
self.addCleanup(self.wait_until_vnf_delete, vnf_id,
constants.VNF_CIRROS_DELETE_TIMEOUT)