selftest: Allow provision_ad_dc() to take functional_level as an argument
authorAndrew Bartlett <abartlet@samba.org>
Wed, 10 May 2023 22:38:20 +0000 (10:38 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 16 May 2023 23:29:32 +0000 (23:29 +0000)
The $$$$$$$ is removed as it does not do what you think it does.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
selftest/target/Samba4.pm

index bb060503fdb9ccc53c54c56472ef2cfa6ebfff3b..8f301cae9984db2d8abdc4b09826c7f337c2b08c 100755 (executable)
@@ -1969,7 +1969,7 @@ sub read_config_h($)
        return \%ret;
 }
 
-sub provision_ad_dc($$$$$$$)
+sub provision_ad_dc()
 {
        my ($self,
            $prefix,
@@ -1978,7 +1978,8 @@ sub provision_ad_dc($$$$$$$)
            $realm,
            $force_fips_mode,
            $smbconf_args,
-           $extra_provision_options) = @_;
+           $extra_provision_options,
+           $functional_level) = @_;
 
        my $prefix_abs = abs_path($prefix);
 
@@ -1993,6 +1994,10 @@ sub provision_ad_dc($$$$$$$)
 
        my $config_h = {};
 
+       if (!defined($functional_level)) {
+               $functional_level = "2008";
+       }
+
        if (defined($ENV{CONFIG_H})) {
                $config_h = read_config_h($ENV{CONFIG_H});
        }
@@ -2142,7 +2147,7 @@ sub provision_ad_dc($$$$$$$)
                                   $hostname,
                                   $domain,
                                   $realm,
-                                  "2008",
+                                  $functional_level,
                                   "locDCpass1",
                                   undef,
                                   undef,
@@ -2714,7 +2719,7 @@ sub setup_rodc
 
 sub _setup_ad_dc
 {
-       my ($self, $path, $conf_opts, $server, $dom) = @_;
+       my ($self, $path, $conf_opts, $server, $dom, $functional_level) = @_;
 
        # If we didn't build with ADS, pretend this env was never available
        if (not $self->{target3}->have_ads()) {
@@ -2734,7 +2739,8 @@ sub _setup_ad_dc
                                         $dom,
                                         undef,
                                         $conf_opts,
-                                        undef);
+                                        undef,
+                                        $functional_level);
        unless ($env) {
                return undef;
        }