You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2007/06/26 21:33:00 UTC

svn commit: r550915 - in /incubator/qpid/trunk/qpid/cpp/src: qpid/client/Connector.cpp tests/Makefile.am tests/cluster.mk

Author: aconway
Date: Tue Jun 26 12:33:00 2007
New Revision: 550915

URL: http://svn.apache.org/viewvc?view=rev&rev=550915
Log:

	* src/tests/cluster.mk: Replace sudo with newgrp for ais tests.
	Skip ais tests with warning if user is not in ais group.
	* src/tests/Makefile.am: Enable valgrind for all tests.
	* src/qpid/client/Connector.cpp: Fix memory leak.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
    incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp?view=diff&rev=550915&r1=550914&r2=550915
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Connector.cpp Tue Jun 26 12:33:00 2007
@@ -46,7 +46,9 @@
     outbuf(send_buffer_size)
 { }
 
-Connector::~Connector(){ }
+Connector::~Connector(){
+    receiver.join();
+}
 
 void Connector::connect(const std::string& host, int port){
     socket = Socket::createTcp();

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am?view=diff&rev=550915&r1=550914&r2=550915
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am Tue Jun 26 12:33:00 2007
@@ -89,12 +89,7 @@
 
 check_PROGRAMS += $(unit_progs) $(testprogs) interop_runner
 
-# FIXME aconway 2007-05-30: TESTS_ENVIRONMENT should have ./run_test
-# as below to run valgrind on all test programs.
-# Disabled temporarily till leaks in client_test are fixed.
-#
-#TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) ./run_test
-TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir)
+TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) ./run_test
 
 system_tests = client_test quick_topictest
 TESTS = dummy_test $(unit_progs) $(unit_wrappers) run-unit-tests start_broker $(system_tests) python_tests kill_broker daemon_test

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk?view=diff&rev=550915&r1=550914&r2=550915
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/cluster.mk Tue Jun 26 12:33:00 2007
@@ -6,16 +6,20 @@
 
 # NOTE: Programs using the openais library must be run with gid=ais
 # Such programs are built as *.ais, with a wrapper script *.sh that
-# runs the program under sudo -u ais.
+# runs the program with newgrp ais.
 # 
 
-# Rule to generate wrappers.
-# The chmod is a horrible hack to allow libtools annoying wrapers to
-# relink the executable when run as user ais.
+# Rule to generate wrapper scripts for tests that require gid=ais.
+run_test="env VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test"
 .ais.sh:
-	echo sudo -u ais env VALGRIND=$(VALGRIND) srcdir=$(srcdir) $(srcdir)/run_test ./$<  >$@; chmod a+x $@
-	chmod a+rwx . .libs
+	echo "if groups | grep '\bais\b' >/dev/null;" > $@_t
+	echo "then echo $(run_test) ./$< \"$$@	\"| newgrp ais;" >>$@_t
+	echo "else echo WARNING: `whoami` not in group ais, skipping $<.;" >>$@_t
+	echo "fi"  >> $@_t
+	mv $@_t $@
+	chmod a+x $@
 
+#
 # Cluster tests.
 # 
 check_PROGRAMS+=Cpg.ais