chiark / gitweb /
changelog: start 0.6.8
[secnet.git] / mtest / t-userv
index 5d159bdb3c9dd0a542eb9f9e0af5440b23091958..5ff7155a0bca62db330c289f27218090dd9625a0 100755 (executable)
@@ -1,4 +1,8 @@
 #! /usr/bin/tclsh
+# This file is part of secnet.
+# See LICENCE and this file CREDITS for full list of copyright holders.
+# SPDX-License-Identifier: GPL-3.0-or-later
+# There is NO WARRANTY.
 
 source mtest/common.tcl
 
@@ -35,3 +39,32 @@ if {![catch {
     }
 }
 
+#----- wrong group is rejected -----
+
+set bad [lreplace $good 1 1 Gwrong]
+
+if {![catch {
+    eval run-mss-userv $bad
+} emsg]} {
+    error "should have failed"
+} else {
+    switch -glob $emsg {
+       {*caller not in group Ginside*} { }
+       * { error "huh ? $emsg" }
+    }
+}
+
+#----- resulting sites file is processable -----
+
+eval run-mss $tmp/out.sites >$tmp/out.conf
+
+diff-mss-sites-conf mtest/e-userv.conf $tmp/out.conf
+
+#----- works without group in `location' line -----
+
+set testgf $tmp/Ginside.no-group
+
+exec sed < mtest/Ginside.sites > $testgf {/^location / s/ root$//}
+
+set testargs [lreplace $good end end $testgf]
+eval run-mss-userv $testargs