Commit 265047ce authored by David Johnson's avatar David Johnson

Handle test dirs vs test names correctly.

(Note new extra argument to test-hadoop.sh .)
parent c2f35500
Pipeline #1895 passed with stage
in 2 seconds
......@@ -38,12 +38,13 @@ file, currently).
You can run ``test-hadoop.sh`` as follows::
USAGE: test-hadoop.sh <testdir> <user-tenant> <service-tenant> <networkname>
USAGE: test-hadoop.sh <testdir> <testname> <user-tenant> <service-tenant> <networkname>
<bridgename> <num-slaves> [<hadoop-args>]
The `testdir` argument specifies a directory where results from the test
(logfiles, OpenVSwitch flow tables, etc) are placed. If this directory
doesn't exist, it will be created. `user-tenant` and `service-tenant`
doesn't exist, it will be created. The `testname` allows you to prefix
the result subdirectories with a name. `user-tenant` and `service-tenant`
are project names; the user tenant will host nodes and a workflow agent;
the service tenant will host only a service workflow agent that installs
Hadoop. `networkname` is the virtual shared OpenStack Capnet network
......@@ -58,8 +59,8 @@ you specify two slaves, you'll wind up with four VMs. You could do that
like this::
cd /root/setup/capnet/networking-capnet/cloudlab
mkdir test1
tests/test-hadoop.sh test1 tenant-0 service-0 capnetlan-1 br-capnetlan-1 2
mkdir testdir
tests/test-hadoop.sh testdir test1 tenant-0 service-0 capnetlan-1 br-capnetlan-1 2
Once you've run the test, you can run the cleanup scripts.
``test-cleanup-tenant.sh`` removes all nodes and workflow agents from a
......
......@@ -24,8 +24,8 @@ DIRNAME=`dirname $0`
. "$DIRNAME/test-lib.sh"
. "$SETUPLIB"
if [ $# -lt 6 ]; then
echo "USAGE: $0 <testdir> <user-tenant> <service-tenant> <networkname>"
if [ $# -lt 7 ]; then
echo "USAGE: $0 <testdir> <testname> <user-tenant> <service-tenant> <networkname>"
echo " <bridgename> <num-slaves> [<hadoop-args>]"
exit 1
fi
......@@ -38,6 +38,8 @@ FASTBOOT=0
TESTDIR=$1
shift
TESTNAME=$1
shift
UTENANT=$1
shift
STENANT=$1
......@@ -67,9 +69,10 @@ PNHOSTS="$PCHOSTS"
fqdn=`getfqdn $NETWORKMANAGER`
PNHOSTS="-H $fqdn $PCHOSTS"
echo "*** Testing hadoop: $TESTDIR $UTENANT $STENANT $NETWORK $BRIDGE $NSLAVES \"$ARGS\" ..."
echo "*** Testing hadoop: $TESTDIR $TESTNAME $UTENANT $STENANT $NETWORK $BRIDGE $NSLAVES \"$ARGS\" ..."
mkdir -p $TESTDIR
cd $TESTDIR
# NB: Be admin when we fire off wfas...
. "$OURDIR/admin-openrc.sh"
......
......@@ -11,7 +11,9 @@ DIRNAME=`dirname $0`
. "$DIRNAME/test-lib.sh"
. "$SETUPLIB"
TESTBASEDIRNAME="test"
HOMEDIR=`readlink -f ~`
TESTBASEDIRNAME="$HOMEDIR/capnet-tests"
TESTBASENAME="test"
SIZES="50 100 150 200"
ITERATIONS=5
UTENANT="tenant-0"
......@@ -22,6 +24,9 @@ BRIDGE="br-capnetlan-1"
if [ $# -gt 1 ]; then
TESTBASEDIRNAME="$1"
fi
if [ $# -gt 2 ]; then
TESTBASENAME="$2"
fi
for size in $SIZES ; do
j=0
......@@ -55,11 +60,12 @@ for size in $SIZES ; do
# Ok, run the test.
#
echo "Running test-$size-$j ..."
testname="${TESTBASEDIRNAME}-${size}-${j}"
mkdir -p "$testname"
$DIRNAME/test-hadoop.sh $testname $UTENANT $STENANT \
testname="${TESTBASENAME}-${size}-${j}"
testdir="${TESTBASEDIRNAME}/${TESTBASENAME}"
mkdir -p "$testdir"
$DIRNAME/test-hadoop.sh "$testdir" "$testname" $UTENANT $STENANT \
$NETWORK $BRIDGE $size | tee $testname/test.log 2>&1
echo "Finished test-$size-$j ..."
echo "Finished $testname (results in $TESTBASEDIRNAME/$testname)..."
done
done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment