Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sergi
Tor
Commits
f308adf8
Commit
f308adf8
authored
11 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Patches
Plain Diff
When possible, run the ntor python integration tests too
parent
18739831
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/test/include.am
+14
-3
14 additions, 3 deletions
src/test/include.am
src/test/ntor_ref.py
+13
-3
13 additions, 3 deletions
src/test/ntor_ref.py
src/test/test_cmdline_args.py
+12
-3
12 additions, 3 deletions
src/test/test_cmdline_args.py
with
39 additions
and
9 deletions
src/test/include.am
+
14
−
3
View file @
f308adf8
...
...
@@ -74,11 +74,22 @@ src_test_test_ntor_cl_LDADD = src/or/libtor.a src/common/libor.a \
@TOR_OPENSSL_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@
src_test_test_ntor_cl_AM_CPPFLAGS = \
-I"$(top_srcdir)/src/or"
NTOR_TEST_DEPS=src/test/test-ntor-cl
else
NTOR_TEST_DEPS=
endif
if COVERAGE_ENABLED
CMDLINE_TEST_TOR = ./src/or/tor-cov
else
CMDLINE_TEST_TOR = ./src/or/tor
endif
check-local:
check-local:
$(NTOR_TEST_DEPS) $(CMDLINE_TEST_TOR)
if USEPYTHON
$(PYTHON) src/test/test_cmdline_args.py
$(PYTHON) src/test/test_cmdline_args.py $(CMDLINE_TEST_TOR) "${top_srcdir}"
if CURVE25519_ENABLED
$(PYTHON) src/test/ntor_ref.py test-tor
$(PYTHON) src/test/ntor_ref.py self-test
endif
endif
This diff is collapsed.
Click to expand it.
src/test/ntor_ref.py
100644 → 100755
+
13
−
3
View file @
f308adf8
#!/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
()
...
...
This diff is collapsed.
Click to expand it.
src/test/test_cmdline_args.py
+
12
−
3
View file @
f308adf8
...
...
@@ -6,11 +6,20 @@ import os
import
re
import
shutil
import
subprocess
import
sys
import
tempfile
import
unittest
TOR
=
"
./src/or/tor-cov
"
TOPDIR
=
"
.
"
TOR
=
"
./src/or/tor
"
TOP_SRCDIR
=
"
.
"
if
len
(
sys
.
argv
)
>
1
:
TOR
=
sys
.
argv
[
1
]
del
sys
.
argv
[
1
]
if
len
(
sys
.
argv
)
>
1
:
TOP_SRCDIR
=
sys
.
argv
[
1
]
del
sys
.
argv
[
1
]
class
UnexpectedSuccess
(
Exception
):
pass
...
...
@@ -110,7 +119,7 @@ class CmdlineTests(unittest.TestCase):
self
.
assertEquals
(
hashlib
.
sha1
(
inp
).
digest
(),
hashed
)
def
test_digests
(
self
):
main_c
=
os
.
path
.
join
(
TOPDIR
,
"
src
"
,
"
or
"
,
"
main.c
"
)
main_c
=
os
.
path
.
join
(
TOP
_SRC
DIR
,
"
src
"
,
"
or
"
,
"
main.c
"
)
if
os
.
stat
(
TOR
).
st_mtime
<
os
.
stat
(
main_c
).
st_mtime
:
self
.
skipTest
(
TOR
+
"
not up to date
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment