* lib/helpers.exp (expect_tcl_prompt): Use the "-re" flag, and
authorTom Yu <tlyu@mit.edu>
Sun, 15 Sep 2002 19:17:58 +0000 (19:17 +0000)
committerTom Yu <tlyu@mit.edu>
Sun, 15 Sep 2002 19:17:58 +0000 (19:17 +0000)
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
src/lib/rpc/unit-test/lib/helpers.exp

index 71fd921fd4f909f7ba124302556e41cf07574031..1da42068cd25e6b55b7e7f6c8acf102fd0ec9a60 100644 (file)
@@ -1,3 +1,11 @@
+2002-09-15  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index 66b4d3054087bf8a23676b6e8b42b9819a68de9e..f07b6f27a81350a5c352788cf7ff678b8b3b1a1b 100644 (file)
@@ -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