diff options
author | Barry Jaspan <bjaspan@mit.edu> | 1996-11-12 21:30:02 +0000 |
---|---|---|
committer | Barry Jaspan <bjaspan@mit.edu> | 1996-11-12 21:30:02 +0000 |
commit | 37ab44de802a7ecb09aa1ce290da612361b3d19d (patch) | |
tree | d0a93064d6945c3e7f05214ab8ece78f96361141 /src/lib/rpc | |
parent | 2bef65c1eefff7154f2f617b62fbddccd8b31b53 (diff) | |
download | krb5-37ab44de802a7ecb09aa1ce290da612361b3d19d.tar.gz krb5-37ab44de802a7ecb09aa1ce290da612361b3d19d.tar.xz krb5-37ab44de802a7ecb09aa1ce290da612361b3d19d.zip |
* 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]
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9389 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/rpc')
-rw-r--r-- | src/lib/rpc/unit-test/ChangeLog | 6 | ||||
-rw-r--r-- | src/lib/rpc/unit-test/Makefile.in | 13 | ||||
-rw-r--r-- | src/lib/rpc/unit-test/client.c | 21 | ||||
-rw-r--r-- | src/lib/rpc/unit-test/config/unix.exp | 4 | ||||
-rw-r--r-- | src/lib/rpc/unit-test/lib/helpers.exp | 10 | ||||
-rw-r--r-- | src/lib/rpc/unit-test/server.c | 47 |
6 files changed, 79 insertions, 22 deletions
diff --git a/src/lib/rpc/unit-test/ChangeLog b/src/lib/rpc/unit-test/ChangeLog index 22cea206a8..585bbb507d 100644 --- a/src/lib/rpc/unit-test/ChangeLog +++ b/src/lib/rpc/unit-test/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/src/lib/rpc/unit-test/Makefile.in b/src/lib/rpc/unit-test/Makefile.in index 4dc6a231e4..c1cb9e28ed 100644 --- a/src/lib/rpc/unit-test/Makefile.in +++ b/src/lib/rpc/unit-test/Makefile.in @@ -32,12 +32,21 @@ unit-test-: 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) diff --git a/src/lib/rpc/unit-test/client.c b/src/lib/rpc/unit-test/client.c index bcf2700e5e..8d676ceac1 100644 --- a/src/lib/rpc/unit-test/client.c +++ b/src/lib/rpc/unit-test/client.c @@ -5,6 +5,11 @@ * $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 @@ -108,6 +113,7 @@ main(argc, argv) char **argv; { char *host, *target, *echo_arg, **echo_resp, buf[BIG_BUF]; + char *prot; CLIENT *clnt; AUTH *tmp_auth; struct rpc_err e; @@ -120,8 +126,9 @@ main(argc, argv) 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); @@ -135,11 +142,19 @@ main(argc, argv) 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; @@ -160,7 +175,7 @@ main(argc, argv) } /* 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); @@ -314,7 +329,7 @@ main(argc, argv) 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); } diff --git a/src/lib/rpc/unit-test/config/unix.exp b/src/lib/rpc/unit-test/config/unix.exp index ff7266a0f1..e266216743 100644 --- a/src/lib/rpc/unit-test/config/unix.exp +++ b/src/lib/rpc/unit-test/config/unix.exp @@ -46,7 +46,7 @@ proc rpc_test_exit {} { # 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 @@ -55,7 +55,7 @@ proc rpc_test_start { } { 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) diff --git a/src/lib/rpc/unit-test/lib/helpers.exp b/src/lib/rpc/unit-test/lib/helpers.exp index 1a37ad512a..b33af6a50b 100644 --- a/src/lib/rpc/unit-test/lib/helpers.exp +++ b/src/lib/rpc/unit-test/lib/helpers.exp @@ -61,11 +61,7 @@ proc flush_server {} { 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" @@ -75,9 +71,9 @@ proc start_client {testname ccname user password lifetime count 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" diff --git a/src/lib/rpc/unit-test/server.c b/src/lib/rpc/unit-test/server.c index 1083502cdd..4ac8f5f841 100644 --- a/src/lib/rpc/unit-test/server.c +++ b/src/lib/rpc/unit-test/server.c @@ -38,8 +38,15 @@ static void rpc_test_badverf(gss_name_t client, gss_name_t server, #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; @@ -47,30 +54,54 @@ main(int argc, char **argv) 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); } |