1 # Copyright 2019 Canonical Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
16 Deploy a multi-vdu, multi-charm VNF
26 class TestCharm(base
.TestN2VC
):
31 - id: multivdurelate-ns
32 name: multivdurelate-ns
33 short-name: multivdurelate-ns
34 description: NS with 1 VNF connected by datanet and mgmtnet VLs
38 - vnfd-id-ref: multivdurelate-vnf
46 vim-network-name: mgmt
47 vnfd-connection-point-ref:
48 - vnfd-id-ref: multivdurelate-vnf
49 member-vnf-index-ref: '1'
50 vnfd-connection-point-ref: vnf-mgmt
51 - vnfd-id-ref: multivdurelate-vnf
52 member-vnf-index-ref: '2'
53 vnfd-connection-point-ref: vnf-mgmt
58 vnfd-connection-point-ref:
59 - vnfd-id-ref: multivdurelate-vnf
60 member-vnf-index-ref: '1'
61 vnfd-connection-point-ref: vnf-data
62 - vnfd-id-ref: multivdurelate-vnf
63 member-vnf-index-ref: '2'
64 vnfd-connection-point-ref: vnf-data
70 - id: multivdurelate-vnf
71 name: multivdurelate-vnf
72 short-name: multivdurelate-vnf
74 description: A VNF consisting of 1 VDUs w/proxy charm
92 internal-connection-point:
93 - id-ref: mgmtVM-internal
94 - id-ref: dataVM-internal
110 external-connection-point-ref: vnf-mgmt
116 internal-connection-point-ref: mgmtVM-internal
117 internal-connection-point:
118 - id: mgmtVM-internal
119 name: mgmtVM-internal
120 short-name: mgmtVM-internal
122 cloud-init-file: cloud-config.txt
128 # Relation needs to map to the vdu providing or
129 # requiring, so that we can map to the deployed app.
131 - provides: dataVM:db
133 initial-config-primitive:
150 external-connection-point-ref: vnf-mgmt
156 internal-connection-point-ref: dataVM-internal
157 internal-connection-point:
158 - id: dataVM-internal
159 name: dataVM-internal
160 short-name: dataVM-internal
162 cloud-init-file: cloud-config.txt
167 initial-config-primitive:
173 # @pytest.mark.serial
175 async def test_multivdu_relate(self
, event_loop
):
176 """Deploy and execute the initial-config-primitive of a VNF."""
178 if self
.nsd
and self
.vnfd
:
181 for config
in self
.get_config():
182 juju
= config
['juju']
183 charm
= juju
['charm']
193 while await self
.running():
194 logging
.debug("Waiting for test to finish...")
195 await asyncio
.sleep(15)
198 logging
.debug("test_multivdu_relate stopped")