diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-21 13:49:30 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2002-11-21 13:49:30 +0000 |
commit | bc2b8129d7ea25df488a988b486ec0fdd6a2a3d4 (patch) | |
tree | 3dd9f2c0745f1951d55652e389cdcc674d71d349 /mail | |
parent | 65de03bc48e19f158107cee0921a0f68025f8b34 (diff) | |
download | mailutils-bc2b8129d7ea25df488a988b486ec0fdd6a2a3d4.tar.gz mailutils-bc2b8129d7ea25df488a988b486ec0fdd6a2a3d4.tar.bz2 |
(default_mail_start): Save mail spawn id in the global variable.
(default_mail_stop): Moved functionality from mail_exit
(mail_stop): Call default_mail_stop unless it has already
been called.
(mail_exit): Call mail_stop
Diffstat (limited to 'mail')
-rw-r--r-- | mail/testsuite/lib/mail.exp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mail/testsuite/lib/mail.exp b/mail/testsuite/lib/mail.exp index 5e90f83cf..e21c72c49 100644 --- a/mail/testsuite/lib/mail.exp +++ b/mail/testsuite/lib/mail.exp @@ -51,6 +51,7 @@ proc default_mail_start {args} { global MU_TOOL_FLAGS global mail_prompt global expect_out + global mail_spawn_id mu_version @@ -69,8 +70,8 @@ proc default_mail_start {args} { set mail_cmd "$MU_TOOL $sw" verbose "Spawning $mail_cmd" - set res [remote_spawn host $mail_cmd] - if { $res < 0 || $res == "" } { + set mail_spawn_id [remote_spawn host $mail_cmd] + if { $mail_spawn_id < 0 || $mail_spawn_id == "" } { perror "Spawning $mail_cmd failed." return 1; } @@ -88,9 +89,9 @@ proc default_mail_start {args} { } proc default_mail_stop {} { - verbose "Stopping mail" - + mail_command "exit" + remote_close host } proc mail_start {args} { @@ -113,7 +114,11 @@ proc mail_start {args} { } proc mail_stop {} { - return [default_mail_stop]; + global mail_spawn_id + if {[info exists mail_spawn_id] && $mail_spawn_id > 0} { + default_mail_stop + unset mail_spawn_id + } } ## @@ -127,9 +132,7 @@ proc mail_command { cmd } { } proc mail_exit {} { - set res [mail_send "exit\n"] - sleep 5 - return res + mail_stop } # mail_test [-message MESSAGE][-default (FAIL|XFAIL)][-noprompt] |