8 DATA_INPUT=$(mktemp -d)
10 echo "starting hadoop-wordcount test"
12 # bail if $TESTDIR is not set as this test will fail in that scenario
13 [ -z $TESTDIR ] && { echo "\$TESTDIR needs to be set, but is not. Exiting."; exit 1; }
15 # if HADOOP_PREFIX is not set, use default
16 [ -z $HADOOP_PREFIX ] && { HADOOP_PREFIX=$TESTDIR/hadoop; }
18 # Nuke hadoop directories
19 $HADOOP_PREFIX/bin/hadoop fs -rm -r $WC_INPUT $WC_OUTPUT || true
21 # Fetch and import testing data set
22 curl http://download.ceph.com/qa/hadoop_input_files.tar | tar xf - -C $DATA_INPUT
23 $HADOOP_PREFIX/bin/hadoop fs -copyFromLocal $DATA_INPUT $WC_INPUT
27 $HADOOP_PREFIX/bin/hadoop jar \
28 $HADOOP_PREFIX/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar \
29 wordcount $WC_INPUT $WC_OUTPUT
32 $HADOOP_PREFIX/bin/hadoop fs -rm -r $WC_INPUT $WC_OUTPUT || true
34 echo "completed hadoop-wordcount test"