1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

selftest: Specify --use-ntvfs to provision in test scripts

Because these run as non-root, we need to avoid doing things that will
fail during the provision.  The main test of the s3fs provision is the
plugin_s4_dc environment with a smb.conf that specifies vfs_fake_acls.

Andrew Bartlett
This commit is contained in:
Andrew Bartlett 2012-08-21 20:04:16 +10:00
parent 97b13799ce
commit 9170f9ce95
5 changed files with 35 additions and 33 deletions

View File

@ -420,11 +420,11 @@ Wfz/8alZ5aMezCQzXJyIaJsCLeKABosSwHcpAFmxlQ==
EOF
}
sub provision_raw_prepare($$$$$$$$$)
sub provision_raw_prepare($$$$$$$$$$)
{
my ($self, $prefix, $server_role, $hostname,
$domain, $realm, $functional_level,
$password, $kdc_ipv4) = @_;
$password, $kdc_ipv4, $use_ntvfs) = @_;
my $ctx;
my $netbiosname = uc($hostname);
@ -534,7 +534,9 @@ sub provision_raw_prepare($$$$$$$$$)
push (@provision_options, "--server-role=\"$ctx->{server_role}\"");
push (@provision_options, "--function-level=\"$ctx->{functional_level}\"");
push (@provision_options, "--dns-backend=BIND9_DLZ");
push (@provision_options, "--use-ntvfs");
if ($use_ntvfs) {
push (@provision_options, "--use-ntvfs");
}
@{$ctx->{provision_options}} = @provision_options;
@ -698,16 +700,16 @@ sub provision_raw_step2($$$)
return $ret;
}
sub provision($$$$$$$$)
sub provision($$$$$$$$$)
{
my ($self, $prefix, $server_role, $hostname,
$domain, $realm, $functional_level,
$password, $kdc_ipv4, $extra_smbconf_options, $extra_smbconf_shares) = @_;
$password, $kdc_ipv4, $extra_smbconf_options, $extra_smbconf_shares, $use_ntvfs) = @_;
my $ctx = $self->provision_raw_prepare($prefix, $server_role,
$hostname,
$domain, $realm, $functional_level,
$password, $kdc_ipv4);
$password, $kdc_ipv4, $use_ntvfs);
$ctx->{share} = "$ctx->{prefix_abs}/share";
push(@{$ctx->{directories}}, "$ctx->{share}");
@ -841,7 +843,7 @@ sub provision_member($$$)
"2008",
"locMEMpass3",
$dcvars->{SERVER_IP},
"", "");
"", "", 1);
unless ($ret) {
return undef;
}
@ -906,7 +908,7 @@ sub provision_rpc_proxy($$$)
"2008",
"locRPCproxypass4",
$dcvars->{SERVER_IP},
$extra_smbconf_options, "");
$extra_smbconf_options, "", 1);
unless ($ret) {
return undef;
@ -978,7 +980,7 @@ sub provision_promoted_vampire_dc($$$)
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
$dcvars->{SERVER_IP});
$dcvars->{SERVER_IP}, 1);
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
@ -1050,7 +1052,7 @@ sub provision_vampire_dc($$$)
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
$dcvars->{SERVER_IP});
$dcvars->{SERVER_IP}, 1);
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
@ -1109,7 +1111,7 @@ sub provision_subdom_dc($$$)
"sub.samba.example.com",
"2008",
$dcvars->{PASSWORD},
undef);
undef, 1);
$ctx->{smb_conf_extra_options} = "
max xmit = 32K
@ -1174,7 +1176,7 @@ allow dns updates = True";
"samba.example.com",
"2008",
"locDCpass1",
undef, $extra_conf_options, "");
undef, $extra_conf_options, "", 1);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {
@ -1203,7 +1205,7 @@ sub provision_fl2000dc($$)
"samba2000.example.com",
"2000",
"locDCpass5",
undef, "");
undef, "", 1);
unless($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
@ -1225,7 +1227,7 @@ sub provision_fl2003dc($$)
"samba2003.example.com",
"2003",
"locDCpass6",
undef, "", "");
undef, "", "", 1);
unless($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
@ -1247,7 +1249,7 @@ sub provision_fl2008r2dc($$)
"samba2008R2.example.com",
"2008_R2",
"locDCpass7",
undef, "", "");
undef, "", "", 1);
unless ($self->add_wins_config("$prefix/private")) {
warn("Unable to add wins configuration");
@ -1270,7 +1272,7 @@ sub provision_rodc($$$)
"samba.example.com",
"2008",
$dcvars->{PASSWORD},
$dcvars->{SERVER_IP});
$dcvars->{SERVER_IP}, 1);
unless ($ctx) {
return undef;
}
@ -1411,7 +1413,7 @@ sub provision_plugin_s4_dc($$)
"2008",
"locDCpass1",
undef, $extra_smbconf_options,
$extra_smbconf_shares);
$extra_smbconf_shares, 0);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {
@ -1440,7 +1442,7 @@ sub provision_chgdcpass($$)
"chgdcpassword.samba.example.com",
"2008",
"chgDCpass1",
undef);
undef, 1);
return undef unless(defined $ret);
unless($self->add_wins_config("$prefix/private")) {

View File

@ -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
testit "simple-default" $PYTHON $SRCDIR/source4/setup/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
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
#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
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
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
testit "simple-member" $PYTHON $SRCDIR/source4/setup/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
testit "simple-standalone" $PYTHON $SRCDIR/source4/setup/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
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
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
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
reprovision() {
rm -rf $PREFIX/reprovision
$PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/reprovision"
$PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$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
}
testit "reprovision" reprovision

View File

@ -39,7 +39,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb1.conf <<EOF
debug level = 0
EOF
testit "samba3-upgrade-member" $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb1.conf --targetdir=$PREFIX/samba3-upgrade/s4_1 --dbdir=$PREFIX/samba3-upgrade/samba3
testit "samba3-upgrade-member" $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
# Test 2 (s3 dc)
@ -63,7 +63,7 @@ EOF
mv $PREFIX/samba3-upgrade/samba3/wins.dat2 $PREFIX/samba3-upgrade/samba3/wins.dat
testit "samba3-upgrade-dc" $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_2 --dbdir=$PREFIX/samba3-upgrade/samba3
testit "samba3-upgrade-dc" $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_2 --dbdir=$PREFIX/samba3-upgrade/samba3 --use-ntvfs
NT4-like domains in samba3upgrade
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
@ -90,7 +90,7 @@ cat - > $PREFIX/samba3-upgrade/samba3/smb3.conf <<EOF
domain logons = yes
EOF
testit "samba3-upgrade-testparm" $samba_tool domain classicupgrade $PREFIX/samba3-upgrade/samba3/smb2.conf --targetdir=$PREFIX/samba3-upgrade/s4_3 --testparm=$testparm
testit "samba3-upgrade-testparm" $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

View File

@ -15,7 +15,7 @@ shift 1
samba_tool="./bin/samba-tool"
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
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 "user add" $samba_tool user create --configfile=$PREFIX/simple-dc/etc/smb.conf testuser testp@ssw0Rd

View File

@ -18,7 +18,7 @@ upgradeprovision() {
if [ -d $PREFIX/upgradeprovision ]; then
rm -fr $PREFIX/upgradeprovision
fi
$PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision" --server-role="dc"
$PYTHON $SRCDIR/source4/setup/provision --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision" --server-role="dc" --use-ntvfs
$PYTHON $SRCDIR/source4/scripting/bin/upgradeprovision -s "$PREFIX/upgradeprovision/etc/smb.conf" --debugchange
}
@ -26,7 +26,7 @@ upgradeprovision_full() {
if [ -d $PREFIX/upgradeprovision_full ]; then
rm -fr $PREFIX/upgradeprovision_full
fi
$PYTHON $SRCDIR/source4/setup/provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision_full" --server-role="dc"
$PYTHON $SRCDIR/source4/setup/provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/upgradeprovision_full" --server-role="dc" --use-ntvfs
$PYTHON $SRCDIR/source4/scripting/bin/upgradeprovision -s "$PREFIX/upgradeprovision_full/etc/smb.conf" --full --debugchange
}