#!/bin/sh # fedora 3 testing script BASE=http://lib-devsandbox1.ucsd.edu:8080/fedora OBJ=3000 DSZ=$(( 1024 * 1024 * 10 )) # 10 MB AUTH="-u fedoraAdmin:fedoraAdmin" if [ ! -d tmp ]; then mkdir tmp mkdir tmp/create mkdir tmp/update mkdir tmp/read fi rm -rf tmp/read/* N=0 echo `date +%T` "generating $OBJ datastreams x2 (create & update versions)" START=`date +%s` while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ ! -f tmp/create/$N ]; then openssl rand $DSZ > tmp/create/$N fi if [ ! -f tmp/update/$N ]; then openssl rand $DSZ > tmp/update/$N fi done END=`date +%s` echo `date +%T` "done in" $(( $END - $START )) "seconds" N=0 echo `date +%T` "creating $OBJ datastreams" START=`date +%s` while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ $(( $N % 10 )) = 0 ]; then echo -n "." fi curl $AUTH -s -X POST "$BASE/objects/bt:$N/?format=info:fedora/fedora-system:FOXML-1.1&label=$N" > /dev/null curl $AUTH -s -X POST -T tmp/create/$N -H "Content-Type: application/octet-stream" "$BASE/objects/bt:$N/datastreams/ds1?versionable=false&controlGroup=M" > /dev/null done echo END=`date +%s` echo `date +%T` "done in" $(( $END - $START )) "seconds" N=0 echo `date +%T` "reading $OBJ datastreams" START=`date +%s` while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ $(( $N % 10 )) = 0 ]; then echo -n "." fi curl $AUTH -s "$BASE/objects/bt:$N/datastreams/ds1/content" > tmp/read/$N done echo END=`date +%s` echo `date +%T` "done in" $(( $END - $START )) "seconds" echo `date +%T` "checking reads" N=0 while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ $(( $N % 10 )) = 0 ]; then echo -n "." fi diff tmp/create/$N tmp/read/$N done N=0 echo `date +%T` "updating $OBJ datastreams" START=`date +%s` while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ $(( $N % 10 )) = 0 ]; then echo -n "." fi curl $AUTH -s -X PUT -T tmp/update/$N "$BASE/objects/bt:$N/datastreams/ds1?versionable=false&controlGroup=M" > /dev/null done echo END=`date +%s` echo `date +%T` "done in" $(( $END - $START )) "seconds" N=0 echo `date +%T` "deleting $OBJ datastreams" START=`date +%s` while [ $N -lt $OBJ ]; do N=$(( $N + 1 )) if [ $(( $N % 10 )) = 0 ]; then echo -n "." fi curl $AUTH -s -X DELETE $BASE/objects/bt:$N > /dev/null done echo END=`date +%s` echo `date +%T` "done in" $(( $END - $START )) "seconds"