+Tue Nov 12 16:27:51 1996 Barry Jaspan <bjaspan@mit.edu>
+
+ * lib/helpers.exp, client.c, server.c, config/unix.exp,
+ Makefile.in: test GSS-RPC with both TCP and UDP transport layers
+ [krb5-libs/180]
+
Tue Nov 12 14:58:20 1996 Tom Yu <tlyu@mit.edu>
* rpc_test_setup.sh: Fix test of $VERBOSE_TEST so that $VERBOSE
unit-test-ok:: unit-test-setup unit-test-body unit-test-cleanup
-unit-test-body::
+unit-test-body:: unit-test-body-tcp unit-test-body-udp
+
+unit-test-body-tcp:
+ RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) \
+ $(RUNTEST) SERVER=./server CLIENT=./client \
+ KINIT=$(BUILDTOP)/clients/kinit/kinit \
+ KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
+ PROT=-t --tool rpc_test
+
+unit-test-body-udp:
RPC_TEST_SRVTAB=/tmp/rpc_test_v5srvtab $(ENV_SETUP) \
$(RUNTEST) SERVER=./server CLIENT=./client \
KINIT=$(BUILDTOP)/clients/kinit/kinit \
KDESTROY=$(BUILDTOP)/clients/kdestroy/kdestroy \
- --tool rpc_test
+ PROT=-u --tool rpc_test
unit-test-setup::
$(ENV_SETUP) $(START_SERVERS)
* $Source$
*
* $Log$
+ * Revision 1.14 1996/11/12 21:29:54 bjaspan
+ * * lib/helpers.exp, client.c, server.c, config/unix.exp,
+ * Makefile.in: test GSS-RPC with both TCP and UDP transport layers
+ * [krb5-libs/180]
+ *
* Revision 1.13 1996/07/22 20:41:40 marc
* this commit includes all the changes on the OV_9510_INTEGRATION and
* OV_MERGE branches. This includes, but is not limited to, the new openvision
char **argv;
{
char *host, *target, *echo_arg, **echo_resp, buf[BIG_BUF];
+ char *prot;
CLIENT *clnt;
AUTH *tmp_auth;
struct rpc_err e;
whoami = argv[0];
count = 1026;
auth_once = 0;
+ prot = NULL;
- while ((c = getopt(argc, argv, "a:m:os:")) != -1) {
+ while ((c = getopt(argc, argv, "a:m:os:tu")) != -1) {
switch (c) {
case 'a':
auth_debug_gssapi = atoi(optarg);
case 's':
svc_debug_gssapi = atoi(optarg);
break;
+ case 't':
+ prot = "tcp";
+ break;
+ case 'u':
+ prot = "udp";
+ break;
case '?':
usage();
break;
}
}
+ if (prot == NULL)
+ usage();
argv += optind;
argc -= optind;
}
/* client handle to rstat */
- clnt = clnt_create(host, RPC_TEST_PROG, RPC_TEST_VERS_1, "tcp");
+ clnt = clnt_create(host, RPC_TEST_PROG, RPC_TEST_VERS_1, prot);
if (clnt == NULL) {
clnt_pcreateerror(whoami);
exit(1);
usage()
{
- fprintf(stderr, "usage: %s [-a] [-s num] [-m num] host service [count]\n",
+ fprintf(stderr, "usage: %s {-t|-u} [-a] [-s num] [-m num] host service [count]\n",
whoami);
exit(1);
}
# rpc_test_start -- start the rpc_test server running
#
proc rpc_test_start { } {
- global SERVER
+ global SERVER PROT
global server_id
global server_pid
global server_started
set env(KRB5_KTNAME) FILE:$env(RPC_TEST_SRVTAB)
verbose "% $SERVER" 1
- set server_pid [spawn $SERVER]
+ set server_pid [spawn $SERVER $PROT]
set server_id $spawn_id
unset env(KRB5_KTNAME)
proc start_client {testname ccname user password lifetime count
{target ""}} {
- global env
- global CLIENT
- global hostname
- global spawn_id
- global verbose
+ global env CLIENT PROT hostname spawn_id verbose
if {$target == ""} {
set target "server@$hostname"
kinit $user $password $lifetime
if {$verbose > 0} {
- spawn $CLIENT -a 1 -s 1 -m 1 $hostname $target $count
+ spawn $CLIENT -a 1 -s 1 -m 1 $PROT $hostname $target $count
} else {
- spawn $CLIENT $hostname $target $count
+ spawn $CLIENT $PROT $hostname $target $count
}
verbose "$testname: client $ccname started"
#define SERVICE_NAME "server"
#endif
+void usage()
+{
+ fprintf(stderr, "Usage: server {-t|-u} [svc-debug] [misc-debug]\n");
+ exit(1);
+}
+
main(int argc, char **argv)
{
+ int c, prot;
auth_gssapi_name names[2];
register SVCXPRT *transp;
names[0].type = (gss_OID) gss_nt_service_name;
names[1].name = 0;
names[1].type = 0;
-
+
+ prot = 0;
+ while ((c = getopt(argc, argv, "tu")) != -1) {
+ switch (c) {
+ case 't':
+ prot = IPPROTO_TCP;
+ break;
+ case 'u':
+ prot = IPPROTO_UDP;
+ break;
+ case '?':
+ usage();
+ break;
+ }
+ }
+ if (prot == 0)
+ usage();
+
+ argv += optind;
+ argc -= optind;
+
switch (argc) {
- case 3:
- misc_debug_gssapi = atoi(argv[2]);
case 2:
- svc_debug_gssapi = atoi(argv[1]);
+ misc_debug_gssapi = atoi(argv[1]);
case 1:
+ svc_debug_gssapi = atoi(argv[0]);
+ case 0:
break;
default:
- fprintf(stderr, "Usage: server [svc-debug] [misc-debug]\n");
+ usage();
exit(1);
}
(void) pmap_unset(RPC_TEST_PROG, RPC_TEST_VERS_1);
- transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+ if (prot == IPPROTO_TCP)
+ transp = svctcp_create(RPC_ANYSOCK, 0, 0);
+ else
+ transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
fprintf(stderr, "cannot create tcp service.");
exit(1);
}
if (!svc_register(transp, RPC_TEST_PROG, RPC_TEST_VERS_1,
- rpc_test_prog_1, IPPROTO_TCP)) {
+ rpc_test_prog_1, prot)) {
fprintf(stderr,
- "unable to register (RPC_TEST_PROG, RPC_TEST_VERS_1, tcp).");
+ "unable to register (RPC_TEST_PROG, RPC_TEST_VERS_1, %s).",
+ prot == IPPROTO_TCP ? "tcp" : "udp");
exit(1);
}