6 * Copyright (C) 1987 by the Massachusetts Institute of Technology
9 * Revision 1.3 1988-01-07 17:42:06 mar
10 * print "tuple" or "tuples" as is correct
12 * Revision 1.2 87/08/22 23:45:10 wesommer
13 * Removed extra RCS headers.
15 * Revision 1.1 87/08/22 18:31:59 wesommer
21 static char *rcsid_test_c = "$Header$";
29 extern ss_request_table sms_test;
52 ss = ss_create_invocation("sms", "0.1", (char *)NULL,
55 com_err(whoami, status, "Unable to create invocation");
58 ss_listen(ss, &status);
60 com_err(whoami, status, 0);
67 int status = sms_noop();
68 if (status) ss_perror(ss, status, 0);
73 int status = sms_connect();
74 if (status) ss_perror(ss, status, 0);
79 int status = sms_disconnect();
80 if (status) ss_perror(ss, status, 0);
85 int status = sms_auth();
86 if (status) ss_perror(ss, status, 0);
89 char *concat(str1, str2)
93 extern char *malloc();
96 int len = strlen(str2) + 1 ;
98 bcopy(str2, rtn, len);
100 int len1 = strlen(str1);
101 int len2 = strlen(str2) + 1;
102 rtn = malloc(len1+len2);
103 bcopy(str1, rtn, len1);
104 bcopy(str2, rtn+len1, len2);
109 test_shutdown(argc, argv)
117 ss_perror(ss, 0, "Usage: shutdown reason ...");
121 for (i = 1 ; i < argc; i++) {
122 if (i != 1) reason = concat(reason, " ");
123 reason = concat(reason, argv[i]);
125 status = sms_shutdown(reason);
126 if (status) ss_perror(ss, status, 0);
131 print_reply(argc, argv)
136 for (i = 0; i < argc; i++) {
137 if (i != 0) printf(", ");
138 printf("%s", argv[i]);
144 test_query(argc, argv)
150 ss_perror(ss, 0, "Usage: query handle [ args ... ]");
154 status = sms_query(argv[1], argc-2, argv+2, print_reply, (char *)NULL);
155 printf("%d tuple%s\n", count, ((count == 1) ? "" : "s"));
156 if (status) ss_perror(ss, status, 0);
159 test_access(argc, argv)
165 ss_perror(ss, 0, "Usage: access handle [ args ... ]");
168 status = sms_access(argv[1], argc-2, argv+2);
169 if (status) ss_perror(ss, status, 0);