[samba/f18] Add support to conditionally enable the testsuite.

asn asn at fedoraproject.org
Tue Dec 4 16:16:36 UTC 2012


commit ab5b3fdb5d023c6eba935d2bf1ef82c22ebe7764
Author: Andreas Schneider <asn at cryptomilk.org>
Date:   Tue Dec 4 17:15:14 2012 +0100

    Add support to conditionally enable the testsuite.
    
    rpmbuild --rebuild --with testsuite samba.rpm

 samba.spec |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index a396231..1bd8465 100644
--- a/samba.spec
+++ b/samba.spec
@@ -1,3 +1,6 @@
+# Set --with testsuite or %bcond_without to run the Samba torture testsuite.
+%bcond_with testsuite
+
 %define main_release 170
 
 %define samba_version 4.0.0
@@ -23,6 +26,12 @@
 %global with_mitkrb5 1
 %global with_dc 0
 
+%if %{with testsuite}
+# The testsuite only works with a full build right now.
+%global with_mitkrb5 0
+%global with_dc 1
+%endif
+
 %global with_clustering_support 1
 
 %{!?python_libdir: %define python_libdir %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1,1)")}
@@ -482,6 +491,9 @@ the local kerberos library to use the same KDC as samba and winbind use
         --with-cluster-support \
         --enable-old-ctdb \
 %endif
+%if %{with testsuite}
+        --enable-selftest \
+%endif
 %if ! %with_pam_smbpass
         --without-pam_smbpass
 %endif
@@ -584,6 +596,11 @@ rm -rf %{buildroot}%{perl_vendorlib}/Parse/Yapp
 # Fix up permission on perl install.
 %{_fixperms} %{buildroot}%{perl_vendorlib}
 
+%if %{with testsuite}
+%check
+TDB_NO_FSYNC=1 make %{?_smp_mflags} test
+%endif
+
 %post
 %systemd_post smb.service
 %systemd_post nmb.service
@@ -1253,6 +1270,13 @@ rm -rf %{buildroot}
 %{_mandir}/man1/smbtorture.1*
 %{_mandir}/man1/vfstest.1*
 
+%if %{with testsuite}
+# files to ignore in testsuite mode
+%{_libdir}/samba/libnss_wrapper.so
+%{_libdir}/samba/libsocket_wrapper.so
+%{_libdir}/samba/libuid_wrapper.so
+%endif
+
 ### TEST-DEVEL
 %files test-devel
 %defattr(-,root,root)


More information about the scm-commits mailing list