2 # This file is part of secnet.
3 # See LICENCE and this file CREDITS for full list of copyright holders.
4 # SPDX-License-Identifier: GPL-3.0-or-later
5 # There is NO WARRANTY.
7 source mtest/common.tcl
9 #----- success test -----
11 set good [list Uuser Ginside -u \
12 mtest/header.sites $tmp/groupfiles $tmp/out.sites Ginside \
13 < mtest/Ginside.sites]
15 eval run-mss-userv $good
17 diff-output e-userv out .sites
19 #----- argument parser does not look for args beyond header -----
21 set env(LC_MESSAGES) C
23 set try [lreplace $good 4 4 --misparse-test]
26 eval run-mss-userv $try
28 error "should have failed"
31 {*unrecognized arguments: --misparse-test*} {
34 {*No such file or directory: '--misparse-test/TGinside'*} {
42 #----- wrong group is rejected -----
44 set bad [lreplace $good 1 1 Gwrong]
47 eval run-mss-userv $bad
49 error "should have failed"
52 {*caller not in group Ginside*} { }
53 * { error "huh ? $emsg" }
57 #----- resulting sites file is processable -----
59 eval run-mss $tmp/out.sites >$tmp/out.conf
61 diff-mss-sites-conf mtest/e-userv.conf $tmp/out.conf
63 #----- works without group in `location' line -----
65 set testgf $tmp/Ginside.no-group
67 exec sed < mtest/Ginside.sites > $testgf {/^location / s/ root$//}
69 set testargs [lreplace $good end end $testgf]
70 eval run-mss-userv $testargs