From: Michael Hanke <mih@debian.org>
Subject: Allow tests to run as root

Packages get built by root, and chirp refused to start as root without
additional argueing.

--- a/chirp/test/TR_001_chirp_benchmark.sh
+++ b/chirp/test/TR_001_chirp_benchmark.sh
@@ -8,7 +8,11 @@
 
 prepare()
 {
-    ../src/chirp_server -Z $PORT_FILE &
+    if [ `id -u` -eq 0 ]; then
+        ../src/chirp_server -i $USER -Z $PORT_FILE &
+    else
+        ../src/chirp_server -Z $PORT_FILE &
+    fi
     pid=$!
 
     # give the server a moment to generate the port file
--- a/chirp/test/TR_002_chirp_ops.sh
+++ b/chirp/test/TR_002_chirp_ops.sh
@@ -10,10 +10,15 @@
 {
     mkdir foo
     ln -s ..//.//./..///foo/ foo/foo
-    ../src/chirp_server -r $PWD/foo -Z $PORT_FILE &
+    if [ `id -u` -eq 0 ]; then
+        ../src/chirp_server -i $USER -r $PWD/foo -Z $PORT_FILE &
+    else
+        ../src/chirp_server -r $PWD/foo -Z $PORT_FILE &
+    fi
+    pid=$!
+
     # give the server a little time to write the port file
     sleep 5
-    pid=$!
 
     if ps ux | awk '{print $2}' | grep "^$pid$"; then
 	echo $pid > $PID_FILE
