chiark
/
gitweb
/
~ian
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
stest: Machinery for runing an old secnet if a test wants
[secnet.git]
/
stest
/
common.tcl
diff --git
a/stest/common.tcl
b/stest/common.tcl
index 89045a5147b5fb46206385be1c0afb8ab25bff91..bc00d22297ff0e9f2e2f0d0cdf902874e10c1544 100644
(file)
--- a/
stest/common.tcl
+++ b/
stest/common.tcl
@@
-30,6
+30,11
@@
set privkey(outside) test-example/outside.privkeys/
proc sitesconf_hook {l} { return $l }
proc sitesconf_hook {l} { return $l }
+proc oldsecnet {site} {
+ upvar #0 oldsecnet($site) oldsecnet
+ expr {[info exists oldsecnet] && [set oldsecnet]}
+}
+
proc mkconf {location site} {
global tmp
global builddir
proc mkconf {location site} {
global tmp
global builddir
@@
-108,6
+113,11
@@
exec cat
log logfile {
prefix \"$site\";
class \"debug\",\"info\",\"notice\",\"warning\",\"error\",\"security\",\"fatal\";
log logfile {
prefix \"$site\";
class \"debug\",\"info\",\"notice\",\"warning\",\"error\",\"security\",\"fatal\";
+ "
+ if {[oldsecnet $site]} { append cfg "
+ filename \"/dev/stderr\";
+ " }
+ append cfg "
};
"
append cfg {
};
"
append cfg {
@@
-153,7
+163,11
@@
proc spawn-secnet {location site} {
set ch [open $cf w]
puts $ch [mkconf $location $site]
close $ch
set ch [open $cf w]
puts $ch [mkconf $location $site]
close $ch
- set argl [list $builddir/secnet -dvnc $cf]
+ set secnet $builddir/secnet
+ if {[oldsecnet $site]} {
+ set secnet $env(OLD_SECNET_DIR)/secnet
+ }
+ set argl [list $secnet -dvnc $cf]
set divertk SECNET_STEST_DIVERT_$site
puts -nonewline "spawn"
foreach k [array names env] {
set divertk SECNET_STEST_DIVERT_$site
puts -nonewline "spawn"
foreach k [array names env] {