]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
Update test config for deployment on test system
authorIan Campbell <ian.campbell@citrix.com>
Thu, 23 May 2013 09:34:08 +0000 (10:34 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 23 May 2013 10:47:01 +0000 (11:47 +0100)
19 files changed:
config/examples/test/README
config/examples/test/apache.conf [new file with mode: 0644]
config/examples/test/control.1.test
config/examples/test/control.10.test [new file with mode: 0644]
config/examples/test/control.2.test
config/examples/test/control.3.test
config/examples/test/control.4.test
config/examples/test/control.5.test
config/examples/test/control.6.test
config/examples/test/control.8.test
config/examples/test/control.9.test [new file with mode: 0644]
config/examples/test/emesinae.conf
config/examples/test/exim4-main-03_testbugs [new file with mode: 0644]
config/examples/test/exim4-route-250_testbugs [new file with mode: 0644]
config/examples/test/exim4-transport-30_testbugs [new file with mode: 0644]
config/examples/test/fakereceive.sh
config/examples/test/insertcorpus.sh
config/examples/test/test.sh
config/examples/xen-bugs.xenproject.org/README

index 2ac16d1a8d39b36b80b0005b8393836a43fe7972..4d2ba3cc4604f065f571206f3373e182154009c1 100644 (file)
@@ -1,5 +1,8 @@
 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
diff --git a/config/examples/test/apache.conf b/config/examples/test/apache.conf
new file mode 100644 (file)
index 0000000..0cfd80f
--- /dev/null
@@ -0,0 +1,12 @@
+# 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/
index a7243cef6d9fe8780fb59ae739fe035f7490fd39..2bc08451febd1cdbe61621ac483f86607638bfce 100644 (file)
@@ -4,7 +4,7 @@ Subject: Re: [Xen-devel] bug when using 4K
 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
diff --git a/config/examples/test/control.10.test b/config/examples/test/control.10.test
new file mode 100644 (file)
index 0000000..f879a6c
--- /dev/null
@@ -0,0 +1,8 @@
+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
index ff18950113840a6107759fdda158d1d3e7e9b3e3..fc96b7a16e67c2ac9e79011890728a8e57f5c4f5 100644 (file)
@@ -2,7 +2,7 @@ From: Ian Campbell <ijc@hellion.org.uk>
 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
index adce54495aa6f86c16b4d4dcde5a377baf8e989b..d2bfdcc7d9e0de69af6719542f0f40e88a7f57f7 100644 (file)
@@ -2,8 +2,8 @@ From: Ian Campbell <ijc@hellion.org.uk>
 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
index 69d5bacafefe94795a576bfc7579bd54c4b3ddb3..26f13087e8ca6956b952f8663bcae1981470ba4e 100644 (file)
@@ -2,7 +2,7 @@ From: Ian Campbell <ijc@hellion.org.uk>
 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
index c5d43fd308a09f3e0f6ad3d2defda4d4e5695da7..8194e55e394ea1eea642c0798e0237bbdcb4c601 100644 (file)
@@ -10,7 +10,7 @@ References: <1334928211-29856-1-git-send-email-roger.pau@citrix.com>
         <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"
index a9e490e700df9514a7716e990eb93bc4f527db13..624e8c5ec0353b88569e5b58de2b36bf770ffedb 100644 (file)
@@ -1,7 +1,7 @@
 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
 
index df4cbce1970e89f08f382d6dd6ba35951278e056..ef43fdeb169dd588383e20dc6dc19d4dbcbef96c 100644 (file)
@@ -1,7 +1,7 @@
 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>
diff --git a/config/examples/test/control.9.test b/config/examples/test/control.9.test
new file mode 100644 (file)
index 0000000..72e747d
--- /dev/null
@@ -0,0 +1,9 @@
+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
index 8327934d93878dbcf2c21249d86d1925b265fcfc..6b802701500d3bbd6a2b51d2afcd064e6eaa5cc4 100644 (file)
@@ -1,26 +1,25 @@
 $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";
@@ -34,16 +33,16 @@ $c{ControlReplyToList} = 0;
 #$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";
 
@@ -53,7 +52,7 @@ $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/;
diff --git a/config/examples/test/exim4-main-03_testbugs b/config/examples/test/exim4-main-03_testbugs
new file mode 100644 (file)
index 0000000..72a2d0e
--- /dev/null
@@ -0,0 +1,3 @@
+TESTBUGS_DOMAIN = bugs.xenproject.org
+TESTBUGS_USER = test-bugs
+TESTBUGS_GROUP = test-bugs
diff --git a/config/examples/test/exim4-route-250_testbugs b/config/examples/test/exim4-route-250_testbugs
new file mode 100644 (file)
index 0000000..ff09304
--- /dev/null
@@ -0,0 +1,7 @@
+testbugs:
+  debug_print = "R: testbugs for $local_part@$domain"
+  driver = accept
+  transport = testbugs_pipe
+  local_parts = test-control
+  domains = TESTBUGS_DOMAIN
+
diff --git a/config/examples/test/exim4-transport-30_testbugs b/config/examples/test/exim4-transport-30_testbugs
new file mode 100644 (file)
index 0000000..5393bed
--- /dev/null
@@ -0,0 +1,9 @@
+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
+
index ae4dcd473fb4f8858b1f3059b53373532a6d8d4e..4b7a88e2c92a97dceccbb58ba4648901e6849890 100755 (executable)
@@ -6,18 +6,23 @@
 
 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";
index 8ebce6b94afac68f944a23f6031b15d86b497712..56fa383965b7fc2ed22f6a0ac89f6c3b0546a544 100755 (executable)
@@ -2,18 +2,12 @@
 
 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";
index a9a504d0f67875a96f5b27a058eafa6397836b3b..26acc0b07e96a6a37c3493efa0cf2a7717e739bb 100755 (executable)
@@ -1,46 +1,65 @@
 #!/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
index ab56faf662442b07d3ff0787c6287d4e96bb23f1..4da7463cea32aa6d5442af15a0cc73336cf38041 100644 (file)
@@ -6,27 +6,28 @@ Installation
 
 # 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