/bin/sh on solaris swallows the failure code, so exec this directly.
[samba.git] / testsuite / nsswitch / initgroups.exp
1 #
2 # @(#) Test initgroups function
3 #
4
5 load_lib util-defs.exp
6 load_lib compile.exp
7
8 if { [util_start "id -u"] != 0 } {
9     set test_desc "must be userid 0 to run"
10     note $test_desc
11     untested $test_desc
12     return
13 }
14
15 # Compile test program
16
17 simple_compile "initgroups"
18
19 # Test domain users
20
21 set user_list [split [util_start "bin/wbinfo" "-u"] "\n"]
22
23 verbose $user_list
24
25 foreach { user } $user_list {
26     set output [util_start "$srcdir/$subdir/initgroups" "\"$user\"" ""]
27
28     verbose $output
29
30     set test_desc "initgroups $user"
31
32     if { [regexp "PASS" $output] } {
33         pass $test_desc
34     } else {
35         fail $test_desc
36     }
37 }