Test corpus taken from xen-devel@lists.xen.org
-test.sh inserts the corpus and runs all control tests.
+test.sh can be run with:
+ - "corpus" inserts the corpus and saves initial db
+ - "test" run test based on saved initial db
+ - "both" both
-emesinae.conf is setup for my local environment.
+emesinae.conf is setup for test environment on bugs.xenproject.org
--- /dev/null
+# Insert into /etc/apache2/sites-available/bugs.xenproject.org
+ ScriptAlias /test/ /srv/test/lib/emesinae/cgi-bin/
+ <Directory "/srv/test/lib/emesinae/cgi-bin">
+ AllowOverride None
+ Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+ Order allow,deny
+ Allow from all
+ SetEnv PERLLIB /srv/test/share/perl/5.10.1/
+ AuthUserFile /srv/test/etc/htpasswd
+ </Directory>
+
+ Alias /test-css/ /srv/test/share/emesinae/css/
Message-id: <control.1.test@emesinae.example.com>
In-Reply-To: <6035A0D088A63A46850C3988ED045A4B299F74F8@BITCOM1.int.sbss.com.au>
To: emesinae-test@list.example.com
-Cc: ijc@hellion.org.uk, control@bugs.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
create ^
title -1 Linux does something weird with sector size
--- /dev/null
+From: Ian Campbell <IJC@heLlion.org.uk>
+Subject: Case Sensitive From
+Message-id: <control.10.test@emesinae.example.com>
+To: emesinae-test@list.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
+
+create !
+thanks
Subject: Creating Pretend bug, multiple bugs
Message-id: <control.2.test@emesinae.example.com>
To: emesinae-test@list.example.com
-Cc: ijc@hellion.org.uk, control@bugs.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
create !
title -1 A bug with a mail which does not exist
Subject: Message with no To line
Message-id: <control.3.test@emesinae.example.com>
To: emesinae-test@list.example.com
-Cc: ijc@hellion.org.uk, control@bugs.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
create <20120629120738.425781e5@mantra.us.oracle.com>
-title -3 Message with no To line
+title -1 Message with no To line
thanks
Subject: Change owner
Message-id: <control.4.test@emesinae.example.com>
To: emesinae-test@list.example.com
-Cc: ijc@hellion.org.uk, control@bugs.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
create <20120629120738.425781e5@mantra.us.oracle.com>
title -1 Owner changed
<1335445762.28015.141.camel@zakaz.uk.xensource.com>
<20397.14624.57140.518016@mariner.uk.xensource.com>
To: emesinae-test@list.example.com
-Cc: control@bugs.example.com
+Cc: test-control@bugs.xenproject.org
create <002301cd590c$49aee250$dd0ca6f0$@brice-amiard.Fr>
title -1 "With text/html part"
From: Ian Campbell <ijc@hellion.org.uk>
Subject: Control with no message id
To: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
-Cc: control@bugs.example.com
+Cc: test-control@bugs.xenproject.org
thanks
From: ijc@hellion.org.uk
Message-ID: 1359410450@hellion.org.uk
Subject: control to just me and control, not list
-To: ijc@hellion.org.uk, control@bugs.example.com
+To: ijc@hellion.org.uk, test-control@bugs.xenproject.org
Message-Id: <control.test.6@fake.hellion.org.uk>
create <1338287956-24691-6-git-send-email-stefano.stabellini@eu.citrix.com>
--- /dev/null
+From: Ian Campbell <ijc@hellion.org.uk>
+Subject: HTML injection
+Message-id: <control.9.test@emesinae.example.com>
+To: emesinae-test@list.example.com
+Cc: ijc@hellion.org.uk, test-control@bugs.xenproject.org
+
+create !
+title -1 <img src="http://www.nyan.cat/cats/technyancolor.gif">
+thanks
$c{Mailer} = "exim";
-#$c{DB} = "/opt/emesinae/var/db.sqlite";
-$c{DB} = "/tmp/emesinae.db"; # RAM
-$c{RawMailBase} = "/opt/emesinae/var/raw/";
+$c{DB} = "/srv/test/var/run/db.sqlite";
+$c{RawMailBase} = "/srv/test/var/raw/";
-$c{TrackerName} = "Emesinae Bug Tracker";
-$c{TrackerHost} = "localhost";
+$c{TrackerName} = "Emesinae Testing Bug Tracker";
+$c{TrackerHost} = "bugs.xen.org";
-$c{StyleSheet} = "/css/style.css";
+$c{StyleSheet} = "/test-css/style.css";
-$c{MailDomain} = "hellion.org.uk";
+$c{MailDomain} = "bugs.xenproject.org";
# Bug tracker owner, within $c{MailDomain}
-$c{OwnerAddress} = "ijc+emesinae-owner;
+$c{OwnerAddress} = "test-bugs-owner";
# Bug control address, within $c{MailDomain}
-$c{ControlAddress} = "ijc+emesinae-control";
+$c{ControlAddress} = "test-control";
# Maildrop address, subscribed to the list
$c{ListDropAddress} = "emesinae-maildrop-address";
# (optional) Address to send a copy of all control replies too. Need not be
# within $c{MailDomain}
-$c{ControlDistAddress} = "control-bugs-dist\@" . $c{MailDomain};
+$c{ControlDistAddress} = "test-bugs-dist\@" . $c{MailDomain};
# The mailing list address
$c{ListAddress} = "emesinae-test\@list.example.com";
#$c{ControlReplyToRequestor} = 1
# If unset replies go to $c{ListAddress}
-$c{ControlReplyOverride} = "ijc+emesinae-control-test\@hellion.org.uk";
+$c{ControlReplyOverride} = "test-bugs-reply\@". $c{MailDomain};
-$c{SpoolDir} = "/opt/emesinae/var/spool/";
+$c{SpoolDir} = "/srv/test/var/spool/";
# Set to 1 to save all incoming mail to YYYY-MM under SpoolDir
$c{ArchiveIncoming} = 1;
# Path component of the CGI URL
-$c{CGIPath} = "/cgi-bin/";
+$c{CGIPath} = "/test/";
-$c{LockDir} = "/opt/emesinae/var/locks/";
+$c{LockDir} = "/srv/test/var/lock";
$c{ReportingURL} = "http://bugs.example.com/Howto_Report_Bugs.html";
"gmane" => "http://mid.gmane.org/<MSGID>",
);
-@{ $c{ControlAllow} } = qw/admin@example.com ijc@hellion.org.uk/;
+@{ $c{ControlAllow} } = qw/Ian.Campbell@citrix.com ijc@hellion.org.uk/;
# Severity levels, in decending order of criticality
@{ $c{SeverityLevels} } = qw/blocker critical normal wishlist/;
--- /dev/null
+TESTBUGS_DOMAIN = bugs.xenproject.org
+TESTBUGS_USER = test-bugs
+TESTBUGS_GROUP = test-bugs
--- /dev/null
+testbugs:
+ debug_print = "R: testbugs for $local_part@$domain"
+ driver = accept
+ transport = testbugs_pipe
+ local_parts = test-control
+ domains = TESTBUGS_DOMAIN
+
--- /dev/null
+testbugs_pipe:
+ debug_print = "T: testbugs_pipe for $local_part@$domain"
+ driver = pipe
+ user = TESTBUGS_USER
+ group = TESTBUGS_GROUP
+ command = /srv/test/lib/emesinae/receive.pl
+ environment = PERLLIB=/srv/test/share/perl/5.10.1/
+ return_output
+
set -e
-if [ $# -lt 2 ] ; then
- echo "usage: need a prefix and and local part" 1>&2
+if [ $# -lt 1 ] ; then
+ echo "usage: need a local part" 1>&2
exit 1
fi
-D=$1/lib/emesinae ; shift
export LOCAL_PART="$1"; shift
+PREFIX=/srv/test
+PERLLIB=$PREFIX/share/perl/5.10.1/
+RECEIVE=$PREFIX/lib/emesinae/receive.pl
+
+export PERLLIB
+
for msg in $@ ; do
t=`stat -c%Y "$msg"`
- cat "$msg" | env FAKE_RECEIVE_TIME=$t $D/receive.pl;
+ cat "$msg" | env FAKE_RECEIVE_TIME=$t $RECEIVE
ret=$?;
if [ $ret -gt 0 ] ; then
echo "ERROR: Receiver exited with code $ret";
set -e
-if [ $# -ne 1 ] ; then
- echo "usage: need a prefix" 1>&2
- exit 1
-fi
-
-PREFIX=$1
FAKE_LOCAL_PART="emesinae-maildrop-address"
IFS='
'
find corpus -type f | while read msg ; do
- ./fakereceive.sh "$PREFIX" "$FAKE_LOCAL_PART" "$msg"
+ ./fakereceive.sh "$FAKE_LOCAL_PART" "$msg"
ret=$?;
if [ $ret -gt 0 ] ; then
echo "ERROR: Receiver exited with code $ret";
#!/bin/bash
-if [ $# -lt 2 -a $# -gt 3 ] ; then
- echo "usage: test.sh <db> <prefix> [corpus|test|both]" 1>&2
+usage()
+{
+ echo "usage: test.sh [corpus|test|both]" 1>&2
exit 1
-fi
+}
-set -e
+if [ $# -ne 1 ] ; then usage; fi
+
+
+mode=${1:-both}
+case "$mode" in
+ corpus|test|both) ;;
+ *) usage;;
+esac
-db=$1
-prefix=$2
-mode=${3:-both}
+set -e
+prefix=/srv/test
+db=$prefix/var/run/db.sqlite
libexec=$prefix/lib/emesinae/
spool=$prefix/var/spool
+user=test-bugs
+
+perllib=$prefix/share/perl/5.10.1/
+
+asuser()
+{
+ sudo su -s /bin/sh -c "$*" $user
+}
+
if [ "${mode}" = "corpus" -o "${mode}" = "both" ] ; then
echo Removing existing spool and db
- rm -rf $spool/incoming/* $spool/201* $db $prefix/var/raw/*
+ sudo rm -rf $spool/incoming/* $spool/201* $db $prefix/var/raw/*
echo Recreating DB
- ../db/createdb.sh -d $1
+ sudo ../../../db/createdb.sh -d $db
+ sudo chown $user:$user $db
echo Inserting corpus
- ./insertcorpus.sh $prefix
+ asuser ./insertcorpus.sh
echo Queue run 1
- $libexec/queuerunner.pl
+ asuser env PERLLIB=$perllib $libexec/queuerunner.pl
- cp $db $db.corpus
+ sudo cp $db $db.corpus
else
- cp $db.corpus $db
+ sudo cp $db.corpus $db
+ sudo chown $user:$user $db
fi
if [ "${mode}" = "test" -o "${mode}" = "both" ] ; then
echo Inserting control messages
for i in control.*.test ; do
- ./fakereceive.sh $prefix control $i
- #./fakereceive.sh $prefix emesinae-maildrop-address $i
+ asuser ./fakereceive.sh test-control $i
+ #asuser ./fakereceive.sh emesinae-maildrop-address $i
done
echo Queue run 2
- $libexec/queuerunner.pl
+ asuser env PERLLIB=$perllib $libexec/queuerunner.pl
fi
# adduser --system --group --home /srv/xen-devel-bugs --no-create-home \
--disabled-login xen-devel-bugs
-# mkdir /srv/xen-devel-bugs
-# chown xen-devel-bugs:xen-devel-bugs /srv/xen-devel-bugs/
-
-$ make PREFIX=/srv/xen-devel-bugs
-# su -s /bin/sh -c 'make install PREFIX=/srv/xen-devel-bugs ' xen-devel-bugs
-
-# mkdir /srv/xen-devel-bugs/var/ /srv/xen-devel-bugs/var/raw \
- /srv/xen-devel-bugs/var/spool/ /srv/xen-devel-bugs/var/spool/incoming \
- /srv/xen-devel-bugs/var/lock/ /srv/xen-devel-bugs/etc \
- /srv/xen-devel-bugs/var/www
-# chown xen-devel-bugs:xen-devel-bugs /srv/xen-devel-bugs/var/ \
- /srv/xen-devel-bugs/var/raw /srv/xen-devel-bugs/var/spool/ \
- /srv/xen-devel-bugs/var/spool/incoming \
- /srv/xen-devel-bugs/var/lock/ /srv/xen-devel-bugs/etc \
- /srv/xen-devel-bugs/var/www
+
+$ echo PREFIX=/srv/xen-devel-bugs > .config
+$ make
+# make install
+# mkdir /srv/xen-devel-bugs/etc
+# mkdir /srv/xen-devel-bugs/var/lock
+# chmod 1777 /srv/xen-devel-bugs/var/lock
+
+# mkdir /srv/xen-devel-bugs/var/raw \
+ /srv/xen-devel-bugs/var/spool/ /srv/xen-devel-bugs/var/spool/incoming
+# chown xen-devel-bugs:xen-devel-bugs \
+ /srv/xen-devel-bugs/var/raw \
+ /srv/xen-devel-bugs/var/spool/ /srv/xen-devel-bugs/var/spool/incoming
# cp config/examples/xen-bugs.xenproject.org/emesinae.conf /srv/xen-devel-bugs/etc/
-# su -s /bin/sh -c './db/createdb.sh -d /srv/xen-devel-bugs/var/db.sqlite' xen-devel-bugs
+# ./db/createdb.sh -d /srv/xen-devel-bugs/var/db.sqlite
+# chown xen-devel-bugs:xen-devel-bugs /srv/xen-devel-bugs/var/db.sqlite
# echo "xen-devel-bugs: ijc" >>/etc/aliases
+# echo "xen-bugs-control-reply: ijc" >>/etc/aliases
+# echo "xen-bugs-dist: ijc" >>/etc/aliases
===================
Exim4 Configuration