chiark / gitweb /
test-example: Make sites.conf variable, in principle
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 3 Dec 2019 21:52:07 +0000 (21:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:53 +0000 (21:56 +0000)
In this commit we split the setting of the sites.conf into two
branches depending on the value of privkey($site).  The path prefix
is common - only the leafname varies.

Right now there isn't actually any change because both branches use
the same sites.conf.  The new-style arrangement needs a new-style
sites file which isn't there yet.

So no functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
stest/common.tcl

index 9a7e38f4525391b8603f32d37e5d2c40dc17418f..bcca102c49b9db77a143a0930bbb7e0796c37def 100644 (file)
@@ -85,6 +85,7 @@ exec cat
 "
     switch -glob $privkey {
        */ {
+           set sitesconf sites.conf
            append cfg "
                key-cache priv-cache({
                    privkeys \"$builddir/${privkey}priv.\";
@@ -92,11 +93,13 @@ exec cat
 "
        }
        * {
+           set sitesconf sites.conf
            append cfg "
                local-key rsa-private(\"$builddir/$privkey\");
 "
        }
     }
+    set sitesconf $builddir/test-example/$sitesconf
     
     append cfg $extra($site)
     append cfg "
@@ -119,7 +122,7 @@ exec cat
     file delete -force $pubkeys
     exec cp -rl $builddir/test-example/pubkeys $pubkeys
 
-    set f [open $builddir/test-example/sites.conf r]
+    set f [open $sitesconf r]
     while {[gets $f l] >= 0} {
        regsub {\"[^\"]*test-example/pubkeys/} $l "\"$pubkeys/" l
        append cfg $l "\n"