From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: David Sterba <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] btrfs-progs: tests, add support for running commands under root
Date: Thu, 15 Jan 2015 08:33:36 +0800 [thread overview]
Message-ID: <54B70AE0.2090203@cn.fujitsu.com> (raw)
In-Reply-To: <1421256302-8503-1-git-send-email-dsterba@suse.cz>
-------- Original Message --------
Subject: [PATCH 1/2] btrfs-progs: tests, add support for running
commands under root
From: David Sterba <dsterba@suse.cz>
To: <linux-btrfs@vger.kernel.org>
Date: 2015年01月15日 01:25
> Most of the checks run fine without root, but some of them may need to
> do a mount test or access the data. Add the support to selectively run
> commands under root, hardcoded to sudo for now.
I'm a little worried about using sudo in such test.
If the test is ran by a script, test will be stuck waiting for input and
timeout after a long time.
I prefer NOT RUN just like xfstests.
Thanks
Qu
>
> Signed-off-by: David Sterba <dsterba@suse.cz>
> ---
>
> tests/common | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/tests/common b/tests/common
> index 80a538165949..84a4b9d335e2 100644
> --- a/tests/common
> +++ b/tests/common
> @@ -47,3 +47,18 @@ check_all_images()
> rm $i.restored
> done
> }
> +
> +# some tests need to mount the recovered image and do verifications call
> +# 'setup_root_helper' and then check for have_root_helper == 1 if the test
> +# needs to fail otherwise; using sudo by default for now
> +sudo=
> +have_root_helper=0
> +export sudo
> +export have_root_helper
> +setup_root_helper()
> +{
> + if [ $UID != 0 ]; then
> + sudo=sudo
> + fi
> + have_root_helper=1
> +}
next prev parent reply other threads:[~2015-01-15 0:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-25 1:32 [PATCH 0/5] New btrfsck test framework Qu Wenruo
2014-12-25 1:32 ` [PATCH 1/5] btrfs-progs: New btrfsck test infrastructure Qu Wenruo
2014-12-25 1:32 ` [PATCH 2/5] btrfs-progs: Move btrfs-image dump to corresponding dir Qu Wenruo
2014-12-25 1:32 ` [PATCH 3/5] btrfs-progs: Move bad root items test cases to its " Qu Wenruo
2014-12-25 1:32 ` [PATCH 4/5] btrfs-progs: Move leaf-corruption no extent data case and add verification script Qu Wenruo
2014-12-25 1:32 ` [PATCH 5/5] btrfs-progs: Move extent tree rebuild test to its dir Qu Wenruo
2015-01-14 17:25 ` [PATCH 1/2] btrfs-progs: tests, add support for running commands under root David Sterba
2015-01-15 0:33 ` Qu Wenruo [this message]
2015-01-19 18:07 ` David Sterba
2015-01-14 17:25 ` [PATCH 2/2] btrfs-progs: teests, use the root helper in 012 David Sterba
2015-01-14 17:43 ` [PATCH 0/5] New btrfsck test framework David Sterba
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=54B70AE0.2090203@cn.fujitsu.com \
--to=quwenruo@cn.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.