[Pkg-privacy-commits] [flashproxy] 32/65: update end-to-end test to install from locally-built debs

Ximin Luo infinity0 at moszumanska.debian.org
Fri Aug 21 13:49:43 UTC 2015


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

infinity0 pushed a commit to branch _volatile-rc
in repository flashproxy.

commit 869bad5bff959e39ff3ba2a0a5ccb10a59244855
Author: Ximin Luo <infinity0 at pwned.gg>
Date:   Mon May 19 16:47:26 2014 +0100

    update end-to-end test to install from locally-built debs
---
 debian/flashproxy-end-to-end-test.sh | 40 +++++++++++++++++++++++++-----------
 1 file changed, 28 insertions(+), 12 deletions(-)

diff --git a/debian/flashproxy-end-to-end-test.sh b/debian/flashproxy-end-to-end-test.sh
index af07d6d..04a49c2 100755
--- a/debian/flashproxy-end-to-end-test.sh
+++ b/debian/flashproxy-end-to-end-test.sh
@@ -3,25 +3,28 @@
 # NOTE: this will destroy existing facilitator config/data/logs !!!
 # NOTE: this does NOT test more complex reg methods like email and appspot.
 #
+# Depends: libparse-debcontrol-perl
+# Usage: $0 [/path/to/flashproxy-*.changes]
+#
+# If no changes file is given, this script will install directly from APT,
+# which may not be what you want.
+#
+# This test assumes the default relays (in /etc/flashproxy/facilitator-relays),
+# which are external internet services, are actually running.
+#
 # You should probably read through this script first. We make no attempt to
 # recover if things go wrong - the script will just abort and start from the
 # beginning next time - so manual cleanup might be required.
-#
-# The script installs flashproxy from APT, so you should make sure that you do
-# not have any pending changes before running this script. You can use reprepro
-# to setup a local APT repo, if you want to test packages you built yourself.
-#
-# You may also install missing packages, such as node-ws or even flashproxy
-# itself, from https://people.torproject.org/~infinity0/apt/
+
+TOR_SOCKS_PORT=19050
 
 set -e
 set -x
 
 function cleanup() {
-	cd
 	sudo a2dissite fp-facilitator.conf || true
 	sudo service apache2 stop
-	sudo aptitude -y purge flashproxy-client flashproxy-facilitator node-flashproxy
+	sudo apt-get -y purge flashproxy-client flashproxy-facilitator node-flashproxy
 	sudo rm -f /etc/apache2/sites-available/fp-facilitator.conf /etc/apache2/fp-facilitator.pem
 	sudo rm -f /usr/local/share/ca-certificates/flashproxy-e2e-test_ssl-cert-snakeoil.crt
 	sudo update-ca-certificates
@@ -29,9 +32,21 @@ function cleanup() {
 }
 
 cleanup
+if [ -f "$1" ]; then
+	perl - "$1" <<-'EOF' | cut '-d ' -f5 | grep '.deb$' | { cd "$(dirname "$1")" && xargs sudo dpkg -i; }
+	use Parse::DebControl;
+	$parser = new Parse::DebControl;
+	@data = @{$parser->parse_file("gpg --decrypt $ARGV[0] 2>/dev/null|", $options)};
+	$files = $data[0]{'Files'};
+	$files =~ s/^\n+//;
+	print "$files\n";
+	EOF
+fi
+sudo apt-mark auto flashproxy-common flashproxy-proxy
+sudo apt-get -y install flashproxy-client flashproxy-facilitator node-flashproxy
+
 mkdir /tmp/flashproxy-e2e-test
 cd /tmp/flashproxy-e2e-test
-sudo aptitude -y install flashproxy-client flashproxy-facilitator node-flashproxy
 
 # generate facilitator www cert and install it as a root CA so stuff works
 openssl genrsa -passout pass:xxxx -des3 -out server.key 1024
@@ -58,7 +73,7 @@ sudo sed -i -e 's/^#\(.*\)websocket\(.*\)/\1websocket\2/g' /etc/flashproxy/facil
 sudo service facilitator start
 sudo service facilitator-reg-daemon start
 
-sudo cp /usr/share/flashproxy-facilitator/examples/fp-facilitator.conf /etc/apache2/sites-available/
+sudo cp /usr/share/doc/flashproxy-facilitator/examples/fp-facilitator.conf /etc/apache2/sites-available/
 sudo sed -i -e 's/ServerName .*/ServerName localhost/g' /etc/apache2/sites-available/fp-facilitator.conf
 
 sudo a2enmod cgi # on debian this is necessary
@@ -78,10 +93,11 @@ NODE_TLS_REJECT_UNAUTHORIZED=0 flashproxy --facilitator https://localhost/ --uns
 
 echo "==== Waiting 60 seconds for Tor to connect"
 sleep 60
-curl --socks5 localhost:19050 https://check.torproject.org | grep -i congratulations
+curl --socks5 localhost:$TOR_SOCKS_PORT https://check.torproject.org | grep -i congratulations
 
 echo "==== TEST SUCCESSFUL!!! CONGRATULATIONS"
 
 echo "==== Now cleaning up and removing all traces of the test... "
 kill $pid_tor $pid_flashproxy
+cd
 cleanup

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



More information about the Pkg-privacy-commits mailing list