summaryrefslogtreecommitdiff
path: root/nsswitch/tests/test_wbinfo_sids_to_xids.sh
blob: a3ab404f644672a0a147d053f5e61003ad1786f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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