summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-11-23 01:35:30 +0100
committerKarolin Seeger <kseeger@samba.org>2012-12-03 13:01:32 +0100
commit4a3a6bc4aad199b5dc74721b632e8f5eb6cb60cf (patch)
tree3733306764979da2c6d9fa3544c515afab461907 /selftest
parent5db648836dccca860f72ab779680c0c1e1df85d5 (diff)
downloadsamba-4a3a6bc4aad199b5dc74721b632e8f5eb6cb60cf.tar.gz
selftest:Samba3: provision the BUILTIN\Users group if the environment runs winbindd
Note that in order to create a local group (alias), the id-allocator of id-mapping is needed, so this can only work if winbindd is running. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 46f2dfa7a51487e1b21c329dfb2e4cac3e6ada11)
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/target/Samba3.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 3a0b9d9264c..2037a2e697f 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1157,6 +1157,30 @@ sub wait_for_start($$$$$)
return 1;
}
+ if ($winbindd eq "yes") {
+ # note: creating builtin groups requires winbindd for the
+ # unix id allocator
+ $ret = system("WINBINDD_SOCKET_DIR=" . $envvars->{WINBINDD_SOCKET_DIR} . " " . Samba::bindir_path($self, "net") ." $envvars->{CONFIGURATION} sam createbuiltingroup Users");
+ if ($ret != 0) {
+ print "Failed to create BUILTIN\\Users group\n";
+ return 0;
+ }
+ my $count = 0;
+ do {
+ system(Samba::bindir_path($self, "net") . " $envvars->{CONFIGURATION} cache flush");
+ $ret = system("WINBINDD_SOCKET_DIR=" . $envvars->{WINBINDD_SOCKET_DIR} . " " . Samba::bindir_path($self, "wbinfo") . " --sid-to-gid=S-1-5-32-545");
+ if ($ret != 0) {
+ sleep(2);
+ }
+ $count++;
+ } while ($ret != 0 && $count < 10);
+ if ($count == 10) {
+ print "WINBINDD not reachable after 20 seconds\n";
+ teardown_env($self, $envvars);
+ return 0;
+ }
+ }
+
print $self->getlog_env($envvars);
return 1;