The branch, master has been updated via 5b4a7ae selftest/Samba4: make use of samba-tool domain provision via 1d085f6 wintest: make use of samba-tool domain provision via 52ba3c8 testprogs/blackbox: make use of samba-tool domain provision via fdd2a7e s4:setup/tests: make use of samba-tool domain provision via 318770a s4:scripting: install samba_kcc to SBINDIR via 15c793f s4:scripting: use the 'sbin_files' variable via a4fc79f s4:samba-tool: add 'samba-tool domain provision' via ca3f285 s4:python/netcmd: give the Commad implementations access to the raw arguments via 7f98cf1 s4:samba-tool: remove unused code in testparm.py via 475755e s4:samba-tool: allow sys.exit(ret) to control the exit code from 5de7a3d quota: move function again to its belonging ifdef block
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 5b4a7aea17ea52fe620100076a9e08959d6fc4ed Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:47:21 2012 +0200 selftest/Samba4: make use of samba-tool domain provision metze Autobuild-User(master): Stefan Metzmacher <me...@samba.org> Autobuild-Date(master): Tue Sep 11 10:15:23 CEST 2012 on sn-devel-104 commit 1d085f6eb18f6984f409ea64150a060f503b4b13 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:47:21 2012 +0200 wintest: make use of samba-tool domain provision metze commit 52ba3c8e6a4daa954995447292d367dffe9f0df7 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:47:21 2012 +0200 testprogs/blackbox: make use of samba-tool domain provision metze commit fdd2a7e65f638eac91471c5428aef4ae8b2f2fb3 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:47:21 2012 +0200 s4:setup/tests: make use of samba-tool domain provision metze commit 318770a67ffea2618d01f9636ce0e4a136854264 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:21:57 2012 +0200 s4:scripting: install samba_kcc to SBINDIR It's use as "%s/samba_kcc", dyn_SCRIPTSBINDIR" similar to samba_spnupdate and samba_dnsupdate. metze commit 15c793fa34d66d599bfd05a5bab379fa5351d173 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:18:54 2012 +0200 s4:scripting: use the 'sbin_files' variable metze commit a4fc79f8fcaf95b85fbb49e99b26d9322392236b Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:05:14 2012 +0200 s4:samba-tool: add 'samba-tool domain provision' This is mostly a copy of the standalone source4/setup/provision. metze commit ca3f2853901c9ae37da561434fe6c50cf23f012c Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 14:02:19 2012 +0200 s4:python/netcmd: give the Commad implementations access to the raw arguments metze commit 7f98cf169843d91571baaa5d8f29d6528c0fa359 Author: Stefan Metzmacher <me...@samba.org> Date: Mon Sep 10 12:12:48 2012 +0200 s4:samba-tool: remove unused code in testparm.py metze commit 475755ef9ff5f39ba499de8f30c23efcce10ba0c Author: Stefan Metzmacher <me...@samba.org> Date: Tue Sep 11 08:21:27 2012 +0200 s4:samba-tool: allow sys.exit(ret) to control the exit code Some subcommands may use sys.exit(0), which shouldn't be reported as an error to the caller. metze ----------------------------------------------------------------------- Summary of changes: selftest/target/Samba4.pm | 4 +- source4/scripting/bin/samba-tool | 2 +- source4/scripting/python/samba/netcmd/__init__.py | 8 + source4/scripting/python/samba/netcmd/domain.py | 265 ++++++++++++++++++++- source4/scripting/python/samba/netcmd/testparm.py | 5 - source4/scripting/wscript_build | 6 +- source4/setup/tests/blackbox_group.sh | 2 +- source4/setup/tests/blackbox_newuser.sh | 2 +- source4/setup/tests/blackbox_provision-backend.sh | 10 +- source4/setup/tests/blackbox_provision.sh | 18 +- source4/setup/tests/blackbox_setpassword.sh | 2 +- source4/setup/tests/blackbox_upgradeprovision.sh | 4 +- testprogs/blackbox/renamedc.sh | 2 +- wintest/test-s4-howto.py | 4 +- 14 files changed, 302 insertions(+), 32 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 9563da6..f1f2e17 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -525,7 +525,9 @@ sub provision_raw_prepare($$$$$$$$$$) if (defined($ENV{PYTHON})) { push (@provision_options, $ENV{PYTHON}); } - push (@provision_options, "$self->{srcdir}/source4/setup/provision"); + push (@provision_options, Samba::bindir_path($self, "samba-tool")); + push (@provision_options, "domain"); + push (@provision_options, "provision"); push (@provision_options, "--configfile=$ctx->{smb_conf}"); push (@provision_options, "--host-name=$ctx->{hostname}"); push (@provision_options, "--host-ip=$ctx->{ipv4}"); diff --git a/source4/scripting/bin/samba-tool b/source4/scripting/bin/samba-tool index c4ea814..8ec6514 100755 --- a/source4/scripting/bin/samba-tool +++ b/source4/scripting/bin/samba-tool @@ -36,7 +36,7 @@ if len(sys.argv) > 1: try: retval = cmd._run("samba-tool", subcommand, *args) except SystemExit, e: - retval = -1 + retval = e.code except Exception, e: cmd.show_command_error(e) retval = 1 diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py index b3a4083..f8ce5ab 100644 --- a/source4/scripting/python/samba/netcmd/__init__.py +++ b/source4/scripting/python/samba/netcmd/__init__.py @@ -70,6 +70,10 @@ class Command(object): takes_options = [] takes_optiongroups = {} + raw_argv = None + raw_args = None + raw_kwargs = None + def __init__(self, outf=sys.stdout, errf=sys.stderr): self.outf = outf self.errf = errf @@ -156,6 +160,10 @@ class Command(object): parser.print_usage() return -1 + self.raw_argv = list(argv) + self.raw_args = args + self.raw_kwargs = kwargs + try: return self.run(*args, **kwargs) except Exception, e: diff --git a/source4/scripting/python/samba/netcmd/domain.py b/source4/scripting/python/samba/netcmd/domain.py index b86f52f..d35ee57 100644 --- a/source4/scripting/python/samba/netcmd/domain.py +++ b/source4/scripting/python/samba/netcmd/domain.py @@ -2,9 +2,11 @@ # # Copyright Matthias Dieter Wallnoefer 2009 # Copyright Andrew Kroeger 2009 -# Copyright Jelmer Vernooij 2009 +# Copyright Jelmer Vernooij 2007-2009 # Copyright Giampaolo Lauria 2011 # Copyright Matthieu Patou <m...@matws.net> 2011 +# Copyright Andrew Bartlett 2008 +# Copyright Stefan Metzmacher 2012 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +28,7 @@ import samba.getopt as options import ldb import string import os +import sys import tempfile import logging from samba.net import Net, LIBNET_JOIN_AUTOMATIC @@ -63,6 +66,15 @@ from samba.dsdb import ( UF_TRUSTED_FOR_DELEGATION ) +from samba.credentials import DONT_USE_KERBEROS +from samba.provision import ( + provision, + FILL_FULL, + FILL_NT4SYNC, + FILL_DRS, + ProvisioningError, + ) + def get_testparm_var(testparm, smbconf, varname): cmd = "%s -s -l --parameter-name='%s' %s 2>/dev/null" % (testparm, varname, smbconf) output = os.popen(cmd, 'r').readline() @@ -125,6 +137,256 @@ class cmd_domain_info(Command): except RuntimeError: raise CommandError("Invalid IP address '" + address + "'!") +class cmd_domain_provision(Command): + """Promotes an existing domain member or NT4 PDC to an AD DC""" + + synopsis = "%prog <dnsdomain> [DC|RODC] [options]" + + takes_optiongroups = { + "sambaopts": options.SambaOptions, + "versionopts": options.VersionOptions, + "credopts": options.CredentialsOptions, + } + + takes_options = [ + Option("--interactive", help="Ask for names", action="store_true"), + Option("--domain", type="string", metavar="DOMAIN", + help="set domain"), + Option("--domain-guid", type="string", metavar="GUID", + help="set domainguid (otherwise random)"), + Option("--domain-sid", type="string", metavar="SID", + help="set domainsid (otherwise random)"), + Option("--ntds-guid", type="string", metavar="GUID", + help="set NTDS object GUID (otherwise random)"), + Option("--invocationid", type="string", metavar="GUID", + help="set invocationid (otherwise random)"), + Option("--host-name", type="string", metavar="HOSTNAME", + help="set hostname"), + Option("--host-ip", type="string", metavar="IPADDRESS", + help="set IPv4 ipaddress"), + Option("--host-ip6", type="string", metavar="IP6ADDRESS", + help="set IPv6 ipaddress"), + Option("--adminpass", type="string", metavar="PASSWORD", + help="choose admin password (otherwise random)"), + Option("--krbtgtpass", type="string", metavar="PASSWORD", + help="choose krbtgt password (otherwise random)"), + Option("--machinepass", type="string", metavar="PASSWORD", + help="choose machine password (otherwise random)"), + Option("--dns-backend", type="choice", metavar="NAMESERVER-BACKEND", + choices=["SAMBA_INTERNAL", "BIND9_FLATFILE", "BIND9_DLZ", "NONE"], + help="The DNS server backend. SAMBA_INTERNAL is the builtin name server, " \ + "BIND9_FLATFILE uses bind9 text database to store zone information, " \ + "BIND9_DLZ uses samba4 AD to store zone information (default), " \ + "NONE skips the DNS setup entirely (not recommended)", + default="BIND9_DLZ"), + Option("--dnspass", type="string", metavar="PASSWORD", + help="choose dns password (otherwise random)"), + Option("--ldapadminpass", type="string", metavar="PASSWORD", + help="choose password to set between Samba and it's LDAP backend (otherwise random)"), + Option("--root", type="string", metavar="USERNAME", + help="choose 'root' unix username"), + Option("--nobody", type="string", metavar="USERNAME", + help="choose 'nobody' user"), + Option("--wheel", type="string", metavar="GROUPNAME", + help="choose 'wheel' privileged group"), + Option("--users", type="string", metavar="GROUPNAME", + help="choose 'users' group"), + Option("--quiet", help="Be quiet", action="store_true"), + Option("--blank", action="store_true", + help="do not add users or groups, just the structure"), + Option("--ldap-backend-type", type="choice", metavar="LDAP-BACKEND-TYPE", + help="Test initialisation support for unsupported LDAP backend type (fedora-ds or openldap) DO NOT USE", + choices=["fedora-ds", "openldap"]), + Option("--server-role", type="choice", metavar="ROLE", + choices=["domain controller", "dc", "member server", "member", "standalone"], + help="The server role (domain controller | dc | member server | member | standalone). Default is dc.", + default="domain controller"), + Option("--function-level", type="choice", metavar="FOR-FUN-LEVEL", + choices=["2000", "2003", "2008", "2008_R2"], + help="The domain and forest function level (2000 | 2003 | 2008 | 2008_R2 - always native). Default is (Windows) 2003 Native.", + default="2003"), + Option("--next-rid", type="int", metavar="NEXTRID", default=1000, + help="The initial nextRid value (only needed for upgrades). Default is 1000."), + Option("--partitions-only", + help="Configure Samba's partitions, but do not modify them (ie, join a BDC)", action="store_true"), + Option("--targetdir", type="string", metavar="DIR", + help="Set target directory"), + Option("--ol-mmr-urls", type="string", metavar="LDAPSERVER", + help="List of LDAP-URLS [ ldap://<FQHN>:<PORT>/ (where <PORT> has to be different than 389!) ] separated with comma (\",\") for use with OpenLDAP-MMR (Multi-Master-Replication), e.g.: \"ldap://s4dc1:9000,ldap://s4dc2:9000\""), + Option("--use-xattrs", type="choice", choices=["yes", "no", "auto"], help="Define if we should use the native fs capabilities or a tdb file for storing attributes likes ntacl, auto tries to make an inteligent guess based on the user rights and system capabilities", default="auto"), + Option("--use-ntvfs", action="store_true", help="Use NTVFS for the fileserver (default = no)"), + Option("--use-rfc2307", action="store_true", help="Use AD to store posix attributes (default = no)"), + ] + takes_args = [] + + def run(self, sambaopts=None, credopts=None, versionopts=None, + interactive = None, + domain = None, + domain_guid = None, + domain_sid = None, + ntds_guid = None, + invocationid = None, + host_name = None, + host_ip = None, + host_ip6 = None, + adminpass = None, + krbtgtpass = None, + machinepass = None, + dns_backend = None, + dnspass = None, + ldapadminpass = None, + root = None, + nobody = None, + wheel = None, + users = None, + quiet = None, + blank = None, + ldap_backend_type = None, + server_role = None, + function_level = None, + next_rid = None, + partitions_only = None, + targetdir = None, + ol_mmr_urls = None, + use_xattrs = None, + use_ntvfs = None, + use_rfc2307 = None): + + logger = self.get_logger("provision") + if quiet: + logger.setLevel(logging.WARNING) + else: + logger.setLevel(logging.INFO) + + lp = sambaopts.get_loadparm() + smbconf = lp.configfile + + creds = credopts.get_credentials(lp) + + creds.set_kerberos_state(DONT_USE_KERBEROS) + + if len(self.raw_argv) == 1: + interactive = True + + if interactive: + from getpass import getpass + import socket + + def ask(prompt, default=None): + if default is not None: + print "%s [%s]: " % (prompt, default), + else: + print "%s: " % (prompt,), + return sys.stdin.readline().rstrip("\n") or default + + try: + default = socket.getfqdn().split(".", 1)[1].upper() + except IndexError: + default = None + realm = ask("Realm", default) + if realm in (None, ""): + raise CommandError("No realm set!") + + try: + default = realm.split(".")[0] + except IndexError: + default = None + domain = ask("Domain", default) + if domain is None: + raise CommandError("No domain set!") + + server_role = ask("Server Role (dc, member, standalone)", "dc") + + dns_backend = ask("DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE)", "BIND9_DLZ") + if dns_backend in (None, ''): + raise CommandError("No DNS backend set!") + + while True: + adminpassplain = getpass("Administrator password: ") + if not adminpassplain: + print >>sys.stderr, "Invalid administrator password." + else: + adminpassverify = getpass("Retype password: ") + if not adminpassplain == adminpassverify: + print >>sys.stderr, "Sorry, passwords do not match." + else: + adminpass = adminpassplain + break + + else: + realm = sambaopts._lp.get('realm') + if realm is None: + raise CommandError("No realm set!") + if domain is None: + raise CommandError("No domain set!") + + if not adminpass: + logger.info("Administrator password will be set randomly!") + + if function_level == "2000": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2000 + elif function_level == "2003": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2003 + elif function_level == "2008": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2008 + elif function_level == "2008_R2": + dom_for_fun_level = DS_DOMAIN_FUNCTION_2008_R2 + + samdb_fill = FILL_FULL + if blank: + samdb_fill = FILL_NT4SYNC + elif partitions_only: + samdb_fill = FILL_DRS + + if targetdir is not None: + if not os.path.isdir(targetdir): + os.mkdir(targetdir) + + eadb = True + + if use_xattrs == "yes": + eadb = False + elif use_xattrs == "auto" and not lp.get("posix:eadb"): + if targetdir: + file = tempfile.NamedTemporaryFile(dir=os.path.abspath(targetdir)) + else: + file = tempfile.NamedTemporaryFile(dir=os.path.abspath(os.path.dirname(lp.get("private dir")))) + try: + try: + samba.ntacls.setntacl(lp, file.name, + "O:S-1-5-32G:S-1-5-32", "S-1-5-32", "native") + eadb = False + except Exception: + logger.info("You are not root or your system do not support xattr, using tdb backend for attributes. ") + finally: + file.close() + + if eadb: + logger.info("not using extended attributes to store ACLs and other metadata. If you intend to use this provision in production, rerun the script as root on a system supporting xattrs.") + + session = system_session() + try: + result = provision(logger, + session, creds, smbconf=smbconf, targetdir=targetdir, + samdb_fill=samdb_fill, realm=realm, domain=domain, + domainguid=domain_guid, domainsid=domain_sid, + hostname=host_name, + hostip=host_ip, hostip6=host_ip6, + ntdsguid=ntds_guid, + invocationid=invocationid, adminpass=adminpass, + krbtgtpass=krbtgtpass, machinepass=machinepass, + dns_backend=dns_backend, + dnspass=dnspass, root=root, nobody=nobody, + wheel=wheel, users=users, + serverrole=server_role, dom_for_fun_level=dom_for_fun_level, + backend_type=ldap_backend_type, + ldapadminpass=ldapadminpass, ol_mmr_urls=ol_mmr_urls, + useeadb=eadb, next_rid=next_rid, lp=lp, use_ntvfs=(use_ntvfs), + use_rfc2307=(use_rfc2307)) + except ProvisioningError, e: + raise CommandError("Provision failed", e) + + result.report_logger(logger) class cmd_domain_dcpromo(Command): """Promotes an existing domain member or NT4 PDC to an AD DC""" @@ -1020,6 +1282,7 @@ class cmd_domain(SuperCommand): if type(cmd_domain_export_keytab).__name__ != 'NoneType': subcommands["exportkeytab"] = cmd_domain_export_keytab() subcommands["info"] = cmd_domain_info() + subcommands["provision"] = cmd_domain_provision() subcommands["join"] = cmd_domain_join() subcommands["dcpromo"] = cmd_domain_dcpromo() subcommands["level"] = cmd_domain_level() diff --git a/source4/scripting/python/samba/netcmd/testparm.py b/source4/scripting/python/samba/netcmd/testparm.py index a6639a3..5cb75e2 100644 --- a/source4/scripting/python/samba/netcmd/testparm.py +++ b/source4/scripting/python/samba/netcmd/testparm.py @@ -43,11 +43,6 @@ class cmd_testparm(Command): synopsis = "%prog [options]" takes_optiongroups = { - "sambaopts" : options.SambaOptions, - "versionopts": options.VersionOptions - } - - takes_optiongroups = { "sambaopts": options.SambaOptions, "versionopts": options.VersionOptions } diff --git a/source4/scripting/wscript_build b/source4/scripting/wscript_build index 2362a64..ddd5533 100644 --- a/source4/scripting/wscript_build +++ b/source4/scripting/wscript_build @@ -4,16 +4,16 @@ from samba_utils import MODE_755 sbin_files = None if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'): - sbin_files = 'bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate bin/samba_upgradedns' + sbin_files = 'bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate bin/samba_upgradedns bin/samba_kcc' if sbin_files: bld.INSTALL_FILES('${SBINDIR}', - 'bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate bin/samba_upgradedns', + sbin_files, chmod=MODE_755, python_fixup=True, flat=True) if bld.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'): bld.INSTALL_FILES('${BINDIR}', - 'bin/samba-tool bin/samba_kcc', + 'bin/samba-tool', chmod=MODE_755, python_fixup=True, flat=True) bld.RECURSE('bin') diff --git a/source4/setup/tests/blackbox_group.sh b/source4/setup/tests/blackbox_group.sh index e03a780..f5569c3 100755 --- a/source4/setup/tests/blackbox_group.sh +++ b/source4/setup/tests/blackbox_group.sh @@ -14,7 +14,7 @@ shift 1 rm -rf $PREFIX/simple-dc -testit "simple-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs +testit "simple-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs samba_tool="./bin/samba-tool" CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf" diff --git a/source4/setup/tests/blackbox_newuser.sh b/source4/setup/tests/blackbox_newuser.sh index 8c9e090..9c11cd6 100755 --- a/source4/setup/tests/blackbox_newuser.sh +++ b/source4/setup/tests/blackbox_newuser.sh @@ -14,7 +14,7 @@ shift 1 rm -rf $PREFIX/simple-dc -testit "simple-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs +testit "simple-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs samba_tool="./bin/samba-tool" CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf" diff --git a/source4/setup/tests/blackbox_provision-backend.sh b/source4/setup/tests/blackbox_provision-backend.sh index f96afd7..a65e7fc 100755 --- a/source4/setup/tests/blackbox_provision-backend.sh +++ b/source4/setup/tests/blackbox_provision-backend.sh @@ -12,13 +12,13 @@ shift 1 . `dirname $0`/../../../testprogs/blackbox/subunit.sh -testit "openldap-backend" $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend --use-ntvfs -testit "openldap-mmr-backend" $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-mmr-backend --ol-mmr-urls="ldap://s4dc1.test:9000,ldap://s4dc2.test:9000" --username=samba-admin --password=linux --adminpass=linux --ldapadminpass=linux --use-ntvfs -testit "fedora-ds-backend" $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend --use-ntvfs +testit "openldap-backend" $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend --use-ntvfs +testit "openldap-mmr-backend" $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-mmr-backend --ol-mmr-urls="ldap://s4dc1.test:9000,ldap://s4dc2.test:9000" --username=samba-admin --password=linux --adminpass=linux --ldapadminpass=linux --use-ntvfs +testit "fedora-ds-backend" $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend --use-ntvfs reprovision() { - $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend-reprovision --use-ntvfs - $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend-reprovision --use-ntvfs + $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend-reprovision --use-ntvfs + $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --ldap-backend-type=openldap --targetdir=$PREFIX/openldap-backend-reprovision --use-ntvfs } testit "reprovision-backend" reprovision diff --git a/source4/setup/tests/blackbox_provision.sh b/source4/setup/tests/blackbox_provision.sh index 8339e7e..4d7ab81 100755 --- a/source4/setup/tests/blackbox_provision.sh +++ b/source4/setup/tests/blackbox_provision.sh @@ -16,29 +16,29 @@ shift 1 rm -rf $PREFIX/simple-default mkdir -p $PREFIX/simple-default/etc touch $PREFIX/simple-default/etc/smb.conf -testit "simple-default" $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-default --use-ntvfs +testit "simple-default" $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-default --use-ntvfs #And try with just whitespace rm -rf $PREFIX/simple-dc mkdir -p $PREFIX/simple-dc/etc echo " " > $PREFIX/simple-dc/etc/smb.conf -testit "simple-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs +testit "simple-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs #The rest of these tests are with no smb.conf file present rm -rf $PREFIX/simple-dc -testit "simple-dc-guids" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --domain-guid=6054d36d-2bfd-44f1-a9cd-32cfbb06480b --ntds-guid=b838f255-c8aa-4fe8-9402-b7d61ca3bd1b --invocationid=6d4cff9a-2bbf-4b4c-98a2-36242ddb0bd6 --targetdir=$PREFIX/simple-dc --use-ntvfs +testit "simple-dc-guids" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --domain-guid=6054d36d-2bfd-44f1-a9cd-32cfbb06480b --ntds-guid=b838f255-c8aa-4fe8-9402-b7d61ca3bd1b --invocationid=6d4cff9a-2bbf-4b4c-98a2-36242ddb0bd6 --targetdir=$PREFIX/simple-dc --use-ntvfs rm -rf $PREFIX/simple-member -testit "simple-member" $PYTHON $SRCDIR/source4/setup/provision --server-role="member" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-member --use-ntvfs +testit "simple-member" $PYTHON $BINDIR/samba-tool domain provision --server-role="member" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-member --use-ntvfs rm -rf $PREFIX/simple-standalone -testit "simple-standalone" $PYTHON $SRCDIR/source4/setup/provision --server-role="standalone" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-standalone --use-ntvfs +testit "simple-standalone" $PYTHON $BINDIR/samba-tool domain provision --server-role="standalone" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-standalone --use-ntvfs rm -rf $PREFIX/blank-dc -testit "blank-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/blank-dc --blank --use-ntvfs +testit "blank-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/blank-dc --blank --use-ntvfs rm -rf $PREFIX/partitions-only-dc -testit "partitions-only-dc" $PYTHON $SRCDIR/source4/setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/partitions-only-dc --partitions-only --use-ntvfs +testit "partitions-only-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/partitions-only-dc --partitions-only --use-ntvfs reprovision() { rm -rf $PREFIX/reprovision - $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision" --use-ntvfs - $PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision" --use-ntvfs + $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision" --use-ntvfs + $PYTHON $BINDIR/samba-tool domain provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision" --use-ntvfs } testit "reprovision" reprovision diff --git a/source4/setup/tests/blackbox_setpassword.sh b/source4/setup/tests/blackbox_setpassword.sh index 6502774..1744747 100755 --- a/source4/setup/tests/blackbox_setpassword.sh +++ b/source4/setup/tests/blackbox_setpassword.sh @@ -15,7 +15,7 @@ shift 1 samba_tool="./bin/samba-tool" rm -rf $PREFIX/simple-dc -- Samba Shared Repository