qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1146959 - in /qpid/trunk/qpid/java/tools/bin: Profile-run-from-source check-qpid-java-env perf-report perf_report.sh qpid-bench qpid-python-testkit run-pub run-sub run_pub.sh run_sub.sh set-testkit-env.sh setenv.sh
Date Fri, 15 Jul 2011 04:43:45 GMT
Author: rajith
Date: Fri Jul 15 04:43:44 2011
New Revision: 1146959

URL: http://svn.apache.org/viewvc?rev=1146959&view=rev
Log:
QPID-3358 Simplified the scripts to make it easy to run them.
1. Removed the various set-env scripts. Instead in their place I want to introduce profiles
that sets the env to
run under different environments. Ex from a source checkout or installed rpms.

2. Introduced Profile-run-from-source to set the env to run the tools
from an SVN checkout in a linux env.

3. Modified the scripts to use common variable names things like
classpaths, java executable, logging config etc..

Added:
    qpid/trunk/qpid/java/tools/bin/Profile-run-from-source   (with props)
    qpid/trunk/qpid/java/tools/bin/check-qpid-java-env   (contents, props changed)
      - copied, changed from r1146679, qpid/trunk/qpid/java/tools/bin/qpid-bench
    qpid/trunk/qpid/java/tools/bin/perf-report
      - copied, changed from r1146679, qpid/trunk/qpid/java/tools/bin/perf_report.sh
    qpid/trunk/qpid/java/tools/bin/run-pub   (contents, props changed)
      - copied, changed from r1146679, qpid/trunk/qpid/java/tools/bin/run_pub.sh
    qpid/trunk/qpid/java/tools/bin/run-sub   (contents, props changed)
      - copied, changed from r1146679, qpid/trunk/qpid/java/tools/bin/run_sub.sh
Removed:
    qpid/trunk/qpid/java/tools/bin/perf_report.sh
    qpid/trunk/qpid/java/tools/bin/run_pub.sh
    qpid/trunk/qpid/java/tools/bin/run_sub.sh
    qpid/trunk/qpid/java/tools/bin/set-testkit-env.sh
    qpid/trunk/qpid/java/tools/bin/setenv.sh
Modified:
    qpid/trunk/qpid/java/tools/bin/qpid-bench   (contents, props changed)
    qpid/trunk/qpid/java/tools/bin/qpid-python-testkit

Added: qpid/trunk/qpid/java/tools/bin/Profile-run-from-source
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/Profile-run-from-source?rev=1146959&view=auto
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/Profile-run-from-source (added)
+++ qpid/trunk/qpid/java/tools/bin/Profile-run-from-source Fri Jul 15 04:43:44 2011
@@ -0,0 +1,71 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Sets the environment for running the scripts from a source checkout.
+txtbld=$(tput bold)             # Bold
+txtrst=$(tput sgr0)             # Reset
+txtred=$(tput setaf 1)          # red
+txtgreen=$(tput setaf 2)        # green
+
+echo "${txtbld}Setting the environment to run qpid java tools from a source checkout${txtrst}"
+
+abs_path()
+{
+  D=`dirname "$1"` 
+  echo "`cd \"$D\" 2>/dev/null && pwd`"
+}
+
+export QPID_CHECKOUT=`abs_path "../../../../"`
+echo "${txtgreen}Using source checkout at $QPID_CHECKOUT${txtrst}"
+
+export PATH=$QPID_CHECKOUT/java/tools/bin:$PATH
+
+if [ "$JAVA" = "" ] ; then
+    export JAVA=$(which java)
+fi
+
+#------------- Required for perf_report, qpid-bench & qpid-python-testkit ----------------
+
+export VENDOR_LIB=$QPID_CHECKOUT/java/build/lib
+export CLASSPATH=`find $VENDOR_LIB -name '*.jar' | tr '\n' ':'`
+export LOG_CONFIG="-Dlog4j.configuration=file:///$QPID_CHECKOUT/java/tools/etc/test.log4j"
+
+
+#------------- Required for qpid-python-testkit -----------------------------------------
+
+PYTHONPATH=$QPID_CHECKOUT/python/qpid:$QPID_CHECKOUT/cpp/src/test/brokertest.py:$PYTHONPATH
+export PATH=$QPID_CHECKOUT/python:$PATH
+
+if [ -x $QPID_CHECKOUT/cpp/src/qpidd ]; then
+   QPIDD_EXEC=$QPID_CHECKOUT/cpp/src/qpidd
+else
+      echo "${txtred}WARNING: Qpid CPP broker executable not found. You will not be able
to run qpid-python-testkit${txtrst}"
+fi
+
+if [ -x $QPID_CHECKOUT/cpp/src/.libs/cluster.so ]; then
+      CLUSTER_LIB=$QPID_CHECKOUT/cpp/src/.libs/cluster.so
+else
+     echo "${txtred}WARNING: Qpid cluster.so not found.You will not be able to run qpid-python-testkit${txtrst}"
+fi
+
+if [ "$STORE_LIB" = "" ] ; then
+     echo "${txtred}WARNING: Please point the STORE_LIB variable to the message store module.
If not persistence tests will not write messages to disk.${txtrst}"
+fi
+
+export PYTHONPATH QPIDD_EXEC CLUSTER_LIB

Propchange: qpid/trunk/qpid/java/tools/bin/Profile-run-from-source
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/trunk/qpid/java/tools/bin/check-qpid-java-env (from r1146679, qpid/trunk/qpid/java/tools/bin/qpid-bench)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/check-qpid-java-env?p2=qpid/trunk/qpid/java/tools/bin/check-qpid-java-env&p1=qpid/trunk/qpid/java/tools/bin/qpid-bench&r1=1146679&r2=1146959&rev=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/qpid-bench (original)
+++ qpid/trunk/qpid/java/tools/bin/check-qpid-java-env Fri Jul 15 04:43:44 2011
@@ -18,18 +18,21 @@
 # under the License.
 #
 
-if [ -z "$QPID_HOME" ]; then
-    export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
-    export PATH=${PATH}:${QPID_HOME}/bin
+if  [ -z "$LOG_CONFIG" ]; then
+  echo "Please set the appropriate parameters for logging as it may affect performance. Ex
log4j defaults to DEBUG if not configured properly"
+  exit -1
 fi
 
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
+if [ -z "$JAVA_MEM" ]; then
+   JAVA_MEM=-Xmx1024m 
+fi
 
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
-       JAVA_VM=-server \
-       JAVA_MEM=-Xmx1024m \
-       QPID_CLASSPATH=$QPID_LIBS
+if [ -z "$JAVA" ]; then
+   echo "Please set the path to the correct java executable to JAVA"
+   exit -1
+fi
 
-. qpid-run org.apache.qpid.tools.QpidBench "$@"
+if [ -z "$CLASSPATH" ]; then
+   echo "Please set the $CLASSPATH variable to point to the jar/class files"
+   exit -1
+fi

Propchange: qpid/trunk/qpid/java/tools/bin/check-qpid-java-env
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/trunk/qpid/java/tools/bin/perf-report (from r1146679, qpid/trunk/qpid/java/tools/bin/perf_report.sh)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/perf-report?p2=qpid/trunk/qpid/java/tools/bin/perf-report&p1=qpid/trunk/qpid/java/tools/bin/perf_report.sh&r1=1146679&r2=1146959&rev=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/perf_report.sh (original)
+++ qpid/trunk/qpid/java/tools/bin/perf-report Fri Jul 15 04:43:44 2011
@@ -23,14 +23,11 @@
 
 SUB_MEM=-Xmx1024M
 PUB_MEM=-Xmx1024M
-LOG_CONFIG="-Damqj.logging.level=WARN"
 QUEUE="queue;{create:always,node:{x-declare:{auto-delete:true}}}"
 DURA_QUEUE="dqueue;{create:always,node:{durable:true,x-declare:{auto-delete:true}}}"
 TOPIC="amq.topic/test"
 DURA_TOPIC="amq.topic/test;{create:always,link:{durable:true}}"
 
-. setenv.sh
-
 waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; }
 cleanup()
 {
@@ -46,9 +43,9 @@ cleanup()
 # $3 producer options
 run_testcase()
 {
-  sh run_sub.sh $LOG_CONFIG $SUB_MEM $2 > sub.out &
+  sh run-sub $LOG_CONFIG $SUB_MEM $2 > sub.out &
   waitfor sub.out "Warming up"
-  sh run_pub.sh $LOG_CONFIG $PUB_MEM $3 > pub.out &
+  sh run-pub $LOG_CONFIG $PUB_MEM $3 > pub.out &
   waitfor sub.out "Completed the test"
   waitfor pub.out "Consumer has completed the test"
   sleep 2 #give a grace period to shutdown

Modified: qpid/trunk/qpid/java/tools/bin/qpid-bench
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/qpid-bench?rev=1146959&r1=1146958&r2=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/qpid-bench (original)
+++ qpid/trunk/qpid/java/tools/bin/qpid-bench Fri Jul 15 04:43:44 2011
@@ -18,18 +18,6 @@
 # under the License.
 #
 
-if [ -z "$QPID_HOME" ]; then
-    export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
-    export PATH=${PATH}:${QPID_HOME}/bin
-fi
+. check-qpid-java-env
 
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
-       JAVA_VM=-server \
-       JAVA_MEM=-Xmx1024m \
-       QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run org.apache.qpid.tools.QpidBench "$@"
+$JAVA -cp $CLASSPATH -server $JAVA_MEM $LOG_CONFIG org.apache.qpid.tools.QpidBench "$@"

Propchange: qpid/trunk/qpid/java/tools/bin/qpid-bench
------------------------------------------------------------------------------
    svn:executable = *

Modified: qpid/trunk/qpid/java/tools/bin/qpid-python-testkit
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/qpid-python-testkit?rev=1146959&r1=1146958&r2=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/qpid-python-testkit (original)
+++ qpid/trunk/qpid/java/tools/bin/qpid-python-testkit Fri Jul 15 04:43:44 2011
@@ -22,9 +22,12 @@
 # via the python test runner. The defaults are set for a running
 # from an svn checkout
 
-. ./set-testkit-env.sh
+. check-qpid-java-env
 
 export PYTHONPATH=./:$PYTHONPATH
-rm -rf $OUTDIR
-qpid-python-test -DOUTDIR=$OUTDIR  -m testkit "$@"
-
+echo $PYTHONPATH
+if [ "$OUTDIR" = "" ] ; then
+   OUTDIR=$PWD
+fi
+testdir=$OUTDIR/testkit-out-`date +%F-%H-%M-%S`
+qpid-python-test -m testkit -DOUTDIR=$testdir"$@"

Copied: qpid/trunk/qpid/java/tools/bin/run-pub (from r1146679, qpid/trunk/qpid/java/tools/bin/run_pub.sh)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/run-pub?p2=qpid/trunk/qpid/java/tools/bin/run-pub&p1=qpid/trunk/qpid/java/tools/bin/run_pub.sh&r1=1146679&r2=1146959&rev=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/run_pub.sh (original)
+++ qpid/trunk/qpid/java/tools/bin/run-pub Fri Jul 15 04:43:44 2011
@@ -18,7 +18,7 @@
 # under the License.
 #
 
-. $QPID_TEST_HOME/bin/setenv.sh
+. check-qpid-java-env
 
 echo "$@"
-$JAVA_HOME/bin/java -cp $CLASSPATH $@ org.apache.qpid.tools.PerfProducer
+$JAVA -cp $CLASSPATH $LOG_CONFIG $JAVA_MEM $@ org.apache.qpid.tools.PerfProducer

Propchange: qpid/trunk/qpid/java/tools/bin/run-pub
------------------------------------------------------------------------------
    svn:executable = *

Copied: qpid/trunk/qpid/java/tools/bin/run-sub (from r1146679, qpid/trunk/qpid/java/tools/bin/run_sub.sh)
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/tools/bin/run-sub?p2=qpid/trunk/qpid/java/tools/bin/run-sub&p1=qpid/trunk/qpid/java/tools/bin/run_sub.sh&r1=1146679&r2=1146959&rev=1146959&view=diff
==============================================================================
--- qpid/trunk/qpid/java/tools/bin/run_sub.sh (original)
+++ qpid/trunk/qpid/java/tools/bin/run-sub Fri Jul 15 04:43:44 2011
@@ -18,8 +18,8 @@
 # under the License.
 #
 
-. $QPID_TEST_HOME/bin/setenv.sh
+. check-qpid-java-env
 
 echo "$@"
-$JAVA_HOME/bin/java -cp $CLASSPATH $@ org.apache.qpid.tools.PerfConsumer
+$JAVA -cp $CLASSPATH $LOG_CONFIG $JAVA_MEM $@ org.apache.qpid.tools.PerfConsumer
 

Propchange: qpid/trunk/qpid/java/tools/bin/run-sub
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message