summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2013-11-18 14:54:26 +0100
committerJeremy Allison <jra@samba.org>2013-11-22 08:56:44 -0800
commita3839ded473ae6d85d44a25537064ce33c3888c1 (patch)
tree030de9084f821cea30fbf5d3b62d2627ef30f293 /selftest
parent4e6934ec6c163ad6fd9c317b5a7dd7775b0dc83f (diff)
downloadsamba-a3839ded473ae6d85d44a25537064ce33c3888c1.tar.gz
selftest/s3: expose share with FS applicable config
Attempt to determine the underlying test share filesystem using statfs. If the filesystem is detected and an applicable configuration is available, then apply it to a new filesystem specific share. Btrfs is currently the only VFS module to utilize this logic. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/target/Samba3.pm26
1 files changed, 25 insertions, 1 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index c3a434558f7..ebfabf6f113 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -29,6 +29,25 @@ sub have_ads($) {
return $found_ads;
}
+# return smb.conf parameters applicable to @path, based on the underlying
+# filesystem type
+sub get_fs_specific_conf($$)
+{
+ my ($self, $path) = @_;
+ my $mods = "";
+ my $stat_out = `stat --file-system $path` or return "";
+
+ if ($stat_out =~ m/Type:\s+btrfs/) {
+ $mods .= "btrfs ";
+ }
+
+ if ($mods) {
+ return "vfs objects = $mods";
+ }
+
+ return undef;
+}
+
sub new($$) {
my ($classname, $bindir, $binary_mapping, $srcdir, $server_maxtime) = @_;
my $self = { vars => {},
@@ -45,7 +64,7 @@ sub teardown_env($$)
{
my ($self, $envvars) = @_;
my $count = 0;
-
+
# This should cause smbd to terminate gracefully
close($envvars->{STDIN_PIPE});
@@ -832,6 +851,8 @@ sub provision($$$$$$)
my $nmbdsockdir="$prefix_abs/nmbd";
unlink($nmbdsockdir);
+ my $fs_specific_conf = $self->get_fs_specific_conf($shrdir);
+
##
## create the test directory layout
##
@@ -1070,6 +1091,9 @@ sub provision($$$$$$)
kernel share modes = no
kernel oplocks = no
posix locking = no
+[fs_specific]
+ copy = tmp
+ $fs_specific_conf
[print1]
copy = tmp
printable = yes