public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3] commands/mkfs: Added new testcase to test mkfs(8) command.
Date: Wed, 4 Nov 2015 14:22:06 +0100	[thread overview]
Message-ID: <20151104132206.GD17823@rei> (raw)
In-Reply-To: <1446624763-3242-1-git-send-email-fenggw-fnst@cn.fujitsu.com>

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

  reply	other threads:[~2015-11-04 13:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28 11:37 [LTP] [PATCH] commands/mkfs: Added new testcase to test mkfs(8) command Guangwen Feng
2015-11-02 15:28 ` Cyril Hrubis
2015-11-03  6:16   ` Guangwen Feng
2015-11-03 11:43     ` [LTP] [PATCH v2] " Guangwen Feng
2015-11-04  4:37       ` =?unknown-8bit?b?5p2O56OK?=
2015-11-04  5:37         ` Guangwen Feng
2015-11-03 11:20   ` [LTP] [PATCH] " Guangwen Feng
2015-11-03 11:39     ` Cyril Hrubis
2015-11-03 11:55       ` Guangwen Feng
2015-11-04  8:12         ` [LTP] [PATCH v3] " Guangwen Feng
2015-11-04 13:22           ` Cyril Hrubis [this message]
2015-11-05  2:03             ` Guangwen Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151104132206.GD17823@rei \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox