Skip to content

Commit

Permalink
Fix coverage tests on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Feb 3, 2024
1 parent a147956 commit b2f3587
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
5 changes: 0 additions & 5 deletions .config/ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,4 @@ python -m pip install --upgrade pip setuptools wheel --ignore-installed
python -m pip install -U tox --ignore-installed

# Dump Environment (so that we can check PATH, UT_FLAGS, etc.)
openssl version
if [ "$OSTYPE" = "linux-gnu" ]
then
smbclient -V
fi
set
20 changes: 16 additions & 4 deletions .config/ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ./test.sh 3.7 both
# ./test.sh 3.9 non_root

if [ "$OSTYPE" = "linux-gnu" ] || [ "$TRAVIS_OS_NAME" = "linux" ]
if [ "$OSTYPE" = "linux-gnu" ]
then
# Linux
OSTOX="linux"
Expand All @@ -18,13 +18,13 @@ then
sudo modprobe -n -v vcan
if [[ $? -ne 0 ]]
then
# The vcan module is currently unavailable on Travis-CI xenial builds
# The vcan module is currently unavailable on xenial builds
UT_FLAGS+=" -K vcan_socket"
fi
else
UT_FLAGS+=" -K vcan_socket"
fi
elif [[ "$OSTYPE" = "darwin"* ]] || [ "$TRAVIS_OS_NAME" = "osx" ] || [[ "$OSTYPE" = "FreeBSD" ]] || [[ "$OSTYPE" = *"bsd"* ]]
elif [[ "$OSTYPE" = "darwin"* ]] || [[ "$OSTYPE" = "FreeBSD" ]] || [[ "$OSTYPE" = *"bsd"* ]]
then
OSTOX="bsd"
# Travis CI in macOS 10.13+ can't load kexts. Need this for tuntaposx.
Expand Down Expand Up @@ -57,6 +57,11 @@ then
export DISABLE_COVERAGE=" "
fi

# macos -k scanner has glitchy coverage. skip it
if [ "$OSTOX" = "bsd" ] && [[ "$UT_FLAGS" = *"-k scanner"* ]]; then
export DISABLE_COVERAGE=" "
fi

# libpcap
if [[ ! -z "$SCAPY_USE_LIBPCAP" ]]; then
UT_FLAGS+=" -K veth"
Expand Down Expand Up @@ -98,11 +103,18 @@ fi
# Configure OpenSSL
export OPENSSL_CONF=$(${PYTHON:=python} `dirname $BASH_SOURCE`/openssl.py)

# Dump vars (the others were already dumped in install.sh)
# Dump vars (environment is already entirely dumped in install.sh)
echo OSTOX=$OSTOX
echo UT_FLAGS=$UT_FLAGS
echo TOXENV=$TOXENV
echo OPENSSL_CONF=$OPENSSL_CONF
echo OPENSSL_VER=$(openssl version)
echo COVERAGE=$([ -z "$DISABLE_COVERAGE" ] && echo "enabled" || echo "disabled")

if [ "$OSTYPE" = "linux-gnu" ]
then
echo SMBCLIENT=$(smbclient -V)
fi

# Launch Scapy unit tests
TOX_PARALLEL_NO_SPINNER=1 tox -- ${UT_FLAGS} || exit 1
Expand Down

0 comments on commit b2f3587

Please sign in to comment.