Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Gaba
Tor
Commits
5a11670f
Commit
5a11670f
authored
6 years ago
by
rl1987
Committed by
Nick Mathewson
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update/fix CI build
Update integration test to Python 3
parent
4811869d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/test_rebind.py
+8
-6
8 additions, 6 deletions
src/test/test_rebind.py
src/test/test_rebind.sh
+2
-0
2 additions, 0 deletions
src/test/test_rebind.sh
with
10 additions
and
6 deletions
src/test/test_rebind.py
+
8
−
6
View file @
5a11670f
#!/usr/bin/python3
from
__future__
import
print_function
import
sys
...
...
@@ -18,14 +20,14 @@ def try_connecting_to_socksport():
def
wait_for_log
(
s
):
while
True
:
l
=
tor_process
.
stdout
.
readline
()
if
s
in
l
:
if
s
in
l
.
decode
(
'
utf8
'
)
:
return
def
pick_random_port
():
port
=
0
random
.
seed
()
for
i
in
x
range
(
8
):
for
i
in
range
(
8
):
port
=
random
.
randint
(
10000
,
60000
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
if
s
.
connect_ex
((
'
127.0.0.1
'
,
port
))
==
0
:
...
...
@@ -69,18 +71,18 @@ if control_socket.connect_ex(('127.0.0.1', control_port)):
print
(
'
FAIL
'
)
sys
.
exit
(
'
Cannot connect to ControlPort
'
)
control_socket
.
sendall
(
'
AUTHENTICATE
\r\n
'
)
control_socket
.
sendall
(
'
SETCONF SOCKSPort=0.0.0.0:{}
\r\n
'
.
format
(
socks_port
))
control_socket
.
sendall
(
'
AUTHENTICATE
\r\n
'
.
encode
(
'
utf8
'
)
)
control_socket
.
sendall
(
'
SETCONF SOCKSPort=0.0.0.0:{}
\r\n
'
.
format
(
socks_port
)
.
encode
(
'
utf8
'
)
)
wait_for_log
(
'
Opened Socks listener
'
)
try_connecting_to_socksport
()
control_socket
.
sendall
(
'
SETCONF SOCKSPort=127.0.0.1:{}
\r\n
'
.
format
(
socks_port
))
control_socket
.
sendall
(
'
SETCONF SOCKSPort=127.0.0.1:{}
\r\n
'
.
format
(
socks_port
)
.
encode
(
'
utf8
'
)
)
wait_for_log
(
'
Opened Socks listener
'
)
try_connecting_to_socksport
()
control_socket
.
sendall
(
'
SIGNAL HALT
\r\n
'
)
control_socket
.
sendall
(
'
SIGNAL HALT
\r\n
'
.
encode
(
'
utf8
'
)
)
time
.
sleep
(
0.1
)
print
(
'
OK
'
)
...
...
This diff is collapsed.
Click to expand it.
src/test/test_rebind.sh
+
2
−
0
View file @
5a11670f
#!/bin/sh
set
-x
exitcode
=
0
"
${
PYTHON
:-
python
}
"
"
${
abs_top_srcdir
:-
.
}
/src/test/test_rebind.py"
"
${
TESTING_TOR_BINARY
}
"
||
exitcode
=
1
...
...
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