Whamcloud - gitweb
Updates to test scripts:
[fs/lustre-release.git] / lustre / tests / maloo_upload.sh
diff --git a/lustre/tests/maloo_upload.sh b/lustre/tests/maloo_upload.sh
new file mode 100644 (file)
index 0000000..dc81ed0
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+FILENAME=$1
+
+if [ -r ~/.maloorc ] ; then
+        source ~/.maloorc
+else
+        echo "Error: ~/.maloorc not found.  Please obtain this file from the maloo web interface, under 'Upload results'"
+        exit 1
+fi
+
+if [ -z $FILENAME ] ; then
+        echo "Usage: ${0} <tarball or directory>"
+        exit 2
+fi
+
+
+if [ ! -r $FILENAME ] ; then
+        echo "Input file '$FILENAME' not found"
+        exit 3
+fi
+
+echo Uploading $FILENAME to $MALOO_URL
+if [ -d $FILENAME ] ; then
+       pushd $FILENAME
+       tar czf - * | curl -F "user_id=${MALOO_USER_ID}" -F "upload=@-" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null
+       popd
+else
+       curl -F "user_id=${MALOO_USER_ID}" -F "upload=@${FILENAME}" -F "user_upload_token=${MALOO_UPLOAD_TOKEN}" ${MALOO_URL} > /dev/null
+fi
+echo Complete.