From aa73f176ed066244453cdc2420502508335227b2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Fri, 11 Oct 2019 23:56:33 +0100 Subject: [PATCH] test: Use dedicated tmp directory in variable We are going to want to run multiple tests at once, so we'll need this. Signed-off-by: Ian Jackson --- .gitignore | 3 +-- test/invoke | 11 ++++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index d597aa5..10fbc23 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,4 @@ test-example/sites.conf test-example/bogus-setup-request build-stamp -test/*.conf -test/*.fake-userv +test/tmp diff --git a/test/invoke b/test/invoke index 628db20..09b18a3 100755 --- a/test/invoke +++ b/test/invoke @@ -25,11 +25,12 @@ set extra(inside) { 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 @@ -37,7 +38,7 @@ proc mkconf {which} { 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 @@ -95,8 +96,9 @@ exec cat 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 @@ -153,6 +155,9 @@ proc sendpkt {} { [hbytes h2raw c0[join $p ""]c0] } +file mkdir test/tmp +set tmp test/tmp + spawn-secnet inside spawn-secnet outside -- 2.30.2