Browse Source

add UDP tests

auth
clowwindy 11 years ago
parent
commit
130cf8fe35
  1. 4
      .travis.yml
  2. 22
      test.py
  3. 10
      tests/socksify/install.sh
  4. 5
      tests/socksify/socks.conf

4
.travis.yml

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

22
test.py

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

10
tests/socksify/install.sh

@ -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

5
tests/socksify/socks.conf

@ -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
}
Loading…
Cancel
Save