summaryrefslogtreecommitdiff
path: root/nsswitch/tests
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2019-04-22 16:15:20 -0700
committerJeremy Allison <jra@samba.org>2019-04-24 01:02:17 +0000
commitd7b5ad5e6159c224f70bea782bbdc46059e67978 (patch)
treed3bb4566e66958f6ec7b26bbff7586550f5d435d /nsswitch/tests
parent1646baa34783b483e88a50babd100939f92e140c (diff)
downloadsamba-d7b5ad5e6159c224f70bea782bbdc46059e67978.tar.gz
selftest: Add gid-to-sid lookup to idmap_ad test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13903 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'nsswitch/tests')
-rwxr-xr-xnsswitch/tests/test_idmap_ad.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/nsswitch/tests/test_idmap_ad.sh b/nsswitch/tests/test_idmap_ad.sh
index 7450ae06059..3e36498efcb 100755
--- a/nsswitch/tests/test_idmap_ad.sh
+++ b/nsswitch/tests/test_idmap_ad.sh
@@ -49,6 +49,13 @@ add: gidNumber
gidNumber: 2000001
EOF
+cat <<EOF | $ldbmodify -H ldap://$DC_SERVER -U "$DOMAIN\Administrator%$DC_PASSWORD"
+dn: CN=Domain Admins,CN=Users,$BASE_DN
+changetype: modify
+add: gidNumber
+gidNumber: 2000002
+EOF
+
#
# Test 1: Test uid of Administrator, should be 2000000
#
@@ -80,6 +87,16 @@ ret=$?
testit "Test get userinfo for Administrator works" test $ret -eq 0 || failed=$(expr $failed + 1)
#
+# Test 4: Test lookup from gid to sid
+#
+
+out="$($wbinfo -G 2000002)"
+echo "wbinfo returned: \"$out\", expecting \"$DOMAIN_SID-512\""
+test "$out" = "$DOMAIN_SID-512"
+ret=$?
+testit "Test gid lookup of Domain Admins" test $ret -eq 0 || failed=$(expr $failed + 1)
+
+#
# Remove POSIX ids from AD
#
cat <<EOF | $ldbmodify -H ldap://$DC_SERVER -U "$DOMAIN\Administrator%$DC_PASSWORD"
@@ -96,4 +113,11 @@ delete: gidNumber
gidNumber: 2000001
EOF
+cat <<EOF | $ldbmodify -H ldap://$DC_SERVER -U "$DOMAIN\Administrator%$DC_PASSWORD"
+dn: CN=Domain Admins,CN=Users,$BASE_DN
+changetype: modify
+delete: gidNumber
+gidNumber: 2000002
+EOF
+
exit $failed