summaryrefslogtreecommitdiff
path: root/testsuite/nsswitch/initgroups.exp
blob: ab21bcc9e7ba9c944b882b159738bbef85b82208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# @(#) Test initgroups function
#

load_lib util-defs.exp
load_lib compile.exp

if { [util_start "id -u"] != 0 } {
    set test_desc "must be userid 0 to run"
    note $test_desc
    untested $test_desc
    return
}

# Compile test program

simple_compile "initgroups"

# Test domain users

set user_list [split [util_start "bin/wbinfo" "-u"] "\n"]

verbose $user_list

foreach { user } $user_list {
    set output [util_start "$srcdir/$subdir/initgroups" "\"$user\"" ""]

    verbose $output

    set test_desc "initgroups $user"

    if { [regexp "PASS" $output] } {
        pass $test_desc
    } else {
        fail $test_desc
    }
}