Skip to content
Snippets Groups Projects
Commit b1b741c5 authored by Pierre LALET's avatar Pierre LALET
Browse files

Tests: introduce "crypto" keyword

Pypy won't run crypto tests on Travis CI because the cryptography
module cannot be installed with the Pypy version used.
parent 164cdd5c
No related branches found
No related tags found
No related merge requests found
...@@ -9,25 +9,7 @@ then ...@@ -9,25 +9,7 @@ then
fi fi
if python --version 2>&1 | grep -q PyPy; then if python --version 2>&1 | grep -q PyPy; then
wget https://pypi.python.org/packages/82/f7/d6dfd7595910a20a563a83a762bf79a253c4df71759c3b228accb3d7e5e4/cryptography-1.7.1.tar.gz # cryptography requires PyPy >= 2.6, Travis CI uses 2.5.0
tar zxf cryptography-1.7.1.tar.gz
cd cryptography-1.7.1
patch << EOF
--- setup.py
+++ setup.py
@@ -47,7 +47,7 @@ if sys.version_info < (3, 4):
if sys.version_info < (3, 3):
requirements.append("ipaddress")
-if platform.python_implementation() == "PyPy":
+if False:
if sys.pypy_version_info < (2, 6):
raise RuntimeError(
"cryptography 1.0 is not compatible with PyPy < 2.6. Please "
EOF
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS .
cd ../
rm -rf cryptography-*
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS ecdsa mock $SCAPY_SUDO pip install $PIP_INSTALL_FLAGS ecdsa mock
else else
$SCAPY_SUDO pip install $PIP_INSTALL_FLAGS cryptography ecdsa mock $SCAPY_SUDO pip install $PIP_INSTALL_FLAGS cryptography ecdsa mock
......
...@@ -26,8 +26,8 @@ fi ...@@ -26,8 +26,8 @@ fi
if python --version 2>&1 | grep -q PyPy if python --version 2>&1 | grep -q PyPy
then then
TRAVIS_PYPY="yes" # cryptography requires PyPy >= 2.6, Travis CI uses 2.5.0
UT_FLAGS+=" -K wep " UT_FLAGS+=" -K crypto "
fi fi
# Set PATH # Set PATH
...@@ -75,11 +75,6 @@ do ...@@ -75,11 +75,6 @@ do
then then
continue continue
fi fi
if [ "$f" = "cert.uts" -o "$f" = "ipsec.uts" ] && [ "$TRAVIS_PYPY" = "yes" ]
then
# currently disabled
continue
fi
$SCAPY_SUDO ./run_tests -q -F -t $f $UT_FLAGS || exit $? $SCAPY_SUDO ./run_tests -q -F -t $f $UT_FLAGS || exit $?
done done
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Try me with: # Try me with:
# bash test/run_tests -t test/cert.uts -F # bash test/run_tests -t test/cert.uts -F
~ crypto
########### PKCS helpers ############################################### ########### PKCS helpers ###############################################
......
...@@ -2,11 +2,14 @@ ...@@ -2,11 +2,14 @@
% IPSec layer regression tests % IPSec layer regression tests
############################## ##############################
~ crypto
############################################################################### ###############################################################################
+ IPv4 / ESP - Transport - Encryption Algorithms + IPv4 / ESP - Transport - Encryption Algorithms
####################################### #######################################
= IPv4 / ESP - Transport - NULL - NULL = IPv4 / ESP - Transport - NULL - NULL
~ -crypto
import socket import socket
...@@ -237,6 +240,7 @@ assert(d[TCP] == p[TCP]) ...@@ -237,6 +240,7 @@ assert(d[TCP] == p[TCP])
####################################### #######################################
= IPv4 / ESP - Tunnel - NULL - NULL = IPv4 / ESP - Tunnel - NULL - NULL
~ -crypto
p = IP(src='1.1.1.1', dst='2.2.2.2') p = IP(src='1.1.1.1', dst='2.2.2.2')
p /= TCP(sport=45012, dport=80) p /= TCP(sport=45012, dport=80)
...@@ -2425,6 +2429,7 @@ except IPSecIntegrityError, err: ...@@ -2425,6 +2429,7 @@ except IPSecIntegrityError, err:
####################################### #######################################
= IPv6 / ESP - Transport - NULL - NULL = IPv6 / ESP - Transport - NULL - NULL
~ -crypto
p = IPv6(src='11::22', dst='22::11') p = IPv6(src='11::22', dst='22::11')
p /= TCP(sport=45012, dport=80) p /= TCP(sport=45012, dport=80)
...@@ -2752,6 +2757,7 @@ except IPSecIntegrityError, err: ...@@ -2752,6 +2757,7 @@ except IPSecIntegrityError, err:
####################################### #######################################
= IPv6 / ESP - Tunnel - NULL - NULL = IPv6 / ESP - Tunnel - NULL - NULL
~ -crypto
p = IPv6(src='11::22', dst='22::11') p = IPv6(src='11::22', dst='22::11')
p /= TCP(sport=45012, dport=80) p /= TCP(sport=45012, dport=80)
......
...@@ -580,7 +580,7 @@ assert(len(y[TFTP_Options].options) == 2 and y[TFTP_Option].oname == "blksize") ...@@ -580,7 +580,7 @@ assert(len(y[TFTP_Options].options) == 2 and y[TFTP_Option].oname == "blksize")
= WEP tests = WEP tests
~ wifi wep Dot11 LLC SNAP IP TCP ~ wifi crypto Dot11 LLC SNAP IP TCP
conf.wepkey = "Fobar" conf.wepkey = "Fobar"
str(Dot11WEP()/LLC()/SNAP()/IP()/TCP(seq=12345678)) str(Dot11WEP()/LLC()/SNAP()/IP()/TCP(seq=12345678))
assert(_ == '\x00\x00\x00\x00\xe3OjYLw\xc3x_%\xd0\xcf\xdeu-\xc3pH#\x1eK\xae\xf5\xde\xe7\xb8\x1d,\xa1\xfe\xe83\xca\xe1\xfe\xbd\xfe\xec\x00)T`\xde.\x93Td\x95C\x0f\x07\xdd') assert(_ == '\x00\x00\x00\x00\xe3OjYLw\xc3x_%\xd0\xcf\xdeu-\xc3pH#\x1eK\xae\xf5\xde\xe7\xb8\x1d,\xa1\xfe\xe83\xca\xe1\xfe\xbd\xfe\xec\x00)T`\xde.\x93Td\x95C\x0f\x07\xdd')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment