[Pkg-privacy-commits] [onionbalance] 41/117: Test setting up a local Tor install and chutney for integration testing

Donncha O'Cearbahill donncha-guest at moszumanska.debian.org
Wed Dec 16 23:18:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

donncha-guest pushed a commit to branch debian/sid
in repository onionbalance.

commit 92971e81ceaf5b7baf3500350cc6656f0f2822b8
Author: Donncha O'Cearbhaill <donncha at donncha.is>
Date:   Wed Jun 24 13:16:01 2015 +0100

    Test setting up a local Tor install and chutney for integration testing
---
 .travis.yml                     |  3 +++
 test/scripts/install-chutney.sh | 29 +++++++++++++++++++++++++++++
 test/scripts/install-tor.sh     |  6 ++++++
 3 files changed, 38 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 43c4092..e1f03e2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,7 @@
 language: python
+before_install:
+  - ./test/scripts/install-tor.sh
+  - source test/scripts/install-chutney.sh
 install:
   - pip install tox
 script:
diff --git a/test/scripts/install-chutney.sh b/test/scripts/install-chutney.sh
new file mode 100755
index 0000000..e8d0b48
--- /dev/null
+++ b/test/scripts/install-chutney.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+# Script to install Chutney, configure a Tor network and wait for the hidden
+# service system to be available.
+git clone https://github.com/DonnchaC/chutney.git
+cd chutney
+./chutney configure networks/hs
+./chutney start networks/hs
+./chutney status networks/hs
+
+# Retry verify until hidden service subsystem is working
+n=0
+until [ $n -ge 20 ]
+do
+  output=$(./chutney verify networks/hs)
+  # Check if chutney output included 'Transmission: Success'.
+  if [[ $output == *"Transmission: Success"* ]]; then
+    hs_address=$(echo $output | grep -Po "([a-z2-7]{16}.onion:\d{2,5})")
+    client_address=$(echo $output | grep -Po -m 1 "(localhost:\d{2,5})" | head -n1)
+    echo "HS system running with service available at $hs_address"
+    export CHUTNEY_ONION_ADDRESS="$hs_address"
+    export CHUTNEY_CLIENT_PORT="$client_address"
+    break
+  else
+    echo "HS system not running yet. Sleeping 15 seconds"
+    n=$[$n+1]
+    sleep 15
+  fi
+done
+cd ..
diff --git a/test/scripts/install-tor.sh b/test/scripts/install-tor.sh
new file mode 100755
index 0000000..092fb16
--- /dev/null
+++ b/test/scripts/install-tor.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+# Script to install Tor
+set -ex
+wget https://www.torproject.org/dist/tor-0.2.7.1-alpha.tar.gz
+tar -xzvf tor-0.2.7.1-alpha.tar.gz
+cd tor-0.2.7.1-alpha && ./configure --disable-asciidoc && make && sudo make install

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onionbalance.git



More information about the Pkg-privacy-commits mailing list