mirror of
https://github.com/samba-team/samba.git
synced 2025-01-21 18:04:06 +03:00
samba-tool tests: add test-case for 'user getgrouops --full-dn'
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
41262d1d66
commit
b545ab1a85
@ -64,6 +64,23 @@ user_getgroups() {
|
||||
}
|
||||
testit "user getgroups" user_getgroups
|
||||
|
||||
# test samba-tool user getgroups --full-dn command
|
||||
user_getgroups_full_dn() {
|
||||
groups="dsg gsg usg ddg gdg udg"
|
||||
|
||||
res=$($PYTHON $samba_tool user getgroups --full-dn $CONFIG testuser)
|
||||
for g in $groups ; do
|
||||
group_dn=$($PYTHON $samba_tool group show $CONFIG $g --attributes=dn)
|
||||
echo "$res" | grep -q "^${group_dn}$" || return 1
|
||||
done
|
||||
|
||||
# the users primary group is expected in the first line
|
||||
primary_group=$(echo "$res" | head -1)
|
||||
group_dn=$($PYTHON $samba_tool group show $CONFIG "Domain Users" --attributes=dn)
|
||||
echo $primary_group | grep -q "^${group_dn}$" || return 1
|
||||
}
|
||||
testit "user getgroups full-dn" user_getgroups
|
||||
|
||||
# test settings a users primary group
|
||||
user_getgroups_primary_first() {
|
||||
expected_primary_group=$1
|
||||
|
Loading…
x
Reference in New Issue
Block a user