[PATCH] selftest/s3: test with FS applicable VFS modules

Michael Adam obnox at samba.org
Tue Sep 17 20:00:55 CEST 2013


Hi David,

this looks like a very good thing and a clean patch!

The only concern I have is that I am not 100% certain
whether we should change all our test targets based on
host setup or whether we should add a separate target
to test host-/fs-specific features.

What do others think?

Cheers - Michael

On 2013-09-16 at 14:51 -0700, David Disseldorp wrote:
> Attempt to determine the underlying test share filesystem using statfs.
> If the filesystem is detected and an applicable VFS module is available,
> then use the module during S3FS selftest.
> Btrfs is currently the only VFS module to utilize this logic.
> 
> Signed-off-by: David Disseldorp <ddiss at samba.org>
> ---
>  selftest/target/Samba3.pm | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
> index 0972457..d81aad0 100755
> --- a/selftest/target/Samba3.pm
> +++ b/selftest/target/Samba3.pm
> @@ -29,6 +29,21 @@ sub have_ads($) {
>  	return $found_ads;
>  }
>  
> +# return a list of VFS modules applicable to @path, based on the underlying
> +# filesystem type
> +sub get_fs_specific_vfs_mods($$)
> +{
> +	my ($self, $path) = @_;
> +	my $mods = "";
> +	my $stat_out = `stat --file-system $path` or return "";
> +
> +	if ($stat_out =~ m/Type:\s+btrfs/) {
> +		$mods .= "btrfs ";
> +	}
> +
> +	return $mods;
> +}
> +
>  sub new($$) {
>  	my ($classname, $bindir, $binary_mapping, $srcdir, $server_maxtime) = @_;
>  	my $self = { vars => {},
> @@ -45,7 +60,7 @@ sub teardown_env($$)
>  {
>  	my ($self, $envvars) = @_;
>  	my $count = 0;
> -	
> +
>  	# This should cause smbd to terminate gracefully
>  	close($envvars->{STDIN_PIPE});
>  
> @@ -832,6 +847,8 @@ sub provision($$$$$$)
>  	my $nmbdsockdir="$prefix_abs/nmbd";
>  	unlink($nmbdsockdir);
>  
> +	my $fs_vfs_modules = $self->get_fs_specific_vfs_mods($shrdir);
> +
>  	## 
>  	## create the test directory layout
>  	##
> @@ -987,7 +1004,7 @@ sub provision($$$$$$)
>  	store dos attributes = yes
>  	create mask = 755
>  	dos filemode = yes
> -	vfs objects = acl_xattr fake_acls xattr_tdb streams_depot
> +	vfs objects = acl_xattr fake_acls xattr_tdb streams_depot $fs_vfs_modules
>  
>  	printing = vlp
>  	print command = $bindir_abs/vlp tdbfile=$lockdir/vlp.tdb print %p %s
> -- 
> 1.8.1.4
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 215 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130917/0e30bc30/attachment.pgp>


More information about the samba-technical mailing list