chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make-secnet-sites: Fix error handling if caller is in wrong group
[secnet.git]
/
stest
/
common.tcl
diff --git
a/stest/common.tcl
b/stest/common.tcl
index 239179a375995183283ba6f5d52591d06257d434..8897bd90da340a99b4529b65e736691673c7cbb9 100644
(file)
--- a/
stest/common.tcl
+++ b/
stest/common.tcl
@@
-177,7
+177,7
@@
proc spawn-secnet {location site} {
}
set argl [list $secnet -dvnc $cf]
set divertk SECNET_STEST_DIVERT_$site
}
set argl [list $secnet -dvnc $cf]
set divertk SECNET_STEST_DIVERT_$site
- puts
-nonewline "spawn
"
+ puts
"spawn:
"
foreach k [array names env] {
switch -glob $k {
SECNET_STEST_DIVERT_* -
foreach k [array names env] {
switch -glob $k {
SECNET_STEST_DIVERT_* -
@@
-186,19
+186,26
@@
proc spawn-secnet {location site} {
*PRELOAD* { puts -nonewline " $k=$env($k)" }
}
}
*PRELOAD* { puts -nonewline " $k=$env($k)" }
}
}
- puts " $argl"
if {[info exists env($divertk)]} {
switch -glob $env($divertk) {
if {[info exists env($divertk)]} {
switch -glob $env($divertk) {
- i {
+ i - {i *} {
+ regsub {^i} $env($divertk) {} divert_prefix
+ puts "$divert_prefix $argl"
puts -nonewline "run ^ command, hit return "
flush stdout
gets stdin
set argl {}
}
0 - "" {
puts -nonewline "run ^ command, hit return "
flush stdout
gets stdin
set argl {}
}
0 - "" {
+ puts " $argl"
}
}
- * {
+ /* - ./* {
+ puts " $argl"
set argl [split $env($divertk)]
set argl [split $env($divertk)]
+ puts "... $argl"
+ }
+ * {
+ error "$divertk not understood"
}
}
}
}
}
}
@@
-349,14
+356,20
@@
proc udp-relay {data src sock args} {
}
}
}
}
+proc adj-after {timeout args} {
+ upvar #0 env(SECNET_STEST_TIMEOUT_MUL) mul
+ if {[info exists mul]} { set timeout [expr {$timeout * $mul}] }
+ eval after $timeout $args
+}
+
proc test-kex {} {
udp-proxy
spawn-secnet in inside
spawn-secnet out outside
proc test-kex {} {
udp-proxy
spawn-secnet in inside
spawn-secnet out outside
- after 500 sendpkt
- after 1000 sendpkt
- after 5000 timed-out
+ a
dj-a
fter 500 sendpkt
+ a
dj-a
fter 1000 sendpkt
+ a
dj-a
fter 5000 timed-out
vwait ok
}
vwait ok
}