]> andersk Git - moira.git/blobdiff - clients/mrtest/mrtest.c
improve parsing of arguement to connect
[moira.git] / clients / mrtest / mrtest.c
index cdeb77a07a9b8956b3cfcd12b36e276b4c8faeca..f4df4e417d36690fa92b687638f104e9755685c1 100644 (file)
@@ -4,6 +4,8 @@
  *     $Header$
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  *
  */
 
@@ -11,6 +13,7 @@
 static char *rcsid_test_c = "$Header$";
 #endif lint
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <sys/file.h>
 #include <ctype.h>
@@ -54,6 +57,7 @@ sms()
                com_err(whoami, status, 0);
                exit(1);
        }
+       exit(0);
 }
 
 test_noop()
@@ -72,9 +76,21 @@ test_old()
        sending_version_no = SMS_VERSION_1;
 }
 
-test_connect()
+test_connect(argc, argv)
+int argc;
+char *argv[];
 {
-       int status = sms_connect();
+       char *server = "", serverbuf[256], *index();
+       int status;
+
+       if (argc > 1) {
+           server = argv[1];
+           if (index(server, ':') == NULL) {
+               server = serverbuf;
+               sprintf(serverbuf, "%s:%s", argv[1], "sms_db");
+           }
+       }
+       status = sms_connect(server);
        if (status) ss_perror(ss, status, 0);
 }
 
@@ -193,25 +209,6 @@ char *concat(str1, str2)
        return rtn;
 }
 
-test_shutdown(argc, argv)
-       int argc;
-       char **argv;
-{
-       char *reason = NULL;
-       int status, i;
-       
-       if (argc < 2) {
-               ss_perror(ss, 0, "Usage: shutdown reason ...");
-               return;
-       }
-       
-       for (i = 1 ; i < argc; i++) {
-               if (i != 1) reason = concat(reason, " ");
-               reason = concat(reason, argv[i]);
-       }
-       status = sms_shutdown(reason);
-       if (status) ss_perror(ss, status, 0);
-}
 static int count;
 
 
@@ -226,6 +223,7 @@ print_reply(argc, argv)
        }
        printf("\n");
        count++;
+       return(SMS_CONT);
 }
 
 test_query(argc, argv)
@@ -256,3 +254,14 @@ test_access(argc, argv)
        status = sms_access(argv[1], argc-2, argv+2);
        if (status) ss_perror(ss, status, 0);
 }
+
+
+test_dcm(argc, argv)
+       int argc;
+       char **argv;
+{
+       int status;
+
+       if (status = sms_do_update())
+         ss_perror(ss, status, " while triggering dcm");
+}
This page took 0.119104 seconds and 4 git commands to generate.