summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2013-02-12 15:21:14 -0800
committerJoe Buck <jbbuck@gmail.com>2013-02-19 14:05:11 -0800
commitf1bff178a4b68e36c93cfe12b8f7cfca8c1a14e3 (patch)
tree3bc43aeb6164876b8e2c9b27c7a19d7fa4dd4268
parent60d9465b535f792e3685af3545f11108b83dd81f (diff)
downloadceph-f1bff178a4b68e36c93cfe12b8f7cfca8c1a14e3.tar.gz
qa: sample test for new replication tests
Signed-off-by: Joe Buck <jbbuck@gmail.com>
-rwxr-xr-xqa/workunits/hadoop-internal-tests/test.sh69
1 files changed, 54 insertions, 15 deletions
diff --git a/qa/workunits/hadoop-internal-tests/test.sh b/qa/workunits/hadoop-internal-tests/test.sh
index 5b84761dee4..bfbb38c73cd 100755
--- a/qa/workunits/hadoop-internal-tests/test.sh
+++ b/qa/workunits/hadoop-internal-tests/test.sh
@@ -1,23 +1,62 @@
-#!/bin/sh -e
+#!/bin/bash -e
-echo "starting hadoop-internal-tests tests"
+BASE=/tmp/cephtest
+TLIB=binary/usr/local/lib
+export LD_LIBRARY_PATH=$BASE/$TLIB
+CEPH_CONF_FILE=$BASE/ceph.conf
-# bail if $TESTDIR is not set as this test will fail in that scenario
-[ -z $TESTDIR] && { echo "\$TESTDIR needs to be set, but is not. Exiting."; exit 1; }
+POOL_SIZES=`seq 1 8`
+POOL_BASE=hadoop
+POOL_NAMES=`echo -n $POOL_SIZES | sed "s/\([0-9]*\)/$POOL_BASE\1/g" | sed "s/ /,/g"`
-command1="cd $TESTDIR/hadoop"
-command2="ant -Dextra.library.path=$LD_LIBRARY_PATH -Dceph.conf.file=$CEPH_CONF -Dtestcase=TestCephFileSystem"
+function gen_hadoop_conf() {
+local outfile=$1
+local poolnames=$2
+cat << EOF > $outfile
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<configuration>
+<property>
+ <name>ceph.conf.file</name>
+ <value>$CEPH_CONF_FILE</value>
+</property>
+<property>
+ <name>ceph.data.pools</name>
+ <value>$poolnames</value>
+</property>
+</configuration>
+EOF
+}
-#print out the command
-echo "----------------------"
-echo $command1
-echo "----------------------"
-echo $command2
-echo "----------------------"
+echo creating hadoop test pools
+for size in $POOL_SIZES; do
+ name=${POOL_BASE}$size
+ echo creating pool $name
+ ./ceph osd pool create $name 100 100
+ ./ceph osd pool set $name size $size
-#now execute the command
-$command1
-$command2
+ echo making pool $name a data pool
+ poolid=`./ceph osd dump | sed -n "s/^pool \([0-9]*\) '$name'.*/\1/p"`
+ ./ceph mds add_data_pool $poolid
+done
+
+def_repl_conf=`mktemp`
+echo generating default replication hadoop config $def_repl_conf
+gen_hadoop_conf $def_repl_conf ""
+
+cust_repl_conf=`mktemp`
+echo generating custom replication hadoop config $cust_repl_conf
+gen_hadoop_conf $cust_repl_conf $POOL_NAMES
+
+pushd $BASE/hadoop
+
+echo running default replication hadoop tests
+ant -Dextra.library.path=$BASE/$TLIB -Dhadoop.conf.file=$def_repl_conf -Dtestcase=TestCephDefaultReplication test
+
+echo running custom replication hadoop tests
+ant -Dextra.library.path=$BASE/$TLIB -Dhadoop.conf.file=$def_repl_conf -Dtestcase=TestCephCustomReplication test
+
+popd
echo "completed hadoop-internal-tests tests"
exit 0