summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-12-21 11:49:33 +0100
committerVolker Lendecke <vl@samba.org>2019-01-08 09:32:10 +0100
commit0e2e6352054a9b4f2c211e9fa3ca3563421e792b (patch)
treeb77dc74075c860d4b5be971f76dfdc7533f7c36b /nsswitch
parentf23287bcb69d7c1318aad2472487066e6e6751f4 (diff)
downloadsamba-0e2e6352054a9b4f2c211e9fa3ca3563421e792b.tar.gz
selftest: Test sids-to-xids with one failing sid
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'nsswitch')
-rwxr-xr-xnsswitch/tests/test_wbinfo_sids_to_xids.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/nsswitch/tests/test_wbinfo_sids_to_xids.sh b/nsswitch/tests/test_wbinfo_sids_to_xids.sh
new file mode 100755
index 00000000000..a3ab404f644
--- /dev/null
+++ b/nsswitch/tests/test_wbinfo_sids_to_xids.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+incdir=`dirname $0`/../../testprogs/blackbox
+. $incdir/subunit.sh
+
+#
+# S-1-5-123456789 fails, but S-1-5-11 succeeds. Check that S-1-5-11 is
+# mapped successfully with a GID in the 1000x range
+#
+wbinfo_some_mapped()
+{
+ output=`$VALGRIND $BINDIR/wbinfo --sids-to-unix-ids=S-1-5-123456789,S-1-5-11`
+ test x"$?" = x"0" || {
+ return 1
+ }
+
+ printf '%s' "$output" | grep -q 'S-1-5-123456789 -> unmapped' || {
+ printf '%s' "$output"
+ return 1
+ }
+
+ printf '%s' "$output" | grep -q 'S-1-5-11 -> gid 10000' || {
+ printf '%s' "$output"
+ return 1
+ }
+
+ return 0
+}
+
+testit "wbinfo some mapped" wbinfo_some_mapped || failed=`expr $failed + 1`
+
+testok $0 $failed