* $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>
int ss;
int recursion = 0;
extern ss_request_table sms_test;
+extern int sending_version_no;
#ifndef __SABER__
main(argc, argv)
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");
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();
test_auth()
{
- int status = sms_auth();
+ int status;
+
+ status = sms_auth("smstest");
if (status) ss_perror(ss, status, 0);
}
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);
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;
}
printf("\n");
count++;
+ return(SMS_CONT);
}
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"));
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");
+}