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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 import osm_im
.vnfd
as vnfd_catalog
17 from pyangbind
.lib
.serialise
import pybindJSONDecoder
26 short-name: cirros_vnf
27 description: Simple VNF example with a cirros
31 # Place the logo as png in icons directory and provide the name here
34 # Management interface
38 # Atleast one VDU need to be specified
42 description: cirros_vnfd-VM
45 # Flavour of the VM to be instantiated for the VDU
46 # flavor below can fit into m1.micro
52 # Image/checksum or image including the full path
57 # Specify the external interfaces
58 # There can be multiple interfaces defined
65 external-connection-point-ref: eth0
72 class PythonTest(unittest
.TestCase
):
75 def test_python_compatibility(self
):
76 """A simple test to verify Python compatibility.
78 This test exercises basic IM interoperability with supported versions
79 of Python in order to verify the IM libraries compatibility.
81 As of 30 Nov 2017, the IM library fails with Python3. This invokes that
82 failing code so that it can be repeatably tested:
84 ValueError: '_pybind_generated_by' in __slots__ conflicts with class variable
88 data
= yaml
.safe_load(VNFD_YAML
)
90 myvnfd
= vnfd_catalog
.vnfd()
91 pybindJSONDecoder
.load_ietf_json(data
, None, None, obj
=myvnfd
)