aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-08-14 14:53:48 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-08-14 14:53:48 +0000
commitdfa9983471d356083ac86f1833f0f92a28b42b62 (patch)
tree0296d77e5896199fdc92d0322d4158cef0f67b2f /testsuite
parent81601a589ce3ba69c125526d52f4e3450e174b04 (diff)
downloadanubis-dfa9983471d356083ac86f1833f0f92a28b42b62.tar.gz
anubis-dfa9983471d356083ac86f1833f0f92a28b42b62.tar.bz2
(update_config): Return -1 if
res is an empty list. Set anubisusr verbose mode only if $verbose > 2 (run_in_authmode): Declare unsupported test if anubis is configured without GSASL (default_anubis_stop,anubis_exit): New procedures (anubis_test_file): Call remote_close (anubis_pat): Call default_anubis_stop
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/lib/anubis.exp45
1 files changed, 31 insertions, 14 deletions
diff --git a/testsuite/lib/anubis.exp b/testsuite/lib/anubis.exp
index 5fd2bdd..1e092ef 100644
--- a/testsuite/lib/anubis.exp
+++ b/testsuite/lib/anubis.exp
@@ -93,6 +93,7 @@ proc update_config {name} {
global ANUBIS_DATA_DIR
global ANUBIS_RC_DIR
global ANUBIS_ETC_DIR
+ global verbose
set rcname $ANUBIS_RC_DIR/$name
set chan [open $rcname r]
@@ -107,10 +108,19 @@ proc update_config {name} {
}
close $outchan
close $chan
+
+ if {$verbose > 2} {
+ set vopt "-vvv"
+ } else {
+ set vopt ""
+ }
set res [remote_exec host "$ANUBIS_USR" \
- "--netrc $ANUBIS_ETC_DIR/net.rc \
- --file $rcname.tmp -vvv localhost:$ANUBIS_PORT"]
- verbose "RESULT $res"
+ "$vopt --netrc $ANUBIS_ETC_DIR/net.rc \
+ --file $rcname.tmp localhost:$ANUBIS_PORT"]
+ verbose -log "ANUBISUSR RESULT: $res"
+ if {[llength $res] < 1} {
+ return -1
+ }
return [lindex $res 0]
}
@@ -123,6 +133,8 @@ proc run_in_authmode {name} {
start_daemon
source $name
kill_daemon
+ } else {
+ unsupported "$name in authmode"
}
}
@@ -203,7 +215,7 @@ proc default_anubis_start {args} {
global ANUBIS_TOOL
global ANUBIS_TOOL_FLAGS
global expect_out
- global anubis_iface_pid
+ global anubis_spawn_id
if [info exists ANUBIS_TOOL_FLAGS] {
set sw $ANUBIS_TOOL_FLAGS
@@ -220,8 +232,8 @@ proc default_anubis_start {args} {
set cmd "$ANUBIS_TOOL $sw"
verbose "Spawning $cmd"
- set anubis_iface_pid [remote_spawn host $cmd]
- if { $anubis_iface_pid < 0 || $anubis_iface_pid == "" } {
+ set anubis_spawn_id [remote_spawn host $cmd]
+ if { $anubis_spawn_id < 0 || $anubis_spawn_id == "" } {
perror "Spawning $cmd failed."
return 1;
}
@@ -442,16 +454,19 @@ proc anubis_command { cmd } {
return $res
}
-proc anubis_close {} {
- global anubis_iface_pid
- if [info exist anubis_iface_pid] {
- if [is_remote host] {
- remote_close host
- }
- unset anubis_iface_pid
+proc default_anubis_stop {} {
+ global anubis_spawn_id
+ verbose -log "STOPPING ANUBIS"
+ if {[info exists anubis_spawn_id] && $anubis_spawn_id > 0} {
+ remote_close host
+ unset anubis_spawn_id
}
}
+proc anubis_exit {} {
+ default_anubis_stop
+}
+
proc anubis_expect { args } {
global env
if { [lindex $args 0] == "-notransfer" } {
@@ -774,6 +789,7 @@ proc anubis_test_file {args} {
} else {
fail "$message"
}
+ remote_close host
return $result
}
@@ -894,9 +910,10 @@ proc anubis_pat {patname} {
anubis_command "$line"
lappend file_pattern $line
}
- anubis_close
}
+ default_anubis_stop
+
set inv anubis_test_file
if {$testname != ""} {
lappend inv -message $testname

Return to:

Send suggestions and report system problems to the System administrator.