summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Buck <jbbuck@gmail.com>2013-02-18 15:46:20 -0800
committerJoe Buck <jbbuck@gmail.com>2013-02-19 08:35:13 -0800
commitd2dbab1f4f3d5aaeb174cd7483cba37ebcb3d6f7 (patch)
tree35d1231435874a36f584d599dd84e572211c1e23
parent8e0be548579a50e006661a338a58aba66e342051 (diff)
downloadceph-d2dbab1f4f3d5aaeb174cd7483cba37ebcb3d6f7.tar.gz
testing: adding a Hadoop wordcount test
Signed-off-by: Joe Buck <jbbuck@gmail.com> Reviewed-by: Sam Lang <sam.lang@inktank.com>
-rwxr-xr-xqa/workunits/hadoop-wordcount/test.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/qa/workunits/hadoop-wordcount/test.sh b/qa/workunits/hadoop-wordcount/test.sh
new file mode 100755
index 00000000000..256c118980a
--- /dev/null
+++ b/qa/workunits/hadoop-wordcount/test.sh
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+
+echo "starting hadoop-wordcount test"
+
+# 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; }
+
+#command1="cd $TESTDIR/hadoop"
+#command2="ant -Dextra.library.path=$LD_LIBRARY_PATH -Dceph.conf.file=$CEPH_CONF -Dtestcase=TestCephFileSystem"
+
+command0="export JAVA_HOME=/usr/lib/jvm/default-java"
+command1="mkdir -p $TESTDIR/hadoop_input"
+command2="wget http://ceph.com/qa/hadoop_input_files.tar -O $TESTDIR/hadoop_input/files.tar"
+command3="cd $TESTDIR/hadoop_input"
+command4="tar -xf $TESTDIR/hadoop_input/files.tar"
+command5="$TESTDIR/hadoop/bin/hadoop fs -mkdir wordcount_input"
+command6="$TESTDIR/hadoop/bin/hadoop fs -put $TESTDIR/hadoop_input/*txt wordcount_input/"
+command7="$TESTDIR/hadoop/bin/hadoop jar $TESTDIR/hadoop/build/hadoop-example*jar wordcount wordcount_input wordcount_output"
+command8="rm -rf $TESTDIR/hadoop_input"
+
+
+#print out the command
+echo "----------------------"
+echo $command0
+echo $command1
+echo $command2
+echo $command3
+echo $command4
+echo $command5
+echo $command6
+echo $command7
+echo $command8
+echo "----------------------"
+
+#now execute the command
+$command0
+$command1
+$command2
+$command3
+$command4
+$command5
+$command6
+$command7
+$command8
+
+echo "completed hadoop-wordcount test"
+exit 0