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 VNF with a proxy charm, executing an initial-config-primitive
26 class TestCharm(base
.TestN2VC
):
33 short-name: charmproxy-ns
34 description: NS with 1 VNF connected by datanet and mgmtnet VLs
38 - vnfd-id-ref: charmproxy-vnf
46 vim-network-name: mgmt
47 vnfd-connection-point-ref:
48 - vnfd-id-ref: charmproxy-vnf
49 member-vnf-index-ref: '1'
50 vnfd-connection-point-ref: vnf-mgmt
51 - vnfd-id-ref: charmproxy-vnf
52 member-vnf-index-ref: '2'
53 vnfd-connection-point-ref: vnf-mgmt
58 vnfd-connection-point-ref:
59 - vnfd-id-ref: charmproxy-vnf
60 member-vnf-index-ref: '1'
61 vnfd-connection-point-ref: vnf-data
62 - vnfd-id-ref: charmproxy-vnf
63 member-vnf-index-ref: '2'
64 vnfd-connection-point-ref: vnf-data
72 short-name: charmproxy-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
127 initial-config-primitive:
132 # @pytest.mark.serial
134 async def test_charm_proxy(self
, event_loop
):
135 """Deploy and execute the initial-config-primitive of a VNF."""
137 if self
.nsd
and self
.vnfd
:
140 for config
in self
.get_config():
141 juju
= config
['juju']
142 charm
= juju
['charm']
151 while await self
.running():
152 print("Waiting for test to finish...")
153 await asyncio
.sleep(15)
154 logging
.debug("test_charm_proxy stopped")