Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu WenRuo <wqu@suse.com>
To: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Cc: David Sterba <DSterba@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Marcos Paulo de Souza <mpdesouza@suse.com>
Subject: Re: [btrfs-progs PATCHv3 1/3] tests: common: Add check_dm_target_support helper
Date: Fri, 3 Jan 2020 05:11:35 +0000	[thread overview]
Message-ID: <dffcf953-a4bd-c6ba-59a0-c94c53063636@suse.com> (raw)
In-Reply-To: <20200103021215.30147-2-marcos.souza.org@gmail.com>



On 2020/1/3 上午10:12, Marcos Paulo de Souza wrote:
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
> 
> This function will be used later to test if dm-thin is supported.
> Inspired by fstests.
> 
> Suggested-by: Qu Wenruo <wqu@suse.com>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>  tests/common | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/tests/common b/tests/common
> index ca098444..3ea8c260 100644
> --- a/tests/common
> +++ b/tests/common
> @@ -322,6 +322,21 @@ check_global_prereq()
>  	fi
>  }
>  
> +# check if the targets passed as arguments are available, and if not just skip
> +# the test
> +check_dm_target_support()
> +{
> +	setup_root_helper
> +
> +	for target in "$@"; do
> +		$SUDO_HELPER modprobe dm-$target >/dev/null 2>&1
> +		$SUDO_HELPER dmsetup targets 2>&1 | grep -q ^$target
> +		if [ $? -ne 0 ]; then
> +			_not_run "This test requires dm $target support."
> +		fi
> +	done
> +}
> +
>  check_image()
>  {
>  	local image
> 

  reply	other threads:[~2020-01-03  5:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-03  2:12 [btrfs-progs PATCHv3 0/3] tests: do not fail if dm-thin is missing Marcos Paulo de Souza
2020-01-03  2:12 ` [btrfs-progs PATCHv3 1/3] tests: common: Add check_dm_target_support helper Marcos Paulo de Souza
2020-01-03  5:11   ` Qu WenRuo [this message]
2020-01-03  2:12 ` [btrfs-progs PATCHv3 2/3] tests: mkfs: 017: Use " Marcos Paulo de Souza
2020-01-03  2:12 ` [btrfs-progs PATCHv3 3/3] tests: mkfs: 005: " Marcos Paulo de Souza

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=dffcf953-a4bd-c6ba-59a0-c94c53063636@suse.com \
    --to=wqu@suse.com \
    --cc=DSterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=marcos.souza.org@gmail.com \
    --cc=mpdesouza@suse.com \
    /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