s4 torture: Split up the torture suite setup for RAW-SFILEINFO
authorTim Prouty <tprouty@samba.org>
Wed, 25 Nov 2009 00:25:02 +0000 (16:25 -0800)
committerTim Prouty <tprouty@samba.org>
Wed, 25 Nov 2009 16:45:14 +0000 (08:45 -0800)
A side effect of this change is that RAW-SFILEINFO now runs the whole
suite instead of just the first test.  I changed the name of the first
test to RAW-SFILEINFO-BASE and changed all of the selftest scripts
that call it.

source3/script/tests/test_posix_s3.sh
source4/selftest/test_w2k3_file.sh
source4/selftest/win/wintest_raw.sh
source4/torture/raw/raw.c
source4/torture/raw/setfileinfo.c

index 11fe2477610ffb41c98ad62e8f55a024b3536a2f..a3bcae8fe43ba7c58de0420a702364efdbbdf3cc 100755 (executable)
@@ -32,7 +32,7 @@ base="$base BASE-XCOPY BASE-SAMBA3ERROR"
 raw="RAW-ACLS RAW-CHKPATH RAW-CLOSE RAW-COMPOSITE RAW-CONTEXT RAW-EAS"
 raw="$raw RAW-IOCTL RAW-LOCK RAW-MKDIR RAW-MUX RAW-NOTIFY RAW-OPEN RAW-OPLOCK"
 raw="$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK"
-raw="$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
+raw="$raw RAW-SFILEINFO-BASE RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE"
 raw="$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME"
 raw="$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK"
 raw="$raw RAW-SAMBA3ROOTDIRFID"
@@ -67,7 +67,7 @@ skipped="BASE-CHARSET BASE-TCONDEV"
 skipped="$skipped RAW-ACLS RAW-COMPOSITE RAW-CONTEXT"
 skipped="$skipped RAW-IOCTL"
 skipped="$skipped RAW-QFILEINFO RAW-QFSINFO"
-skipped="$skipped RAW-SFILEINFO"
+skipped="$skipped RAW-SFILEINFO-BASE"
 
 echo "WARNING: Skipping tests $skipped"
 
index d59d2b49efedc929b64e85d58189aebef7e6a4a9..27714c2c19febecf1248a59739a192bb17de1296 100755 (executable)
@@ -27,7 +27,7 @@ tests="$tests BASE-DENY3 BASE-XCOPY BASE-OPEN BASE-DENYDOS"
 tests="$tests BASE-DELETE BASE-PROPERTIES BASE-MANGLE"
 tests="$tests BASE-CHKPATH BASE-SECLEAK BASE-TRANS2"
 tests="$tests BASE-NTDENY1 BASE-NTDENY2  BASE-RENAME BASE-OPENATTR"
-tests="$tests RAW-QFILEINFO RAW-SFILEINFO-BUG RAW-SFILEINFO"
+tests="$tests RAW-QFILEINFO RAW-SFILEINFO-BUG RAW-SFILEINFO-BASE"
 tests="$tests RAW-LOCK RAW-MKDIR RAW-SEEK RAW-CONTEXT RAW-MUX RAW-OPEN RAW-WRITE"
 tests="$tests RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-CHKPATH RAW-RENAME"
 tests="$tests RAW-EAS RAW-STREAMS RAW-OPLOCK RAW-NOTIFY BASE-DELAYWRITE"
index 541e19829ab37dc0059a200c869eeebaf0d89f19..d1bece26594fb104a5c363d48dd689fc241d5b84 100755 (executable)
@@ -22,7 +22,7 @@ shift 4
 
 export SMBTORTURE_REMOTE_HOST=$server
 
-raw_tests="RAW-QFILEINFO RAW-SFILEINFO RAW-MKDIR RAW-SEEK RAW-OPEN RAW-WRITE RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-RENAME RAW-EAS RAW-STREAMS"
+raw_tests="RAW-QFILEINFO RAW-SFILEINFO-BASE RAW-MKDIR RAW-SEEK RAW-OPEN RAW-WRITE RAW-UNLINK RAW-READ RAW-CLOSE RAW-IOCTL RAW-RENAME RAW-EAS RAW-STREAMS"
 # This test fails: RAW-QFSINFO
 
 all_errs=0
index 138f26310684384977b4e184745068a75e4a321f..ada290f436ecadc384f14c9460c41bc9936172d4 100644 (file)
@@ -41,10 +41,7 @@ NTSTATUS torture_raw_init(void)
        torture_suite_add_1smb_test(suite, "QFSINFO", torture_raw_qfsinfo);
        torture_suite_add_1smb_test(suite, "QFILEINFO", torture_raw_qfileinfo);
        torture_suite_add_1smb_test(suite, "QFILEINFO-IPC", torture_raw_qfileinfo_pipe);
-       torture_suite_add_1smb_test(suite, "SFILEINFO", torture_raw_sfileinfo);
-       torture_suite_add_1smb_test(suite, "SFILEINFO-BUG", torture_raw_sfileinfo_bug);
-       torture_suite_add_1smb_test(suite, "SFILEINFO-RENAME",
-                                     torture_raw_sfileinfo_rename);
+       torture_suite_add_suite(suite, torture_raw_sfileinfo(suite));
        torture_suite_add_suite(suite, torture_raw_search(suite));
        torture_suite_add_1smb_test(suite, "CLOSE", torture_raw_close);
        torture_suite_add_1smb_test(suite, "OPEN", torture_raw_open);
index 31c753300c7dddd6ee55ee158087ff0114440af4..d2163629d7df41d73e7a30db1f6279f07adbc311 100644 (file)
@@ -29,8 +29,8 @@
    for each call we test that it succeeds, and where possible test 
    for consistency between the calls. 
 */
-bool torture_raw_sfileinfo(struct torture_context *torture, 
-                          struct smbcli_state *cli)
+static bool
+torture_raw_sfileinfo_base(struct torture_context *torture, struct smbcli_state *cli)
 {
        bool ret = true;
        int fnum = -1;
@@ -442,8 +442,9 @@ done:
 /*
  * basic testing of all RAW_SFILEINFO_RENAME call
  */
-bool torture_raw_sfileinfo_rename(struct torture_context *torture,
-                                                                 struct smbcli_state *cli)
+static bool
+torture_raw_sfileinfo_rename(struct torture_context *torture,
+    struct smbcli_state *cli)
 {
        bool ret = true;
        int fnum_saved, d_fnum, fnum2, fnum = -1;
@@ -669,8 +670,8 @@ done:
 /* 
    look for the w2k3 setpathinfo STANDARD bug
 */
-bool torture_raw_sfileinfo_bug(struct torture_context *torture,
-                                                          struct smbcli_state *cli)
+static bool torture_raw_sfileinfo_bug(struct torture_context *torture,
+    struct smbcli_state *cli)
 {
        const char *fname = "\\bug3.txt";
        union smb_setfileinfo sfinfo;
@@ -698,3 +699,16 @@ bool torture_raw_sfileinfo_bug(struct torture_context *torture,
 
        return true;
 }
+
+struct torture_suite *torture_raw_sfileinfo(TALLOC_CTX *mem_ctx)
+{
+       struct torture_suite *suite = torture_suite_create(mem_ctx,
+           "SFILEINFO");
+
+       torture_suite_add_1smb_test(suite, "BASE", torture_raw_sfileinfo_base);
+       torture_suite_add_1smb_test(suite, "RENAME",
+                                     torture_raw_sfileinfo_rename);
+       torture_suite_add_1smb_test(suite, "BUG", torture_raw_sfileinfo_bug);
+
+       return suite;
+}