Author: kpvdr
Date: 2009-07-10 10:13:30 -0400 (Fri, 10 Jul 2009)
New Revision: 3481
Added:
store/trunk/cpp/tests/cluster/run_long_cluster_tests
store/trunk/cpp/tests/jrnl/_st_long_basic
store/trunk/cpp/tests/jrnl/_st_long_read
store/trunk/cpp/tests/run_long_python_tests
Modified:
store/trunk/cpp/Makefile.am
store/trunk/cpp/rhel4-support/rhel4.patch
store/trunk/cpp/tests/Makefile.am
store/trunk/cpp/tests/cluster/Makefile.am
store/trunk/cpp/tests/cluster/run_cluster_tests
store/trunk/cpp/tests/jrnl/
store/trunk/cpp/tests/jrnl/Makefile.am
store/trunk/cpp/tests/jrnl/_st_basic.cpp
store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
store/trunk/cpp/tests/jrnl/_st_read.cpp
store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
store/trunk/cpp/tests/jrnl/jtt/
store/trunk/cpp/tests/jrnl/jtt/Makefile.am
store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
store/trunk/cpp/tests/jrnl/run-journal-tests
store/trunk/cpp/tests/python_tests/flow_to_disk.py
store/trunk/cpp/tests/run_python_tests
store/trunk/cpp/tests/system_test.sh
Log:
Split tests into long and short tests. (Python tests till need splitting.) "make
check" builds short tests, "make check-long" builds long tests. Both should
be run for complete testing, as some crucial tests fall into the long category.
Modified: store/trunk/cpp/Makefile.am
===================================================================
--- store/trunk/cpp/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -55,3 +55,6 @@
else
@echo "WARNING: rpmlint not found, could not validate RPMs."
endif
+
+check-long:
+ $(MAKE) -C tests check-long
\ No newline at end of file
Modified: store/trunk/cpp/rhel4-support/rhel4.patch
===================================================================
--- store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/rhel4-support/rhel4.patch 2009-07-10 14:13:30 UTC (rev 3481)
@@ -91,24 +91,10 @@
+ fun:calloc
+ fun:_dl_allocate_tls
+ fun:pthread_create@@GLIBC_2.2.5
-+ fun:_ZN3mrg3jtt13jrnl_instance6run_tcEv
-+ fun:_Z13constructor_1v
-+ fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
+}
+{
+ <insert a suppression name here>
+ Memcheck:Leak
-+ fun:calloc
-+ fun:_dl_allocate_tls
-+ fun:pthread_create@@GLIBC_2.2.5
-+ fun:_ZN4qpid3sys13ThreadPrivateC1EPNS0_8RunnableE
-+ fun:_ZN4qpid3sys6ThreadC1EPNS0_8RunnableE
-+ fun:_ZN4qpid6broker5Timer5startEv
-+ fun:_ZN4qpid6broker5TimerC1Ev
-+}
-+{
-+ <insert a suppression name here>
-+ Memcheck:Leak
+ fun:_Znwm
+ fun:_ZN5boost9unit_test9test_caseC2ENS0_13basic_cstringIKcEEbmb
+}
Modified: store/trunk/cpp/tests/Makefile.am
===================================================================
--- store/trunk/cpp/tests/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -39,6 +39,9 @@
system_test.sh \
clean.sh
+LONG_TESTS = \
+ run_long_python_tests
+
check_PROGRAMS = \
SimpleTest \
OrderingTest \
@@ -83,3 +86,10 @@
STORE_LIB=$(abs_builddir)/../lib/.libs/msgstore.so \
TMP_DATA_DIR=$(TMP_DATA_DIR) \
$(srcdir)/run_test
+
+# Note: Auto-recursion is not supported for custom targets, so add a ${MAKE} -C for each
dir in the SUBDIRS list above.
+check-long:
+# $(MAKE) -C jrnl check-long
+# $(MAKE) -C cluster check-long
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
+
\ No newline at end of file
Modified: store/trunk/cpp/tests/cluster/Makefile.am
===================================================================
--- store/trunk/cpp/tests/cluster/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/cluster/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -42,6 +42,8 @@
TESTS = run_cluster_tests
+LONG_TESTS = run_long_cluster_tests
+
TESTS_ENVIRONMENT = \
BOOST_TEST_SHOW_PROGRESS=yes \
STORE_ENABLE=1 \
@@ -54,4 +56,7 @@
EXTRA_DIST = \
run_cluster_tests
+check-long:
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
+
endif
\ No newline at end of file
Modified: store/trunk/cpp/tests/cluster/run_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/cluster/run_cluster_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -23,6 +23,11 @@
srcdir=`dirname $0`
+if test $1 == "LONG_TEST"; then
+ echo "Running long tests..."
+ LONG_TEST=1
+fi
+
# Check AIS requirements and run tests if found.
id -nG | grep '\<ais\>' >/dev/null || \
NOGROUP="You are not a member of the ais group."
@@ -47,11 +52,10 @@
fi
# QPID_DIR is defined for source tree builds because of the --with-qpid-checkout config
parameter
-CPP_CLUSTER_EXEC=cluster_test
-PYTHON_CLUSTER_EXEC=cluster.py
if test "${QPID_DIR}" -a -d ${QPID_DIR} ; then
# Source tree path
CLUSTER_DIR=${QPID_DIR}/cpp/src/tests
+ CPP_CLUSTER_EXEC=cluster_test
export PYTHONPATH=${QPID_DIR}/python:${abs_srcdir}
export QPIDD_EXEC=${QPID_DIR}/cpp/src/qpidd
export CLUSTER_LIB=${QPID_DIR}/cpp/src/.libs/cluster.so
@@ -72,12 +76,12 @@
export STORE_LIB=${abs_srcdir}/../../lib/.libs/msgstore.so
# Run the C++ cluster tests
-pwd=`pwd`
-cd ${CLUSTER_DIR}
-sg ais -c "./${CPP_CLUSTER_EXEC}"
-RETCODE=$?
-if test x${RETCODE} != x0; then
- exit 1;
+if test ! ${LONG_TEST}; then
+ sg ais -c "${CLUSTER_DIR}/${CPP_CLUSTER_EXEC}"
+ RETCODE=$?
+ if test x${RETCODE} != x0; then
+ exit 1;
+ fi
fi
# --- Check for Python, then run python cluster tests ---
@@ -110,7 +114,13 @@
fi
export TMP_DATA_DIR
-sg ais -c "./${PYTHON_CLUSTER_EXEC} -v"
+if test ${LONG_TEST}; then
+ PYTHON_CLUSTER_EXEC=long_cluster_tests.py
+else
+ PYTHON_CLUSTER_EXEC=cluster_tests.py
+fi
+
+sg ais -c "${CLUSTER_DIR}/${PYTHON_CLUSTER_EXEC} -v"
RETCODE=$?
if test x${RETCODE} != x0; then
exit 1;
Added: store/trunk/cpp/tests/cluster/run_long_cluster_tests
===================================================================
--- store/trunk/cpp/tests/cluster/run_long_cluster_tests (rev 0)
+++ store/trunk/cpp/tests/cluster/run_long_cluster_tests 2009-07-10 14:13:30 UTC (rev
3481)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+./run_cluster_tests LONG_TEST
Property changes on: store/trunk/cpp/tests/cluster/run_long_cluster_tests
___________________________________________________________________
Name: svn:executable
+ *
Property changes on: store/trunk/cpp/tests/jrnl
___________________________________________________________________
Name: svn:ignore
- .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
+ .deps
.libs
Makefile
Makefile.in
jtest
_ut_enq_map
_ut_arr_cnt
_ut_jdir
_ut_jerrno
_ut_jexception
_ut_jinf
_ut_long_lpmgr
_ut_lpmgr
_ut_rec_hdr
_ut_time_ns
_ut_txn_map
_st_basic
_st_basic_txn
_st_read
_st_read_txn
_st_auto_expand
.valgrind.supp
.valgrindrc
Modified: store/trunk/cpp/tests/jrnl/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -56,7 +56,12 @@
_st_basic_txn \
_st_read \
_st_read_txn \
- _st_auto_expand \
+ _st_auto_expand
+
+LONG_TESTS = \
+ _ut_long_lpmgr \
+ _st_long_basic \
+ _st_long_read \
run-journal-tests
check_PROGRAMS = \
@@ -70,14 +75,17 @@
_ut_enq_map \
_ut_txn_map \
_ut_lpmgr \
+ _ut_long_lpmgr \
_st_basic \
_st_basic_txn \
+ _st_long_basic \
+ _st_long_read \
_st_read \
_st_read_txn \
_st_auto_expand
UNIT_TEST_SRCS = ../unit_test.cpp
-UNIT_TEST_LDADD = -lboost_unit_test_framework ${top_builddir}/lib/msgstore.la
+UNIT_TEST_LDADD = -lboost_unit_test_framework $(top_builddir)/lib/msgstore.la
_ut_time_ns_SOURCES = _ut_time_ns.cpp $(UNIT_TEST_SRCS)
_ut_time_ns_LDADD = $(UNIT_TEST_LDADD)
@@ -109,15 +117,27 @@
_ut_lpmgr_SOURCES = _ut_lpmgr.cpp $(UNIT_TEST_SRCS)
_ut_lpmgr_LDADD = $(UNIT_TEST_LDADD) -lrt
+_ut_long_lpmgr_SOURCES = _ut_lpmgr.cpp $(UNIT_TEST_SRCS)
+_ut_long_lpmgr_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_ut_long_lpmgr_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_basic_SOURCES = _st_basic.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_basic_LDADD = $(UNIT_TEST_LDADD) -lrt
+_st_long_basic_SOURCES = _st_basic.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
+_st_long_basic_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_st_long_basic_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_basic_txn_SOURCES = _st_basic_txn.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_basic_txn_LDADD = $(UNIT_TEST_LDADD) -lrt
_st_read_SOURCES = _st_read.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_read_LDADD = $(UNIT_TEST_LDADD) -lrt
+_st_long_read_SOURCES = _st_read.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
+_st_long_read_CPPFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_st_long_read_LDADD = $(UNIT_TEST_LDADD) -lrt
+
_st_read_txn_SOURCES = _st_read_txn.cpp _st_helper_fns.hpp $(UNIT_TEST_SRCS)
_st_read_txn_LDADD = $(UNIT_TEST_LDADD) -lrt
@@ -127,3 +147,8 @@
EXTRA_DIST = \
run-journal-tests \
tests.ods
+
+# Note: Auto-recursion is not supported for custom targets, so add a $(MAKE) -C for each
dir in the SUBDIRS list above.
+check-long:
+ $(MAKE) -C jtt check-long
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
Modified: store/trunk/cpp/tests/jrnl/_st_basic.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_basic.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -38,6 +38,16 @@
// === Test suite ===
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(instantiation)
{
string test_name = get_test_name(test_filename, "instantiation");
@@ -350,6 +360,37 @@
cout << "ok" << endl;
}
+QPID_AUTO_TEST_CASE(double_dequeue)
+{
+ string test_name = get_test_name(test_filename, "double_dequeue");
+ try
+ {
+ string msg;
+
+ test_jrnl jc(test_name, test_dir, test_name);
+ jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
+ enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
+ deq_msg(jc, 0, 1);
+ try{ deq_msg(jc, 0, 2); BOOST_ERROR("Did not throw exception on second
dequeue."); }
+ catch (const jexception& e){ BOOST_CHECK_EQUAL(e.err_code(),
jerrno::JERR_WMGR_DEQRIDNOTENQ); }
+ enq_msg(jc, 2, create_msg(msg, 1, MSG_SIZE), false);
+ deq_msg(jc, 2, 3);
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(journal_overflow)
{
string test_name = get_test_name(test_filename, "journal_overflow");
@@ -494,24 +535,6 @@
cout << "ok" << endl;
}
-QPID_AUTO_TEST_CASE(double_dequeue)
-{
- string test_name = get_test_name(test_filename, "double_dequeue");
- try
- {
- string msg;
+#endif
- test_jrnl jc(test_name, test_dir, test_name);
- jc.initialize(NUM_TEST_JFILES, false, 0, TEST_JFSIZE_SBLKS);
- enq_msg(jc, 0, create_msg(msg, 0, MSG_SIZE), false);
- deq_msg(jc, 0, 1);
- try{ deq_msg(jc, 0, 2); BOOST_ERROR("Did not throw exception on second
dequeue."); }
- catch (const jexception& e){ BOOST_CHECK_EQUAL(e.err_code(),
jerrno::JERR_WMGR_DEQRIDNOTENQ); }
- enq_msg(jc, 2, create_msg(msg, 1, MSG_SIZE), false);
- deq_msg(jc, 2, 3);
- }
- catch(const exception& e) { BOOST_FAIL(e.what()); }
- cout << "ok" << endl;
-}
-
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_helper_fns.hpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -534,8 +534,8 @@
}
bool
-handle_jcntl_response(const iores res, jcntl& jc, unsigned& aio_sleep_cnt, const
std::string& ctxt,
- const iores exp_ret, test_dtok* dtp)
+handle_jcntl_response(const iores res, jcntl& jc, unsigned& aio_sleep_cnt, const
std::string& ctxt, const iores exp_ret,
+ test_dtok* dtp)
{
if (res == RHM_IORES_PAGE_AIOWAIT)
{
@@ -553,8 +553,7 @@
}
u_int64_t
-enq_msg(jcntl& jc, const u_int64_t rid, const string& msg, const bool transient,
- const iores exp_ret = RHM_IORES_SUCCESS)
+enq_msg(jcntl& jc, const u_int64_t rid, const string& msg, const bool transient,
const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_msg(" << rid << ")";
@@ -595,8 +594,8 @@
}
u_int64_t
-enq_txn_msg(jcntl& jc, const u_int64_t rid, const string& msg, const string&
xid,
- const bool transient, const iores exp_ret = RHM_IORES_SUCCESS)
+enq_txn_msg(jcntl& jc, const u_int64_t rid, const string& msg, const string&
xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_txn_msg(" << rid << ")";
@@ -617,8 +616,8 @@
}
u_int64_t
-enq_extern_txn_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const
string& xid,
- const bool transient, const iores exp_ret = RHM_IORES_SUCCESS)
+enq_extern_txn_msg(jcntl& jc, const u_int64_t rid, const std::size_t msg_size, const
string& xid, const bool transient,
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "enq_extern_txn_msg(" << rid << ")";
@@ -661,7 +660,7 @@
u_int64_t
deq_txn_msg(jcntl& jc, const u_int64_t drid, const u_int64_t rid, const string&
xid,
- const iores exp_ret = RHM_IORES_SUCCESS)
+ const iores exp_ret = RHM_IORES_SUCCESS)
{
ostringstream ctxt;
ctxt << "deq_txn_msg(" << drid << ")";
@@ -719,8 +718,7 @@
}
void
-read_msg(jcntl& jc, string& msg, string& xid, bool& transient, bool&
external,
- const iores exp_ret = RHM_IORES_SUCCESS)
+read_msg(jcntl& jc, string& msg, string& xid, bool& transient, bool&
external, const iores exp_ret = RHM_IORES_SUCCESS)
{
void* mp = 0;
std::size_t msize = 0;
@@ -755,9 +753,14 @@
delete dtp;
}
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty
journal with or without
+ * corresponding dequeues (controlled by include_deq) without a threshold - ie until the
journal is full. Assumes
+ * that dequeue records fit into one dblk.
+ */
u_int32_t
-num_msgs_to_full(const u_int16_t num_files, const u_int32_t file_size_dblks,
- const u_int32_t msg_rec_size_dblks, bool include_deq)
+num_msgs_to_full(const u_int16_t num_files, const u_int32_t file_size_dblks, const
u_int32_t msg_rec_size_dblks,
+ bool include_deq)
{
u_int32_t rec_size_dblks = msg_rec_size_dblks;
if (include_deq)
@@ -765,18 +768,30 @@
return u_int32_t(::floor(1.0 * num_files * file_size_dblks / rec_size_dblks));
}
+/*
+ * Returns the number of messages of size msg_rec_size_dblks that will fit into an empty
journal before the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
u_int32_t
-num_msgs_to_threshold(const u_int16_t num_files, const u_int32_t file_size_dblks,
- const u_int32_t msg_rec_size_dblks)
+num_msgs_to_threshold(const u_int16_t num_files, const u_int32_t file_size_dblks, const
u_int32_t msg_rec_size_dblks)
{
- return u_int32_t(::floor(1.0 * num_files * file_size_dblks * JRNL_ENQ_THRESHOLD /
- msg_rec_size_dblks / 100));
+ return u_int32_t(::floor(1.0 * num_files * file_size_dblks * JRNL_ENQ_THRESHOLD /
msg_rec_size_dblks / 100));
}
+/*
+ * Returns the amount of space reserved in dblks (== num dequeues assuming dequeue size
of 1 dblk) for the enqueue
+ * threshold of JRNL_ENQ_THRESHOLD (%).
+ */
u_int32_t
-num_dequeues_rem(const u_int16_t num_files, const u_int32_t file_size_sblks)
+num_dequeues_rem(const u_int16_t num_files, const u_int32_t file_size_dblks)
{
- return u_int32_t(::ceil(num_files * file_size_sblks * (1 - (1.0 * JRNL_ENQ_THRESHOLD
/ 100))));
+ /*
+ * Fraction of journal remaining after threshold is used --------------+
+ * Total no. dblks in journal ------+ |
+ * | |
+ * +------------+------------+
+-----------------+---------------------+
+ */
+ return u_int32_t(::ceil(num_files * file_size_dblks * (1.0 - (1.0 *
JRNL_ENQ_THRESHOLD / 100))));
}
string&
Added: store/trunk/cpp/tests/jrnl/_st_long_basic
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_basic (rev 0)
+++ store/trunk/cpp/tests/jrnl/_st_long_basic 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,131 @@
+#! /bin/sh
+
+# _st_long_basic - temporary wrapper script for .libs/_st_long_basic
+# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
+#
+# The _st_long_basic program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null
2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z
\"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export
LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH
|| { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z
\"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=;
export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset
LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z
\"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=;
export LD_LIBRARY_PATH; }; };
PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\";
export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual
-Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers
-pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_bas!
ic-_st_basic.o _st_long_basic-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais
-L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework
../../lib/.libs/msgstore.so -ldb_cxx-4.7
/home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so
/home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options
-lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath
-Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs
-Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variable:
+ notinst_deplibs=' ../../lib/msgstore.la
/home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la
/home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
+else
+ # When we are sourced in execute mode, $file and $echo are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ echo="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'_st_long_basic'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" || \
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program"
2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $echo "$0: cannot exec $program $*"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $echo "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
Property changes on: store/trunk/cpp/tests/jrnl/_st_long_basic
___________________________________________________________________
Name: svn:executable
+ *
Added: store/trunk/cpp/tests/jrnl/_st_long_read
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_long_read (rev 0)
+++ store/trunk/cpp/tests/jrnl/_st_long_read 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,131 @@
+#! /bin/sh
+
+# _st_long_read - temporary wrapper script for .libs/_st_long_read
+# Generated by ltmain.sh - GNU libtool 1.5.26 (1.1220.2.493 2008/02/01 16:58:18)
+#
+# The _st_long_read program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='/bin/sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null
2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command="(cd /home/kpvdr/mrg/store/tests/jrnl; { test -z
\"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export
LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH
|| { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z
\"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=;
export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset
LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z
\"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=;
export LD_LIBRARY_PATH; }; };
PATH=\"/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kpvdr/bin\";
export PATH; g++ -Werror -pedantic -Wall -Wextra -Wno-shadow -Wpointer-arith -Wcast-qual
-Wcast-align -Wno-long-long -Wvolatile-register-var -Winvalid-pch -Wno-system-headers
-pthread -DBOOST_TEST_DYN_LINK -g -O2 -o \$progdir/\$file _st_long_rea!
d-_st_read.o _st_long_read-unit_test.o -L/usr/lib/openais -L/usr/lib64/openais
-L/usr/lib/corosync -L/usr/lib64/corosync -lboost_unit_test_framework
../../lib/.libs/msgstore.so -ldb_cxx-4.7
/home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidbroker.so
/home/kpvdr/mrg/qpid/cpp/src/.libs/libqpidcommon.so -lboost_program_options
-lboost_filesystem -luuid -ldl -lsasl2 -lrt -laio -Wl,--rpath
-Wl,/home/kpvdr/mrg/store/lib/.libs -Wl,--rpath -Wl,/home/kpvdr/mrg/qpid/cpp/src/.libs
-Wl,--rpath -Wl,/usr/local/lib/qpid/daemon -Wl,--rpath -Wl,/usr/local/lib ) "
+
+# This environment variable determines our operation mode.
+if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
+ # install mode needs the following variable:
+ notinst_deplibs=' ../../lib/msgstore.la
/home/kpvdr/mrg/qpid/cpp/src/libqpidbroker.la
/home/kpvdr/mrg/qpid/cpp/src/libqpidcommon.la'
+else
+ # When we are sourced in execute mode, $file and $echo are already set.
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ echo="echo"
+ file="$0"
+ # Make sure echo works.
+ if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
+ fi
+ fi
+
+ # Find the directory that this script lives in.
+ thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "x$thisdir" = "x$file" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
+ while test -n "$file"; do
+ destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+
+ # If there was a directory component, then change thisdir.
+ if test "x$destdir" != "x$file"; then
+ case "$destdir" in
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
+ *) thisdir="$thisdir/$destdir" ;;
+ esac
+ fi
+
+ file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=`cd "$thisdir" && pwd`
+ test -n "$absdir" && thisdir="$absdir"
+
+ program=lt-'_st_long_read'
+ progdir="$thisdir/.libs"
+
+ if test ! -f "$progdir/$program" || \
+ { file=`ls -1dt "$progdir/$program" "$progdir/../$program"
2>/dev/null | /bin/sed 1q`; \
+ test "X$file" != "X$progdir/$program"; }; then
+
+ file="$$-$program"
+
+ if test ! -d "$progdir"; then
+ mkdir "$progdir"
+ else
+ rm -f "$progdir/$file"
+ fi
+
+ # relink executable if necessary
+ if test -n "$relink_command"; then
+ if relink_command_output=`eval $relink_command 2>&1`; then :
+ else
+ echo "$relink_command_output" >&2
+ rm -f "$progdir/$file"
+ exit 1
+ fi
+ fi
+
+ mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
+ { rm -f "$progdir/$program";
+ mv -f "$progdir/$file" "$progdir/$program"; }
+ rm -f "$progdir/$file"
+ fi
+
+ if test -f "$progdir/$program"; then
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
+ # Run the actual program with our arguments.
+
+ exec "$progdir/$program" ${1+"$@"}
+
+ $echo "$0: cannot exec $program $*"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ $echo "$0: error: \`$progdir/$program' does not exist" 1>&2
+ $echo "This script is just a wrapper for $program." 1>&2
+ echo "See the libtool documentation for more information." 1>&2
+ exit 1
+ fi
+fi
Property changes on: store/trunk/cpp/tests/jrnl/_st_long_read
___________________________________________________________________
Name: svn:executable
+ *
Modified: store/trunk/cpp/tests/jrnl/_st_read.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_st_read.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -38,6 +38,16 @@
// === Test suite ===
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(empty_read)
{
string test_name = get_test_name(test_filename, "empty_read");
@@ -90,42 +100,6 @@
cout << "ok" << endl;
}
-QPID_AUTO_TEST_CASE(multi_page_enqueue_read_dequeue_block)
-{
- string test_name = get_test_name(test_filename,
"multi_page_enqueue_read_dequeue_block");
- try
- {
- string msg;
- string rmsg;
- string xid;
- bool transientFlag;
- bool externalFlag;
-
- test_jrnl jc(test_name, test_dir, test_name);
- jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
- for (int i=0; i<10; i++)
- {
- for (int m=0; m<NUM_MSGS*125; m++)
- enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
- jc.flush();
- for (int m=0; m<NUM_MSGS*125; m++)
- {
- read_msg(jc, rmsg, xid, transientFlag, externalFlag);
- BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
- BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
- BOOST_CHECK_EQUAL(transientFlag, false);
- BOOST_CHECK_EQUAL(externalFlag, false);
- }
- read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
- for (int m=0; m<NUM_MSGS*125; m++)
- deq_msg(jc, m, m+NUM_MSGS*125);
- read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
- }
- }
- catch(const exception& e) { BOOST_FAIL(e.what()); }
- cout << "ok" << endl;
-}
-
QPID_AUTO_TEST_CASE(enqueue_read_dequeue_interleaved)
{
string test_name = get_test_name(test_filename,
"enqueue_read_dequeue_interleaved");
@@ -374,6 +348,53 @@
cout << "ok" << endl;
}
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+QPID_AUTO_TEST_CASE(multi_page_enqueue_read_dequeue_block)
+{
+ string test_name = get_test_name(test_filename,
"multi_page_enqueue_read_dequeue_block");
+ try
+ {
+ string msg;
+ string rmsg;
+ string xid;
+ bool transientFlag;
+ bool externalFlag;
+
+ test_jrnl jc(test_name, test_dir, test_name);
+ jc.initialize(2*NUM_TEST_JFILES, false, 0, 10*TEST_JFSIZE_SBLKS);
+ for (int i=0; i<10; i++)
+ {
+ for (int m=0; m<NUM_MSGS*125; m++)
+ enq_msg(jc, m, create_msg(msg, m, 16*MSG_SIZE), false);
+ jc.flush();
+ for (int m=0; m<NUM_MSGS*125; m++)
+ {
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag);
+ BOOST_CHECK_EQUAL(create_msg(msg, m, 16*MSG_SIZE), rmsg);
+ BOOST_CHECK_EQUAL(xid.size(), std::size_t(0));
+ BOOST_CHECK_EQUAL(transientFlag, false);
+ BOOST_CHECK_EQUAL(externalFlag, false);
+ }
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ for (int m=0; m<NUM_MSGS*125; m++)
+ deq_msg(jc, m, m+NUM_MSGS*125);
+ read_msg(jc, rmsg, xid, transientFlag, externalFlag, RHM_IORES_EMPTY);
+ }
+ }
+ catch(const exception& e) { BOOST_FAIL(e.what()); }
+ cout << "ok" << endl;
+}
+
QPID_AUTO_TEST_CASE(increasing_interval_delayed_read)
{
string test_name = get_test_name(test_filename,
"increasing_interval_delayed_read");
@@ -422,4 +443,6 @@
cout << "ok" << endl;
}
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/_ut_lpmgr.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -395,9 +395,19 @@
// === Tests ===
+#ifndef LONG_TEST
/*
-* Check that after construction, the fcntl array _fcntl_arr is empty and the is_init()
function returns false.
-*/
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
+/*
+ * Check that after construction, the fcntl array _fcntl_arr is empty and the is_init()
function returns false.
+ */
QPID_AUTO_TEST_CASE(default_constructor)
{
string test_name = get_test_name(test_filename, "default_constructor");
@@ -415,8 +425,8 @@
}
/*
-* Check that initialize() correctly creates an ordered fcntl array _fcntl_arr.
-*/
+ * Check that initialize() correctly creates an ordered fcntl array _fcntl_arr.
+ */
QPID_AUTO_TEST_CASE(initialize)
{
string test_name = get_test_name(test_filename, "initialize");
@@ -443,8 +453,8 @@
}
/*
-* Check that recover() correctly sets up the specified pfid list order.
-*/
+ * Check that recover() correctly sets up the specified pfid list order.
+ */
QPID_AUTO_TEST_CASE(recover)
{
string test_name = get_test_name(test_filename, "recover");
@@ -478,8 +488,8 @@
}
/*
-* Check that finalize() after an initialize() empties _fcntl_arr and that afterwards
is_init() returns false.
-*/
+ * Check that finalize() after an initialize() empties _fcntl_arr and that afterwards
is_init() returns false.
+ */
QPID_AUTO_TEST_CASE(initialize_finalize)
{
string test_name = get_test_name(test_filename, "initialize_finalize");
@@ -509,8 +519,8 @@
}
/*
-* Check that finalize() after a recover() empties _fcntl_arr and that afterwards
is_init() returns false.
-*/
+ * Check that finalize() after a recover() empties _fcntl_arr and that afterwards
is_init() returns false.
+ */
QPID_AUTO_TEST_CASE(recover_finalize)
{
string test_name = get_test_name(test_filename, "recover_finalize");
@@ -548,8 +558,8 @@
}
/*
-* Check that 0 and/or null and other extreme/boundary parameters behave as expected.
-*/
+ * Check that 0 and/or null and other extreme/boundary parameters behave as expected.
+ */
QPID_AUTO_TEST_CASE(zero_null_params)
{
string test_name = get_test_name(test_filename, "zero_null_params");
@@ -571,9 +581,9 @@
}
/*
-* Check that initialize()/recover() works correctly after a previous
initialize()/recover() with/without an intervening
-* finalize().
-*/
+ * Check that initialize()/recover() works correctly after a previous
initialize()/recover() with/without an intervening
+ * finalize().
+ */
QPID_AUTO_TEST_CASE(multiple_initialization_recover)
{
string test_name = get_test_name(test_filename,
"multiple_initialization_recover");
@@ -598,15 +608,15 @@
}
/*
-* Check that insert() works correctly after initialize() and shifts the pfid sequence
beyond the insert point correctly:
-*
-* The following sequence is tested:
-* initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
-* insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
-* insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
-* insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
-* issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
-*/
+ * Check that insert() works correctly after initialize() and shifts the pfid sequence
beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * initialize 4 pfids=[0,1,2,3] lfids=[0,1,2,3]
+ * insert 1 after lfid 0 pfids=[0,4,1,2,3] lfids=[0,2,3,4,1]
+ * insert 2 after lfid 2 pfids=[0,4,1,5,6,2,3] lfids=[0,2,5,6,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,1,5,6,2,3,7] lfids=[0,2,5,6,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,1,5,8,6,2,3,7] lfids=[0,2,6,7,1,3,5,8,4]
+ */
QPID_AUTO_TEST_CASE(initialize_insert)
{
string test_name = get_test_name(test_filename, "initialize_insert");
@@ -629,15 +639,15 @@
}
/*
-* Check that insert() works correctly after recover() and shifts the pfid sequence beyond
the insert point correctly:
-*
-* The following sequence is tested:
-* recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
-* insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
-* insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
-* insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
-* issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
-*/
+ * Check that insert() works correctly after recover() and shifts the pfid sequence
beyond the insert point correctly:
+ *
+ * The following sequence is tested:
+ * recover 4 pfids=[0,2,3,1] lfids=[0,3,1,2]
+ * insert 1 after lfid 0 pfids=[0,4,2,3,1] lfids=[0,4,2,3,1]
+ * insert 2 after lfid 2 pfids=[0,4,2,5,6,3,1] lfids=[0,6,2,5,1,3,4]
+ * insert 1 after lfid 6 pfids=[0,4,2,5,6,3,1,7] lfids=[0,6,2,5,1,3,4,7]
+ * issert 1 after lfid 3 pfids=[0,4,2,5,8,6,3,1,7] lfids=[0,7,2,6,1,3,5,8,4]
+ */
QPID_AUTO_TEST_CASE(recover_insert)
{
string test_name = get_test_name(test_filename, "recover_insert");
@@ -662,8 +672,8 @@
}
/*
-* Check that illegal ae parameter combinations are caught and result in an exception
being thrown.
-*/
+ * Check that illegal ae parameter combinations are caught and result in an exception
being thrown.
+ */
QPID_AUTO_TEST_CASE(ae_parameters)
{
string test_name = get_test_name(test_filename, "ae_parameters");
@@ -698,8 +708,8 @@
}
/*
-* Check that initialized or recovered journals with auto-expand disabled will not allow
either inserts or appends.
-*/
+ * Check that initialized or recovered journals with auto-expand disabled will not allow
either inserts or appends.
+ */
QPID_AUTO_TEST_CASE(ae_disabled)
{
string test_name = get_test_name(test_filename, "ae_disabled");
@@ -716,9 +726,9 @@
}
/*
-* Check that initialized or recovered journals with auto-expand enabled and a file limit
set will enforce the correct
-* limits on inserts and appends.
-*/
+ * Check that initialized or recovered journals with auto-expand enabled and a file limit
set will enforce the correct
+ * limits on inserts and appends.
+ */
QPID_AUTO_TEST_CASE(ae_enabled_limit)
{
string test_name = get_test_name(test_filename, "ae_enabled_limit");
@@ -735,9 +745,9 @@
}
/*
-* Check that initialized or recovered journals with auto-expand enabled and no file limit
set (0) will allow inserts and
-* appends up to the file limit JRNL_MAX_NUM_FILES.
-*/
+ * Check that initialized or recovered journals with auto-expand enabled and no file
limit set (0) will allow inserts and
+ * appends up to the file limit JRNL_MAX_NUM_FILES.
+ */
QPID_AUTO_TEST_CASE(ae_enabled_unlimited)
{
string test_name = get_test_name(test_filename, "ae_enabled_unlimited");
@@ -753,12 +763,23 @@
cout << "done" << endl;
}
+#else
/*
-* Tests randomized combinations of initialization/recovery, initial size, number, size
and location of inserts.
-*
-* To reproduce a specific test, comment out the get_seed() statement and uncomment the
literal below, adjusting the seed
-* value to that required.
-*/
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * Tests randomized combinations of initialization/recovery, initial size, number, size
and location of inserts.
+ *
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the
literal below, adjusting the seed
+ * value to that required.
+ */
QPID_AUTO_TEST_CASE(randomized_tests)
{
string test_name = get_test_name(test_filename, "randomized_tests");
@@ -774,7 +795,7 @@
u_int16_t curr_ae_max_jfiles = 0;
jdir::create_dir(test_dir); // Check test dir exists; create it if not
- for (int test_num = 0; test_num < 100; test_num++)
+ for (int test_num = 0; test_num < 250; test_num++)
{
test_jrnl jc(test_name, test_dir, test_name);
lpmgr lm;
@@ -848,4 +869,6 @@
cout << "done" << endl;
}
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Property changes on: store/trunk/cpp/tests/jrnl/jtt
___________________________________________________________________
Name: svn:ignore
- jtt
Makefile
Makefile.in
_ut_data_src
_ut_jrnl_init_params
_ut_jrnl_instance
_ut_read_arg
_ut_test_case
_ut_test_case_set
_ut_test_case_result
_ut_test_case_result_agregation
.deps
.libs
.valgrind.supp
.valgrindrc
+ jtt
Makefile
Makefile.in
_ut_data_src
_ut_jrnl_init_params
_ut_jrnl_instance
_ut_long_data_src
_ut_read_arg
_ut_test_case
_ut_test_case_set
_ut_test_case_result
_ut_test_case_result_agregation
.deps
.libs
.valgrind.supp
.valgrindrc
Modified: store/trunk/cpp/tests/jrnl/jtt/Makefile.am
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/jtt/Makefile.am 2009-07-10 14:13:30 UTC (rev 3481)
@@ -22,11 +22,11 @@
abs_builddir=@abs_builddir@
abs_srcdir=@abs_srcdir@
-AM_CXXFLAGS = $(WARNING_CFLAGS) -I${top_srcdir}/lib -pthread -DBOOST_TEST_DYN_LINK
+AM_CXXFLAGS = $(WARNING_CFLAGS) -I$(top_srcdir)/lib -pthread -DBOOST_TEST_DYN_LINK
TMP_DATA_DIR=$(abs_srcdir)/../../tmp_data_dir
-LINK_BDB = ${top_builddir}/lib/msgstore.la
+LINK_BDB = $(top_builddir)/lib/msgstore.la
TESTS_ENVIRONMENT = \
VALGRIND=$(VALGRIND) \
@@ -50,8 +50,12 @@
_ut_test_case_set \
_ut_jrnl_instance
+LONG_TESTS = \
+ _ut_long_data_src
+
check_PROGRAMS = jtt \
_ut_data_src \
+ _ut_long_data_src \
_ut_jrnl_init_params \
_ut_read_arg \
_ut_test_case \
@@ -91,6 +95,13 @@
../../unit_test.cpp
_ut_data_src_LDADD = -lboost_unit_test_framework -lrt $(LINK_BDB)
+_ut_long_data_src_SOURCES = \
+ _ut_data_src.cpp \
+ data_src.cpp \
+ ../../unit_test.cpp
+_ut_long_data_src_CXXFLAGS = $(AM_CXXFLAGS) -DLONG_TEST
+_ut_long_data_src_LDADD = -lboost_unit_test_framework -lrt $(LINK_BDB)
+
_ut_jrnl_init_params_SOURCES = \
_ut_jrnl_init_params.cpp \
jrnl_init_params.cpp \
@@ -157,3 +168,6 @@
jfile_chk.py \
jtt.csv \
_ut_test_case_set.csv
+
+check-long:
+ $(MAKE) check TESTS="$(LONG_TESTS)" SUBDIRS=.
Modified: store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/jtt/_ut_data_src.cpp 2009-07-10 14:13:30 UTC (rev 3481)
@@ -35,6 +35,26 @@
const string test_filename("_ut_data_src");
+long
+get_seed()
+{
+ timespec ts;
+ if (::clock_gettime(CLOCK_REALTIME, &ts))
+ BOOST_FAIL("Unable to read clock to generate seed.");
+ long tenths = ts.tv_nsec / 100000000;
+ return long(10 * ts.tv_sec + tenths); // time in tenths of a second
+}
+
+#ifndef LONG_TEST
+/*
+ * ==============================================
+ * NORMAL TESTS
+ * This section contains normal "make check" tests
+ * for building/packaging. These are built when
+ * LONG_TEST is _not_ defined.
+ * ==============================================
+ */
+
QPID_AUTO_TEST_CASE(data)
{
cout << test_filename << ".data: " << flush;
@@ -56,9 +76,10 @@
cout << "ok" << endl;
}
+// There is a long version of this test in _ut_long_data_src.cpp
QPID_AUTO_TEST_CASE(xid_data_xid)
{
- const std::size_t num = 256;
+ const std::size_t num = 64;
cout << test_filename << ".xid_data_xid: " << flush;
BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
@@ -103,4 +124,86 @@
cout << "ok" << endl;
}
+#else
+/*
+ * ==============================================
+ * LONG TESTS
+ * This section contains long tests and soak tests,
+ * and are run using target check-long (ie "make
+ * check-long"). These are built when LONG_TEST is
+ * defined.
+ * ==============================================
+ */
+
+/*
+ * To reproduce a specific test, comment out the get_seed() statement and uncomment the
literal below, adjusting the seed
+ * value to that required.
+ */
+QPID_AUTO_TEST_CASE(xid_data_xid)
+{
+ const long seed = get_seed();
+ // const long seed = 0x2d9b69d32;
+ ::srand48(seed);
+
+ const std::size_t num = 1024;
+ cout << test_filename << ".xid_data_xid: seed=0x" <<
std::hex << seed << std::dec << flush;
+ BOOST_CHECK_EQUAL(data_src::get_xid(1), "0");
+ BOOST_CHECK_EQUAL(data_src::get_xid(2), "01");
+ BOOST_CHECK_EQUAL(data_src::get_xid(3), "002");
+ BOOST_CHECK_EQUAL(data_src::get_xid(4), "0003");
+ BOOST_CHECK_EQUAL(data_src::get_xid(5), "00004");
+ BOOST_CHECK_EQUAL(data_src::get_xid(6), "000005");
+ BOOST_CHECK_EQUAL(data_src::get_xid(7), "0000006");
+ BOOST_CHECK_EQUAL(data_src::get_xid(8), "00000007");
+ BOOST_CHECK_EQUAL(data_src::get_xid(9), "xid:00008");
+ BOOST_CHECK_EQUAL(data_src::get_xid(10), "xid:000009");
+ BOOST_CHECK_EQUAL(data_src::get_xid(11), "xid:0000010");
+ BOOST_CHECK_EQUAL(data_src::get_xid(12), "xid:00000011");
+ BOOST_CHECK_EQUAL(data_src::get_xid(13), "xid:00000012:");
+ BOOST_CHECK_EQUAL(data_src::get_xid(14), "xid:00000013:n");
+ BOOST_CHECK_EQUAL(data_src::get_xid(15), "xid:00000014:no");
+ std::size_t i = 15;
+ for (; i<num; i++)
+ {
+ string xid(data_src::get_xid(i));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8)
<< i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), i);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[i-1], (char)('a' + ((i-1)%26)));
+ }
+ for (std::size_t j=data_src::max_xsize-num; j<data_src::max_xsize; j++,i++)
+ {
+ string xid(data_src::get_xid(j));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8)
<< i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), j);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[j-1], (char)('a' + ((j-1)%26)));
+ }
+ std::srand(seed);
+ for (int cnt=0; cnt<1000; cnt++,i++)
+ {
+ std::size_t k = 1 + ::lrand48() % (data_src::max_xsize - 1);
+ string xid(data_src::get_xid(k));
+
+ ostringstream oss;
+ oss << setfill('0') << "xid:" << setw(8)
<< i << ":";
+
+ BOOST_CHECK_EQUAL(xid.size(), k);
+ BOOST_CHECK_EQUAL(xid.substr(0, 13), oss.str());
+ BOOST_CHECK_EQUAL(xid[13], 'n');
+ BOOST_CHECK_EQUAL(xid[k-1], (char)('a' + ((k-1)%26)));
+ }
+ cout << "ok" << endl;
+}
+
+#endif
+
QPID_AUTO_TEST_SUITE_END()
Modified: store/trunk/cpp/tests/jrnl/run-journal-tests
===================================================================
--- store/trunk/cpp/tests/jrnl/run-journal-tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/jrnl/run-journal-tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -22,7 +22,7 @@
# The GNU Lesser General Public License is available in the file COPYING.
fail=0
-num_jrnls=1
+num_jrnls=3
# Run jtt using default test set
echo
Modified: store/trunk/cpp/tests/python_tests/flow_to_disk.py
===================================================================
--- store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/python_tests/flow_to_disk.py 2009-07-10 14:13:30 UTC (rev 3481)
@@ -119,37 +119,42 @@
# --- Simple tests ---
def test_FlowToDisk_00_SimpleMaxCount(self):
+ """Flow-to-disk tests based on setting
max_count"""
self.simpleLimit("test_FlowToDisk_00a", max_count = 10)
self.simpleLimit("test_FlowToDisk_00b", max_count = 10, persistent =
True)
self.simpleLimit("test_FlowToDisk_00c", max_count = 10, max_size =
10000000, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_00d", max_count = 10, max_size =
10000000, persistent = True, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_01_SimpleMaxSize(self):
+ """Flow-to-disk tests based on setting max_size"""
self.simpleLimit("test_FlowToDisk_01a", max_size = 100)
self.simpleLimit("test_FlowToDisk_01b", max_size = 100, persistent =
True)
self.simpleLimit("test_FlowToDisk_01c", max_size = 100000, numMsgs =
100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_01d", max_size = 100000, persistent =
True, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_02_SimpleMaxCountNotAcquired(self):
+ """Flow-to-disk tests based on setting max_count, but not using
pre-acquired mode (ie browsing)"""
self.simpleLimit("test_FlowToDisk_02a", max_count = 10, pre_acquired =
False)
self.simpleLimit("test_FlowToDisk_02b", max_count = 10, persistent =
True, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_02c", max_count = 10, max_size =
10000000, pre_acquired = False, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_02d", max_count = 10, max_size =
10000000, persistent = True, pre_acquired = False, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_03_SimpleMaxSizeNotAcquired(self):
+ """Flow-to-disk tests based on setting max_size, but not using
pre-acquired mode (ie browsing)"""
self.simpleLimit("test_FlowToDisk_03a", max_size = 100, pre_acquired =
False)
self.simpleLimit("test_FlowToDisk_03b", max_size = 100, persistent =
True, pre_acquired = False)
self.simpleLimit("test_FlowToDisk_03c", max_size = 100, pre_acquired =
False, numMsgs = 100, msgSize = 10000)
self.simpleLimit("test_FlowToDisk_03d", max_size = 100, persistent =
True, pre_acquired = False, numMsgs = 100, msgSize = 10000)
def test_FlowToDisk_04_MaxSizeMaxCount(self):
- """Set both max-count and max-size at the same
time"""
+ """Flow-to-disk tests based on setting both max-count and max-size
at the same time"""
self.simpleLimit("test_FlowToDisk_04a", max_count = 10, max_size =
1000)
self.simpleLimit("test_FlowToDisk_04b", max_count = 10, max_size =
1000, msgSize = 250)
self.simpleLimit("test_FlowToDisk_04c", max_count = 10, max_size =
1000, persistent = True)
self.simpleLimit("test_FlowToDisk_04d", max_count = 10, max_size =
1000, msgSize = 250, persistent = True)
def test_FlowToDisk_05_Randomized(self):
+ """Randomized flow-to-disk tests"""
seed = long(1000.0 * time.time())
print "seed=0x%x" % seed
random.seed(seed)
Added: store/trunk/cpp/tests/run_long_python_tests
===================================================================
--- store/trunk/cpp/tests/run_long_python_tests (rev 0)
+++ store/trunk/cpp/tests/run_long_python_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Copyright (c) 2008, 2009 Red Hat, Inc.
+#
+# This file is part of the Qpid async store library msgstore.so.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+#
+# The GNU Lesser General Public License is available in the file COPYING.
+
+./run_python_tests LONG_TEST
Property changes on: store/trunk/cpp/tests/run_long_python_tests
___________________________________________________________________
Name: svn:executable
+ *
Modified: store/trunk/cpp/tests/run_python_tests
===================================================================
--- store/trunk/cpp/tests/run_python_tests 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/run_python_tests 2009-07-10 14:13:30 UTC (rev 3481)
@@ -21,6 +21,11 @@
#
# The GNU Lesser General Public License is available in the file COPYING.
+if test x$1 == x"LONG_TEST"; then
+ echo "Running long tests..."
+ LONG_TEST=1
+fi
+
if test -z ${QPID_DIR} ; then
cat <<EOF
@@ -75,7 +80,7 @@
# Run all python tests
pwdir=$(pwd)
cd ${QPID_PYTHON_DIR}
-sg ais -c "./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I
${FAILING_PYTHON_TESTS} -B \"${BROKER_OPTS}\" ${PYTHON_TESTS}" || { echo
"FAIL python tests for ${AMQP_SPEC}"; fail=1; }
+./run-tests --skip-self-test -v -s ${AMQP_SPEC} -I ${FAILING_PYTHON_TESTS} -B
"${BROKER_OPTS}" ${PYTHON_TESTS} || { echo "FAIL python tests for
${AMQP_SPEC}"; fail=1; }
cd ${pwdir}
exit ${fail}
Modified: store/trunk/cpp/tests/system_test.sh
===================================================================
--- store/trunk/cpp/tests/system_test.sh 2009-07-07 21:58:37 UTC (rev 3480)
+++ store/trunk/cpp/tests/system_test.sh 2009-07-10 14:13:30 UTC (rev 3481)
@@ -48,7 +48,6 @@
done
}
-echo 'Journal (AIO) persistence...'
run_tests || fail=1
exit $fail