#! /bin/sh

USER=justin
DEVICE=/dev/md0
blocks="4096"
stride=8

echo danger will robinson, there is danger! you MUST read and edit this script!
exit 1

mkdir /test
for cipher in "twofish" "serpent" "aes" 
do
	echo
        echo "----- $cipher: $blocks * $stride -----"
	cd
	modprobe $cipher && echo "test password" | cryptsetup -c "$cipher-cbc-essiv:sha256" create test $DEVICE && dmsetup table && time mkfs.ext3 -b $blocks -R stride=$stride /dev/mapper/test && mount -O noatime /dev/mapper/test /test && mkdir /test/test && chown $USER /test/test && cd /test/test && bonnie++ -b -s 10000 -n 100 -u $USER 
        cd
        umount /test
	cryptsetup remove test
        echo
        echo sleeping 2 minutes
        sleep 120
done | tee loadtest.log
rmdir /test

