1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2021-04-14 11:44:51 +02:00 committed by Andrew Bartlett
parent 86f7bc7a37
commit f291b8f157
25 changed files with 93 additions and 81 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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]

View File

@ -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()

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -40,7 +40,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb1.conf <<EOF
EOF
testit "samba3-upgrade-member" $PYTHON $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb1.conf --targetdir=$PREFIX/samba3-upgrade/s4_1 --dbdir=$PREFIX/samba3-upgrade/samba3 --use-ntvfs
testit "samba3-upgrade-member-getlocalsid" $samba_net getlocalsid s3upgrade -s $PREFIX/samba3-upgrade/s4_1/etc/smb.conf
testit "samba3-upgrade-member-getlocalsid" $samba_net getlocalsid s3upgrade --configfile=$PREFIX/samba3-upgrade/s4_1/etc/smb.conf
# Test 2 (s3 dc)
cat - > $PREFIX/samba3-upgrade/samba3/smb2.conf <<EOF
@ -65,8 +65,8 @@ mv $PREFIX/samba3-upgrade/samba3/wins.dat2 $PREFIX/samba3-upgrade/samba3/wins.da
# Upgrade NT4-like domains in samba3upgrade
testit "samba3-upgrade-dc" $PYTHON $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_2 --dbdir=$PREFIX/samba3-upgrade/samba3 --use-ntvfs
testit "samba3-upgrade-dc-getlocalsid" $samba_net getlocalsid samba -s $PREFIX/samba3-upgrade/s4_2/etc/smb.conf
testit "samba3-upgrade-dc-getdomainsid" $samba_net getdomainsid -s $PREFIX/samba3-upgrade/s4_2/etc/smb.conf
testit "samba3-upgrade-dc-getlocalsid" $samba_net getlocalsid samba --configfile=$PREFIX/samba3-upgrade/s4_2/etc/smb.conf
testit "samba3-upgrade-dc-getdomainsid" $samba_net getdomainsid --configfile=$PREFIX/samba3-upgrade/s4_2/etc/smb.conf
#Run final test without a wins.dat
rm -f $PREFIX/samba3-upgrade/samba3/wins.dat
@ -91,8 +91,8 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb3.conf <<EOF
EOF
testit "samba3-upgrade-testparm" $PYTHON $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_3 --testparm=$testparm --use-ntvfs
testit "samba3-upgrade-testparm-getlocalsid" $samba_net getlocalsid samba -s $PREFIX/samba3-upgrade/s4_3/etc/smb.conf
testit "samba3-upgrade-testparm-getdomainsid" $samba_net getdomainsid -s $PREFIX/samba3-upgrade/s4_3/etc/smb.conf
testit "samba3-upgrade-testparm-getlocalsid" $samba_net getlocalsid samba --configfile=$PREFIX/samba3-upgrade/s4_3/etc/smb.conf
testit "samba3-upgrade-testparm-getdomainsid" $samba_net getdomainsid --configfile=$PREFIX/samba3-upgrade/s4_3/etc/smb.conf
rm -rf $PREFIX/samba3-upgrade

View File

@ -56,7 +56,7 @@ start_backup()
OPTS="$OPTS --debug-stderr"
# start samba and capture the debug output
OUTPUT=$($BINDIR/samba -s $DBPATH/etc/smb.conf $OPTS 2>&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

View File

@ -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

View File

@ -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")

View File

@ -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):

View File

@ -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))

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"
}

View File

@ -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

View File

@ -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() {