s4:torture: add boilerplate code for vfs_fruit
authorRalph Boehme <rb@sernet.de>
Tue, 8 Jul 2014 03:47:02 +0000 (05:47 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 18 Aug 2014 15:42:50 +0000 (17:42 +0200)
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
selftest/target/Samba3.pm
selftest/target/Samba4.pm
source3/selftest/tests.py
source4/torture/vfs/fruit.c [new file with mode: 0644]
source4/torture/vfs/vfs.c

index 394d6372c0cd3ec57f217fcdce95f164483b40dd..a17f2f6cc662a5574bde5b982ed878a3e1f3a02e 100755 (executable)
@@ -1169,6 +1169,14 @@ sub provision($$$$$$)
 
 [print\$]
        copy = tmp
+
+[vfs_fruit]
+       path = $shrdir
+       vfs objects = catia fruit streams_xattr
+       fruit:ressource = file
+       fruit:metadata = netatalk
+       fruit:locking = netatalk
+       fruit:encoding = native
        ";
        close(CONF);
 
index 412fbff6f009718ec01acb6cf00f427db2c2d94f..ec0f43904fadc44f5c8567a00809369ac89adc4f 100755 (executable)
@@ -879,6 +879,14 @@ sub provision($$$$$$$$$)
        copy = simple
        ntvfs handler = cifsposix
 
+[vfs_fruit]
+       path = $ctx->{share}
+       vfs objects = catia fruit streams_xattr
+       fruit:ressource = file
+       fruit:metadata = netatalk
+       fruit:locking = netatalk
+       fruit:encoding = native
+
 $extra_smbconf_shares
 ";
 
index e9b91d468ffaa6341a4ac1a3abc4bb7c49f58bc5..b4e038637930c0a9e80d99431f7e72a368a4e488 100755 (executable)
@@ -289,7 +289,9 @@ nbt = ["nbt.dgram" ]
 
 libsmbclient = ["libsmbclient"]
 
-tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap
+vfs = ["vfs.fruit"]
+
+tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs
 
 for t in tests:
     if t == "base.delaywrite":
@@ -360,6 +362,9 @@ for t in tests:
 # test the dirsort module.
         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
+    elif t == "vfs.fruit":
+        plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share1=vfs_fruit --option=torture:share2=tmp --option=torture:localdir=$SELFTEST_PREFIX/s3dc/share')
+        plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share1=vfs_fruit --option=torture:share2=tmp --option=torture:localdir=$SELFTEST_PREFIX/plugin_s4_dc/share')
     else:
         plansmbtorture4testsuite(t, "s3dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD')
         plansmbtorture4testsuite(t, "plugin_s4_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
new file mode 100644 (file)
index 0000000..2685a8f
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+   Unix SMB/CIFS implementation.
+
+   vfs_fruit tests
+
+   Copyright (C) Ralph Boehme 2014
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+
+#include "torture/torture.h"
+#include "torture/util.h"
+#include "torture/smb2/proto.h"
+#include "torture/vfs/proto.h"
+
+/*
+ * Note: This test depends on "vfs objects = catia fruit
+ * streams_xattr".  Note: To run this test, use
+ * "--option=torture:share1=<SHARENAME1>
+ * --option=torture:share2=<SHARENAME2>
+ * --option=torture:localpath=<SHAREPATH>"
+ */
+struct torture_suite *torture_vfs_fruit(void)
+{
+       struct torture_suite *suite = torture_suite_create(
+               talloc_autofree_context(), "fruit");
+
+       suite->description = talloc_strdup(suite, "vfs_fruit tests");
+
+       return suite;
+}
index 965c7c9620d228b411a751e1001c7f03ff76ade6..9b82387874825e4f1d50a6af855786c9a8cb461a 100644 (file)
@@ -106,6 +106,8 @@ NTSTATUS torture_vfs_init(void)
 
        suite->description = talloc_strdup(suite, "VFS modules tests");
 
+       torture_suite_add_suite(suite, torture_vfs_fruit());
+
        torture_register_suite(suite);
 
        return NT_STATUS_OK;