This fix provides to pass the position information to LCM.
Change-Id: Ic3ddc376932ad52e09205484202542b0c50a6cd3
Signed-off-by: aticig <gulsum.atici@canonical.com>
vdur["internal-connection-point"].append(vdu_icp)
for iface in icp.get("virtual-network-interface-requirement", ()):
- iface_fields = ("name", "mac-address")
+ # Name, mac-address and interface position is taken from VNFD
+ # and included into VNFR. By this way RO can process this information
+ # while creating the VDU.
+ iface_fields = ("name", "mac-address", "position")
vdu_iface = {
x: iface[x] for x in iface_fields if iface.get(x) is not None
}
mgmt-vnf: true
name: mgmtVM-eth0
ns-vld-id: mgmt
+ position: 1
- ip-address: 192.168.54.2
mac-address: fa:16:3e:6e:7e:78
name: mgmtVM-eth1
vnf-vld-id: internal
+ position: 2
internal-connection-point:
- connection-point-id: mgmtVM-internal
id: mgmtVM-internal
self.assertEqual(
len(created_vnfrs), 2, "created a mismatch number of vnfr at database"
)
+
+ self.assertEqual(
+ created_vnfrs[0]["vdur"][0]["interfaces"][0]["position"],
+ 1,
+ "vdur first interface position does not match",
+ )
+
+ self.assertEqual(
+ created_vnfrs[0]["vdur"][0]["interfaces"][1]["position"],
+ 2,
+ "vdur second interface position does not match",
+ )
+
self.assertEqual(
len(created_nsrs), 1, "Only one nsrs must be created at database"
)