set timeout 30

load_lib "helpers.exp"

global spawn_id
global server_id
global server_started
global hostname

if { !$server_started } {return} 

start_client "gss err" gsserr testuser notathena 8h 1026 notserver@$hostname

eof_client "gss err" gsserr $spawn_id 2

#
# test: server logged an authentication attempted failed?
#
verbose "gss err: checking server output"

expect {
	-i $server_id
	-re "rpc_test server: Authent.*failed: .* not found in keytab" {
	    pass "gss err: server logged auth error"
	}
	eof { fail "gss err: server exited" }
	timeout { fail "gss err: timeout waiting for server output" }
}

flush_server
