From c70cf04055fb6a5a18f7176e8db0574bbd8ef045 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: May 25 2017 15:32:04 +0000 Subject: More work on test suite. --- diff --git a/cassandane.ini b/cassandane.ini index 5705bf9..50428dc 100644 --- a/cassandane.ini +++ b/cassandane.ini @@ -6,8 +6,8 @@ # so this requires some finesse. [cassandane] -rootdir = BUILDDIR/cassandane/work -pwcheck = alwaystrue +rootdir = CASSDIR/work +pwcheck = alwaystrue # This is enabled in Fedora builds cleanup = no maxworkers = 1 @@ -35,7 +35,7 @@ destdir = BUILDROOT #[config] #[caldavtalk] -#basedir = BUILDDIR/cassandane/testdata +#basedir = CASSDIR/cassandane/testdata #[imaptest] # XXX Cassandane wants this to not be installed. Don't know why. If diff --git a/cyrus-imapd.spec b/cyrus-imapd.spec index 46a9873..7f23673 100644 --- a/cyrus-imapd.spec +++ b/cyrus-imapd.spec @@ -1,5 +1,5 @@ -# Cassandane doesn't have releases often. This was fetched on 20170412. -%global cmt1 9fed6232e4bf202987b5b8a57bac018797fbb6c6 +# Cassandane doesn't have releases often. This was fetched on 20170523. +%global cmt1 b97ba9cbe78e48d10ee0cbdb1f43a73b907e3460 %define scmt(l:) %(c=%1; echo ${c:0:%{-l:%{-l*}}%{!-l:7}}) Name: cyrus-imapd @@ -21,6 +21,9 @@ License: BSD URL: http://www.cyrusimap.org/ 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 Source11: cyrus-imapd.pam-config Source12: cyrus-imapd.sysconfig @@ -34,7 +37,8 @@ Source18: cyrus-imapd-init.service Source19: cyr_systemd_helper # 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 # 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: # svn export https://github.com/brong/Net-CalDAVTalk/trunk/testdata # tar cfz cassandane-testdata-20170523.tar.gz testdata -Source91: 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 +Source81: cassandane-testdata-20170523.tar.gz # 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: # * 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 # 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: 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: 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: 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: net-tools words #BuildRequires: imaptest # 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(Config::IniFiles) perl(Mail::JMAPTalk) perl(Math::Int64) BuildRequires: perl(Net::CalDAVTalk) perl(Net::CardDAVTalk) -BuildRequires: perl(News::NNTPClient) perl(String::CRC32) perl(Sys::Syslog) -BuildRequires: perl(Test::Unit::TestRunner) perl(Time::HiRes) perl(XML::DOM) -BuildRequires: perl(XML::Generator) +BuildRequires: perl(Net::Server) perl(News::NNTPClient) perl(String::CRC32) +BuildRequires: perl(Sys::Syslog) perl(Test::Unit::TestRunner) perl(Time::HiRes) +BuildRequires: perl(Unix::Syslog) perl(XML::DOM) perl(XML::Generator) Requires(pre): shadow-utils Requires(post): /sbin/ldconfig @@ -172,24 +181,27 @@ IMAP server. # Build dir is either $PWD, $(pwd) or % %prep -%autosetup -p1 +%autosetup -p1 -S git # Install the Fedora-specific documentation file install -m 644 %SOURCE16 doc/ # Unpack and prepare cassandane -tar xf %SOURCE90 +tar xf %SOURCE80 ln -s cassandane-%cmt1 cassandane pushd cassandane mkdir work -tar xf %SOURCE91 +tar xf %SOURCE81 -patch -p1 < %SOURCE92 -cp %SOURCE93 cassandane.ini +patch -p1 < %SOURCE90 +patch -p1 < %SOURCE91 +cp %SOURCE82 cassandane.ini sed -i \ - -e "s!BUILDDIR!$(pwd)!" \ + -e "s!CASSDIR!$(pwd)!" \ -e "s!BUILDROOT!%buildroot!" \ cassandane.ini + +cp %SOURCE83 redirect-syslog.c popd %build @@ -211,12 +223,12 @@ popd # --with-cyrus-prefix and --with-service-path went away; use --with-libexecdir= # instead. -autoreconf -vi +#autoreconf -vi %configure \ --disable-silent-rules \ \ --libexecdir=%cyrexecdir \ - --with-extraident="Fedora-RPM-%version-%release" \ + --with-extraident="%release Fedora" \ --with-krbimpl=mit \ --with-ldap=/usr \ --with-pgsql \ @@ -386,10 +398,59 @@ find %buildroot -name ".packlist" -exec rm {} \; %check -make check +make %{?_smp_mflags} check || exit 1 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 # Create 'cyrus' user on target host