selftest/Samba4: create add ${TRUST_DOMSID}-513 to a local group
authorStefan Metzmacher <metze@samba.org>
Mon, 26 Feb 2018 16:05:49 +0000 (17:05 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 19 Mar 2018 19:30:51 +0000 (20:30 +0100)
This will allow testing expanding groups on the trust boundary.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13300

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
selftest/target/Samba4.pm

index 608265ca11c84112375cffd68ab49745ac66e1b3..842cd1e1bb6ed793a3e081ed6d671b3a32d1b713 100755 (executable)
@@ -399,6 +399,20 @@ sub setup_trust($$$$$)
                return undef;
        }
 
+       my $groupname = "g_$localenv->{TRUST_DOMAIN}";
+       my $groupadd = $cmd_env;
+       $groupadd .= " $samba_tool group add '$groupname' --group-scope=Domain $cmd_config";
+       unless (system($groupadd) == 0) {
+               warn("Failed to create group \n$groupadd");
+               return undef;
+       }
+       my $groupmem = $cmd_env;
+       $groupmem .= " $samba_tool group addmembers '$groupname' '$localenv->{TRUST_DOMSID}-513' $cmd_config";
+       unless (system($groupmem) == 0) {
+               warn("Failed to add group member \n$groupmem");
+               return undef;
+       }
+
        return $localenv
 }