Skip to content
This repository has been archived by the owner on Jan 19, 2019. It is now read-only.

Attempt to fix travis build setup via bash+chutney #13

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
'Topic :: System :: Networking',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
],
license="GPLv3",
packages=["txmix"],
Expand Down
17 changes: 4 additions & 13 deletions test/scripts/install-chutney.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,10 @@ cd chutney
./chutney status networks/basic-025

# Retry verify until Tor circuit creation is working
echo before find
client_torrc=$(find net/nodes -wholename "*c/torrc" | head -n1)
echo before grep $client_torrc
control_port=$(grep -Po -m1 "ControlPort\s(\d+)$" $client_torrc | awk '{print $2}')
export CHUTNEY_CONTROL_PORT="$control_port"
n=0
until [ $n -ge 10 ]
do
output=$(./chutney verify networks/basic-025)
# Check if chutney output included 'Transmission: Success'.
if [[ $output == *"Transmission: Success"* ]]; then
break
else
n=$[$n+1]
sleep 5
fi
done
cd ..

echo chutney control port is $CHUTNEY_CONTROL_PORT
10 changes: 5 additions & 5 deletions txmix/onion_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def addr(self):

def register_protocol(self, protocol):
# XXX todo: assert that protocol provides the appropriate interface
self.mix_protocol = protocol
self.protocol = protocol

def start(self):
"""
Expand Down Expand Up @@ -201,14 +201,14 @@ def do_send(self, addr, message):
onion_host, onion_port = addr
tor_endpoint = self.tor.stream_via(onion_host, onion_port)
send_message_protocol = Int32StringReceiver()
self.remote_mix_protocol = yield endpoints.connectProtocol(tor_endpoint, send_message_protocol)
self.remote_mix_protocol.sendString(message)
self.remote_mix_protocol.transport.loseConnection()
self.remote_protocol = yield endpoints.connectProtocol(tor_endpoint, send_message_protocol)
self.remote_protocol.sendString(message)
self.remote_protocol.transport.loseConnection()

# Protocol parent method overwriting

def datagram_received(self, data):
self.mix_protocol.received(data)
self.protocol.received(data)

def connectionLost(self, reason):
"""
Expand Down