[LTP] [PATCH v3] commands/mkfs: Added new testcase to test mkfs(8) command.

Cyril Hrubis chrubis@suse.cz
Wed Nov 4 14:22:06 CET 2015


Hi!
> +mkfs_verify_size()
> +{
> +	mkfs_mount
> +	local blocknum=`df -B 1k mntpoint | tail -n1 | awk '{print $2}'`
> +	mkfs_umount
> +
> +	if [ $blocknum -gt "$2" ]; then
> +		return 1
> +	fi
> +
> +	# Size argument in mkfs.ntfs denotes number-of-sectors which is 512bytes,
> +	# 1k-block size should be devided by this argument for ntfs verification.
> +	if [ "$1" = "ntfs" ]; then
> +		local rate=1024/512
> +		if [ $blocknum -lt "$(($2/rate*9/10))" ]; then
> +			return 1
> +		fi
> +	else
> +		if [ $blocknum -lt "$(($2*9/10))" ]; then
> +			return 1
> +		fi
> +	fi

I've added explicit return 0 here, since otherwise the retul value would
be set by the last executed command (which would be the either umount
or mount above...).


And pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the Ltp mailing list