libisoburn/releng/auto_printsize

97 lines
2.5 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2011-07-11 09:40:23 +00:00
# Copyright 2011 George Danchev <danchev@spnet.net>
2011-07-15 06:05:57 +00:00
# Licensed under GNU GPL version 2 or later
2011-07-11 09:40:23 +00:00
set -e
2011-07-13 11:24:32 +00:00
not_in_releng_exit() {
printf "\nPlease execute the tests from releng directory.\n\n"
exit 1
}
# Include common bits
2011-07-13 11:24:32 +00:00
. inc/releng_getopts.inc || not_in_releng_exit
2011-07-18 17:22:59 +00:00
#print_specific_help() {
# # NONE YET
#}
if test "$SPECIFIC_HELP" = 1; then
# print_specific_help
exit 0
fi
2011-07-18 12:26:30 +00:00
# Each test should decide whether or not it needs
# a xorriso binary to test, since some do compilations only.
if [ ! -x $RELENG_XORRISO ]; then
print_help
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
exit 31
fi
# check data dir, if any and after checking -x xorriso
if [ -d "${GEN_DATA_DIR}" ]; then
printf "\n${SELF}: directory %s exists!" ${GEN_DATA_DIR}
2011-07-15 18:07:02 +00:00
printf "\n${SELF}: use '${SELF} -c' to remove.\n"
exit 8
else
mkdir "${GEN_DATA_DIR}"
fi
#
2011-06-29 17:44:03 +00:00
UPPER=40
# All must be set at this point
2011-07-10 20:02:07 +00:00
# TODO: work out a smarter way to quickly generate different
# types of trees (long, deep, etc)
printf "\n${SELF}: Generating sample tree in ${GEN_DATA_DIR} :\n"
for ((i1=0; i1 < ${UPPER}/4; i1++))
do
for ((i2=0; i2 < ${UPPER}/2; i2++))
do
for ((i3=0; i3 < ${UPPER}; i3++))
do
mkdir -p ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3
touch ${GEN_DATA_DIR}/DirOne$i1/DirTwo$i2/DirThree$i3/FileOne
done
done
echo " $(expr '(' ${i1} + 1 ')' '*' ${UPPER} / 2 '*' ${UPPER}) " \
"files created ..."
done
2011-07-06 11:30:10 +00:00
printf "done.\n"
printf "\n${SELF}: Performing several print size runs to neutralize possible disk cache impact.\n"
# run xorriso
if [ -x ${RELENG_XORRISO} ]; then
for run in 1 2 3; do
printf "\n${SELF}: Running ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
time ${RELENG_XORRISO} -as mkisofs -quiet -print-size ${GEN_DATA_DIR}
done
fi
# try to run genisoimage
if which genisoimage >/dev/null 2>&1; then
RELENG_GENISOIMAGE=`which genisoimage`
for run in 1 2 3; do
printf "\n${SELF}: Running ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
time ${RELENG_GENISOIMAGE} -quiet -print-size ${GEN_DATA_DIR}
done
fi
# try to run mkisofs
if which mkisofs >/dev/null 2>&1; then
RELENG_MKISOFS=`which mkisofs`
for run in 1 2 3; do
printf "\n${SELF}: Running ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}. Trial: ${run}.\n"
time ${RELENG_MKISOFS} -quiet -print-size ${GEN_DATA_DIR}
done
fi
#
cleanup
#
2011-06-29 17:44:03 +00:00
exit 0