diff options
author | Tim Beale <timbeale@catalyst.net.nz> | 2018-09-18 16:30:15 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-09-26 07:49:17 +0200 |
commit | 696fa6a1e6c615a992a3016ff32405b864b62eec (patch) | |
tree | c2c75ac18c13b2f342104891e150d5696dd9fa1e /selftest/target | |
parent | ce57a800c9bed7e6876cdc0baf3a2d5fdc879ecf (diff) | |
download | samba-696fa6a1e6c615a992a3016ff32405b864b62eec.tar.gz |
selftest: Change backup testenvs to use non-default site
Previously (i.e. up until the last patch) the backup/restore commands
only worked if the Default-First-Site-Name site was present. If this
site didn't exist, then the various restore testenvs would fail to
start. This is now fixed, but this patch changes the backupfrom testenv
so that it uses a non-default site. This will detect the problem if it
is ever re-introduced.
To do this we need to change provision_ad_dc() so the
extra_provision_options can be specified as an argument. (Note that Perl
treats undef the same as an empty array).
By default, the restore will add the new DC into the
Default-First-Site-Name site. This means the backupfromdc and restored
testenvs will now have different sites, so we need to update the ldapcmp
filters to exclude site-specific attributes.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13621
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest/target')
-rwxr-xr-x | selftest/target/Samba4.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 68038fb5183..dc25e1371f2 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -1861,7 +1861,8 @@ sub read_config_h($) sub provision_ad_dc($$$$$$) { - my ($self, $prefix, $hostname, $domain, $realm, $smbconf_args) = @_; + my ($self, $prefix, $hostname, $domain, $realm, $smbconf_args, + $extra_provision_options) = @_; my $prefix_abs = abs_path($prefix); @@ -1972,7 +1973,6 @@ sub provision_ad_dc($$$$$$) copy = print1 "; - my $extra_provision_options = undef; push (@{$extra_provision_options}, "--backend-store=mdb"); print "PROVISIONING AD DC...\n"; my $ret = $self->provision($prefix, @@ -2538,7 +2538,7 @@ sub setup_ad_dc } my $env = $self->provision_ad_dc($path, "addc", "ADDOMAIN", - "addom.samba.example.com", ""); + "addom.samba.example.com", "", undef); unless ($env) { return undef; } @@ -2565,7 +2565,7 @@ sub setup_ad_dc_no_nss } my $env = $self->provision_ad_dc($path, "addc_no_nss", "ADNONSSDOMAIN", - "adnonssdom.samba.example.com", ""); + "adnonssdom.samba.example.com", "", undef); unless ($env) { return undef; } @@ -2596,7 +2596,7 @@ sub setup_ad_dc_no_ntlm my $env = $self->provision_ad_dc($path, "addc_no_ntlm", "ADNONTLMDOMAIN", "adnontlmdom.samba.example.com", - "ntlm auth = disabled"); + "ntlm auth = disabled", undef); unless ($env) { return undef; } @@ -2627,8 +2627,11 @@ sub setup_backupfromdc return "UNKNOWN"; } + my $provision_args = ["--site=Backup-Site"]; + my $env = $self->provision_ad_dc($path, "backupfromdc", "BACKUPDOMAIN", - "backupdom.samba.example.com", ""); + "backupdom.samba.example.com", "", + $provision_args); unless ($env) { return undef; } |