Whamcloud - gitweb
Branch HEAD
authoryangsheng <yangsheng>
Sun, 6 Jul 2008 15:25:03 +0000 (15:25 +0000)
committeryangsheng <yangsheng>
Sun, 6 Jul 2008 15:25:03 +0000 (15:25 +0000)
b=16247
i=sheng.yang
i=johann

Allow liblustre sanity to exclude tests

lustre/kernel_patches/targets/2.6-rhel5.target.in
lustre/liblustre/tests/sanity.c

index ccaa05e..46c5302 100644 (file)
@@ -1,5 +1,5 @@
 lnxmaj="2.6.18"
 lnxmaj="2.6.18"
-lnxrel="53.1.21.el5"
+lnxrel="92.1.6.el5"
 
 KERNEL=linux-${lnxmaj}-${lnxrel}.tar.bz2
 SERIES=2.6-rhel5.series
 
 KERNEL=linux-${lnxmaj}-${lnxrel}.tar.bz2
 SERIES=2.6-rhel5.series
@@ -9,7 +9,7 @@ RHBUILD=1
 LINUX26=1
 LUSTRE_VERSION=@VERSION@
 
 LINUX26=1
 LUSTRE_VERSION=@VERSION@
 
-OFED_VERSION=1.3
+OFED_VERSION=1.3.1
 
 BASE_ARCHS="i686 x86_64 ia64"
 BIGMEM_ARCHS=""
 
 BASE_ARCHS="i686 x86_64 ia64"
 BIGMEM_ARCHS=""
index 7056d58..bcf7056 100644 (file)
@@ -94,6 +94,7 @@ int t1(char *name)
 {
         char path[MAX_PATH_LENGTH] = "";
 
 {
         char path[MAX_PATH_LENGTH] = "";
 
+        ENTER("touch+unlink");
         snprintf(path, MAX_PATH_LENGTH, "%s/test_t1", lustre_path);
 
         if (opt_verbose)
         snprintf(path, MAX_PATH_LENGTH, "%s/test_t1", lustre_path);
 
         if (opt_verbose)
@@ -1376,8 +1377,8 @@ extern void __liblustre_cleanup_(void);
 void usage(char *cmd)
 {
         printf("\n"
 void usage(char *cmd)
 {
         printf("\n"
-               "usage: %s [--only {test}] --target mgsnid:/fsname\n",
-               cmd);
+             "usage: %s [-o test][-e test][-v] --target mgsnid:/fsname\n",
+             cmd);
         printf("       %s --dumpfile dumpfile\n", cmd);
         exit(-1);
 }
         printf("       %s --dumpfile dumpfile\n", cmd);
         exit(-1);
 }
@@ -1423,21 +1424,28 @@ struct testlist {
 int main(int argc, char * const argv[])
 {
         struct testlist *test;
 int main(int argc, char * const argv[])
 {
         struct testlist *test;
-        int opt_index, c, rc = 0, numonly = 0;
-        char *only[100];
+        int opt_index, c, rc = 0, numonly = 0, numexcept = 0;
+        char *only[100], *except[100];
         static struct option long_opts[] = {
                 {"dumpfile", 1, 0, 'd'},
                 {"only", 1, 0, 'o'},
         static struct option long_opts[] = {
                 {"dumpfile", 1, 0, 'd'},
                 {"only", 1, 0, 'o'},
+                {"except", 1, 0, 'e'},
                 {"target", 1, 0, 't'},
                 {"verbose", 1, 0, 'v'},
                 {0, 0, 0, 0}
         };
 
                 {"target", 1, 0, 't'},
                 {"verbose", 1, 0, 'v'},
                 {0, 0, 0, 0}
         };
 
-        while ((c = getopt_long(argc, argv, "d:o:t:v", long_opts, &opt_index)) != -1) {
+        while ((c = getopt_long(argc, argv, "d:e:o:t:v", long_opts, &opt_index)) != -1) {
                 switch (c) {
                 case 'd':
                         setenv(ENV_LUSTRE_DUMPFILE, optarg, 1);
                         break;
                 switch (c) {
                 case 'd':
                         setenv(ENV_LUSTRE_DUMPFILE, optarg, 1);
                         break;
+                case 'e':
+                        if (numexcept == 0)
+                                printf("Not running test(s): ");
+                        printf("%s ", optarg);
+                        except[numexcept++] = optarg;
+                        break;
                 case 'o':
                         if (numonly == 0)
                                 printf("Only running test(s): ");
                 case 'o':
                         if (numonly == 0)
                                 printf("Only running test(s): ");
@@ -1478,14 +1486,35 @@ int main(int argc, char * const argv[])
 
         for (test = testlist; test->test != NULL; test++) {
                 int run = 1, i;
 
         for (test = testlist; test->test != NULL; test++) {
                 int run = 1, i;
+                int len, olen;
 
 
-                if (numonly > 0) {
-                        int len;
+                if (numexcept > 0) {
+                        len = strlen(test->name);
+                        for (i = 0; i < numexcept; i++) {
+                                olen = strlen(except[i]);
+
+                                if (len < olen)
+                                        continue;
+
+                                if (strncmp(except[i], test->name, olen) == 0) {
+                                        switch(test->name[olen]) {
+                                        case '0': case '1': case '2': case '3':
+                                        case '4': case '5': case '6': case '7':
+                                        case '8': case '9':
+                                                break;
+                                        default:
+                                                run = 0;
+                                                break;
+                                        }
+                                }
+                        }
+                }
 
 
+                if (numonly > 0) {
                         run = 0;
                         len = strlen(test->name);
                         for (i = 0; i < numonly; i++) {
                         run = 0;
                         len = strlen(test->name);
                         for (i = 0; i < numonly; i++) {
-                                int olen = strlen(only[i]);
+                                olen = strlen(only[i]);
 
                                 if (len < olen)
                                         continue;
 
                                 if (len < olen)
                                         continue;