Author: mgoulish Date: Wed Sep 23 09:39:12 2009 New Revision: 818020 URL: http://svn.apache.org/viewvc?rev=818020&view=rev Log: rhs's new system for python allows us to build python test code that is appropriate for the installed python version, and place the code at any desired location. This is a big improvement in making the builds automatically adapt to different OSs.
>From src/tests/Makefile.am, I am calling his gadget to create the code, and placing it all in PYTHON_DIR/temp. Then altering the paths in a bunch of test scripts to point to the right places. Modified: qpid/trunk/qpid/cpp/src/tests/Makefile.am qpid/trunk/qpid/cpp/src/tests/clustered_replication_test qpid/trunk/qpid/cpp/src/tests/federated_cluster_test qpid/trunk/qpid/cpp/src/tests/federated_topic_test qpid/trunk/qpid/cpp/src/tests/python_tests qpid/trunk/qpid/cpp/src/tests/reliable_replication_test qpid/trunk/qpid/cpp/src/tests/run_acl_tests qpid/trunk/qpid/cpp/src/tests/run_cli_tests qpid/trunk/qpid/cpp/src/tests/run_cluster_tests qpid/trunk/qpid/cpp/src/tests/run_federation_tests qpid/trunk/qpid/cpp/src/tests/run_header_test qpid/trunk/qpid/cpp/src/tests/run_ring_queue_test Modified: qpid/trunk/qpid/cpp/src/tests/Makefile.am URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/Makefile.am?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/Makefile.am (original) +++ qpid/trunk/qpid/cpp/src/tests/Makefile.am Wed Sep 23 09:39:12 2009 @@ -349,3 +349,10 @@ check-long: $(MAKE) check TESTS="$(LONG_TESTS)" VALGRIND= + +all: python_prep + +python_prep : + ( cd ../../../python ; make install EXEC_PREFIX=temp PYTHON_LIB=temp AMQP_SPEC_DIR=$${PWD}/../specs ) + + Modified: qpid/trunk/qpid/cpp/src/tests/clustered_replication_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/clustered_replication_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/clustered_replication_test (original) +++ qpid/trunk/qpid/cpp/src/tests/clustered_replication_test Wed Sep 23 09:39:12 2009 @@ -22,7 +22,7 @@ # Test reliability of the replication feature in the face of link # failures: srcdir=`dirname $0` -PYTHON_DIR=$srcdir/../../../python +PYTHON_DIR=$srcdir/../../../python/temp export PYTHONPATH=$PYTHON_DIR trap stop_brokers INT EXIT @@ -89,8 +89,8 @@ #start first node of primary cluster and set up test queue echo Starting primary cluster PRIMARY1=$(with_ais_group ../qpidd $GENERAL_OPTS $PRIMARY_OPTS --log-to-file repl.primary.1.tmp) || fail "Could not start node" - $PYTHON_DIR/commands/qpid-config -a "localhost:$PRIMARY1" add queue test-queue --generate-queue-events 2 - $PYTHON_DIR/commands/qpid-config -a "localhost:$PRIMARY1" add queue control-queue --generate-queue-events 1 + $PYTHON_DIR/qpid-config -a "localhost:$PRIMARY1" add queue test-queue --generate-queue-events 2 + $PYTHON_DIR/qpid-config -a "localhost:$PRIMARY1" add queue control-queue --generate-queue-events 1 #send 10 messages, consume 5 of them for i in `seq 1 10`; do echo Message$i; done | ./sender --port $PRIMARY1 @@ -105,10 +105,10 @@ DR1=$(with_ais_group ../qpidd $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.1.tmp) DR2=$(with_ais_group ../qpidd $GENERAL_OPTS $DR_OPTS --log-to-file repl.dr.2.tmp) - $PYTHON_DIR/commands/qpid-config -a "localhost:$DR1" add queue test-queue - $PYTHON_DIR/commands/qpid-config -a "localhost:$DR1" add queue control-queue - $PYTHON_DIR/commands/qpid-config -a "localhost:$DR1" add exchange replication REPLICATION_EXCHANGE - $PYTHON_DIR/commands/qpid-route queue add localhost:$DR2 localhost:$PRIMARY2 REPLICATION_EXCHANGE REPLICATION_QUEUE + $PYTHON_DIR/qpid-config -a "localhost:$DR1" add queue test-queue + $PYTHON_DIR/qpid-config -a "localhost:$DR1" add queue control-queue + $PYTHON_DIR/qpid-config -a "localhost:$DR1" add exchange replication REPLICATION_EXCHANGE + $PYTHON_DIR/qpid-route queue add localhost:$DR2 localhost:$PRIMARY2 REPLICATION_EXCHANGE REPLICATION_QUEUE #send more messages to primary for i in `seq 11 20`; do echo Message$i; done | ./sender --port $PRIMARY1 --send-eos 1 Modified: qpid/trunk/qpid/cpp/src/tests/federated_cluster_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/federated_cluster_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/federated_cluster_test (original) +++ qpid/trunk/qpid/cpp/src/tests/federated_cluster_test Wed Sep 23 09:39:12 2009 @@ -22,7 +22,7 @@ # Test reliability of the replication feature in the face of link # failures: srcdir=`dirname $0` -PYTHON_DIR=$srcdir/../../../python +PYTHON_DIR=$srcdir/../../../python/temp trap stop_brokers EXIT @@ -63,20 +63,20 @@ setup() { export PYTHONPATH=$PYTHON_DIR #create exchange on both cluster and single broker - $PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_A" add exchange direct test-exchange - $PYTHON_DIR/commands/qpid-config -a "localhost:$NODE_1" add exchange direct test-exchange + $PYTHON_DIR/qpid-config -a "localhost:$BROKER_A" add exchange direct test-exchange + $PYTHON_DIR/qpid-config -a "localhost:$NODE_1" add exchange direct test-exchange #create dynamic routes for test exchange - $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$NODE_2" "localhost:$BROKER_A" test-exchange - $PYTHON_DIR/commands/qpid-route dynamic add "localhost:$BROKER_A" "localhost:$NODE_2" test-exchange + $PYTHON_DIR/qpid-route dynamic add "localhost:$NODE_2" "localhost:$BROKER_A" test-exchange + $PYTHON_DIR/qpid-route dynamic add "localhost:$BROKER_A" "localhost:$NODE_2" test-exchange #create test queue on cluster and bind it to the test exchange - $PYTHON_DIR/commands/qpid-config -a "localhost:$NODE_1" add queue test-queue - $PYTHON_DIR/commands/qpid-config -a "localhost:$NODE_1" bind test-exchange test-queue to-cluster + $PYTHON_DIR/qpid-config -a "localhost:$NODE_1" add queue test-queue + $PYTHON_DIR/qpid-config -a "localhost:$NODE_1" bind test-exchange test-queue to-cluster #create test queue on single broker and bind it to the test exchange - $PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_A" add queue test-queue - $PYTHON_DIR/commands/qpid-config -a "localhost:$BROKER_A" bind test-exchange test-queue from-cluster + $PYTHON_DIR/qpid-config -a "localhost:$BROKER_A" add queue test-queue + $PYTHON_DIR/qpid-config -a "localhost:$BROKER_A" bind test-exchange test-queue from-cluster } run_test_pull_to_cluster_two_consumers() { Modified: qpid/trunk/qpid/cpp/src/tests/federated_topic_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/federated_topic_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/federated_topic_test (original) +++ qpid/trunk/qpid/cpp/src/tests/federated_topic_test Wed Sep 23 09:39:12 2009 @@ -43,7 +43,7 @@ done MY_DIR=$(dirname $(which $0)) -PYTHON_DIR=${MY_DIR}/../../../python +PYTHON_DIR=${MY_DIR}/../../../python/temp trap stop_brokers EXIT Modified: qpid/trunk/qpid/cpp/src/tests/python_tests URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/python_tests?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/python_tests (original) +++ qpid/trunk/qpid/cpp/src/tests/python_tests Wed Sep 23 09:39:12 2009 @@ -22,7 +22,7 @@ # Run the python tests. QPID_PORT=${QPID_PORT:-5672} PYTHON_TESTS=${PYTHON_TESTS:-$*} -QPID_PYTHON_DIR=${QPID_PYTHON_DIR:-`dirname $0`/../../../python} +QPID_PYTHON_DIR=${QPID_PYTHON_DIR:-`dirname $0`/../../../python/temp} FAILING=${FAILING:-/dev/null} if test -d $QPID_PYTHON_DIR; then Modified: qpid/trunk/qpid/cpp/src/tests/reliable_replication_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/reliable_replication_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/reliable_replication_test (original) +++ qpid/trunk/qpid/cpp/src/tests/reliable_replication_test Wed Sep 23 09:39:12 2009 @@ -22,7 +22,7 @@ # Test reliability of the replication feature in the face of link # failures: MY_DIR=`dirname \`which $0\`` -PYTHON_DIR=${MY_DIR}/../../../python +PYTHON_DIR=${MY_DIR}/../../../python/temp trap stop_brokers EXIT Modified: qpid/trunk/qpid/cpp/src/tests/run_acl_tests URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_acl_tests?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_acl_tests (original) +++ qpid/trunk/qpid/cpp/src/tests/run_acl_tests Wed Sep 23 09:39:12 2009 @@ -20,7 +20,7 @@ # # Run the acl tests. $srcdir is set by the Makefile. -PYTHON_DIR=$srcdir/../../../python +PYTHON_DIR=$srcdir/../../../python/temp DATA_DIR=`pwd`/data_dir trap stop_brokers INT TERM QUIT Modified: qpid/trunk/qpid/cpp/src/tests/run_cli_tests URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cli_tests?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_cli_tests (original) +++ qpid/trunk/qpid/cpp/src/tests/run_cli_tests Wed Sep 23 09:39:12 2009 @@ -21,8 +21,8 @@ # Run the cli-utility tests. MY_DIR=`dirname \`which $0\`` -PYTHON_DIR=${MY_DIR}/../../../python -CLI_DIR=${PYTHON_DIR}/commands +PYTHON_DIR=${MY_DIR}/../../../python/temp +CLI_DIR=${PYTHON_DIR} trap stop_brokers INT TERM QUIT Modified: qpid/trunk/qpid/cpp/src/tests/run_cluster_tests URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_cluster_tests?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_cluster_tests (original) +++ qpid/trunk/qpid/cpp/src/tests/run_cluster_tests Wed Sep 23 09:39:12 2009 @@ -26,7 +26,7 @@ top_builddir=${srcdir}/../../ fi TEST_DIR=${top_builddir}/src/tests -PYTHON_DIR=${srcdir}/../../../python +PYTHON_DIR=${srcdir}/../../../python/temp if test -z $1; then CLUSTER_TEST="${PYTHON_DIR}/qpid-python-test -m cluster_tests cluster_tests.ShortTests.\*" @@ -114,4 +114,4 @@ # Delete cluster store dir if test was successful. rm -rf ${TMP_DATA_DIR} -exit 0 \ No newline at end of file +exit 0 Modified: qpid/trunk/qpid/cpp/src/tests/run_federation_tests URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_federation_tests?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_federation_tests (original) +++ qpid/trunk/qpid/cpp/src/tests/run_federation_tests Wed Sep 23 09:39:12 2009 @@ -21,7 +21,7 @@ # Run the federation tests. MY_DIR=`dirname \`which $0\`` -PYTHON_DIR=${MY_DIR}/../../../python +PYTHON_DIR=${MY_DIR}/../../../python/temp trap stop_brokers INT TERM QUIT Modified: qpid/trunk/qpid/cpp/src/tests/run_header_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_header_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_header_test (original) +++ qpid/trunk/qpid/cpp/src/tests/run_header_test Wed Sep 23 09:39:12 2009 @@ -24,7 +24,7 @@ # in both directions srcdir=`dirname $0` -PYTHON_DIR=$srcdir/../../../python +PYTHON_DIR=$srcdir/../../../python/temp test -f qpidd.port && QPID_PORT=`cat qpidd.port` if test -d ${PYTHON_DIR} ; then Modified: qpid/trunk/qpid/cpp/src/tests/run_ring_queue_test URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/run_ring_queue_test?rev=818020&r1=818019&r2=818020&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/run_ring_queue_test (original) +++ qpid/trunk/qpid/cpp/src/tests/run_ring_queue_test Wed Sep 23 09:39:12 2009 @@ -22,7 +22,7 @@ #setup path to find qpid-config and sender/receiver test progs srcdir=`dirname $0` -PYTHON_DIR=$srcdir/../../../python +PYTHON_DIR=$srcdir/../../../python/temp export PYTHONPATH=$PYTHON_DIR export PATH=./:$PYTHON_DIR/commands:$PATH --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscr...@qpid.apache.org