add UDP tests

This commit is contained in:
clowwindy 2014-07-11 17:35:47 +08:00
parent d97e351b88
commit 130cf8fe35
4 changed files with 36 additions and 5 deletions

View file

@ -3,10 +3,14 @@ python:
- 2.6
- 2.7
- pypy
cache:
directories:
- dante-1.4.0
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq build-essential libssl-dev swig python-m2crypto python-numpy
- pip install m2crypto salsa20
- sudo tests/socksify/install.sh
script:
- python test.py -c tests/table.json
- python test.py -c tests/aes.json

22
test.py
View file

@ -38,15 +38,27 @@ try:
if local_ready and server_ready and p3 is None:
time.sleep(1)
p3 = Popen(['curl', 'http://www.example.com/', '-v', '-L',
'--socks5-hostname', '127.0.0.1:1081'], close_fds=True)
break
p3 = Popen(['curl', 'http://www.example.com/', '-v', '-L',
'--socks5-hostname', '127.0.0.1:1081'], close_fds=True)
if p3 is not None:
r = p3.wait()
if r == 0:
print 'test passed'
sys.exit(r)
if r != 0:
sys.exit(r)
else:
sys.exit(1)
p4 = Popen(['socksify', 'dig', '@8.8.8.8', 'www.google.com'],
close_fds=True)
if p4 is not None:
r = p4.wait()
if r != 0:
sys.exit(r)
else:
sys.exit(1)
print 'test passed'
finally:
for p in [p1, p2]:

10
tests/socksify/install.sh Executable file
View file

@ -0,0 +1,10 @@
#!/bin/bash
if [ ! -d dante-1.4.0 ]; then
wget http://www.inet.no/dante/files/dante-1.4.0.tar.gz || exit 1
tar xf dante-1.4.0.tar.gz || exit 1
fi
pushd dante-1.4.0
./configure && make && make install || exit 1
popd
cp tests/socksify/socks.conf /etc/ || exit 1

View file

@ -0,0 +1,5 @@
route {
from: 0.0.0.0/0 to: 0.0.0.0/0 via: 127.0.0.1 port = 1081
proxyprotocol: socks_v5
method: none
}