summaryrefslogtreecommitdiff
path: root/source4/setup
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-03-07 10:57:52 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-03-07 10:57:52 +1100
commit14c5f968e1f99ceabc5a42d9a38a00ea137b00ea (patch)
treea922ad72242dd91f215d06b8a3f16d054800370b /source4/setup
parent45149fbf9d3e55e17e21ab4a6159e9b805adc06d (diff)
downloadsamba-14c5f968e1f99ceabc5a42d9a38a00ea137b00ea.tar.gz
samba-14c5f968e1f99ceabc5a42d9a38a00ea137b00ea.tar.bz2
samba-14c5f968e1f99ceabc5a42d9a38a00ea137b00ea.zip
Rework provision scripts for more testing
This fixes up some issues with testdir (was not honoured) and increases test coverage. We now check all the major provision modes. In doing so, to make it possible to call from the multiple layers of 'sh', I have allowed 'dc' to alias 'domain controller' and 'member' to alias 'member server'. Fighting shell quoting in the test system was just too hard... Also fix upgrade.py Andrew Bartlett (This used to be commit 0923de12282b0e063dd73bc3e056dd5c3663c190)
Diffstat (limited to 'source4/setup')
-rwxr-xr-xsource4/setup/provision20
-rw-r--r--source4/setup/provision.smb.conf.dc4
-rw-r--r--source4/setup/provision.smb.conf.member4
-rw-r--r--source4/setup/provision.smb.conf.standalone4
-rwxr-xr-xsource4/setup/tests/blackbox_provision.sh5
5 files changed, 22 insertions, 15 deletions
diff --git a/source4/setup/provision b/source4/setup/provision
index 606443a6ed..629bfa10e0 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -88,7 +88,7 @@ parser.add_option("--ldap-backend-type", type="choice", metavar="LDAP-BACKEND-TY
parser.add_option("--aci", type="string", metavar="ACI",
help="An arbitary LDIF fragment, particularly useful to loading a backend ACI value into a target LDAP server. You must provide at least a realm and domain")
parser.add_option("--server-role", type="choice", metavar="ROLE",
- choices=["domain controller", "member server"],
+ choices=["domain controller", "dc", "member server", "member", "standalone"],
help="Set server role to provision for (default standalone)")
parser.add_option("--partitions-only",
help="Configure Samba's partitions, but do not modify them (ie, join a BDC)", action="store_true")
@@ -110,14 +110,18 @@ if opts.realm is None or opts.domain is None:
parser.print_usage()
sys.exit(1)
-# cope with an initially blank smb.conf
-
-if sambaopts.get_loadparm_path() is not None:
- smbconf = sambaopts.get_loadparm_path()
+smbconf = sambaopts.get_loadparm_path()
if opts.aci is not None:
print "set ACI: %s" % opts.aci
+if opts.server_role == "dc":
+ server_role = "domain controller"
+elif opts.server_role == "member":
+ server_role = "member server"
+else:
+ server_role = opts.server_role
+
creds = credopts.get_credentials()
setup_dir = opts.setupdir
@@ -131,8 +135,8 @@ elif opts.partitions_only:
samdb_fill = FILL_DRS
provision(setup_dir, message,
- system_session(), creds, smbconf=smbconf,
- samdb_fill=samdb_fill, realm=opts.realm,
+ system_session(), creds, smbconf=smbconf, targetdir=opts.targetdir,
+ samdb_fill=samdb_fill, realm=opts.realm, domain=opts.domain,
domainguid=opts.domain_guid, domainsid=opts.domain_sid,
policyguid=opts.policy_guid, hostname=opts.host_name,
hostip=opts.host_ip, hostguid=opts.host_guid,
@@ -140,7 +144,7 @@ provision(setup_dir, message,
krbtgtpass=opts.krbtgtpass, machinepass=opts.machinepass,
dnspass=opts.dnspass, root=opts.root, nobody=opts.nobody,
nogroup=opts.nogroup, wheel=opts.wheel, users=opts.users,
- aci=opts.aci, serverrole=opts.server_role,
+ aci=opts.aci, serverrole=server_role,
ldap_backend=opts.ldap_backend,
ldap_backend_type=opts.ldap_backend_type)
diff --git a/source4/setup/provision.smb.conf.dc b/source4/setup/provision.smb.conf.dc
index e77e699028..ad06be4301 100644
--- a/source4/setup/provision.smb.conf.dc
+++ b/source4/setup/provision.smb.conf.dc
@@ -1,7 +1,7 @@
[globals]
netbios name = ${HOSTNAME}
- workgroup = ${DOMAIN_CONF}
- realm = ${REALM_CONF}
+ workgroup = ${DOMAIN}
+ realm = ${REALM}
server role = ${SERVERROLE}
${PRIVATEDIR_LINE}
${LOCKDIR_LINE}
diff --git a/source4/setup/provision.smb.conf.member b/source4/setup/provision.smb.conf.member
index 1d9191d8c2..0d742fb903 100644
--- a/source4/setup/provision.smb.conf.member
+++ b/source4/setup/provision.smb.conf.member
@@ -1,7 +1,7 @@
[globals]
netbios name = ${HOSTNAME}
- workgroup = ${DOMAIN_CONF}
- realm = ${REALM_CONF}
+ workgroup = ${DOMAIN}
+ realm = ${REALM}
server role = ${SERVERROLE}
${PRIVATEDIR_LINE}
${LOCKDIR_LINE}
diff --git a/source4/setup/provision.smb.conf.standalone b/source4/setup/provision.smb.conf.standalone
index 1d9191d8c2..0d742fb903 100644
--- a/source4/setup/provision.smb.conf.standalone
+++ b/source4/setup/provision.smb.conf.standalone
@@ -1,7 +1,7 @@
[globals]
netbios name = ${HOSTNAME}
- workgroup = ${DOMAIN_CONF}
- realm = ${REALM_CONF}
+ workgroup = ${DOMAIN}
+ realm = ${REALM}
server role = ${SERVERROLE}
${PRIVATEDIR_LINE}
${LOCKDIR_LINE}
diff --git a/source4/setup/tests/blackbox_provision.sh b/source4/setup/tests/blackbox_provision.sh
index 0aed7bb8b7..83c045e40d 100755
--- a/source4/setup/tests/blackbox_provision.sh
+++ b/source4/setup/tests/blackbox_provision.sh
@@ -27,7 +27,10 @@ testit() {
return $status
}
-testit "simple" $PYTHON ./setup/provision $CONFIGURATION --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple
+testit "simple-default" $PYTHON ./setup/provision $CONFIGURATION --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-default
+testit "simple-dc" $PYTHON ./setup/provision $CONFIGURATION --server-role="dc" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-dc
+testit "simple-member" $PYTHON ./setup/provision $CONFIGURATION --server-role="member" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-member
+testit "simple-standalone" $PYTHON ./setup/provision $CONFIGURATION --server-role="standalone" --domain=FOO --realm=foo.example.com --targetdir=$PREFIX/simple-standalone
reprovision() {
$PYTHON ./setup/provision $CONFIGURATION --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision"