summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2020-01-21 12:53:15 +0100
committerStefan Metzmacher <metze@samba.org>2020-01-21 14:38:45 +0000
commitb545ab1a85d56f169eecfa5d8735fdc5dd5a83f4 (patch)
treecbba10352802565faac41e37af78fe50397f0f9f
parent41262d1d66c18e3ea2f2f3c009a88ef830d25aa4 (diff)
downloadsamba-b545ab1a85d56f169eecfa5d8735fdc5dd5a83f4.tar.gz
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>
-rwxr-xr-xsource4/setup/tests/blackbox_group.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/setup/tests/blackbox_group.sh b/source4/setup/tests/blackbox_group.sh
index e4a587fbba1..b8a90113a74 100755
--- a/source4/setup/tests/blackbox_group.sh
+++ b/source4/setup/tests/blackbox_group.sh
@@ -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