diff --git a/test/vpp_vxlan_tunnel.py b/test/vpp_vxlan_tunnel.py
index d7e087d..8c993b0 100644
--- a/test/vpp_vxlan_tunnel.py
+++ b/test/vpp_vxlan_tunnel.py
@@ -2,7 +2,7 @@
 from vpp_papi import VppEnum
 
 
-INDEX_INVALID = 0xffffffff
+INDEX_INVALID = 0xFFFFFFFF
 DEFAULT_PORT = 4789
 UNDEFINED_PORT = 0
 
@@ -19,11 +19,13 @@
         dst_port = d_port
 
     for t in ts:
-        if src == str(t.src_address) and \
-           dst == str(t.dst_address) and \
-           src_port == t.src_port and \
-           dst_port == t.dst_port and \
-           t.vni == vni:
+        if (
+            src == str(t.src_address)
+            and dst == str(t.dst_address)
+            and src_port == t.src_port
+            and dst_port == t.dst_port
+            and t.vni == vni
+        ):
             return t.sw_if_index
     return INDEX_INVALID
 
@@ -33,13 +35,22 @@
     VPP VXLAN interface
     """
 
-    def __init__(self, test, src, dst, vni,
-                 src_port=UNDEFINED_PORT, dst_port=UNDEFINED_PORT,
-                 mcast_itf=None,
-                 mcast_sw_if_index=INDEX_INVALID,
-                 decap_next_index=INDEX_INVALID,
-                 encap_vrf_id=None, instance=0xffffffff, is_l3=False):
-        """ Create VXLAN Tunnel interface """
+    def __init__(
+        self,
+        test,
+        src,
+        dst,
+        vni,
+        src_port=UNDEFINED_PORT,
+        dst_port=UNDEFINED_PORT,
+        mcast_itf=None,
+        mcast_sw_if_index=INDEX_INVALID,
+        decap_next_index=INDEX_INVALID,
+        encap_vrf_id=None,
+        instance=0xFFFFFFFF,
+        is_l3=False,
+    ):
+        """Create VXLAN Tunnel interface"""
         super(VppVxlanTunnel, self).__init__(test)
         self.src = src
         self.dst = dst
@@ -53,35 +64,44 @@
         self.instance = instance
         self.is_l3 = is_l3
 
-        if (self.mcast_itf):
+        if self.mcast_itf:
             self.mcast_sw_if_index = self.mcast_itf.sw_if_index
 
     def add_vpp_config(self):
         reply = self.test.vapi.vxlan_add_del_tunnel_v3(
-            is_add=1, src_address=self.src, dst_address=self.dst, vni=self.vni,
-            src_port=self.src_port, dst_port=self.dst_port,
+            is_add=1,
+            src_address=self.src,
+            dst_address=self.dst,
+            vni=self.vni,
+            src_port=self.src_port,
+            dst_port=self.dst_port,
             mcast_sw_if_index=self.mcast_sw_if_index,
-            encap_vrf_id=self.encap_vrf_id, is_l3=self.is_l3,
-            instance=self.instance, decap_next_index=self.decap_next_index)
+            encap_vrf_id=self.encap_vrf_id,
+            is_l3=self.is_l3,
+            instance=self.instance,
+            decap_next_index=self.decap_next_index,
+        )
         self.set_sw_if_index(reply.sw_if_index)
         self._test.registry.register(self, self._test.logger)
 
     def remove_vpp_config(self):
         self.test.vapi.vxlan_add_del_tunnel_v2(
-            is_add=0, src_address=self.src, dst_address=self.dst, vni=self.vni,
-            src_port=self.src_port, dst_port=self.dst_port,
+            is_add=0,
+            src_address=self.src,
+            dst_address=self.dst,
+            vni=self.vni,
+            src_port=self.src_port,
+            dst_port=self.dst_port,
             mcast_sw_if_index=self.mcast_sw_if_index,
-            encap_vrf_id=self.encap_vrf_id, instance=self.instance,
-            decap_next_index=self.decap_next_index)
+            encap_vrf_id=self.encap_vrf_id,
+            instance=self.instance,
+            decap_next_index=self.decap_next_index,
+        )
 
     def query_vpp_config(self):
-        return (INDEX_INVALID != find_vxlan_tunnel(self._test,
-                                                   self.src,
-                                                   self.dst,
-                                                   self.src_port,
-                                                   self.dst_port,
-                                                   self.vni))
+        return INDEX_INVALID != find_vxlan_tunnel(
+            self._test, self.src, self.dst, self.src_port, self.dst_port, self.vni
+        )
 
     def object_id(self):
-        return "vxlan-%d-%d-%s-%s" % (self.sw_if_index, self.vni,
-                                      self.src, self.dst)
+        return "vxlan-%d-%d-%s-%s" % (self.sw_if_index, self.vni, self.src, self.dst)
