[pve-devel] [PATCH storage] check if root in zfs regression tests

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Nov 15 11:03:54 CET 2017


On Wed, Nov 08, 2017 at 10:27:46AM +0100, Dominik Csapak wrote:
> since 'zpool status' runs now with non-root priliveges,
> we have to explicitely test for root, else we cannot build
> without root but with zfs utils installed

I wonder if we should not stop running those tests automatically at
build time? production packages are built as non-root/unprivileged root
wherever possible. I'd rather run those tests manually after each ZFS
upgrade or when something about the storage API changes, then pretend
they are run automatically when they are not ;)

> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  test/run_test_zfspoolplugin.pl | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/test/run_test_zfspoolplugin.pl b/test/run_test_zfspoolplugin.pl
> index bda8348..f3f4b55 100755
> --- a/test/run_test_zfspoolplugin.pl
> +++ b/test/run_test_zfspoolplugin.pl
> @@ -2664,6 +2664,11 @@ if ($@) {
>      exit 0;
>  }
>  
> +if ($> ne 0) { # $> is the effective user id
> +    warn "not root, not running tests.\n";
> +    exit 0;
> +}
> +
>  setup_zpool();
>  
>  my $time = time;
> -- 
> 2.11.0
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list