Add unit tests for OpenstackNetworkingUtil.

Change-Id: I86f573564bcc16df69e0b69ff623c68101b399d1
diff --git a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
index 1338587..9ece612 100644
--- a/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
+++ b/apps/openstacknetworking/app/src/main/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtil.java
@@ -72,7 +72,7 @@
  */
 public final class OpenstackNetworkingUtil {
 
-    protected static final Logger log = LoggerFactory.getLogger(OpenstackNetworkingUtil.class);
+    private static final Logger log = LoggerFactory.getLogger(OpenstackNetworkingUtil.class);
 
     private static final int HEX_RADIX = 16;
     private static final String ZERO_FUNCTION_NUMBER = "0";
@@ -132,7 +132,8 @@
                     .writeValueAsString(entity);
             log.trace(strModelEntity);
             return (ObjectNode) mapper.readTree(strModelEntity.getBytes());
-        } catch (Exception e) {
+        } catch (IOException e) {
+            log.error("IOException occurred because of {}", e.toString());
             throw new IllegalStateException();
         }
     }
@@ -146,16 +147,21 @@
      */
     public static NetFloatingIP associatedFloatingIp(InstancePort port,
                                                      Set<NetFloatingIP> fips) {
-        for (NetFloatingIP fip : fips) {
-            if (Strings.isNullOrEmpty(fip.getFixedIpAddress())) {
-                continue;
+        try {
+            for (NetFloatingIP fip : fips) {
+                if (Strings.isNullOrEmpty(fip.getFixedIpAddress())) {
+                    continue;
+                }
+                if (Strings.isNullOrEmpty(fip.getFloatingIpAddress())) {
+                    continue;
+                }
+                if (fip.getFixedIpAddress().equals(port.ipAddress().toString())) {
+                    return fip;
+                }
             }
-            if (Strings.isNullOrEmpty(fip.getFloatingIpAddress())) {
-                continue;
-            }
-            if (fip.getFixedIpAddress().equals(port.ipAddress().toString())) {
-                return fip;
-            }
+        } catch (NullPointerException e) {
+            log.error("Exception occurred because of {}", e.toString());
+            throw new NullPointerException();
         }
         return null;
     }
@@ -284,12 +290,14 @@
      */
     public static String getIntfNameFromPciAddress(Port port) {
 
-        if (port.getProfile() == null) {
+
+        if (port.getProfile() == null || port.getProfile().isEmpty()) {
             log.error("Port profile is not found");
             return null;
         }
 
-        if (port.getProfile() != null && port.getProfile().get(PCISLOT) == null) {
+        if (!port.getProfile().containsKey(PCISLOT) ||
+                Strings.isNullOrEmpty(port.getProfile().get(PCISLOT).toString())) {
             log.error("Failed to retrieve the interface name because of no pci_slot information from the port");
             return null;
         }
@@ -311,8 +319,9 @@
 
         String vendorInfoForPort = String.valueOf(port.getProfile().get(PCI_VENDOR_INFO));
 
-        if (vendorInfoForPort == null) {
-            log.error("Failed to retrieve the interface name because of no pci vendor information from the port");
+        if (!portNamePrefixMap().containsKey(vendorInfoForPort)) {
+            log.error("Failed to retrieve the interface name because of no port name prefix for vendor ID {}",
+                    vendorInfoForPort);
             return null;
         }
         String portNamePrefix = portNamePrefixMap().get(vendorInfoForPort);
diff --git a/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtilTest.java b/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtilTest.java
index 41252b1..270fbd6 100644
--- a/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtilTest.java
+++ b/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/util/OpenstackNetworkingUtilTest.java
@@ -26,13 +26,21 @@
 import org.junit.Test;
 import org.onlab.packet.Ip4Address;
 import org.onlab.packet.IpAddress;
+import org.onlab.packet.MacAddress;
 import org.onosproject.net.Device;
 import org.onosproject.net.DeviceId;
+import org.onosproject.net.PortNumber;
+import org.onosproject.openstacknetworking.api.InstancePort;
+import org.onosproject.openstacknetworking.impl.DefaultInstancePort;
+import org.onosproject.openstacknetworking.web.OpenstackFloatingIpWebResourceTest;
+import org.onosproject.openstacknetworking.web.OpenstackNetworkWebResourceTest;
 import org.onosproject.openstacknode.api.NodeState;
 import org.onosproject.openstacknode.api.OpenstackNode;
 import org.onosproject.openstacknode.api.OpenstackNodeTest;
 import org.openstack4j.model.network.NetFloatingIP;
+import org.openstack4j.model.network.Port;
 import org.openstack4j.openstack.networking.domain.NeutronFloatingIP;
+import org.openstack4j.openstack.networking.domain.NeutronPort;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -41,18 +49,71 @@
 import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.onosproject.openstacknetworking.util.OpenstackNetworkingUtil.getGwByComputeDevId;
 
 public final class OpenstackNetworkingUtilTest {
 
-    private NetFloatingIP floatingIp;
+    private NetFloatingIP floatingIp1;
+    private NetFloatingIP floatingIp2;
+    private NetFloatingIP floatingIp3;
+    private Port openstackPort;
+    private Port openstackSriovPort1;
+    private Port openstackSriovPort2;
+    private Port openstackSriovPort3;
+    private InstancePort instancePort1;
+    private InstancePort instancePort2;
+    private InstancePort instancePort3;
 
     @Before
     public void setUp() {
-        floatingIp = NeutronFloatingIP.builder()
-                .floatingNetworkId("floatingNetworkingId")
-                .portId("portId")
+
+        instancePort1 = DefaultInstancePort.builder()
+                .networkId("net-id-1")
+                .portId("ce705c24-c1ef-408a-bda3-7bbd946164ab")
+                .deviceId(DeviceId.deviceId("of:000000000000000a"))
+                .portNumber(PortNumber.portNumber(1, "tap-1"))
+                .ipAddress(IpAddress.valueOf("10.0.0.3"))
+                .macAddress(MacAddress.valueOf("11:22:33:44:55:66"))
+                .state(InstancePort.State.valueOf("ACTIVE"))
                 .build();
+
+        instancePort2 = DefaultInstancePort.builder()
+                .networkId("net-id-2")
+                .portId("port-id-2")
+                .deviceId(DeviceId.deviceId("of:000000000000000b"))
+                .portNumber(PortNumber.portNumber(2, "tap-2"))
+                .ipAddress(IpAddress.valueOf("10.10.10.2"))
+                .macAddress(MacAddress.valueOf("22:33:44:55:66:11"))
+                .state(InstancePort.State.valueOf("ACTIVE"))
+                .build();
+
+        instancePort3 = DefaultInstancePort.builder()
+                .networkId("net-id-3")
+                .portId("port-id-3")
+                .deviceId(DeviceId.deviceId("of:000000000000000c"))
+                .oldDeviceId(DeviceId.deviceId("of:000000000000000d"))
+                .oldPortNumber(PortNumber.portNumber(4, "tap-4"))
+                .portNumber(PortNumber.portNumber(3, "tap-3"))
+                .ipAddress(IpAddress.valueOf("10.10.10.3"))
+                .macAddress(MacAddress.valueOf("33:44:55:66:11:22"))
+                .state(InstancePort.State.valueOf("ACTIVE"))
+                .build();
+
+        InputStream floatingIpjsonStream1 = OpenstackFloatingIpWebResourceTest.class
+                .getResourceAsStream("openstack-floatingip1.json");
+        InputStream floatingIpjsonStream2 = OpenstackFloatingIpWebResourceTest.class
+                .getResourceAsStream("openstack-floatingip2.json");
+        InputStream floatingIpjsonStream3 = OpenstackFloatingIpWebResourceTest.class
+                .getResourceAsStream("openstack-floatingip3.json");
+
+        floatingIp1 = (NetFloatingIP)
+                OpenstackNetworkingUtil.jsonToModelEntity(floatingIpjsonStream1, NeutronFloatingIP.class);
+        floatingIp2 = (NetFloatingIP)
+                OpenstackNetworkingUtil.jsonToModelEntity(floatingIpjsonStream2, NeutronFloatingIP.class);
+        floatingIp3 = (NetFloatingIP)
+                OpenstackNetworkingUtil.jsonToModelEntity(floatingIpjsonStream3, NeutronFloatingIP.class);
+
     }
 
     @After
@@ -65,11 +126,47 @@
     @Test
     public void testFloatingIp() throws IOException {
         ObjectNode floatingIpNode =
-                OpenstackNetworkingUtil.modelEntityToJson(floatingIp, NeutronFloatingIP.class);
+                OpenstackNetworkingUtil.modelEntityToJson(floatingIp1, NeutronFloatingIP.class);
         InputStream is = IOUtils.toInputStream(floatingIpNode.toString(), StandardCharsets.UTF_8.name());
         NetFloatingIP floatingIp2 = (NetFloatingIP)
                 OpenstackNetworkingUtil.jsonToModelEntity(is, NeutronFloatingIP.class);
-        new EqualsTester().addEqualityGroup(floatingIp, floatingIp2).testEquals();
+        new EqualsTester().addEqualityGroup(floatingIp1, floatingIp2).testEquals();
+    }
+
+    /**
+     * Tests the associatedFloatingIp method.
+     * @throws NullPointerException
+     */
+    @Test
+    public void testAsscoatedFloatingIp() throws NullPointerException {
+        Set<NetFloatingIP> testSet = Sets.newHashSet();
+        testSet.add(floatingIp1);
+        testSet.add(floatingIp2);
+        testSet.add(floatingIp3);
+
+        NetFloatingIP floatingIp1 = OpenstackNetworkingUtil.associatedFloatingIp(instancePort1, testSet);
+        NetFloatingIP floatingIp2 = OpenstackNetworkingUtil.associatedFloatingIp(instancePort2, testSet);
+
+        assertEquals(floatingIp1, this.floatingIp1);
+        assertEquals(floatingIp2, null);
+    }
+
+    /**
+     * Tests the getGwByInstancePort method.
+     */
+    @Test
+    public void testGetGwByInstancePort() {
+
+        Set<OpenstackNode> gws = Sets.newConcurrentHashSet();
+        gws.add(genGateway(1));
+        gws.add(genGateway(2));
+        gws.add(genGateway(3));
+
+        int expectedGwIndex = 2;
+
+        OpenstackNode gw = OpenstackNetworkingUtil.getGwByInstancePort(gws, instancePort1);
+
+        assertEquals(genGateway(expectedGwIndex), gw);
     }
 
     /**
@@ -78,6 +175,10 @@
     @Test
     public void testGetGwByComputeDevId() {
         Set<OpenstackNode> gws = Sets.newConcurrentHashSet();
+
+        OpenstackNode nullGw = getGwByComputeDevId(gws, genDeviceId(1));
+        assertNull(nullGw);
+
         gws.add(genGateway(1));
         gws.add(genGateway(2));
         gws.add(genGateway(3));
@@ -106,6 +207,53 @@
         assertEquals(numOfDev, sum);
     }
 
+    /**
+     * Tests getIntfNameFromPciAddress method.
+     */
+    @Test
+    public void testGetIntfNameFromPciAddress() {
+
+        InputStream portJsonStream = OpenstackNetworkWebResourceTest.class
+                .getResourceAsStream("openstack-port.json");
+
+        InputStream sriovPortJsonStream1 = OpenstackNetworkWebResourceTest.class
+                .getResourceAsStream("openstack-port-sriov1.json");
+        InputStream sriovPortJsonStream2 = OpenstackNetworkWebResourceTest.class
+                .getResourceAsStream("openstack-port-sriov2.json");
+        InputStream sriovPortJsonStream3 = OpenstackNetworkWebResourceTest.class
+                .getResourceAsStream("openstack-port-sriov3.json");
+
+        openstackPort = (Port)
+                OpenstackNetworkingUtil.jsonToModelEntity(portJsonStream, NeutronPort.class);
+
+        openstackSriovPort1 = (Port)
+                OpenstackNetworkingUtil.jsonToModelEntity(sriovPortJsonStream1, NeutronPort.class);
+        openstackSriovPort2 = (Port)
+                OpenstackNetworkingUtil.jsonToModelEntity(sriovPortJsonStream2, NeutronPort.class);
+        openstackSriovPort3 = (Port)
+                OpenstackNetworkingUtil.jsonToModelEntity(sriovPortJsonStream3, NeutronPort.class);
+
+        String expectedIntfName1 = "enp5s8";
+        String expectedIntfName2 = "enp5s8f3";
+
+        assertNull(OpenstackNetworkingUtil.getIntfNameFromPciAddress(openstackPort));
+        assertEquals(expectedIntfName1, OpenstackNetworkingUtil.getIntfNameFromPciAddress(openstackSriovPort1));
+        assertEquals(expectedIntfName2, OpenstackNetworkingUtil.getIntfNameFromPciAddress(openstackSriovPort2));
+        assertNull(OpenstackNetworkingUtil.getIntfNameFromPciAddress(openstackSriovPort3));
+    }
+
+    /**
+     * tests swapStaleLocation method.
+     */
+    @Test
+    public void testSwapStaleLocation() {
+        InstancePort swappedInstancePort =  OpenstackNetworkingUtil.swapStaleLocation(instancePort3);
+
+        assertEquals(instancePort3.oldDeviceId(), swappedInstancePort.deviceId());
+        assertEquals(instancePort3.oldPortNumber(), swappedInstancePort.portNumber());
+
+    }
+
     private OpenstackNode genGateway(int index) {
 
         Device intgBrg = InternalOpenstackNodeTest.createDevice(index);
diff --git a/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/web/OpenstackFloatingIpWebResourceTest.java b/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/web/OpenstackFloatingIpWebResourceTest.java
index 3e98a5d..e786784 100644
--- a/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/web/OpenstackFloatingIpWebResourceTest.java
+++ b/apps/openstacknetworking/app/src/test/java/org/onosproject/openstacknetworking/web/OpenstackFloatingIpWebResourceTest.java
@@ -77,7 +77,7 @@
 
         final WebTarget wt = target();
         InputStream jsonStream = OpenstackFloatingIpWebResourceTest.class
-                .getResourceAsStream("openstack-floatingip.json");
+                .getResourceAsStream("openstack-floatingip1.json");
 
         Response response = wt.path(PATH).request(MediaType.APPLICATION_JSON_TYPE)
                 .post(Entity.json(jsonStream));
@@ -115,7 +115,7 @@
 
         final WebTarget wt = target();
         InputStream jsonStream = OpenstackFloatingIpWebResourceTest.class
-                .getResourceAsStream("openstack-floatingip.json");
+                .getResourceAsStream("openstack-floatingip1.json");
 
         Response response = wt.path(PATH).request(MediaType.APPLICATION_JSON_TYPE)
                 .post(Entity.json(jsonStream));
@@ -136,7 +136,7 @@
 
         final WebTarget wt = target();
         InputStream jsonStream = OpenstackFloatingIpWebResourceTest.class
-                .getResourceAsStream("openstack-floatingip.json");
+                .getResourceAsStream("openstack-floatingip1.json");
 
         Response response = wt.path(PATH + "/2f245a7b-796b-4f26-9cf9-9e82d248fda7")
                 .request(MediaType.APPLICATION_JSON_TYPE)
@@ -176,7 +176,7 @@
 
         final WebTarget wt = target();
         InputStream jsonStream = OpenstackFloatingIpWebResourceTest.class
-                .getResourceAsStream("openstack-floatingip.json");
+                .getResourceAsStream("openstack-floatingip1.json");
 
         Response response = wt.path(PATH + "/2f245a7b-796b-4f26-9cf9-9e82d248fda7")
                 .request(MediaType.APPLICATION_JSON_TYPE)
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip1.json
similarity index 100%
rename from apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip.json
rename to apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip1.json
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip2.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip2.json
new file mode 100644
index 0000000..d0cea26
--- /dev/null
+++ b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip2.json
@@ -0,0 +1,11 @@
+{
+  "floatingip": {
+    "id": "id2",
+    "router_id": "router_id2",
+    "tenant_id": "tenant_id2",
+    "floating_network_id": "floating_network_id2",
+    "floating_ip_address": "2.2.2.2",
+    "fixed_ip_address": "",
+    "port_id": "port_id2"
+  }
+}
\ No newline at end of file
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip3.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip3.json
new file mode 100644
index 0000000..708608f
--- /dev/null
+++ b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-floatingip3.json
@@ -0,0 +1,11 @@
+{
+  "floatingip": {
+    "id": "id3",
+    "router_id": "router_id3",
+    "tenant_id": "tenant_id3",
+    "floating_network_id": "floating_network_id3",
+    "floating_ip_address": "",
+    "fixed_ip_address": "3.3.3.3",
+    "port_id": "port_id3"
+  }
+}
\ No newline at end of file
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov1.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov1.json
new file mode 100644
index 0000000..87ec922
--- /dev/null
+++ b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov1.json
@@ -0,0 +1,39 @@
+{
+  "port": {
+    "id": "65c0ee9f-d634-4522-8954-51021b570b0d",
+    "admin_state_up": true,
+    "device_id": "1",
+    "device_owner": "compute:nova",
+    "fixed_ips": [
+      {
+        "ip_address": "10.0.0.2",
+        "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2"
+      }
+    ],
+    "allowed_address_pairs": [
+      {
+        "ip_address": "12.12.11.12",
+        "mac_address": "fa:14:2a:b3:cb:f0"
+      }
+    ],
+    "mac_address": "fa:16:3e:c9:cb:f0",
+    "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7",
+    "status": "ACTIVE",
+    "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa",
+    "security_groups": [
+      "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
+    ],
+    "extra_dhcp_opts": [
+      {
+        "opt_value": "pxelinux.0",
+        "opt_name": "bootfile-name"
+      }
+    ],
+    "port_security_enabled": true,
+    "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad",
+    "binding:vif_type": "unbound",
+    "binding:vif_details": {},
+    "binding:vnic_type": "other",
+    "binding:profile": {"pci_slot": "0000:05:08.0", "physical_network": "sriov_net", "pci_vendor_info": "177d:9712"}
+  }
+}
\ No newline at end of file
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov2.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov2.json
new file mode 100644
index 0000000..ac994db
--- /dev/null
+++ b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov2.json
@@ -0,0 +1,39 @@
+{
+  "port": {
+    "id": "65c0ee9f-d634-4522-8954-51021b570b0d",
+    "admin_state_up": true,
+    "device_id": "1",
+    "device_owner": "compute:nova",
+    "fixed_ips": [
+      {
+        "ip_address": "10.0.0.2",
+        "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2"
+      }
+    ],
+    "allowed_address_pairs": [
+      {
+        "ip_address": "12.12.11.12",
+        "mac_address": "fa:14:2a:b3:cb:f0"
+      }
+    ],
+    "mac_address": "fa:16:3e:c9:cb:f0",
+    "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7",
+    "status": "ACTIVE",
+    "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa",
+    "security_groups": [
+      "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
+    ],
+    "extra_dhcp_opts": [
+      {
+        "opt_value": "pxelinux.0",
+        "opt_name": "bootfile-name"
+      }
+    ],
+    "port_security_enabled": true,
+    "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad",
+    "binding:vif_type": "unbound",
+    "binding:vif_details": {},
+    "binding:vnic_type": "other",
+    "binding:profile": {"pci_slot": "0000:05:08.3", "physical_network": "sriov_net", "pci_vendor_info": "177d:9712"}
+  }
+}
\ No newline at end of file
diff --git a/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov3.json b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov3.json
new file mode 100644
index 0000000..9872cac
--- /dev/null
+++ b/apps/openstacknetworking/app/src/test/resources/org/onosproject/openstacknetworking/web/openstack-port-sriov3.json
@@ -0,0 +1,39 @@
+{
+  "port": {
+    "id": "65c0ee9f-d634-4522-8954-51021b570b0d",
+    "admin_state_up": true,
+    "device_id": "1",
+    "device_owner": "compute:nova",
+    "fixed_ips": [
+      {
+        "ip_address": "10.0.0.2",
+        "subnet_id": "a0304c3a-4f08-4c43-88af-d796509c97d2"
+      }
+    ],
+    "allowed_address_pairs": [
+      {
+        "ip_address": "12.12.11.12",
+        "mac_address": "fa:14:2a:b3:cb:f0"
+      }
+    ],
+    "mac_address": "fa:16:3e:c9:cb:f0",
+    "network_id": "a87cc70a-3e15-4acf-8205-9b711a3531b7",
+    "status": "ACTIVE",
+    "tenant_id": "d6700c0c9ffa4f1cb322cd4a1f3906fa",
+    "security_groups": [
+      "f0ac4394-7e4a-4409-9701-ba8be283dbc3"
+    ],
+    "extra_dhcp_opts": [
+      {
+        "opt_value": "pxelinux.0",
+        "opt_name": "bootfile-name"
+      }
+    ],
+    "port_security_enabled": true,
+    "binding:host_id": "4df8d9ff-6f6f-438f-90a1-ef660d4586ad",
+    "binding:vif_type": "unbound",
+    "binding:vif_details": {},
+    "binding:vnic_type": "other",
+    "binding:profile": {"pci_slot": "0000:05:08.3", "physical_network": "sriov_net", "pci_vendor_info": "aaaa:bbbb"}
+  }
+}
\ No newline at end of file
diff --git a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/util/OpenstackNodeUtil.java b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/util/OpenstackNodeUtil.java
index 095d2bc..fac184e 100644
--- a/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/util/OpenstackNodeUtil.java
+++ b/apps/openstacknode/app/src/main/java/org/onosproject/openstacknode/util/OpenstackNodeUtil.java
@@ -49,7 +49,7 @@
  * An utility that used in openstack node app.
  */
 public final class OpenstackNodeUtil {
-    protected static final Logger log = LoggerFactory.getLogger(OpenstackNodeUtil.class);
+    private static final Logger log = LoggerFactory.getLogger(OpenstackNodeUtil.class);
 
     // keystone endpoint related variables
     private static final String DOMAIN_DEFAULT = "default";