btrfs-progs: tests: do not run sudo helper tests if not necessary
authorDavid Sterba <dsterba@suse.com>
Fri, 23 Oct 2015 09:34:50 +0000 (11:34 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 2 Nov 2015 08:35:06 +0000 (09:35 +0100)
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>
tests/common

index 785280f..4542fa8 100644 (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