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 Test a charm that breaks post-deployment
26 class TestCharm(base
.TestN2VC
):
33 short-name: brokencharm-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
70 - id: hackfest-simplecharm-vnf
71 name: hackfest-simplecharm-vnf
72 short-name: hackfest-simplecharm-vnf
74 description: A VNF consisting of 2 VDUs connected to an internal VL, and one VDU with cloud-init
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
125 image: hackfest3-mgmt
137 internal-connection-point-ref: dataVM-internal
143 external-connection-point-ref: vnf-data
144 internal-connection-point:
145 - id: dataVM-internal
146 name: dataVM-internal
147 short-name: dataVM-internal
153 initial-config-primitive:
158 value: '/home/ubuntu/first-touch'
164 default-value: '/home/ubuntu/touched'
167 # @pytest.mark.serial
169 async def test_charm_proxy(self
, event_loop
):
170 """Deploy and execute the initial-config-primitive of a VNF."""
172 if self
.nsd
and self
.vnfd
:
175 for config
in self
.get_config():
176 juju
= config
['juju']
177 charm
= juju
['charm']
186 while await self
.running():
187 print("Waiting for test to finish...")
188 await asyncio
.sleep(15)
189 logging
.debug("test_charm_proxy stopped")