summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2011-11-02 14:19:30 +0000
committerGordon Sim <gsim@apache.org>2011-11-02 14:19:30 +0000
commitadd12bb4afe149cdf6328ea314aafb03edf72418 (patch)
treed9130b6b7274ec3eb334b8894fc36f1c67edfa0a
parent8dc6bddc9dba67daad2ac149d0a73a624adcf76a (diff)
downloadqpid-python-add12bb4afe149cdf6328ea314aafb03edf72418.tar.gz
QPID-3573: handle case where /home/gordon does not exist
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1196597 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-xqpid/cpp/examples/old_api/verify13
-rwxr-xr-xqpid/cpp/examples/old_api/verify_all8
-rw-r--r--qpid/cpp/src/tests/test_env.sh.in8
3 files changed, 24 insertions, 5 deletions
diff --git a/qpid/cpp/examples/old_api/verify b/qpid/cpp/examples/old_api/verify
index 9a1ed078d6..1ee21f6b03 100755
--- a/qpid/cpp/examples/old_api/verify
+++ b/qpid/cpp/examples/old_api/verify
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
@@ -30,9 +30,16 @@ export LC_ALL=C
# If $QPID_HOST or $QPID_PORT are set, use them to connect.
#
-QPID_DATA_DIR=
QPID_NO_MODULE_DIR=1
-export QPID_DATA_DIR QPID_NO_MODULE_DIR
+QPID_DATA_DIR=
+
+# Use temporary directory if $HOME does not exist
+if [ ! -e "$HOME" ]; then
+ QPID_DATA_DIR=/tmp/qpid
+ QPID_PID_DIR=/tmp/qpid
+fi
+
+export QPID_DATA_DIR QPID_NO_MODULE_DIR QPID_PID_DIR
cleanup() {
test -n "$QPIDD" && $QPIDD -q # Private broker
diff --git a/qpid/cpp/examples/old_api/verify_all b/qpid/cpp/examples/old_api/verify_all
index fbe51377b6..e71479d6be 100755
--- a/qpid/cpp/examples/old_api/verify_all
+++ b/qpid/cpp/examples/old_api/verify_all
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
@@ -28,6 +28,12 @@ qpidd=$topbuilddir/src/qpidd
broker_args=$3
exclude_regexp=$4
+# Use temporary directory if $HOME does not exist
+if ! test -e "$HOME"; then
+ export QPID_DATA_DIR=/tmp/qpid
+ export QPID_PID_DIR=/tmp/qpid
+fi
+
trap "$qpidd -q" exit
QPID_PORT=`$qpidd -dp0 $broker_args` || { echo "Can't run qpidd" ; exit 1; }
export QPID_PORT
diff --git a/qpid/cpp/src/tests/test_env.sh.in b/qpid/cpp/src/tests/test_env.sh.in
index 842d7729cb..26be15b48a 100644
--- a/qpid/cpp/src/tests/test_env.sh.in
+++ b/qpid/cpp/src/tests/test_env.sh.in
@@ -72,7 +72,13 @@ exportmodule XML_LIB xml.so
# Qpid options
export QPID_NO_MODULE_DIR=1 # Don't accidentally load installed modules
-export QPID_DATA_DIR= # Default to no data dir, not ~/.qpidd
+export QPID_DATA_DIR=
+
+# Use temporary directory if $HOME does not exist
+if [ ! -e "$HOME" ]; then
+ export QPID_DATA_DIR=/tmp/qpid
+ export QPID_PID_DIR=/tmp/qpid
+fi
# Options for boost test framework
export BOOST_TEST_SHOW_PROGRESS=yes