10 set hostname [exec hostname]
12 # Hack around Solaris 9 kernel race condition that causes last output
13 # from a pty to get dropped.
14 if { $PRIOCNTL_HACK } {
15 catch {exec priocntl -s -c FX -m 30 -p 30 -i pid [getpid]}
18 upvar 1 spawn_id spawn_id
23 if { $arg == "-ignore" \
25 || $arg == "-leaveopen" } {
30 if [string match "-*" $arg] {
41 set newargs [concat $newargs {priocntl -e -c FX -p 0}]
45 set pid [eval oldspawn $newargs]
50 if { [string length $VALGRIND] } {
51 rename spawn valgrind_aux_spawn
54 upvar 1 spawn_id spawn_id
59 if { $arg == "-ignore" \
61 || $arg == "-leaveopen" } {
66 if [string match "-*" $arg] {
77 # Only run valgrind for local programs, not
79 #&&![string match "/bin/sh" $arg] sh is used to start kadmind!
80 if [string match "/" [string index $arg 0]]&&![string match "/bin/ls" $arg]&&![regexp {/kshd$} $arg] {
81 set newargs [concat $newargs $VALGRIND]
82 } elseif [string match "." [string index $arg 0]] {
83 set newargs [concat $newargs $VALGRIND]
88 set pid [eval valgrind_aux_spawn $newargs]
93 # this will initialize the database and keytab
94 load_lib "helpers.exp"
96 proc rpc_test_version {} {
100 clone_output "$CLIENT version <unknown>"
101 clone_output "$SERVER version <unknown>"
104 proc rpc_test_load {} {
108 # rpc_test_exit -- clean up and exit
109 proc rpc_test_exit {} {
112 global server_started
119 fail "server exited!"
120 verbose $expect_out(buffer) 1
122 timeout { pass "server survived" }
125 fail "server exited! (expect failed)"
130 # rpc_test_start -- start the rpc_test server running
132 proc rpc_test_start { } {
136 global server_started
140 if [info exists server_pid] { rpc_test_exit }
142 set env(KRB5_KTNAME) FILE:$env(RPC_TEST_SRVTAB)
144 verbose "% $SERVER" 1
145 set server_pid [spawn $SERVER $PROT]
146 set server_id $spawn_id
150 unset env(KRB5_KTNAME)
155 -re "port: (\[0-9\]*)\r\n" {
156 set server_port $expect_out(1,string)
160 send_error "server exited!"
161 verbose $expect_out(buffer) 1
164 send_error "server didn't start in $timeout seconds"
165 verbose $expect_out(buffer) 1
172 {tcp PROT=-t dummy=[rpc_test_start]}
173 {udp PROT=-u dummy=[rpc_test_start]}