gen_template can be split in to two parts:
- the static headers
- the dynamic ones linked to the arguments from cmdline
The static ones are now in gen_template() call before parsing the
cmdline.
The dynamic ones are now call in finish_template() after parsing the
cmdline.
That also open the ability of feeding the fio header during the parsing
removing the need of specific variables to remember the values.
EOF
}
-gen_template() {
-cat >$TEMPLATE << EOF
-[global]
-ioengine=libaio
+finish_template() {
+cat >>$TEMPLATE <<EOF
iodepth=$IODEPTH
-invalidate=1
-ramp_time=5
EOF
if [ "$RUNTIME" != "0" ]; then
direct=1
EOF
fi
+}
+gen_template() {
+cat >$TEMPLATE << EOF
+[global]
+ioengine=libaio
+invalidate=1
+ramp_time=5
+EOF
}
gen_seq_suite() {
########## MAIN
+gen_template
parse_cmdline $@
+finish_template
check_mode_order
-gen_template
echo "Generating $OUTFILE"
cp -f $TEMPLATE $OUTFILE