]> andersk Git - moira.git/blobdiff - clients/mrtest/mrtest.c
added copyright message
[moira.git] / clients / mrtest / mrtest.c
index 1699444ca2c1e2e36e1ff0c61266978c603abb05..1352476113605f32d1d4db10a6684f449895705e 100644 (file)
@@ -4,26 +4,16 @@
  *     $Header$
  *
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
+ *     For copying and distribution information, please see the file
+ *     <mit-copyright.h>.
  *
- *     $Log$
- *     Revision 1.4  1988-01-21 17:57:51  mar
- *     added capability to read from a script file, and put output in another file
- *
- * Revision 1.3  88/01/07  17:42:06  mar
- * print "tuple" or "tuples" as is correct
- * 
- * Revision 1.2  87/08/22  23:45:10  wesommer
- * Removed extra RCS headers.
- * 
- * Revision 1.1  87/08/22  18:31:59  wesommer
- * Initial revision
- * 
  */
 
 #ifndef lint
 static char *rcsid_test_c = "$Header$";
 #endif lint
 
+#include <mit-copyright.h>
 #include <stdio.h>
 #include <sys/file.h>
 #include <ctype.h>
@@ -33,6 +23,7 @@ static char *rcsid_test_c = "$Header$";
 int ss;
 int recursion = 0;
 extern ss_request_table sms_test;
+extern int sending_version_no;
 
 #ifndef __SABER__
 main(argc, argv)
@@ -55,7 +46,7 @@ sms()
        init_sms_err_tbl();
        init_krb_err_tbl();
 
-       ss = ss_create_invocation("sms", "1.0", (char *)NULL,
+       ss = ss_create_invocation("sms", "2.0", (char *)NULL,
                                  &sms_test, &status);
        if (status != 0) {
                com_err(whoami, status, "Unable to create invocation");
@@ -74,6 +65,16 @@ test_noop()
        if (status) ss_perror(ss, status, 0);
 }
 
+test_new()
+{
+       sending_version_no = SMS_VERSION_2;
+}
+
+test_old()
+{
+       sending_version_no = SMS_VERSION_1;
+}
+
 test_connect()
 {
        int status = sms_connect();
@@ -88,7 +89,9 @@ test_disconnect()
 
 test_auth()
 {
-       int status = sms_auth();
+       int status;
+
+       status = sms_auth("smstest");
        if (status) ss_perror(ss, status, 0);
 }
 
@@ -142,8 +145,10 @@ char *argv[];
          break;
        if ((cp = index(input, '\n')) != (char *)NULL)
          *cp = 0;
-       if (input[0] == 0)
-         continue;
+       if (input[0] == 0) {
+           printf("\n");
+           continue;
+       }
        if (input[0] == '%') {
            for (cp = &input[1]; *cp && isspace(*cp); cp++);
            printf("Comment: %s\n", cp);
@@ -191,25 +196,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;
 
 
@@ -224,6 +210,7 @@ print_reply(argc, argv)
        }
        printf("\n");
        count++;
+       return(SMS_CONT);
 }
 
 test_query(argc, argv)
@@ -235,6 +222,7 @@ test_query(argc, argv)
                ss_perror(ss, 0, "Usage: query handle [ args ... ]");
                return;
        }
+
        count = 0;
        status = sms_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL);
        printf("%d tuple%s\n", count, ((count == 1) ? "" : "s"));
@@ -254,3 +242,13 @@ test_access(argc, argv)
        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.355527 seconds and 4 git commands to generate.