rpms/nss/devel nss.spec,1.38,1.39

Kai Engert (kengert) fedora-extras-commits at redhat.com
Fri Feb 15 16:58:21 UTC 2008


Author: kengert

Update of /cvs/extras/rpms/nss/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv25017

Modified Files:
	nss.spec 
Log Message:
* Fri Feb 15 2008 Kai Engert <kengert at redhat.com> - 3.11.99.3-5
- Support concurrent runs of the test suite on a single build host.



Index: nss.spec
===================================================================
RCS file: /cvs/extras/rpms/nss/devel/nss.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- nss.spec	15 Feb 2008 02:44:07 -0000	1.38
+++ nss.spec	15 Feb 2008 16:57:37 -0000	1.39
@@ -4,7 +4,7 @@
 Summary:          Network Security Services
 Name:             nss
 Version:          3.11.99.3
-Release:          4%{?dist}
+Release:          5%{?dist}
 License:          MPLv1.1 or GPLv2+ or LGPLv2+
 URL:              http://www.mozilla.org/projects/security/pki/nss/
 Group:            System Environment/Libraries
@@ -16,6 +16,7 @@
 BuildRequires:    pkgconfig
 BuildRequires:    gawk
 BuildRequires:    psmisc
+BuildRequires:    perl
 Provides:         mozilla-nss
 Obsoletes:        mozilla-nss
 
@@ -161,21 +162,49 @@
 # enable the following line to force a test failure
 # find ./mozilla -name \*.chk | xargs rm -f
 
-# test suite fails on ppc64 and ppc
+### test suite fails on ppc64 and ppc, temporarily disable
 %ifnarch ppc64 ppc
 
-# run test suite
-killall selfserv || :
+# Run test suite.
+# In order to support multiple concurrent executions of the test suite
+# (caused by concurrent RPM builds) on a single host,
+# we'll use a random port. Also, we want to clean up any stuck
+# selfserv processes. If process name "selfserv" is used everywhere,
+# we can't simply do a "killall selfserv", because it could disturb
+# concurrent builds. Therefore we'll do a search and replace and use
+# a different process name.
+# Using xargs doesn't mix well with spaces in filenames, in order to
+# avoid weird quoting we'll require that no spaces are being used.
+
+SPACEISBAD=`find ./mozilla/security/nss/tests | grep -c ' '` ||:
+if [ SPACEISBAD -ne 0 ]; then
+  echo "error: filenames containing space are not supported (xargs)"
+  exit 1
+fi
+MYRAND=`perl -e 'print 9000 + int rand 1000'`; echo $MYRAND ||:
+RANDSERV=selfserv_${MYRAND}; echo $RANDSERV ||:
+DISTBINDIR=`ls -d ./mozilla/dist/*.OBJ/bin`; echo $DISTBINDIR ||:
+pushd `pwd`
+cd $DISTBINDIR
+ln -s selfserv $RANDSERV
+popd
+# man perlrun, man perlrequick
+# replace word-occurrences of selfserv with selfserv_$MYRAND
+find ./mozilla/security/nss/tests -type f |\
+  grep -v "\.db$" |grep -v "\.crl$" | grep -v "\.crt$" |\
+  grep -vw CVS  |xargs grep -lw selfserv |\
+  xargs -l perl -pi -e "s/\bselfserv\b/$RANDSERV/g" ||:
+
+killall $RANDSERV || :
+
 rm -rf ./mozilla/tests_results
 cd ./mozilla/security/nss/tests/
-%ifarch x86_64 s390x ppc64
-TEST_BIND_PORT=8564
-%else
-TEST_BIND_PORT=8532
-%endif
-HOST=localhost DOMSUF=localdomain PORT=$TEST_BIND_PORT ./all.sh
+# all.sh is the test suite script
+HOST=localhost DOMSUF=localdomain PORT=$MYRAND ./all.sh
 cd ../../../../
 
+killall $RANDSERV || :
+
 TEST_FAILURES=`grep -c FAILED ./mozilla/tests_results/security/localhost.1/output.log` || :
 if [ $TEST_FAILURES -ne 0 ]; then
   echo "error: test suite returned failure(s)"
@@ -183,7 +212,7 @@
 fi
 echo "test suite completed"
 
-# end of ifarch for test suite
+### end of ifnarch for test suite
 %endif
 
 
@@ -406,6 +435,8 @@
 
 
 %changelog
+* Fri Feb 15 2008 Kai Engert <kengert at redhat.com> - 3.11.99.3-5
+- Support concurrent runs of the test suite on a single build host.
 * Thu Feb 14 2008 Kai Engert <kengert at redhat.com> - 3.11.99.3-4
 - disable test suite on ppc
 * Thu Feb 14 2008 Kai Engert <kengert at redhat.com> - 3.11.99.3-3




More information about the fedora-extras-commits mailing list