More work on test suite.

This commit is contained in:
Jason Tibbitts 2017-05-25 10:32:04 -05:00
parent 5a7ae23159
commit c70cf04055
2 changed files with 91 additions and 30 deletions

View File

@ -6,8 +6,8 @@
# so this requires some finesse. # so this requires some finesse.
[cassandane] [cassandane]
rootdir = BUILDDIR/cassandane/work rootdir = CASSDIR/work
pwcheck = alwaystrue pwcheck = alwaystrue # This is enabled in Fedora builds
cleanup = no cleanup = no
maxworkers = 1 maxworkers = 1
@ -35,7 +35,7 @@ destdir = BUILDROOT
#[config] #[config]
#[caldavtalk] #[caldavtalk]
#basedir = BUILDDIR/cassandane/testdata #basedir = CASSDIR/cassandane/testdata
#[imaptest] #[imaptest]
# XXX Cassandane wants this to not be installed. Don't know why. If # XXX Cassandane wants this to not be installed. Don't know why. If

View File

@ -1,5 +1,5 @@
# Cassandane doesn't have releases often. This was fetched on 20170412. # Cassandane doesn't have releases often. This was fetched on 20170523.
%global cmt1 9fed6232e4bf202987b5b8a57bac018797fbb6c6 %global cmt1 b97ba9cbe78e48d10ee0cbdb1f43a73b907e3460
%define scmt(l:) %(c=%1; echo ${c:0:%{-l:%{-l*}}%{!-l:7}}) %define scmt(l:) %(c=%1; echo ${c:0:%{-l:%{-l*}}%{!-l:7}})
Name: cyrus-imapd Name: cyrus-imapd
@ -21,6 +21,9 @@ License: BSD
URL: http://www.cyrusimap.org/ URL: http://www.cyrusimap.org/
Source0: http://www.cyrusimap.org/releases/%name-%version.tar.gz Source0: http://www.cyrusimap.org/releases/%name-%version.tar.gz
# Allow master to run even if there's no cyrus user in /etc/passwd
Patch1: patch-neuter-become-cyrus
Source10: cyrus-imapd.logrotate Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config Source11: cyrus-imapd.pam-config
Source12: cyrus-imapd.sysconfig Source12: cyrus-imapd.sysconfig
@ -34,7 +37,8 @@ Source18: cyrus-imapd-init.service
Source19: cyr_systemd_helper Source19: cyr_systemd_helper
# Source files for running the Cassandane test suite at build time. # Source files for running the Cassandane test suite at build time.
Source90: https://github.com/cyrusimap/cassandane/archive/%cmt1.tar.gz#/cassandane-%{scmt %cmt1}.tar.gz Source80: https://github.com/cyrusimap/cassandane/archive/%cmt1.tar.gz#/cassandane-%{scmt %cmt1}.tar.gz
# The CPAN version, and hence the Fedora-packaged version, of Net::CalDAVTalk # The CPAN version, and hence the Fedora-packaged version, of Net::CalDAVTalk
# doesn't include the testdata directory. Cassandane can use it for testing # doesn't include the testdata directory. Cassandane can use it for testing
@ -42,14 +46,19 @@ Source90: https://github.com/cyrusimap/cassandane/archive/%cmt1.tar.gz#/cassanda
# This archive was generated by running: # This archive was generated by running:
# svn export https://github.com/brong/Net-CalDAVTalk/trunk/testdata # svn export https://github.com/brong/Net-CalDAVTalk/trunk/testdata
# tar cfz cassandane-testdata-20170523.tar.gz testdata # tar cfz cassandane-testdata-20170523.tar.gz testdata
Source91: cassandane-testdata-20170523.tar.gz Source81: cassandane-testdata-20170523.tar.gz
# This is a source file and not a patch because you can't use autosetup to
# apply patches to secondary unpacked source files.
Source92: patch-cassandane-no-sudo
# A template config file for cassandane; we will substitute in varions values. # A template config file for cassandane; we will substitute in varions values.
Source93: cassandane.ini Source82: cassandane.ini
# Basically everything in the test suite wants to use syslog. That's not so
# easy in mock, so here's an LD_PRELOAD to redirect syslog calls to stderr.
Source83: cassandane-redirect-syslog.c
# These are source files and not patches because you can't use autosetup to
# apply patches to secondary unpacked source files.
Source90: patch-cassandane-no-sudo
Source91: patch-cassandane-no-syslog
# Dependency notes: # Dependency notes:
# * clamav-devel and mariadb-devel removed because they both depend on # * clamav-devel and mariadb-devel removed because they both depend on
@ -59,11 +68,11 @@ Source93: cassandane.ini
# configure: Your version of libical can not support patching iCalendar # configure: Your version of libical can not support patching iCalendar
# objects. Consider upgrading to libical >= 2.1 # objects. Consider upgrading to libical >= 2.1
BuildRequires: autoconf automake bison flex groff libtool BuildRequires: autoconf automake bison flex gcc gcc-c++ git groff libtool
BuildRequires: pkgconfig systemd tcp_wrappers transfig BuildRequires: pkgconfig systemd tcp_wrappers transfig
BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker) perl(Pod::Html) BuildRequires: perl-devel perl-generators perl(ExtUtils::MakeMaker)
BuildRequires: perl(Pod::Html)
BuildRequires: clamav-devel CUnit-devel cyrus-sasl-devel glib2-devel BuildRequires: clamav-devel CUnit-devel cyrus-sasl-devel glib2-devel
BuildRequires: jansson-devel krb5-devel libical-devel libnghttp2-devel BuildRequires: jansson-devel krb5-devel libical-devel libnghttp2-devel
@ -71,9 +80,9 @@ BuildRequires: libxml2-devel net-snmp-devel openldap-devel
BuildRequires: openssl-devel postgresql-devel shapelib-devel sqlite-devel BuildRequires: openssl-devel postgresql-devel shapelib-devel sqlite-devel
BuildRequires: xapian-core-devel BuildRequires: xapian-core-devel
# SASL modules needed for 'make check' to function: # Miscellaneous modules needed for 'make check' to function:
BuildRequires: cyrus-sasl-plain cyrus-sasl-md5 BuildRequires: cyrus-sasl-plain cyrus-sasl-md5
BuildRequires: net-tools words
#BuildRequires: imaptest #BuildRequires: imaptest
# Perl modules required for cassandane to function # Perl modules required for cassandane to function
@ -81,9 +90,9 @@ BuildRequires: perl(AnyEvent) perl(BSD::Resource) perl(Clone)
BuildRequires: perl(File::chdir) perl(IO::Socket::INET6) perl(Mail::IMAPTalk) BuildRequires: perl(File::chdir) perl(IO::Socket::INET6) perl(Mail::IMAPTalk)
BuildRequires: perl(Config::IniFiles) perl(Mail::JMAPTalk) perl(Math::Int64) BuildRequires: perl(Config::IniFiles) perl(Mail::JMAPTalk) perl(Math::Int64)
BuildRequires: perl(Net::CalDAVTalk) perl(Net::CardDAVTalk) BuildRequires: perl(Net::CalDAVTalk) perl(Net::CardDAVTalk)
BuildRequires: perl(News::NNTPClient) perl(String::CRC32) perl(Sys::Syslog) BuildRequires: perl(Net::Server) perl(News::NNTPClient) perl(String::CRC32)
BuildRequires: perl(Test::Unit::TestRunner) perl(Time::HiRes) perl(XML::DOM) BuildRequires: perl(Sys::Syslog) perl(Test::Unit::TestRunner) perl(Time::HiRes)
BuildRequires: perl(XML::Generator) BuildRequires: perl(Unix::Syslog) perl(XML::DOM) perl(XML::Generator)
Requires(pre): shadow-utils Requires(pre): shadow-utils
Requires(post): /sbin/ldconfig Requires(post): /sbin/ldconfig
@ -172,24 +181,27 @@ IMAP server.
# Build dir is either $PWD, $(pwd) or % # Build dir is either $PWD, $(pwd) or %
%prep %prep
%autosetup -p1 %autosetup -p1 -S git
# Install the Fedora-specific documentation file # Install the Fedora-specific documentation file
install -m 644 %SOURCE16 doc/ install -m 644 %SOURCE16 doc/
# Unpack and prepare cassandane # Unpack and prepare cassandane
tar xf %SOURCE90 tar xf %SOURCE80
ln -s cassandane-%cmt1 cassandane ln -s cassandane-%cmt1 cassandane
pushd cassandane pushd cassandane
mkdir work mkdir work
tar xf %SOURCE91 tar xf %SOURCE81
patch -p1 < %SOURCE92 patch -p1 < %SOURCE90
cp %SOURCE93 cassandane.ini patch -p1 < %SOURCE91
cp %SOURCE82 cassandane.ini
sed -i \ sed -i \
-e "s!BUILDDIR!$(pwd)!" \ -e "s!CASSDIR!$(pwd)!" \
-e "s!BUILDROOT!%buildroot!" \ -e "s!BUILDROOT!%buildroot!" \
cassandane.ini cassandane.ini
cp %SOURCE83 redirect-syslog.c
popd popd
%build %build
@ -211,12 +223,12 @@ popd
# --with-cyrus-prefix and --with-service-path went away; use --with-libexecdir= # --with-cyrus-prefix and --with-service-path went away; use --with-libexecdir=
# instead. # instead.
autoreconf -vi #autoreconf -vi
%configure \ %configure \
--disable-silent-rules \ --disable-silent-rules \
\ \
--libexecdir=%cyrexecdir \ --libexecdir=%cyrexecdir \
--with-extraident="Fedora-RPM-%version-%release" \ --with-extraident="%release Fedora" \
--with-krbimpl=mit \ --with-krbimpl=mit \
--with-ldap=/usr \ --with-ldap=/usr \
--with-pgsql \ --with-pgsql \
@ -386,10 +398,59 @@ find %buildroot -name ".packlist" -exec rm {} \;
%check %check
make check make %{?_smp_mflags} check || exit 1
pushd cassandane pushd cassandane
./testrunner.pl --config cassandane.ini -f tap
# Build the syslog interposer
gcc -fPIC -shared -Wl,-soname,-libredirectsyslog.so.0 -ldl -o libredirectsyslog.so.0.0 redirect-syslog.c
# More work is required to get this going properly
export LD_LIBRARY_PATH=%buildroot/%_libdir
#./testrunner.pl %{?_smp_mflags} -f tap \
# -vvv \
# !Cassandane::Test::Core \
# ACL \
# 2>&1
# #!ACL \
# #!Admin \
#LD_LIBRARY_PATH=%buildroot/%_libdir ./testrunner.pl -j 16 --config cassandane.ini -f tap 2>&1
#exit 1
# Can't possibly work:
# Cassandane::Test::Core
# Known OK tests:
# Archive
# Backups
# Bug3072 (slow)
# Bug3470
# Bug3649
# CaldavAlarm
# Carddav
# Conversations
# CyrusDB
# Known bad tests:
# ACL (9 failures of 11)
# Admin (1 failure of 1)
# Annotator (all tests error; very slow, problems running the annotator utility; problems with missing cyrus user)
# Autocreate (1 failure of 1)
# Bug3463
# Bug3903
# Caldav (just 3 failures out of 46 tests)
# Delete (all tests fail)
# ClamAV is probably not supported.
# No runnable tests:
# Cassandane::AnnotatorDaemon-# Annotator: patch utils/annotator.pl to pass the
# current UID to Cassandane::AnnotatorDaemon->run.
# (getpwuid($<))[0]
# Also override group
%pre %pre
# Create 'cyrus' user on target host # Create 'cyrus' user on target host