diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /testsuite/nsswitch/finger.exp | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | testsuite/nsswitch/finger.exp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/nsswitch/finger.exp b/testsuite/nsswitch/finger.exp new file mode 100644 index 0000000..36bab8e --- /dev/null +++ b/testsuite/nsswitch/finger.exp @@ -0,0 +1,39 @@ +# +# @(#) Test default domain users resolve using the finger command +# + +load_lib util-defs.exp + +set output [util_start "bin/wbinfo" "-u"] +if { [regexp "Error" $output] } { + fail "error running wbinfo" + return +} + +set user_list [split $output "\n"] + +# Look up all users using finger -m. This should test getpwnam() + +foreach { user } $user_list { + set output [util_start "finger" "-m \"$user\"" "" "no such user"] + verbose $output + + if { [regexp "no such user" $output] } { + fail "finger -m $user" + } else { + pass "finger -m $user" + } +} + +# Run finger without the -m to also test set/get/endpwent() + +foreach { user } $user_list { + set output [util_start "finger" "\"$user\""] + verbose $output + + if { [regexp "no such user" $output] } { + fail "finger $user" + } else { + pass "finger $user" + } +} |