btrfs-progs: tests: do not run sudo helper tests if not necessary

We use setup_root_helper in some helpers to make sure that the sudo
helper is set up, and adding that to each test. Make the real test run
only once.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2015-10-23 11:34:50 +02:00
parent 6105df64a1
commit 1fcb190793

View File

@ -157,7 +157,7 @@ root_helper()
setup_root_helper()
{
if [ $UID -eq 0 ]; then
if [ $UID -eq 0 -o -n "$SUDO_HELPER" ]; then
return
fi