[Ocfs2-test-devel] [PATCH 1/7] single_run: Add single_run-WIP
Sunil Mushran
sunil.mushran at oracle.com
Wed Sep 2 15:56:33 PDT 2009
tristan.ye wrote:
>>
> Should add:
> local DEVICE=${1}
>
>> +
>> + LABEL=`${TUNEFS_BIN} -q -Q "label=%V\n" ${1}|${CUT} -f2 -d"="`
>>
> replace ${1} as ${DEVICE} instead.
>> + if [ "X${LABEL}" == "X" ]; then
>> + LABEL="testlabel"
>> + fi
>> +
>> + SLOTS=`${TUNEFS_BIN} -q -Q "slots=%N\n" ${DEVICE}|${CUT} -f2 -d"="`
>> +
>> + CLUSTERSIZE_BITS=`${DEBUGFS_BIN} -R stats ${DEVICE} | grep Bits|
>> ${AWK} -F" " '{print $8}'`
>> + BLOCKSIZE_BITS=`${DEBUGFS_BIN} -R stats ${DEVICE} | grep Bits|
>> ${AWK} -F" " '{print $4}'`
>> +
>> + CLUSTERSIZE=`${ECHO} 2^${CLUSTERSIZE_BITS} |bc`
>> + BLOCKSIZE=`${ECHO} 2^${BLOCKSIZE_BITS} |bc`
>>
> You'd better define the globals CLUSTERSIZE and BLOCKSIZE at the very
> beginning.
Better. I've removed get_device_info.
> Maybe error info can be redirected to the LOGFILE, we therefore got
> the reason why mkfs failed...
I still need to figure this out. One of the reasons I've called this WIP.
> The do_format() func can be enhanced to also take label and slot
> number as arguments.
It could. But we don't need it for the single node case.
> Can the error info be redirected to logfile?
WIP.
> It will be more secure to add 'local' tag to above variable definition...
This suite is for a local node. Hence hard coded in do_format.
> Why not directly use:
> h) usage;;
> ?) usage;;
Doh! Done.
> It will be better as follows in case we didn't execute the binary from
> working directory.
>
> if [ -f `dirname ${0}`/config.sh ]; then
> . `dirname ${0}`/config.sh
> fi
Agreed. Done.
More information about the Ocfs2-test-devel
mailing list