From d084b8fb16661b7d0a38e6cdd9014f8d76f9bfb0 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Sun, 15 Sep 2002 19:17:58 +0000 Subject: [PATCH] * lib/helpers.exp (expect_tcl_prompt): Use the "-re" flag, and match end of output. (expect_kadm_ok): s/error/perror. (setup_database): Work around tcl 8.4's (incorrect?) output EOL translation. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14867 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/unit-test/ChangeLog | 8 ++++++++ src/lib/rpc/unit-test/lib/helpers.exp | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/lib/rpc/unit-test/ChangeLog b/src/lib/rpc/unit-test/ChangeLog index 71fd921fd..1da42068c 100644 --- a/src/lib/rpc/unit-test/ChangeLog +++ b/src/lib/rpc/unit-test/ChangeLog @@ -1,3 +1,11 @@ +2002-09-15 Tom Yu + + * lib/helpers.exp (expect_tcl_prompt): Use the "-re" flag, and + match end of output. + (expect_kadm_ok): s/error/perror. + (setup_database): Work around tcl 8.4's (incorrect?) output EOL + translation. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/lib/rpc/unit-test/lib/helpers.exp b/src/lib/rpc/unit-test/lib/helpers.exp index 66b4d3054..f07b6f27a 100644 --- a/src/lib/rpc/unit-test/lib/helpers.exp +++ b/src/lib/rpc/unit-test/lib/helpers.exp @@ -30,8 +30,8 @@ proc expect_tcl_prompt {} { global kadmin_tcl_spawn_id expect { -i $kadmin_tcl_spawn_id - "^% " { } - -re . { error "unexpected output {$expect_out(buffer)} from subprocess, expecting tcl prompt" } + -re "^% $" { } + -re . { perror "unexpected output {$expect_out(buffer)} from subprocess, expecting tcl prompt" } timeout { perror "timeout waiting for tcl prompt" } eof { perror "eof from subprocess when expecting tcl prompt" } } @@ -51,7 +51,7 @@ proc expect_kadm_ok {} { expect { -i $kadmin_tcl_spawn_id -re "^OK OVSEC_KADM_OK \[^\n\]*\n" {} - default { error "didn't get ok back" } + default { perror "didn't get ok back" } } } # trying to translate rpc_test_setup.sh into inline tcl... @@ -76,6 +76,10 @@ proc setup_database {} { set kadmin_tcl_spawn_id $spawn_id if [info exists x] { set spawn_id $x } + expect_tcl_prompt + # tcl 8.4 for some reason screws up autodetection of output EOL + # translation. Work around it for now. + send_tcl_cmd_await_echo "if { \[info commands fconfigure\] ne \"\" } { fconfigure stdout -translation lf }" expect_tcl_prompt send_tcl_cmd_await_echo "source {$TCLUTIL}" expect_tcl_prompt -- 2.26.2