Fix a bug in the output from print_canonical_sockaddr() fix from 36f8bafbd3dee66a8....
[ira/wip.git] / testsuite / smbd / se_access_check.exp
1 #
2 # @(#) Test se_access_check() function
3 #
4
5 #
6 # Unix SMB/Netbios implementation.
7 # Copyright (C) Tim Potter 2000
8 #   
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
13 #   
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #   
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, see <http://www.gnu.org/licenses/>.
21 #
22
23 load_lib "compile.exp"
24 load_lib "util-defs.exp"
25
26 # Run tests from C source files
27
28 set se_access_check_tests [list \
29         { "null security descriptor" "se_access_check_nullsd" } \
30         { "security descriptor allow everyone" "se_access_check_allowall" } \
31         { "security descriptor allow everyone" "se_access_check_allowall" } \
32         { "security descriptor deny everyone" "se_access_check_denyall" } \
33         { "empty security descriptor" "se_access_check_empty" } \
34         { "allow some users access" "se_access_check_allowsome" } \
35         { "deny some users access" "se_access_check_denysome" } \
36         { "printer access permissions" "se_access_check_printer" } \
37         ]
38
39 foreach { test } $se_access_check_tests {
40     set test_desc [lindex $test 0]
41     set test_file [lindex $test 1]
42
43     simple_make "se_access_check" $test_file
44     set output [util_start "$srcdir/$subdir/$test_file" ]
45
46     if { [regexp "PASS" $output] } {
47         pass $test_desc
48         file delete "$srcdir/$subdir/$test_file" "$srcdir/$subdir/$test_file.o"
49     } else {
50         fail $test_desc
51         puts $output
52     }
53 }