From: Tim Beale Date: Mon, 4 Feb 2019 23:23:43 +0000 (+1300) Subject: selftest: Change backup/restore testenvs to use 1 prefork child X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=22c016b12142e675c5b8ef0ea1f450385f555268 selftest: Change backup/restore testenvs to use 1 prefork child Recently the gitlab CI jobs were hitting memory resource limits and using swap, which then caused test failures. The process model used in the testenvs seemed to be contributing to this problem. We can reduce the memory overhead of the restore/backup testenvs by using 1 prefork child process instead of the default of 4 (kudos to Garming for the idea). The tests run against these testenvs are basic sanity-checks, rather than heavy-duty stress tests, so the number of prefork workers shouldn't matter. This is a bit of a tradeoff between testing the defaults that will actually be used in production vs using limited resources efficiently on shared CI runner machines. Signed-off-by: Tim Beale Reviewed-by: Andrew Bartlett --- diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index c0f557999ebf..647e1f14467f 100755 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -3081,7 +3081,8 @@ sub setup_restoredc # we arbitrarily designate the restored DC as having SMBv1 disabled my $extra_conf = " server min protocol = SMB2 - client min protocol = SMB2"; + client min protocol = SMB2 + prefork children = 1"; my ($env, $ctx) = $self->prepare_dc_testenv($prefix, "restoredc", $dcvars->{DOMAIN}, @@ -3124,11 +3125,12 @@ sub setup_renamedc # note: dcvars contains the env info for the dependent testenv ('backupfromdc') my ($self, $prefix, $dcvars) = @_; print "Preparing RENAME DC...\n"; + my $extra_conf = "prefork children = 1"; my $realm = "renamedom.samba.example.com"; my ($env, $ctx) = $self->prepare_dc_testenv($prefix, "renamedc", "RENAMEDOMAIN", $realm, - $dcvars->{PASSWORD}, ""); + $dcvars->{PASSWORD}, $extra_conf); # create a backup of the 'backupfromdc' which renames the domain my $backupdir = File::Temp->newdir(); @@ -3171,11 +3173,12 @@ sub setup_offlinebackupdc # note: dcvars contains the env info for the dependent testenv ('backupfromdc') my ($self, $prefix, $dcvars) = @_; print "Preparing OFFLINE BACKUP DC...\n"; + my $extra_conf = "prefork children = 1"; my ($env, $ctx) = $self->prepare_dc_testenv($prefix, "offlinebackupdc", $dcvars->{DOMAIN}, $dcvars->{REALM}, - $dcvars->{PASSWORD}, ""); + $dcvars->{PASSWORD}, $extra_conf); # create an offline backup of the 'backupfromdc' target my $backupdir = File::Temp->newdir(); @@ -3215,11 +3218,12 @@ sub setup_labdc # note: dcvars contains the env info for the dependent testenv ('backupfromdc') my ($self, $prefix, $dcvars) = @_; print "Preparing LAB-DOMAIN DC...\n"; + my $extra_conf = "prefork children = 1"; my ($env, $ctx) = $self->prepare_dc_testenv($prefix, "labdc", "LABDOMAIN", "labdom.samba.example.com", - $dcvars->{PASSWORD}, ""); + $dcvars->{PASSWORD}, $extra_conf); # create a backup of the 'backupfromdc' which renames the domain and uses # the --no-secrets option to scrub any sensitive info