test-osdi16.sh 1.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh

#
# A script (untested, for archival purposes) that runs the commands used
# to generated the data for the OSDI 2016 submission.
#

set -x

DIRNAME=`dirname $0`
. "$DIRNAME/test-lib.sh"
. "$SETUPLIB"

14 15 16
HOMEDIR=`readlink -f ~`
TESTBASEDIRNAME="$HOMEDIR/capnet-tests"
TESTBASENAME="test"
David Johnson's avatar
David Johnson committed
17
SIZES="50 100 150 200"
18 19 20 21 22 23 24 25 26
ITERATIONS=5
UTENANT="tenant-0"
STENANT="service-0"
NETWORK="capnetlan-1-net"
BRIDGE="br-capnetlan-1"

if [ $# -gt 1 ]; then
    TESTBASEDIRNAME="$1"
fi
27 28 29
if [ $# -gt 2 ]; then
    TESTBASENAME="$2"
fi
30 31

for size in $SIZES ; do
David Johnson's avatar
David Johnson committed
32 33 34
    j=0
    while [ $j -lt $ITERATIONS ]; do 
	j=`expr $j + 1`
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

        #
        # Clean out tenants and switches to make sure everything's
        # clean.  Sometimes a workflow agent doesn't get fully deleted,
        # probably because the switch restart acts before the capnet
        # agent can delete the wfagents.  So we just add sleeps and do
        # it all twice.
        #
        echo "Cleaning out tenant $STENANT ..."
	$DIRNAME/test-cleanup-tenant.sh $STENANT
	echo "Cleaning out tenant $UTENANT ..."
	$DIRNAME/test-cleanup-tenant.sh $UTENANT
	sleep 4
	echo "Cleaning out bridge $BRIDGE ..."
	$DIRNAME/test-cleanup-sw-restart-controller.sh $BRIDGE

	echo "Cleaning out tenant $STENANT ..."
	$DIRNAME/test-cleanup-tenant.sh $STENANT
	echo "Cleaning out tenant $UTENANT ..."
	$DIRNAME/test-cleanup-tenant.sh $UTENANT
	sleep 4
	echo "Cleaning out bridge $BRIDGE ..."
	$DIRNAME/test-cleanup-sw-restart-controller.sh $BRIDGE

        #
        # Ok, run the test.
        #
David Johnson's avatar
David Johnson committed
62
	echo "Running test-$size-$j ..."
63 64 65 66
	testname="${TESTBASENAME}-${size}-${j}"
	testdir="${TESTBASEDIRNAME}/${TESTBASENAME}"
	mkdir -p "$testdir"
	$DIRNAME/test-hadoop.sh "$testdir" "$testname" $UTENANT $STENANT \
67
	    $NETWORK $BRIDGE $size | tee $testname/test.log 2>&1
68
	echo "Finished $testname (results in $TESTBASEDIRNAME/$testname)..."
69 70 71
    done
done

72
echo "Done with $ITERATIONS iterations of test sizes $SIZES ."
73 74

exit 0