set extra(outside) {}
proc mkconf {which} {
+ global tmp
global netlink
global ports
global extra
global netlinkfh
- set pipefp test/$which.netlink
+ set pipefp $tmp/$which.netlink
foreach tr {t r} {
file delete $pipefp.$tr
exec mkfifo -m600 $pipefp.$tr
fconfigure $fh -blocking 0 -buffering none -translation binary
}
fileevent $netlinkfh($which.r) readable [list netlink-readable $which]
- set fakeuf test/$which.fake-userv
+ set fakeuf $tmp/$which.fake-userv
set fakeuh [open $fakeuf w 0755]
puts $fakeuh "#!/bin/sh
set -e
proc spawn-secnet {which} {
global netlinkfh
+ global tmp
upvar #0 pids($which) pid
- set cf test/$which.conf
+ set cf $tmp/$which.conf
set ch [open $cf w]
puts $ch [mkconf $which]
close $ch
[hbytes h2raw c0[join $p ""]c0]
}
+file mkdir test/tmp
+set tmp test/tmp
+
spawn-secnet inside
spawn-secnet outside