diff mbox

btrfs-progs: tests, use non-interactive sudo helper

Message ID 1421691107-4106-1-git-send-email-dsterba@suse.cz (mailing list archive)
State Accepted
Headers show

Commit Message

David Sterba Jan. 19, 2015, 6:11 p.m. UTC
Sudo may not be configured to run without user prompt, in that case the
tests would be stuck.

Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
---
 tests/common | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Qu Wenruo Jan. 20, 2015, 12:24 a.m. UTC | #1
-------- Original Message --------
Subject: [PATCH] btrfs-progs: tests, use non-interactive sudo helper
From: David Sterba <dsterba@suse.cz>
To: <linux-btrfs@vger.kernel.org>
Date: 2015?01?20? 02:11
> Sudo may not be configured to run without user prompt, in that case the
> tests would be stuck.
>
> Reported-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
> Signed-off-by: David Sterba <dsterba@suse.cz>
> ---
>   tests/common | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/common b/tests/common
> index 84a4b9d335e2..d7d2e9bef050 100644
> --- a/tests/common
> +++ b/tests/common
> @@ -58,7 +58,7 @@ export have_root_helper
>   setup_root_helper()
>   {
>   	if [ $UID != 0 ]; then
> -		sudo=sudo
> +		sudo="sudo --non-interactive"
>   	fi
>   	have_root_helper=1
>   }
Looks good for me.

This seems much better than the original interactive one.

Thanks,
Qu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/common b/tests/common
index 84a4b9d335e2..d7d2e9bef050 100644
--- a/tests/common
+++ b/tests/common
@@ -58,7 +58,7 @@  export have_root_helper
 setup_root_helper()
 {
 	if [ $UID != 0 ]; then
-		sudo=sudo
+		sudo="sudo --non-interactive"
 	fi
 	have_root_helper=1
 }