set timeout 30

load_lib "helpers.exp"

global spawn_id
global server_id
global hostname

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: .* Wrong princ" {
		pass "gss err: server logged auth error"
	}
	eof { fail "gss err: server exited" }
	timeout { fail "gss err: timeout waiting for server output" }
}

flush_server
