#
# @(#) Test domain users resolve using getpwnam()
#

load_lib util-defs.exp
load_lib "compile.exp"

# Compile getpwnam.c

simple_compile "getpwnam"

# 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/getpwnam" "\"$user\"" ""]

    verbose $output

    if {[regexp "PASS:" $output]} {
        pass "getpwnam $user"
    } else {
        fail "getpwnam $user"
    }
}
