diff --git a/doc/vagrant_ci/Vagrantfile b/doc/vagrant_ci/Vagrantfile index 59282054a..0ba833fd4 100644 --- a/doc/vagrant_ci/Vagrantfile +++ b/doc/vagrant_ci/Vagrantfile @@ -19,7 +19,7 @@ Vagrant.configure("2") do |config| end config.vm.define "freebsd" do |bsd| - bsd.vm.box = "freebsd/FreeBSD-13.1-RELEASE" + bsd.vm.box = "freebsd/FreeBSD-14.0-RELEASE" bsd.vm.provision "shell", path: "provision_freebsd.sh" end diff --git a/doc/vagrant_ci/provision_freebsd.sh b/doc/vagrant_ci/provision_freebsd.sh index 3077d0184..56a9b9220 100644 --- a/doc/vagrant_ci/provision_freebsd.sh +++ b/doc/vagrant_ci/provision_freebsd.sh @@ -5,7 +5,7 @@ # See https://scapy.net/ for more information # Copyright (C) Philippe Biondi -PACKAGES="git python2 python39 py39-virtualenv py39-pip py27-sqlite3 py39-sqlite3 bash rust sudo" +PACKAGES="git python39 python311 py39-virtualenv py39-pip py39-sqlite3 py311-sqlite3 bash rust sudo" pkg update pkg install --yes $PACKAGES diff --git a/scapy/data.py b/scapy/data.py index 4d951d2c7..c1d3ac22c 100644 --- a/scapy/data.py +++ b/scapy/data.py @@ -319,7 +319,7 @@ def scapy_data_cache(name): "Couldn't load cache from %s" % str(cachepath), exc_info=True, ) - cachepath.unlink() + cachepath.unlink(missing_ok=True) # Cache does not exist or is invalid. content = func(filename) data = { diff --git a/test/configs/bsd.utsc b/test/configs/bsd.utsc index b437cc715..912a4f7c2 100644 --- a/test/configs/bsd.utsc +++ b/test/configs/bsd.utsc @@ -17,7 +17,8 @@ "test/contrib/automotive/ecu_am.uts", "test/contrib/automotive/gm/gmlanutils.uts", "test/contrib/isotp_packet.uts", - "test/contrib/isotpscan.uts" + "test/contrib/isotpscan.uts", + "test/contrib/isotp_soft_socket.uts" ], "onlyfailed": true, "preexec": { diff --git a/test/imports.uts b/test/imports.uts index a9dca268a..ad6ca8359 100644 --- a/test/imports.uts +++ b/test/imports.uts @@ -12,7 +12,7 @@ import subprocess import re import time import sys -from scapy.consts import WINDOWS +from scapy.consts import WINDOWS, OPENBSD # DEV: to add your file to this list, make sure you have # a GREAT reason. @@ -47,7 +47,7 @@ ALL_FILES = [ x.split(".")[1] not in EXCEPTION_PACKAGES ] -NB_PROC = 1 if WINDOWS else 4 +NB_PROC = 1 if WINDOWS or OPENBSD else 4 def append_processes(processes, filename): processes.append( diff --git a/test/regression.uts b/test/regression.uts index fa71faef4..64791fbd7 100644 --- a/test/regression.uts +++ b/test/regression.uts @@ -1684,10 +1684,11 @@ assert country == 'US' def _test(): with no_debug_dissector(): x = sr1(IP(dst="www.google.com")/ICMP(),timeout=3) + assert x is not None x assert x[IP].ottl() in [32, 64, 128, 255] assert 0 <= x[IP].hops() <= 126 - x is not None and ICMP in x and x[ICMP].type == 0 + assert ICMP in x and x[ICMP].type == 0 retry_test(_test) @@ -1996,7 +1997,8 @@ retry_test(_test) ~ netaccess needs_root tcpdump * Let's test traceroute def _test(): - ans, unans = traceroute("www.slashdot.org") + with no_debug_dissector(): + ans, unans = traceroute("www.slashdot.org") ans.nsummary() s,r=ans[0] s.show() diff --git a/tox.ini b/tox.ini index fd9968058..ab08759e2 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ # minversion = 4.0 skip_missing_interpreters = true # envlist = default when doing 'tox' -envlist = py{37,38,39,310,311,312}-{linux,bsd,windows}-non_root +envlist = py{37,38,39,310,311,312}-{linux,bsd,windows}-{non_root,root} # Main tests @@ -41,7 +41,7 @@ deps = mock zstandard ; sys_platform != 'win32' platform = linux: linux - bsd: darwin|freebsd|openbsd|netbsd + bsd: (darwin|freebsd|openbsd|netbsd).* windows: win32 commands = linux-non_root: {envpython} {env:DISABLE_COVERAGE:-m coverage run} -m scapy.tools.UTscapy -c ./test/configs/linux.utsc -N {posargs}