diff --git a/.travis.yml b/.travis.yml index dabbb80..6543a4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/test.py b/test.py index a05afb5..4ee04a0 100755 --- a/test.py +++ b/test.py @@ -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]: diff --git a/tests/socksify/install.sh b/tests/socksify/install.sh new file mode 100755 index 0000000..1927d76 --- /dev/null +++ b/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 diff --git a/tests/socksify/socks.conf b/tests/socksify/socks.conf new file mode 100644 index 0000000..13db772 --- /dev/null +++ b/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 +} \ No newline at end of file