summaryrefslogtreecommitdiffstats
path: root/testsuite/nsswitch
diff options
context:
space:
mode:
authorcvs2svn Import User <samba-bugs@samba.org>2001-05-31 14:41:54 +0000
committercvs2svn Import User <samba-bugs@samba.org>2001-05-31 14:41:54 +0000
commita5470a6bce218533bdbd238f21f216d7f76b1f88 (patch)
tree154710017344a395bb260b73a8ff8a2c4f79fa64 /testsuite/nsswitch
parent939403fd12f34151b9e1ef920835d8452f51963c (diff)
parent6594a59263c9ec8f62d23f3aa1b56051eefc2f88 (diff)
downloadsamba-a5470a6bce218533bdbd238f21f216d7f76b1f88.tar.gz
samba-a5470a6bce218533bdbd238f21f216d7f76b1f88.tar.xz
samba-a5470a6bce218533bdbd238f21f216d7f76b1f88.zip
This commit was manufactured by cvs2svn to create branch 'SAMBA_2_2'.
Diffstat (limited to 'testsuite/nsswitch')
-rw-r--r--testsuite/nsswitch/login.exp102
1 files changed, 102 insertions, 0 deletions
diff --git a/testsuite/nsswitch/login.exp b/testsuite/nsswitch/login.exp
new file mode 100644
index 00000000000..c2bb0e5a40a
--- /dev/null
+++ b/testsuite/nsswitch/login.exp
@@ -0,0 +1,102 @@
+#
+# @(#) Test logins using pam_winbind.so module using telnet
+#
+
+load_lib util-defs.exp
+load_lib nsswitch-config.exp
+
+#
+# @(#) Test user can login
+#
+
+spawn telnet localhost
+
+set test_desc "telnet localhost (login)"
+
+expect {
+ "login:" { }
+ timeout { fail "timed out in $test_desc"; return }
+ eof { fail "end of file in $test_desc"; return }
+}
+
+send "$domain/$USER\r"
+
+set test_desc "telnet localhost (password)"
+
+expect {
+ "Password:" { }
+ timeout { fail "timed out in $test_desc"; return }
+ eof { fail "end of file in $test_desc"; return }
+}
+
+send "$PASSWORD\r"
+
+expect {
+ "$ " { }
+ "Login incorrect" { fail "login incorrect"; return }
+ timeout { fail "timed out in $test_desc"; return }
+ eof { fail "end of file in $test_desc"; return }
+}
+
+pass "login $domain/$USER"
+
+#
+# @(#) Check supplementary group membership
+#
+
+set test_desc "supplementary groups"
+
+# Get list of groups
+
+send "id -G\r"
+
+expect {
+ -re "((\[0-9]+ )*\[0-9]+\r)" { exp_continue; }
+ "$ " { }
+ timeout { fail "timed out in $test_desc"; return }
+ eof { fail "end of file in $test_desc"; return }
+}
+
+set groups $expect_out(1,string)
+set wb_groups [util_start "bin/wbinfo" "-r $domain/$USER"]
+
+verbose "id groups are $groups"
+verbose "wbinfo groups are $wb_groups"
+
+# Check all groups from id are in wbinfo and vice-versa
+
+set failed 0
+
+foreach { group } $groups {
+ set got_group 0
+ foreach { wb_group } $wb_groups {
+ if { $wb_group == $group } {
+ set got_group 1
+ break
+ }
+ }
+
+ if { !$got_group } {
+ fail "group $group not in output of wbinfo -r"
+ set failed 1
+ }
+}
+
+foreach { wb_group } $wb_groups {
+ set got_group 0
+ foreach { group } $groups {
+ if { $group == $wb_group } {
+ set got_group 1
+ break
+ }
+ }
+
+ if { !$got_group } {
+ fail "group $group not in output of id -G"
+ set failed 1
+ }
+}
+
+if { !$failed } {
+ pass "id/wbinfo groups match"
+}