Adding Tacker functional tests with parameterization using tosca template

Closes-bug: #1594599
    Depends-On: I8f7c36333ae26a88f52fe06883a9bfe8efdcf731

Change-Id: I16339b9107bb45bca6afb933b8d74963a32e8510
This commit is contained in:
OpenStack Proposal Bot 2016-07-18 18:16:36 +00:00 committed by Santosh Kodicherla
parent 81480d8eca
commit 86d848eacf
4 changed files with 128 additions and 6 deletions

View File

@ -23,10 +23,10 @@ python-heatclient>=1.1.0 # Apache-2.0
python-keystoneclient!=1.8.0,!=2.1.0,>=1.7.0 # Apache-2.0
alembic>=0.8.4 # MIT
six>=1.9.0 # MIT
stevedore>=1.10.0 # Apache-2.0
stevedore>=1.16.0 # Apache-2.0
oslo.concurrency>=3.8.0 # Apache-2.0
oslo.config>=3.12.0 # Apache-2.0
oslo.context>=2.4.0 # Apache-2.0
oslo.context!=2.6.0,>=2.4.0 # Apache-2.0
oslo.db>=4.1.0 # Apache-2.0
oslo.log>=1.14.0 # Apache-2.0
oslo.messaging>=5.2.0 # Apache-2.0

View File

@ -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'
}

View File

@ -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}

View File

@ -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)