From: Andreas Schneider Date: Wed, 14 Apr 2021 09:44:51 +0000 (+0200) Subject: tests: Use --configfile instead of -s X-Git-Tag: tevent-0.11.0~993 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f291b8f157156024fe6726ddf16218529b39f5e9;p=thirdparty%2Fsamba.git tests: Use --configfile instead of -s We should use long options in tests to make clear what we are trying to do. Also the -s short option will be removed for --configfile later. Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- diff --git a/examples/ad-bench/time_group.sh b/examples/ad-bench/time_group.sh index 438376e6c10..bb989314b83 100644 --- a/examples/ad-bench/time_group.sh +++ b/examples/ad-bench/time_group.sh @@ -30,7 +30,7 @@ SERVER=$2 add_group () { GROUP=$1 - ${NET} ads group add "${GROUP}" -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group add "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} ads group add returned error: $RET" @@ -40,7 +40,7 @@ add_group () { del_group () { GROUP=$1 - ${NET} ads group delete "${GROUP}" -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group delete "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -49,7 +49,7 @@ del_group () { } enum_group () { - ${NET} ads group -k -s $CONFIG_FILE -S $SERVER > /dev/null + ${NET} ads group -k --configfile=$CONFIG_FILE -S $SERVER > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -59,7 +59,7 @@ enum_group () { info_group () { GROUP=$1 - ${NET} ads group info "${GROUP}" -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group info "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" diff --git a/examples/ad-bench/time_join.sh b/examples/ad-bench/time_join.sh index e9c3873e49c..5d6afef68eb 100644 --- a/examples/ad-bench/time_join.sh +++ b/examples/ad-bench/time_join.sh @@ -29,7 +29,7 @@ NT_DOM=$(get_nt_dom $1) join_domain () { SERVER=$1 - ${NET} ads join -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads join -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -39,7 +39,7 @@ join_domain () { leave_domain () { SERVER=$1 - ${NET} ads leave -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads leave -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" exit 1 diff --git a/examples/ad-bench/time_ldap.sh b/examples/ad-bench/time_ldap.sh index 586c56873eb..1f28a5d145a 100644 --- a/examples/ad-bench/time_ldap.sh +++ b/examples/ad-bench/time_ldap.sh @@ -11,7 +11,7 @@ NT_DOM=$(get_nt_dom $1) SERVER=$2 search_users () { - ${NET} ads search '(objectCategory=user)' sAMAccountName -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads search '(objectCategory=user)' sAMAccountName -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -20,7 +20,7 @@ search_users () { } search_groups () { - ${NET} ads search '(objectCategory=group)' sAMAccountName -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads search '(objectCategory=group)' sAMAccountName -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" exit 1 @@ -28,7 +28,7 @@ search_groups () { } search_computers () { - ${NET} ads search '(objectCategory=computer)' sAMAccountName -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads search '(objectCategory=computer)' sAMAccountName -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" exit 1 @@ -36,7 +36,7 @@ search_computers () { } search_wildcard () { - ${NET} ads search '(objectCategory=*)' sAMAccountName -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads search '(objectCategory=*)' sAMAccountName -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" exit 1 @@ -44,7 +44,7 @@ search_wildcard () { } search_unindexed () { - ${NET} ads search '(description=Built-in account for adminstering the computer/domain)' sAMAccountName -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads search '(description=Built-in account for adminstering the computer/domain)' sAMAccountName -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" exit 1 diff --git a/examples/ad-bench/time_user.sh b/examples/ad-bench/time_user.sh index 5380115628b..549960b1733 100644 --- a/examples/ad-bench/time_user.sh +++ b/examples/ad-bench/time_user.sh @@ -30,7 +30,7 @@ SERVER=$2 add_user () { USER=$1 - ${NET} ads user add "${USER}" 'Sup3rS3cr3T!' -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads user add "${USER}" 'Sup3rS3cr3T!' -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} ads user add returned error: $RET" @@ -40,7 +40,7 @@ add_user () { del_user () { USER=$1 - ${NET} ads user delete "${USER}" -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads user delete "${USER}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -49,7 +49,7 @@ del_user () { } enum_user () { - ${NET} ads user -k -s $CONFIG_FILE -S $SERVER > /dev/null + ${NET} ads user -k --configfile=$CONFIG_FILE -S $SERVER > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -59,7 +59,7 @@ enum_user () { info_user () { USER=$1 - ${NET} ads user info "${USER}" -k -s $CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads user info "${USER}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" diff --git a/nsswitch/tests/test_wbinfo_user_info_cached.sh b/nsswitch/tests/test_wbinfo_user_info_cached.sh index 5b451fde202..f13e98a9246 100755 --- a/nsswitch/tests/test_wbinfo_user_info_cached.sh +++ b/nsswitch/tests/test_wbinfo_user_info_cached.sh @@ -22,7 +22,7 @@ failed=0 samba_bindir="$BINDIR" wbinfo_tool="$VALGRIND $samba_bindir/wbinfo" -net_tool="$VALGRIND $samba_bindir/net -s $SERVERCONFFILE" +net_tool="$VALGRIND $samba_bindir/net --configfile=$SERVERCONFFILE" . $(dirname $0)/../../testprogs/blackbox/subunit.sh diff --git a/python/samba/tests/blackbox/mdsearch.py b/python/samba/tests/blackbox/mdsearch.py index 8da5a49e136..c9156ae6e0e 100644 --- a/python/samba/tests/blackbox/mdsearch.py +++ b/python/samba/tests/blackbox/mdsearch.py @@ -123,7 +123,7 @@ class MdfindBlackboxTests(BlackboxTestCase): self.server.json_in = json_in.replace("%BASEPATH%", self.sharepath) self.server.json_out = json_out.replace("%BASEPATH%", self.sharepath) - output = self.check_output("mdsearch -s %s -U %s%%%s fileserver spotlight '*==\"samba*\"'" % (config, username, password)) + output = self.check_output("mdsearch --configfile=%s -U %s%%%s fileserver spotlight '*==\"samba*\"'" % (config, username, password)) actual = output.decode('utf-8').splitlines() expected = ["%s/%s" % (self.sharepath, file) for file in testfiles] diff --git a/python/samba/tests/docs.py b/python/samba/tests/docs.py index 135be830521..995b8e09978 100644 --- a/python/samba/tests/docs.py +++ b/python/samba/tests/docs.py @@ -310,8 +310,11 @@ class SmbDotConfTests(TestCase): else: self.fail("%s has no valid context" % param) - cmdline = program + ["-s", - self.smbconf, + program_arg1 = ["--configfile=%s" % (self.smbconf)] + if (program[0] == 'bin/testparm'): + program_arg1 = ["--suppress-prompt", self.smbconf] + + cmdline = program + program_arg1 + [ "--section-name", section, "--parameter-name", @@ -360,8 +363,11 @@ class SmbDotConfTests(TestCase): else: self.fail("%s has no valid context" % param) - cmdline = program + ["-s", - self.smbconf, + program_arg1 = ["--configfile=%s" % (self.smbconf)] + if (program[0] == 'bin/testparm'): + program_arg1 = ["--suppress-prompt", self.smbconf] + + cmdline = program + program_arg1 + [ "--section-name", section, "--parameter-name", @@ -434,8 +440,11 @@ class SmbDotConfTests(TestCase): if value_to_use is None: self.fail("%s has an invalid type" % param) - cmdline = program + ["-s", - self.smbconf, + program_arg1 = ["--configfile=%s" % (self.smbconf)] + if (program[0] == 'bin/testparm'): + program_arg1 = ["--suppress-prompt", self.smbconf] + + cmdline = program + program_arg1 + [ "--section-name", section, "--parameter-name", @@ -478,9 +487,12 @@ class SmbDotConfTests(TestCase): if program[0] == 'bin/samba-tool' and os.getenv("PYTHON", None): program = [os.environ["PYTHON"]] + program - p = subprocess.Popen(program + ["-s", - self.blankconf, - "--suppress-prompt"], + program_arg1 = ["--configfile=%s" % (self.blankconf), "--suppress-prompt"] + if (program[0] == 'bin/testparm'): + program_arg1 = ["--suppress-prompt", self.blankconf] + + print(program + program_arg1) + p = subprocess.Popen(program + program_arg1, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=self.topdir).communicate() diff --git a/python/samba/tests/domain_backup_offline.py b/python/samba/tests/domain_backup_offline.py index 23300ac91b7..4ba1249e81b 100644 --- a/python/samba/tests/domain_backup_offline.py +++ b/python/samba/tests/domain_backup_offline.py @@ -170,7 +170,7 @@ class DomainBackupOfflineCmp(BlackboxTestCase): def backup(self, prov_dir): # Run the backup and check we got one backup tar file cmd = ("samba-tool domain backup offline --targetdir={prov_dir} " - "-s {prov_dir}/etc/smb.conf").format(prov_dir=prov_dir) + "--configfile={prov_dir}/etc/smb.conf").format(prov_dir=prov_dir) self.check_output(cmd) tar_files = [fn for fn in os.listdir(prov_dir) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 87e0f6e5e98..40efa36fdf3 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1843,7 +1843,7 @@ sub make_bin_cmd @preargs = split(/ /, $valgrind); } my @args = ("-F", "--no-process-group", - "-s", $env_vars->{SERVERCONFFILE}, + "--configfile=$env_vars->{SERVERCONFFILE}", "-l", $env_vars->{LOGDIR}); if (not defined($dont_log_stdout)) { @@ -3058,7 +3058,7 @@ force_user:x:$gid_force_user: $ret{SMBD_TEST_LOG_POS} = 0; $ret{SERVERCONFFILE} = $conffile; $ret{TESTENV_DIR} = $prefix_abs; - $ret{CONFIGURATION} ="-s $conffile"; + $ret{CONFIGURATION} ="--configfile=$conffile"; $ret{LOCK_DIR} = $lockdir; $ret{SERVER} = $server; $ret{USERNAME} = $unix_name; diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 2cbd306d8bc..5c9bbe0da20 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -607,10 +607,10 @@ sub provision_raw_prepare($$$$$$$$$$$$$$) $ctx->{nsswrap_hostname} = "$ctx->{hostname}.$ctx->{dnsname}"; if ($ENV{SAMBA_DNS_FAKING}) { $ctx->{dns_host_file} = "$ENV{SELFTEST_PREFIX}/dns_host_file"; - $ctx->{samba_dnsupdate} = "$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate -s $ctx->{smb_conf} --all-interfaces --use-file=$ctx->{dns_host_file}"; + $ctx->{samba_dnsupdate} = "$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --configfile=$ctx->{smb_conf} --all-interfaces --use-file=$ctx->{dns_host_file}"; $ctx->{samba_dnsupdate} = $python_cmd . $ctx->{samba_dnsupdate}; } else { - $ctx->{samba_dnsupdate} = "$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate -s $ctx->{smb_conf} --all-interfaces"; + $ctx->{samba_dnsupdate} = "$ENV{SRCDIR_ABS}/source4/scripting/bin/samba_dnsupdate --configfile=$ctx->{smb_conf} --all-interfaces"; $ctx->{samba_dnsupdate} = $python_cmd . $ctx->{samba_dnsupdate}; $ctx->{use_resolv_wrapper} = 1; } @@ -782,8 +782,8 @@ sub provision_raw_step1($$) server min protocol = SMB2_02 mangled names = yes dns update command = $ctx->{samba_dnsupdate} - spn update command = $ctx->{python} $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate -s $ctx->{smb_conf} - gpo update command = $ctx->{python} $ENV{SRCDIR_ABS}/source4/scripting/bin/samba-gpupdate -s $ctx->{smb_conf} --target=Computer + spn update command = $ctx->{python} $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_spnupdate --configfile $ctx->{smb_conf} + gpo update command = $ctx->{python} $ENV{SRCDIR_ABS}/source4/scripting/bin/samba-gpupdate --configfile $ctx->{smb_conf} --target=Computer samba kcc command = $ctx->{python} $ENV{SRCDIR_ABS}/source4/scripting/bin/samba_kcc dreplsrv:periodic_startup_interval = 0 dsdb:schema update allowed = yes @@ -3250,7 +3250,7 @@ sub setup_offlinebackupdc # create an offline backup of the 'backupfromdc' target my $backupdir = File::Temp->newdir(); - my $cmd = "offline -s $dcvars->{SERVERCONFFILE}"; + my $cmd = "offline --configfile $dcvars->{SERVERCONFFILE}"; my $backup_file = $self->create_backup($env, $dcvars, $backupdir, $cmd); diff --git a/source4/setup/tests/blackbox_s3upgrade.sh b/source4/setup/tests/blackbox_s3upgrade.sh index 840371a515b..3c0afe96744 100755 --- a/source4/setup/tests/blackbox_s3upgrade.sh +++ b/source4/setup/tests/blackbox_s3upgrade.sh @@ -40,7 +40,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb1.conf < $PREFIX/samba3-upgrade/samba3/smb2.conf < $PREFIX/samba3-upgrade/samba3/smb3.conf <&1) + OUTPUT=$($BINDIR/samba --configfile=$DBPATH/etc/smb.conf $OPTS 2>&1) if [ $? -eq 0 ] ; then echo "ERROR: Samba should not have started successfully" return 1 diff --git a/source4/setup/tests/blackbox_upgradeprovision.sh b/source4/setup/tests/blackbox_upgradeprovision.sh index 5222b5ca924..e53e7031cd2 100755 --- a/source4/setup/tests/blackbox_upgradeprovision.sh +++ b/source4/setup/tests/blackbox_upgradeprovision.sh @@ -26,7 +26,7 @@ upgradeprovision() { rm -fr $PREFIX/upgradeprovision fi $PYTHON $BINDIR/samba-tool domain provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision" --server-role="dc" --use-ntvfs --base-schema=2008_R2 - $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX/upgradeprovision/etc/smb.conf" --debugchange + $PYTHON $BINDIR/samba_upgradeprovision --configfile="$PREFIX/upgradeprovision/etc/smb.conf" --debugchange } upgradeprovision_full() { @@ -34,7 +34,7 @@ upgradeprovision_full() { rm -fr $PREFIX/upgradeprovision_full fi $PYTHON $BINDIR/samba-tool domain provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision_full" --server-role="dc" --use-ntvfs --base-schema=2008_R2 - $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX/upgradeprovision_full/etc/smb.conf" --full --debugchange + $PYTHON $BINDIR/samba_upgradeprovision --configfile="$PREFIX/upgradeprovision_full/etc/smb.conf" --full --debugchange } # The ldapcmp runs here are to ensure that a 'null' run of diff --git a/source4/torture/drs/python/ridalloc_exop.py b/source4/torture/drs/python/ridalloc_exop.py index 3c7b39b280a..8efdd6a0603 100644 --- a/source4/torture/drs/python/ridalloc_exop.py +++ b/source4/torture/drs/python/ridalloc_exop.py @@ -293,7 +293,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): self.assertFalse("rIDSetReferences" in res[0]) - (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force") + (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "--configfile=%s" % (smbconf), "--force") self.assertCmdSuccess(result, out, err) self.assertEqual(err, "", "Shouldn't be any error messages") @@ -621,7 +621,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): self.assertTrue("rIDSetReferences" in res[0]) rid_set_dn = ldb.Dn(new_ldb, res[0]["rIDSetReferences"][0].decode('utf8')) # 4. Seize the RID Manager role - (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force") + (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "--configfile=%s" % (smbconf), "--force") self.assertCmdSuccess(result, out, err) self.assertEqual(err, "", "Shouldn't be any error messages") diff --git a/source4/torture/drs/python/samba_tool_drs.py b/source4/torture/drs/python/samba_tool_drs.py index 988f1dc7a3c..ac97162e23d 100644 --- a/source4/torture/drs/python/samba_tool_drs.py +++ b/source4/torture/drs/python/samba_tool_drs.py @@ -203,7 +203,7 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase): new_dc_config_file = "%s/etc/smb.conf" % self.tempdir - self.check_output("samba-tool drs replicate --local %s %s %s %s -s %s" + self.check_output("samba-tool drs replicate --local %s %s %s %s --configfile=%s" % ("invalid", self.dc1, nc_name, self.cmdline_creds, new_dc_config_file)) @@ -227,7 +227,7 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase): self._net_drs_replicate(DC=self.dnsname_dc2, fromDC=self.dnsname_dc1) # pull that change with --local into local db from dc1: should send link and some objects - out = self.check_output("samba-tool drs replicate --local %s %s %s %s -s %s" + out = self.check_output("samba-tool drs replicate --local %s %s %s %s --configfile=%s" % ("invalid", self.dc1, nc_name, self.cmdline_creds, new_dc_config_file)) @@ -238,7 +238,7 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase): # pull that change with --local into local db from dc2: shouldn't send link or object # as we sent an up-to-dateness vector showing that we had already synced with DC1 - out = self.check_output("samba-tool drs replicate --local %s %s %s %s -s %s" + out = self.check_output("samba-tool drs replicate --local %s %s %s %s --configfile=%s" % ("invalid", self.dc2, nc_name, self.cmdline_creds, new_dc_config_file)) @@ -247,7 +247,7 @@ class SambaToolDrsTests(drs_base.DrsBaseTestCase): self.assertEqual(obj_2, 0) self.assertEqual(link_2, 0) - self.check_output("samba-tool domain demote --remove-other-dead-server=%s -H ldap://%s %s -s %s" + self.check_output("samba-tool domain demote --remove-other-dead-server=%s -H ldap://%s %s --configfile=%s" % (netbiosname, self.dc1, self.cmdline_creds, new_dc_config_file)) def test_samba_tool_replicate_machine_creds_P(self): diff --git a/source4/torture/drs/python/samba_tool_drs_no_dns.py b/source4/torture/drs/python/samba_tool_drs_no_dns.py index 41ae51374ce..33b43b48d05 100644 --- a/source4/torture/drs/python/samba_tool_drs_no_dns.py +++ b/source4/torture/drs/python/samba_tool_drs_no_dns.py @@ -103,11 +103,11 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase): forestdns_dn = ldb.binary_encode('DC=ForestDNSZones,' + str(nc_name)) domaindns_dn = ldb.binary_encode('DC=DomainDNSZones,' + str(nc_name)) - self.check_output("samba-tool drs replicate --local %s %s %s %s -s %s --full-sync" + self.check_output("samba-tool drs replicate --local %s %s %s %s --configfile=%s --full-sync" % ("invalid", self.dc1, forestdns_dn, self.cmdline_creds, new_dc_config_file)) - self.check_output("samba-tool drs replicate --local %s %s %s %s -s %s --full-sync" + self.check_output("samba-tool drs replicate --local %s %s %s %s --configfile=%s --full-sync" % ("invalid", self.dc1, domaindns_dn, self.cmdline_creds, new_dc_config_file)) @@ -122,7 +122,7 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase): expression="(msds-hasmasterncs=%s)" % domaindns_dn) self.assertEqual(len(res), 0) - self.check_output("samba_upgradedns -s %s" % (new_dc_config_file)) + self.check_output("samba_upgradedns --configfile=%s" % (new_dc_config_file)) res = samdb.search(base=server_ds_name, expression="(msds-hasmasterncs=%s)" % forestdns_dn) @@ -143,11 +143,11 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase): try: # This fixes any forward-link-backward-link issues with the tools - self.check_output("samba-tool dbcheck -s %s --cross-ncs --fix --yes" % (new_dc_config_file)) + self.check_output("samba-tool dbcheck --configfile=%s --cross-ncs --fix --yes" % (new_dc_config_file)) except BlackboxProcessError as e: self.assertTrue("Checked " in get_string(e.stdout)) - self.check_output("samba-tool dbcheck -s %s --cross-ncs" % (new_dc_config_file)) + self.check_output("samba-tool dbcheck --configfile=%s --cross-ncs" % (new_dc_config_file)) # Compare the two directories self.check_output("samba-tool ldapcmp ldap://%s ldb://%s %s --filter=%s" % @@ -179,5 +179,5 @@ class SambaToolDrsNoDnsTests(drs_base.DrsBaseTestCase): self.assertEqual(len(res), 1) # Demote the DC we created in the test - self.check_output("samba-tool domain demote --remove-other-dead-server=%s -H ldap://%s %s -s %s" + self.check_output("samba-tool domain demote --remove-other-dead-server=%s -H ldap://%s %s --configfile=%s" % (netbiosname, self.dc1, self.cmdline_creds, new_dc_config_file)) diff --git a/testprogs/blackbox/renamedc.sh b/testprogs/blackbox/renamedc.sh index 494af98f6d8..e267d1dff5c 100755 --- a/testprogs/blackbox/renamedc.sh +++ b/testprogs/blackbox/renamedc.sh @@ -30,7 +30,7 @@ testrenamedc() { $PYTHON $SRCDIR/source4/scripting/bin/renamedc \ --oldname="BAR" \ --newname="RAYMONBAR" \ - -s $PREFIX/renamedc_test/etc/smb.conf + --configfile=$PREFIX/renamedc_test/etc/smb.conf } confirmrenamedc() { @@ -61,19 +61,19 @@ testrenamedc2() { $PYTHON $SRCDIR/source4/scripting/bin/renamedc \ --oldname="RAYMONBAR" \ --newname="BAR" \ - -s $PREFIX/renamedc_test/etc/smb.conf + --configfile=$PREFIX/renamedc_test/etc/smb.conf } dbcheck_fix() { # Unlike most calls to dbcheck --fix, this will not trigger an error, as # we do not flag an error count for this old DN string case. - $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs -s $PREFIX/renamedc_test/etc/smb.conf --fix \ + $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --configfile=$PREFIX/renamedc_test/etc/smb.conf --fix \ --quiet --yes fix_all_old_dn_string_component_mismatch \ --attrs="fsmoRoleOwner interSiteTopologyGenerator msDS-NC-Replica-Locations" } dbcheck() { - $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs -s $PREFIX/renamedc_test/etc/smb.conf + $PYTHON $BINDIR/samba-tool dbcheck --cross-ncs --configfile=$PREFIX/renamedc_test/etc/smb.conf } diff --git a/testprogs/blackbox/test_chgdcpass.sh b/testprogs/blackbox/test_chgdcpass.sh index 66853b364f2..1c8659ecc92 100755 --- a/testprogs/blackbox/test_chgdcpass.sh +++ b/testprogs/blackbox/test_chgdcpass.sh @@ -77,7 +77,7 @@ test_drs bind "Test drs bind with with kerberos ccache" || failed=`expr $failed #check that drs options works before we change the password (prime the ccache) test_drs options "Test drs options with with kerberos ccache" || failed=`expr $failed + 1` -testit "change dc password" $PYTHON $samba4srcdir/scripting/devel/chgtdcpass -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "change dc password" $PYTHON $samba4srcdir/scripting/devel/chgtdcpass --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` #This is important because it shows that the old ticket remains valid (as it must) for incoming connections after the DC password is changed test_smbclient "Test login with kerberos ccache after password change" 'ls' "$unc" -k yes || failed=`expr $failed + 1` @@ -88,7 +88,7 @@ test_drs bind "Test drs bind with new password" || failed=`expr $failed + 1` #check that drs options works after we change the password test_drs options "Test drs options with new password" || failed=`expr $failed + 1` -testit "change dc password (2nd time)" $PYTHON $samba4srcdir/scripting/devel/chgtdcpass -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "change dc password (2nd time)" $PYTHON $samba4srcdir/scripting/devel/chgtdcpass --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` # This is important because it shows that the old ticket is discarded if the server rejects it (as it must) after the password was changed twice in succession. # This also ensures we handle the case where the domain is re-provisioned etc diff --git a/testprogs/blackbox/test_client_etypes.sh b/testprogs/blackbox/test_client_etypes.sh index 98ff73ad6ba..1c2006f22b7 100755 --- a/testprogs/blackbox/test_client_etypes.sh +++ b/testprogs/blackbox/test_client_etypes.sh @@ -44,7 +44,7 @@ cd $RUNDIR failed=0 -net_tool="$BINDIR/net -s $BASEDIR/$WORKDIR/client.conf --option=security=ads --option=kerberosencryptiontypes=$ETYPE_CONF" +net_tool="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=security=ads --option=kerberosencryptiontypes=$ETYPE_CONF" pcap_file=$BASEDIR/$WORKDIR/test.pcap export SOCKET_WRAPPER_PCAP_FILE=$pcap_file diff --git a/testprogs/blackbox/test_net_ads.sh b/testprogs/blackbox/test_net_ads.sh index e07edf4a147..c63382c60c7 100755 --- a/testprogs/blackbox/test_net_ads.sh +++ b/testprogs/blackbox/test_net_ads.sh @@ -24,7 +24,7 @@ cd $RUNDIR failed=0 -net_tool="$BINDIR/net -s $BASEDIR/$WORKDIR/client.conf --option=security=ads" +net_tool="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=security=ads" ldbsearch="ldbsearch" if [ -x "$BINDIR/ldbsearch" ]; then diff --git a/testprogs/blackbox/test_net_ads_fips.sh b/testprogs/blackbox/test_net_ads_fips.sh index 6364f9dcd94..4e2c1fda22f 100755 --- a/testprogs/blackbox/test_net_ads_fips.sh +++ b/testprogs/blackbox/test_net_ads_fips.sh @@ -24,7 +24,7 @@ cd $RUNDIR failed=0 -net_tool="$BINDIR/net -s $BASEDIR/$WORKDIR/client.conf --option=security=ads" +net_tool="$BINDIR/net --configfile=$BASEDIR/$WORKDIR/client.conf --option=security=ads" # Load test functions . `dirname $0`/subunit.sh diff --git a/testprogs/blackbox/test_pdbtest.sh b/testprogs/blackbox/test_pdbtest.sh index 28bb02b4d1e..43852b3aabe 100755 --- a/testprogs/blackbox/test_pdbtest.sh +++ b/testprogs/blackbox/test_pdbtest.sh @@ -70,12 +70,12 @@ expect retype new password: send ${NEWUSERPASS}\n EOF -testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit -s $SMB_CONF -a $USER --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1` +testit "create user with pdbedit" $texpect $PREFIX/tmpsmbpasswdscript $VALGRIND $pdbedit --configfile=$SMB_CONF -a $USER --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS $@ || failed=`expr $failed + 1` -testit "modify user" $VALGRIND $pdbedit -s $SMB_CONF --modify $USER --drive="D:" $@ || failed=`expr $failed + 1` +testit "modify user" $VALGRIND $pdbedit --configfile=$SMB_CONF --modify $USER --drive="D:" $@ || failed=`expr $failed + 1` test_smbclient "Test login with user (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPASS $@|| failed=`expr $failed + 1` @@ -108,11 +108,11 @@ test_smbclient "Test login with no expiry (ntlm)" 'ls' "$unc" -U$USER%$NEWUSERPA NEWUSERPASS=testPaSS@03% NEWUSERHASH=062519096c45739c1938800f80906731 -testit "Set user password with password hash" $VALGRIND $pdbedit -s $SMB_CONF -u $USER --set-nt-hash $NEWUSERHASH $@ || failed=`expr $failed + 1` +testit "Set user password with password hash" $VALGRIND $pdbedit --configfile=$SMB_CONF -u $USER --set-nt-hash $NEWUSERHASH $@ || failed=`expr $failed + 1` test_smbclient "Test login with new password (from hash)" 'ls' "$unc" -U$USER%$NEWUSERPASS || failed=`expr $failed + 1` -testit "del user" $VALGRIND $pdbedit -s $SMB_CONF -x $USER $@ || failed=`expr $failed + 1` +testit "del user" $VALGRIND $pdbedit --configfile=$SMB_CONF -x $USER $@ || failed=`expr $failed + 1` rm $PREFIX/tmpsmbpasswdscript diff --git a/testprogs/blackbox/test_samba-tool_ntacl.sh b/testprogs/blackbox/test_samba-tool_ntacl.sh index 6bee9344c5a..698eff8b8d2 100755 --- a/testprogs/blackbox/test_samba-tool_ntacl.sh +++ b/testprogs/blackbox/test_samba-tool_ntacl.sh @@ -50,7 +50,7 @@ test_get_acl_ntvfs() testfile="$1" exptextedacl="$2" - retacl=$($PYTHON $samba_tool ntacl get "$testfile" --as-sddl --use-ntvfs --xattr-backend=tdb -s $PREFIX/ad_member/lib/server.conf) || return $? + retacl=$($PYTHON $samba_tool ntacl get "$testfile" --as-sddl --use-ntvfs --xattr-backend=tdb --configfile=$PREFIX/ad_member/lib/server.conf) || return $? test "$retacl" = "$exptextedacl" } @@ -60,7 +60,7 @@ test_set_acl_ntvfs() testfile="$1" acl="$2" - $PYTHON $samba_tool ntacl set "$acl" "$testfile" --use-ntvfs --xattr-backend=tdb -s $PREFIX/ad_member/lib/server.conf + $PYTHON $samba_tool ntacl set "$acl" "$testfile" --use-ntvfs --xattr-backend=tdb --configfile=$PREFIX/ad_member/lib/server.conf } test_changedomsid() @@ -70,13 +70,13 @@ test_changedomsid() $PYTHON $samba_tool ntacl changedomsid \ "$domain_sid" "$new_domain_sid" "$testfile" \ --service=tmp \ - -s $PREFIX/ad_member/lib/server.conf + --configfile=$PREFIX/ad_member/lib/server.conf retacl=$($PYTHON $samba_tool ntacl get \ "$testfile" \ --as-sddl \ --service=tmp \ - -s $PREFIX/ad_member/lib/server.conf) || return $? + --configfile=$PREFIX/ad_member/lib/server.conf) || return $? test "$retacl" = "$new_acl" } @@ -89,14 +89,14 @@ test_changedomsid_ntvfs() "$domain_sid" "$new_domain_sid" "$testfile" \ --use-ntvfs \ --xattr-backend=tdb \ - -s $PREFIX/ad_member/lib/server.conf + --configfile=$PREFIX/ad_member/lib/server.conf retacl=$($PYTHON $samba_tool ntacl get \ "$testfile" \ --as-sddl \ --xattr-backend=tdb \ --use-ntvfs \ - -s $PREFIX/ad_member/lib/server.conf) || return $? + --configfile=$PREFIX/ad_member/lib/server.conf) || return $? test "$retacl" = "$new_acl" } diff --git a/testprogs/blackbox/test_samba_upgradedns.sh b/testprogs/blackbox/test_samba_upgradedns.sh index ab3dc269e94..d3ac52522b7 100755 --- a/testprogs/blackbox/test_samba_upgradedns.sh +++ b/testprogs/blackbox/test_samba_upgradedns.sh @@ -27,15 +27,15 @@ fi . `dirname $0`/subunit.sh -testit "run samba_upgradedns converting to bind9 DLZ" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "run samba_upgradedns converting to bind9 DLZ" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` -testit "run samba_upgradedns converting to internal" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=SAMBA_INTERNAL -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "run samba_upgradedns converting to internal" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=SAMBA_INTERNAL --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` -testit "run samba_upgradedns converting to internal (2nd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=SAMBA_INTERNAL -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "run samba_upgradedns converting to internal (2nd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=SAMBA_INTERNAL --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` -testit "run samba_upgradedns converting to bind9 DLZ (2nd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "run samba_upgradedns converting to bind9 DLZ (2nd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` -testit "run samba_upgradedns converting to bind9 DLZ (3rd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ -s $PROVDIR/etc/smb.conf || failed=`expr $failed + 1` +testit "run samba_upgradedns converting to bind9 DLZ (3rd time)" $PYTHON $samba4srcdir/scripting/bin/samba_upgradedns --dns-backend=BIND9_DLZ --configfile=$PROVDIR/etc/smb.conf || failed=`expr $failed + 1` exit $failed diff --git a/testprogs/blackbox/upgradeprovision-oldrelease.sh b/testprogs/blackbox/upgradeprovision-oldrelease.sh index 5b095fca05e..b02aef9f91f 100755 --- a/testprogs/blackbox/upgradeprovision-oldrelease.sh +++ b/testprogs/blackbox/upgradeprovision-oldrelease.sh @@ -156,7 +156,7 @@ dbcheck_full_clean_well_known_acls() { upgradeprovision() { # bring the really old Samba schema in line with a more recent 2008R2 schema - $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX_ABS/${RELEASE}_upgrade/etc/smb.conf" --debugchange + $PYTHON $BINDIR/samba_upgradeprovision --configfile="$PREFIX_ABS/${RELEASE}_upgrade/etc/smb.conf" --debugchange # on top of this, also apply 2008R2 changes we accidentally missed in the past $PYTHON $BINDIR/samba-tool domain schemaupgrade -H tdb://$PREFIX_ABS/${RELEASE}_upgrade/private/sam.ldb --ldf-file=samba-4.7-missing-for-schema45.ldif,fix-forest-rev.ldf @@ -169,11 +169,11 @@ upgradeprovision_full() { # add missing domain prep for 2008R2 $PYTHON $BINDIR/samba-tool domain functionalprep -H tdb://$PREFIX_ABS/${RELEASE}_upgrade_full/private/sam.ldb --domain --function-level 2008_R2 - $PYTHON $BINDIR/samba_upgradeprovision -s "$PREFIX_ABS/${RELEASE}_upgrade_full/etc/smb.conf" --full --debugchange + $PYTHON $BINDIR/samba_upgradeprovision --configfile="$PREFIX_ABS/${RELEASE}_upgrade_full/etc/smb.conf" --full --debugchange } samba_upgradedns() { - $PYTHON $BINDIR/samba_upgradedns --dns-backend=SAMBA_INTERNAL -s "$PREFIX_ABS/${RELEASE}_upgrade_full/etc/smb.conf" + $PYTHON $BINDIR/samba_upgradedns --dns-backend=SAMBA_INTERNAL --configfile="$PREFIX_ABS/${RELEASE}_upgrade_full/etc/smb.conf" } referenceprovision() {