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 Exercise the simplecharm hackfest example:
17 https://osm-download.etsi.org/ftp/osm-4.0-four/4th-hackfest/packages/hackfest_simplecharm_vnf.tar.gz
27 class TestCharm(base
.TestN2VC
):
34 short-name: charmproxy-ns
35 description: NS with 1 VNF connected by datanet and mgmtnet VLs
39 - vnfd-id-ref: charmproxy-vnf
47 vim-network-name: mgmt
48 vnfd-connection-point-ref:
49 - vnfd-id-ref: charmproxy-vnf
50 member-vnf-index-ref: '1'
51 vnfd-connection-point-ref: vnf-mgmt
52 - vnfd-id-ref: charmproxy-vnf
53 member-vnf-index-ref: '2'
54 vnfd-connection-point-ref: vnf-mgmt
59 vnfd-connection-point-ref:
60 - vnfd-id-ref: charmproxy-vnf
61 member-vnf-index-ref: '1'
62 vnfd-connection-point-ref: vnf-data
63 - vnfd-id-ref: charmproxy-vnf
64 member-vnf-index-ref: '2'
65 vnfd-connection-point-ref: vnf-data
71 - id: hackfest-simplecharm-vnf
72 name: hackfest-simplecharm-vnf
73 short-name: hackfest-simplecharm-vnf
75 description: A VNF consisting of 2 VDUs connected to an internal VL, and one VDU with cloud-init
93 internal-connection-point:
94 - id-ref: mgmtVM-internal
95 - id-ref: dataVM-internal
111 external-connection-point-ref: vnf-mgmt
117 internal-connection-point-ref: mgmtVM-internal
118 internal-connection-point:
119 - id: mgmtVM-internal
120 name: mgmtVM-internal
121 short-name: mgmtVM-internal
123 cloud-init-file: cloud-config.txt
126 image: hackfest3-mgmt
138 internal-connection-point-ref: dataVM-internal
144 external-connection-point-ref: vnf-data
145 internal-connection-point:
146 - id: dataVM-internal
147 name: dataVM-internal
148 short-name: dataVM-internal
154 initial-config-primitive:
159 value: '/home/ubuntu/first-touch'
165 default-value: '/home/ubuntu/touched'
168 # @pytest.mark.serial
170 async def test_charm_proxy(self
, event_loop
):
171 """Deploy and execute the initial-config-primitive of a VNF."""
173 if self
.nsd
and self
.vnfd
:
176 for config
in self
.get_config():
177 juju
= config
['juju']
178 charm
= juju
['charm']
187 while await self
.running():
188 print("Waiting for test to finish...")
189 await asyncio
.sleep(15)
190 logging
.debug("test_charm_proxy stopped")