tests: replace pycodestyle with black

Drop pycodestyle for code style checking in favor of black. Black is
much faster, stable PEP8 compliant code style checker offering also
automatic formatting. It aims to be very stable and produce smallest
diffs. It's used by many small and big projects.

Running checkstyle with black takes a few seconds with a terse output.
Thus, test-checkstyle-diff is no longer necessary.

Expand scope of checkstyle to all python files in the repo, replacing
test-checkstyle with checkstyle-python.

Also, fixstyle-python is now available for automatic style formatting.

Note: python virtualenv has been consolidated in test/Makefile,
test/requirements*.txt which will eventually be moved to a central
location.  This is required to simply the automated generation of
docker executor images in the CI.

Type: improvement
Change-Id: I022a326603485f58585e879ac0f697fceefbc9c8
Signed-off-by: Klement Sekera <klement.sekera@gmail.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
diff --git a/test/vpp_vxlan_gpe_tunnel.py b/test/vpp_vxlan_gpe_tunnel.py
index cff5e45..2826c29 100644
--- a/test/vpp_vxlan_gpe_tunnel.py
+++ b/test/vpp_vxlan_gpe_tunnel.py
@@ -2,7 +2,7 @@
 from vpp_papi import VppEnum
 
 
-INDEX_INVALID = 0xffffffff
+INDEX_INVALID = 0xFFFFFFFF
 DEFAULT_PORT = 4790
 UNDEFINED_PORT = 0
 
@@ -19,11 +19,13 @@
         dst_port = d_port
 
     for t in ts:
-        if src == str(t.local) and \
-           dst == str(t.remote) and \
-           src_port == t.local_port and \
-           dst_port == t.remote_port and \
-           t.vni == vni:
+        if (
+            src == str(t.local)
+            and dst == str(t.remote)
+            and src_port == t.local_port
+            and dst_port == t.remote_port
+            and t.vni == vni
+        ):
             return t.sw_if_index
     return INDEX_INVALID
 
@@ -33,12 +35,20 @@
     VPP VXLAN GPE interface
     """
 
-    def __init__(self, test, src_addr, dst_addr, vni,
-                 src_port=UNDEFINED_PORT, dst_port=UNDEFINED_PORT,
-                 mcast_sw_if_index=INDEX_INVALID,
-                 encap_vrf_id=None,
-                 decap_vrf_id=None, protocol=3):
-        """ Create VXLAN GPE Tunnel interface """
+    def __init__(
+        self,
+        test,
+        src_addr,
+        dst_addr,
+        vni,
+        src_port=UNDEFINED_PORT,
+        dst_port=UNDEFINED_PORT,
+        mcast_sw_if_index=INDEX_INVALID,
+        encap_vrf_id=None,
+        decap_vrf_id=None,
+        protocol=3,
+    ):
+        """Create VXLAN GPE Tunnel interface"""
         super(VppVxlanGpeTunnel, self).__init__(test)
         self.src = src_addr
         self.dst = dst_addr
@@ -52,32 +62,38 @@
 
     def add_vpp_config(self):
         reply = self.test.vapi.vxlan_gpe_add_del_tunnel_v2(
-            is_add=1, local=self.src, remote=self.dst, vni=self.vni,
-            local_port=self.src_port, remote_port=self.dst_port,
+            is_add=1,
+            local=self.src,
+            remote=self.dst,
+            vni=self.vni,
+            local_port=self.src_port,
+            remote_port=self.dst_port,
             mcast_sw_if_index=self.mcast_sw_if_index,
             encap_vrf_id=self.encap_vrf_id,
             decap_vrf_id=self.decap_vrf_id,
-            protocol=self.protocol)
+            protocol=self.protocol,
+        )
         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_gpe_add_del_tunnel_v2(
-            is_add=0, local=self.src, remote=self.dst, vni=self.vni,
-            local_port=self.src_port, remote_port=self.dst_port,
+            is_add=0,
+            local=self.src,
+            remote=self.dst,
+            vni=self.vni,
+            local_port=self.src_port,
+            remote_port=self.dst_port,
             mcast_sw_if_index=self.mcast_sw_if_index,
             encap_vrf_id=self.encap_vrf_id,
             decap_vrf_id=self.decap_vrf_id,
-            protocol=self.protocol)
+            protocol=self.protocol,
+        )
 
     def query_vpp_config(self):
-        return (INDEX_INVALID != find_vxlan_gpe_tunnel(self._test,
-                                                       self.src,
-                                                       self.dst,
-                                                       self.src_port,
-                                                       self.dst_port,
-                                                       self.vni))
+        return INDEX_INVALID != find_vxlan_gpe_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)