Author: jelmer
Date: 2007-01-26 13:03:28 +0000 (Fri, 26 Jan 2007)
New Revision: 21028

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21028

Log:
Generate list of tests rather than maintaining it manually.
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/script/tests/test_posix.sh
   branches/SAMBA_4_0/source/torture/smbtorture.c


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:merge
   - [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

   + [EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Modified: branches/SAMBA_4_0/source/script/tests/test_posix.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/test_posix.sh        2007-01-26 
09:50:56 UTC (rev 21027)
+++ branches/SAMBA_4_0/source/script/tests/test_posix.sh        2007-01-26 
13:03:28 UTC (rev 21028)
@@ -20,34 +20,9 @@
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
-#
-# please don't remove tests here, when you want them to be skipped!
-# just add them to the skipped line below
-# this should be the complete list smbtorture offers as BASE-* tests
-#
-base="BASE-ATTR BASE-CHARSET BASE-CHKPATH BASE-DEFER_OPEN BASE-DELAYWRITE 
BASE-DELETE"
-base="$base BASE-DENY1 BASE-DENY2 BASE-DENY3 BASE-DENYDOS BASE-DIR1 BASE-DIR2"
-base="$base BASE-DISCONNECT BASE-FDPASS BASE-LOCK "
-base="$base BASE-MANGLE BASE-NEGNOWAIT BASE-NTDENY1"
-base="$base BASE-NTDENY2 BASE-OPEN BASE-OPENATTR BASE-PROPERTIES BASE-RENAME 
BASE-RW1"
-base="$base BASE-SECLEAK BASE-TCON BASE-TCONDEV BASE-TRANS2 BASE-UNLINK 
BASE-VUID"
-base="$base BASE-XCOPY"
+tests=`bin/smbtorture --list | grep "^(BASE|RAW|SMB2)-" | xargs`
 
 #
-# please don't remove tests here, when you want them to be skipped!
-# just add them to the skipped line below
-# this should be the complete list smbtorture offers as RAW-* tests
-#
-raw="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"
-
-smb2="SMB2-CONNECT SMB2-GETINFO SMB2-SETINFO SMB2-FIND"
-
-tests="$base $raw $smb2"
-
-#
 # please add tests you want to be skipped here!
 #
 skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE RAW-COMPOSITE RAW-OPLOCK 
RAW-ACLS"

Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smbtorture.c      2007-01-26 09:50:56 UTC 
(rev 21027)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c      2007-01-26 13:03:28 UTC 
(rev 21028)
@@ -163,6 +163,23 @@
 
 }
 
+static void print_test_list(void)
+{
+       struct torture_suite *o;
+       struct torture_suite *s;
+       struct torture_tcase *t;
+
+       for (o = torture_root->children; o; o = o->next) {
+               for (s = o->children; s; s = s->next) {
+                       printf("%s-%s\n", o->name, s->name);
+               }
+
+               for (t = o->testcases; t; t = t->next) {
+                       printf("%s-%s\n", o->name, t->name);
+               }
+       }
+}
+
 static void usage(poptContext pc)
 {
        struct torture_suite *o;
@@ -487,7 +504,8 @@
        NTSTATUS status;
        int shell = False;
        static const char *ui_ops_name = "simple";
-       enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS,
+       static int list_tests = 0;
+       enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST,
              OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS, OPT_BASEDIR};
        
        struct poptOption long_options[] = {
@@ -500,6 +518,7 @@
                {"num-ops",       0, POPT_ARG_INT,  &torture_numops,    0,      
"num ops",      NULL},
                {"entries",       0, POPT_ARG_INT,  &torture_entries,   0,      
"entries",      NULL},
                {"loadfile",      0, POPT_ARG_STRING,   NULL,   OPT_LOADFILE,   
"loadfile",     NULL},
+               {"list",          0, POPT_ARG_NONE, &list_tests, 0, NULL, NULL 
},
                {"unclist",       0, POPT_ARG_STRING,   NULL,   OPT_UNCLIST,    
"unclist",      NULL},
                {"timelimit",   't', POPT_ARG_INT,      NULL,   OPT_TIMELIMIT,  
"timelimit",    NULL},
                {"failures",    'f', POPT_ARG_INT,  &torture_failures,  0,      
"failures",     NULL},
@@ -584,6 +603,11 @@
        torture_init();
        ldb_global_init();
 
+       if (list_tests) {
+               print_test_list();
+               return 0;
+       }
+
        subunit_dir = lp_parm_string_list(-1, "torture", "subunitdir", ":");
        if (subunit_dir == NULL) 
                torture_subunit_load_testsuites(dyn_TORTUREDIR, true, NULL);

Reply via email to