Skip to content

Commit

Permalink
Travis CI improvements (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
guedou authored and p-l- committed Aug 12, 2016
1 parent 02ae08b commit 5b5bd11
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ matrix:
- os: osx
language: generic
env:
- SCAPY_USE_PCAPDNET=true
- SCAPY_USE_PCAPDNET=yes

# Run as root
- os: linux
Expand All @@ -29,13 +29,13 @@ matrix:
python: 2.7
env:
- TRAVIS_SUDO=sudo
- SCAPY_USE_PCAPDNET=true
- SCAPY_USE_PCAPDNET=yes

- os: osx
language: generic
env:
- TRAVIS_SUDO=sudo
- SCAPY_USE_PCAPDNET=true
- SCAPY_USE_PCAPDNET=yes

install: bash .travis/install.sh

Expand Down
2 changes: 1 addition & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ ! -z $SCAPY_USE_PCAPDNET ]
then
if [ "$TRAVIS_OS_NAME" = "linux" ]
then
$TRAVIS_SUDO apt-get install python-pcapy python-dumbnet
$TRAVIS_SUDO apt-get install python-libpcap python-dumbnet
elif [ "$TRAVIS_OS_NAME" = "osx" ]
then
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages
Expand Down
9 changes: 6 additions & 3 deletions .travis/test.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
# Dump Scapy config
python -c "from scapy.all import *; print conf"

# Don't run tests that requires root privileges
if [ -z $TRAVIS_SUDO ]
then
UT_FLAGS="-K netaccess"
fi

# Run unit tests
# Run unit tests
cd test/

for f in *.uts
do
$TRAVIS_SUDO ./run_tests -q -F -t $f $UT_FLAGS || exit $?
$TRAVIS_SUDO ./run_tests -f text -t $f $UT_FLAGS || exit $?
done

for f in ../scapy/contrib/*.uts
do
$TRAVIS_SUDO ./run_tests -q -F -t $f $UT_FLAGS -P "load_contrib('$(basename ${f/.uts})')" || exit $?
$TRAVIS_SUDO ./run_tests -f text -t $f $UT_FLAGS -P "load_contrib('$(basename ${f/.uts})')" || exit $?
done

0 comments on commit 5b5bd11

Please sign in to comment.