tests docs: update python3 venv packages

- Package update performed by
  1. updating pip, pip-tools, setuptools
  2. 'make test-refresh-deps' on ubuntu 22.04
  3. fixing 'make test' and 'make docs' issues
     on ubuntu 22.04
  4. 'make test-refresh-deps' on ubuntu 20.04
- Add dependency for 'make test-refresh-deps'
  to insure python venv is set up.
- Update of python formatter, black,
  caused reformating of 41 python code
  files.

Type: make

Change-Id: I7cafdf4b5189065ac57cb6b254937f6e0897a924
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
This commit is contained in:
Dave Wallace 2023-08-15 19:05:26 -04:00 committed by Andrew Yourtchenko
parent d826a60269
commit 7b8b465269
45 changed files with 583 additions and 471 deletions

View File

@ -251,7 +251,6 @@ class Siphon(object):
output."""
def process(self, out=None):
if out is None:
out = sys.stdout

View File

@ -19,7 +19,6 @@ import os
class SiphonCLICMD(process.Siphon):
name = "clicmd"
identifier = "VLIB_CLI_COMMAND"

View File

@ -18,7 +18,6 @@ from . import process, parsers
class SiphonSYSCFG(process.Siphon):
name = "syscfg"
identifier = "VLIB_CONFIG_FUNCTION"

View File

@ -69,7 +69,7 @@ master_doc = "index"
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "English"
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.

View File

@ -410,6 +410,7 @@ Golang
Goncalves
govpp
gpe
graphviz
gre
grep
grepping

View File

@ -1099,7 +1099,7 @@ class TestGBP(VppTestCase):
# adj-fibs due to the fact the the BVI address has /32 and
# the subnet is not attached.
#
for (ip, fip) in zip(ep.ips, ep.fips):
for ip, fip in zip(ep.ips, ep.fips):
# Add static mappings for each EP from the 10/8 to 11/8 network
if ip_address(ip).version == 4:
flags = self.nat_config_flags.NAT_IS_ADDR_ONLY

View File

@ -45,7 +45,6 @@ class Edge:
for start in startTokens:
for end in endTokens:
edge = Edge()
edge.Start = start

View File

@ -42,6 +42,7 @@ parser.add_argument(
)
args = parser.parse_args()
#
# Print domain
#

View File

@ -11,6 +11,7 @@ for dir in args.inputdir:
sys.path.append(dir)
from vpp_papi import *
#
# 1:1 Shared IPv4 address, shared BR (16) VPP CLI
#

View File

@ -25,6 +25,7 @@ parser = argparse.ArgumentParser(description="MAP VPP configuration generator")
parser.add_argument("-t", action="store", dest="mapmode")
args = parser.parse_args()
#
# 1:1 Shared IPv4 address, shared BR
#

View File

@ -24,7 +24,6 @@ class ContainerStartupError(Exception):
class Container(object):
tmp = "/tmp"
cmd = "vppctl -s 0:5002"
cmd_bash = "/bin/bash"
@ -69,7 +68,6 @@ class Container(object):
@classmethod
def new(cls, client, image, name):
temp = join(cls.tmp, name)
if isdir(temp):
rmtree(temp)
@ -241,7 +239,6 @@ class Containers(object):
self.image = image
def tmp_render(self, path, template, kwargs):
with open(path, "w") as fo:
fo.write(template.render(**kwargs))
@ -349,7 +346,6 @@ class Networks(object):
class Program(object):
image = "srv6m-image"
name_prefix = "hck"
@ -386,7 +382,6 @@ class Program(object):
return "{}-{}".format(self.name_prefix, name)
def stop_containers(self):
for name in self.instance_names:
instance = self.containers.get(self.get_name(name))
if instance:
@ -398,7 +393,6 @@ class Program(object):
network.rem()
def start_containers(self):
self.stop_containers()
networks = list()
@ -2457,7 +2451,6 @@ class Program(object):
p.show2()
def status_containers(self):
print("Instances:")
for i, name in enumerate(self.instance_names):
@ -2585,7 +2578,6 @@ def get_args():
def main(op=None, prefix=None, verbose=None, image=None, index=None, command=None):
if verbose:
basicConfig(level=verbose_levels[verbose])

View File

@ -24,7 +24,6 @@ def listy(points):
def plot_data(d):
plt.figure(1)
cwndx = listx(d["cwnd"])

View File

@ -123,7 +123,6 @@ class ToJSON:
)
)
else:
write(
' cJSON_AddStringToObject(o, "{n}", (char *)a->{n});\n'.format(
n=o.fieldname

View File

@ -14,5 +14,5 @@ import pkg_resources # part of setuptools
try:
__version__ = pkg_resources.get_distribution("vpp_papi").version
except (pkg_resources.DistributionNotFound):
except pkg_resources.DistributionNotFound:
"""Can't find vpp_papi via setuptools"""

View File

@ -53,7 +53,6 @@ class MACAddress:
return "%s(%s)" % (self.__class__.__name__, self.mac_string)
def __eq__(self, other):
if not isinstance(other, MACAddress):
try:
# if it looks like a mac address, we'll take it.

View File

@ -468,7 +468,6 @@ class TestAddType(unittest.TestCase):
self.assertEqual(nt.something, 200)
def test_abf(self):
fib_mpls_label = VPPType(
"vl_api_fib_mpls_label_t",
[["u8", "is_uniform"], ["u32", "label"], ["u8", "ttl"], ["u8", "exp"]],
@ -561,7 +560,6 @@ class TestAddType(unittest.TestCase):
)
def test_bier(self):
bier_table_id = VPPType(
"vl_api_bier_table_id_t",
[["u8", "bt_set"], ["u8", "bt_sub_domain"], ["u8", "bt_hdr_len_id"]],

View File

@ -183,7 +183,6 @@ class CStruct(Struct):
class CSimpleType(SimpleType):
swap_to_be_dict = {
"i16": "htobe16",
"u16": "htobe16",

View File

@ -74,10 +74,10 @@ V=0
endif
PYTHON_VERSION=$(shell $(PYTHON_INTERP) -c 'import sys; print(sys.version_info.major)')
PIP_VERSION=22.0.4
PIP_VERSION=23.2.1
# Keep in sync with requirements.txt
PIP_TOOLS_VERSION=6.6.0
PIP_SETUPTOOLS_VERSION=62.1.0
PIP_TOOLS_VERSION=7.3.0
PIP_SETUPTOOLS_VERSION=68.1.0
PYTHON_DEPENDS=requirements-$(PYTHON_VERSION).txt
SCAPY_SOURCE=$(shell find $(VENV_PATH)/lib/python* -name site-packages)
BUILD_COV_DIR=$(BR)/test-coverage
@ -131,7 +131,7 @@ $(PAPI_INSTALL_DONE): $(PIP_PATCH_DONE)
@touch $@
.PHONY: refresh-deps
refresh-deps: clean-deps $(PYTHON_DEPENDS)
refresh-deps: clean-deps $(PIP_INSTALL_DONE) $(PYTHON_DEPENDS)
.PHONY: clean-deps
clean-deps:

View File

@ -924,7 +924,7 @@ class VppTestCase(CPUInterface, unittest.TestCase):
@classmethod
def pg_start(cls, trace=True):
"""Enable the PG, wait till it is done, then clean up"""
for (intf, worker) in cls._old_pcaps:
for intf, worker in cls._old_pcaps:
intf.handle_old_pcap_file(intf.get_in_path(worker), intf.in_history_counter)
cls._old_pcaps = []
if trace:
@ -1204,7 +1204,6 @@ class VppTestCase(CPUInterface, unittest.TestCase):
@classmethod
def sleep(cls, timeout, remark=None):
# /* Allow sleep(0) to maintain win32 semantics, and as decreed
# * by Guido, only the main thread can be interrupted.
# */

View File

@ -22,7 +22,6 @@ class TestLbEmptyApi(asfframework.VppTestCase):
"""TestLbEmptyApi"""
def test_lb_empty_vip_dump(self):
# no records should normally return [], but
# lb initializes with a default VIP
rv = self.vapi.lb_vip_dump()
@ -30,7 +29,6 @@ class TestLbEmptyApi(asfframework.VppTestCase):
self.assertEqual(rv, [], "Expected: [] Received: %r." % rv)
def test_lb_empty_as_dump(self):
# no records should return []
rv = self.vapi.lb_as_dump()
# print(rv)

View File

@ -1002,7 +1002,7 @@ class VppTestCase(CPUInterface, unittest.TestCase):
@classmethod
def pg_start(cls, trace=True):
"""Enable the PG, wait till it is done, then clean up"""
for (intf, worker) in cls._old_pcaps:
for intf, worker in cls._old_pcaps:
intf.handle_old_pcap_file(intf.get_in_path(worker), intf.in_history_counter)
cls._old_pcaps = []
if trace:
@ -1435,7 +1435,6 @@ class VppTestCase(CPUInterface, unittest.TestCase):
@classmethod
def sleep(cls, timeout, remark=None):
# /* Allow sleep(0) to maintain win32 semantics, and as decreed
# * by Guido, only the main thread can be interrupted.
# */

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
pip-tools==6.6.0 # BSD Keep this in sync with Makefile's PIP_TOOLS_VERSION
pip-tools==7.3.0 # BSD Keep this in sync with Makefile's PIP_TOOLS_VERSION
cryptography!=2.0 # BSD/Apache-2.0
deprecation>=2.0.6 # Apache-2.0
faulthandler; python_version < '3.3' # # BSD License (2 clause)
@ -10,6 +10,7 @@ scapy==2.4.3; python_version >= '2.7' or python_version >= '3.4' # GPL2 http
six # MIT
syslog_rfc5424_parser>=0.3.1 # ISC
objgraph # MIT
pyparsing # MIT
pympler # Apache-2.0
sphinx # BSD
sphinxcontrib-spelling # BSD

View File

@ -51,6 +51,7 @@ pip_tools_version = "6.6.0"
# Compiled pip requirements file
pip_compiled_requirements_file = os.path.join(test_dir, "requirements-3.txt")
# Gracefully exit after executing cleanup scripts
# upon receiving a SIGINT or SIGTERM
def handler(signum, frame):

View File

@ -902,7 +902,6 @@ def parse_results(results):
if __name__ == "__main__":
print(f"Config is: {config}")
if config.sanity:

View File

@ -26,7 +26,6 @@ from os import popen
class IPsecIPv4Params:
addr_type = socket.AF_INET
addr_any = "0.0.0.0"
addr_bcast = "255.255.255.255"
@ -74,7 +73,6 @@ class IPsecIPv4Params:
class IPsecIPv6Params:
addr_type = socket.AF_INET6
addr_any = "0::0"
addr_bcast = "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"

View File

@ -470,7 +470,6 @@ class TestCNatTranslation(CnatCommonTestCase):
ctx.cnat_expect(self.pg0, src_pgi, sport, self.pg2, 0, 5000)
def _test_icmp(self):
#
# Testing ICMP
#

View File

@ -23,7 +23,6 @@ class TestGeneve(BridgeDomain, VppTestCase):
VppTestCase.__init__(self, *args)
def encapsulate(self, pkt, vni):
"""
Encapsulate the original payload frame by adding GENEVE header with its
UDP, IP and Ethernet fields

View File

@ -240,7 +240,6 @@ class TestGRE(VppTestCase):
def verify_tunneled_4o4(
self, src_if, capture, sent, tunnel_src, tunnel_dst, dscp=0, ecn=0
):
self.assertEqual(len(capture), len(sent))
tos = (dscp << 2) | ecn
@ -273,7 +272,6 @@ class TestGRE(VppTestCase):
def verify_tunneled_6o6(
self, src_if, capture, sent, tunnel_src, tunnel_dst, dscp=0, ecn=0
):
self.assertEqual(len(capture), len(sent))
tc = (dscp << 2) | ecn
@ -304,7 +302,6 @@ class TestGRE(VppTestCase):
raise
def verify_tunneled_4o6(self, src_if, capture, sent, tunnel_src, tunnel_dst):
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):
@ -333,7 +330,6 @@ class TestGRE(VppTestCase):
raise
def verify_tunneled_6o4(self, src_if, capture, sent, tunnel_src, tunnel_dst):
self.assertEqual(len(capture), len(sent))
for i in range(len(capture)):

View File

@ -38,7 +38,6 @@ class TestGtpuUDP(VppTestCase):
self.pg0.config_ip6()
def _check_udp_port_ip4(self, enabled=True):
pkt = (
Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
/ IP(src=self.pg0.remote_ip4, dst=self.pg0.local_ip4)
@ -58,7 +57,6 @@ class TestGtpuUDP(VppTestCase):
self.ip4_err = err
def _check_udp_port_ip6(self, enabled=True):
pkt = (
Ether(src=self.pg0.local_mac, dst=self.pg0.remote_mac)
/ IPv6(src=self.pg0.remote_ip6, dst=self.pg0.local_ip6)

Some files were not shown because too many files have changed in this diff Show More