Whamcloud - gitweb
liblustre:
authorericm <ericm>
Thu, 13 Nov 2003 06:56:20 +0000 (06:56 +0000)
committerericm <ericm>
Thu, 13 Nov 2003 06:56:20 +0000 (06:56 +0000)
 - adjust the way of zeroconf
 - bring lltest/recovery_small to zeroconf

lustre/liblustre/recovery_small.c
lustre/liblustre/test_common.h
lustre/utils/lrun

index 700faa8..578480e 100644 (file)
@@ -301,34 +301,48 @@ extern void __liblustre_cleanup_(void);
 
 void usage(const char *cmd)
 {
-        printf("Usage: %s -s server_name [-c config_file]\n", cmd);
+        printf("Usage: \t%s -s mds_hostname --target mdsnid:/mdsname/profile\n", cmd);
+        printf("       \t%s -s mds_hostname --dumpfile dumpfile\n", cmd);
+        exit(-1);
 }
 
 int main(int argc, char * argv[])
 {
-        int c;
+        int opt_index, c;
         char cmd[1024];
+        static struct option long_opts[] = {
+                {"target", 1, 0, 0},
+                {"dumpfile", 1, 0, 0},
+                {0, 0, 0, 0}
+        };
 
-        setenv("LIBLUSTRE_USE_ZCONF", "no", 1);
+        if (argc < 3)
+                usage(argv[0]);
 
-        while ((c = getopt(argc, argv, "c:s:")) != -1) {
+        while ((c = getopt_long(argc, argv, "s:", long_opts, &opt_index)) != -1) {
                 switch (c) {
-                case 'c':
-                        setenv("LIBLUSTRE_CONFIG_FILE", optarg, 1);
+                case 0: {
+                        if (!optarg[0])
+                                usage(argv[0]);
+
+                        if (!strcmp(long_opts[opt_index].name, "target")) {
+                                setenv(ENV_LUSTRE_MNTTGT, optarg, 1);
+                        } else if (!strcmp(long_opts[opt_index].name, "dumpfile")) {
+                                setenv(ENV_LUSTRE_DUMPFILE, optarg, 1);
+                        } else
+                                usage(argv[0]);
                         break;
+                }
                 case 's':
                         strcpy(mds_server, optarg);
                         break;
                 default:
                         usage(argv[0]);
-                        exit(-1);
                 }
         }
 
-        if (argc < 2 || optind != argc) {
+        if (optind != argc)
                 usage(argv[0]);
-                exit(-1);
-        }
 
         sprintf(cmd, "ssh %s cat /dev/null", mds_server);
         if (system(cmd)) {
index 416e100..6628b4d 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef __TEST_COMMON__H
 #define __TEST_COMMON__H
 
+#define ENV_LUSTRE_MNTPNT               "LIBLUSTRE_MOUNT_POINT"
+#define ENV_LUSTRE_MNTTGT               "LIBLUSTRE_MOUNT_TARGET"
+#define ENV_LUSTRE_DUMPFILE             "LIBLUSTRE_DUMPFILE"
+
 extern int exit_on_err;
 
 void t_touch(const char *path);
index 3f96820..b7dc796 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 
-LUSTRE_MOUNT_POINT=${LUSTRE_MOUNT_POINT:-"/mnt/lustre"}
-LIBLUSTRE_USE_ZCONF="no"
-LUSTRE_CONFIG_FILE=${LUSTRE_CONFIG_FILE:-"/tmp/DUMP_FILE"}
+LIBLUSTRE_MOUNT_POINT=${LIBLUSTRE_MOUNT_POINT:-"/mnt/lustre"}
+LIBLUSTRE_MOUNT_TARGET=${LIBLUSTRE_MOUNT_TARGET:-""}
+LIBLUSTRE_DUMPFILE=${LIBLUSTRE_DUMPFILE:-"/tmp/DUMP_FILE"}
 LD_PRELOAD=${LD_PRELOAD:-"/usr/lib/liblustre.so"}
 
 export LUSTRE_MOUNT_POINT