diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-11 13:21:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-10-11 13:21:42 -0400 |
commit | f308adf8382bc7e61ea05a172057260cf8be9a6b (patch) | |
tree | 7355c13e09fc0ee1a5b6d8b5e56f5343588eaa65 /src/test/ntor_ref.py | |
parent | 187398318ef9b8b66e0f19ef031a847e8824e1d1 (diff) | |
download | tor-f308adf8382bc7e61ea05a172057260cf8be9a6b.tar.gz tor-f308adf8382bc7e61ea05a172057260cf8be9a6b.zip |
When possible, run the ntor python integration tests too
Diffstat (limited to 'src/test/ntor_ref.py')
-rwxr-xr-x[-rw-r--r--] | src/test/ntor_ref.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/test/ntor_ref.py b/src/test/ntor_ref.py index ade468da7d..2a5f984609 100644..100755 --- a/src/test/ntor_ref.py +++ b/src/test/ntor_ref.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # Copyright 2012-2013, The Tor Project, Inc # See LICENSE for licensing information @@ -27,7 +28,13 @@ commands: """ import binascii -import curve25519 +try: + import curve25519 +except ImportError: + curve25519 = None + print "SKIPPING: No Python curve25519 module installed" + import sys + sys.exit(0) import hashlib import hmac import subprocess @@ -286,6 +293,7 @@ def demo(node_id="iToldYouAboutStairs.", server_key=PrivateKey()): assert len(skeys) == 72 assert len(ckeys) == 72 assert skeys == ckeys + print "OK" # ====================================================================== def timing(): @@ -368,13 +376,15 @@ def test_tor(): assert c_keys == s_keys assert len(c_keys) == 90 - print "We just interoperated." + print "OK" # ====================================================================== if __name__ == '__main__': import sys - if sys.argv[1] == 'gen_kdf_vectors': + if len(sys.argv) < 2: + print __doc__ + elif sys.argv[1] == 'gen_kdf_vectors': kdf_vectors() elif sys.argv[1] == 'timing': timing() |