summaryrefslogtreecommitdiff
path: root/testsuite/nsswitch
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-08-05 11:19:34 +0000
committerTim Potter <tpot@samba.org>2001-08-05 11:19:34 +0000
commita3f96dd2293ff6711dbe3b643e96ac6d24c82a68 (patch)
treed8259e7f9a58fa9d9c20cf9a215f6c1f3723fa7e /testsuite/nsswitch
parente485a1a4986c9328754b9a8b3054b8a6738b54f0 (diff)
downloadsamba-a3f96dd2293ff6711dbe3b643e96ac6d24c82a68.tar.gz
samba-a3f96dd2293ff6711dbe3b643e96ac6d24c82a68.tar.bz2
samba-a3f96dd2293ff6711dbe3b643e96ac6d24c82a68.zip
Another winbind test - fill in later.
(This used to be commit 99071c45d05231e5683b37823bcca90542f4e332)
Diffstat (limited to 'testsuite/nsswitch')
-rw-r--r--testsuite/nsswitch/domusers.exp38
1 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/nsswitch/domusers.exp b/testsuite/nsswitch/domusers.exp
new file mode 100644
index 0000000000..3b291ab398
--- /dev/null
+++ b/testsuite/nsswitch/domusers.exp
@@ -0,0 +1,38 @@
+#
+# @(#) Test that all users are members of the Domain Users group.
+#
+# Note that this isn't necessarily true all the time but you have to
+# explicitly move people out of that group so it should be OK for te
+#
+
+load_lib util-defs.exp
+load_lib $srcdir/lib/nsswitch-config.exp
+
+# Get list of users and stick usernames in a hash
+
+set user_list [util_start "getent" "passwd" ""]
+
+foreach { user } [split $user_list "\n"] {
+ set user_elts [split $user ":"]
+ set users([lindex $user_elts 0]) 1
+}
+
+# Get list of groups
+
+set group_list [util_start "getent" "group" ""]
+
+foreach { group } [split $group_list "\n"] {
+ set group_elts [split $group ":"]
+
+ # Look for domain users group
+
+ if { ![regexp "Domain Users" [lindex $group_elts 0]] } {
+ continue
+ }
+
+ # Check each member of group was found in getent passwd
+
+ foreach { mem } [split [lindex $group_elts 3] ","] {
+ set mems($mem) 1
+ }
+}