From d0b5e216b0732a95c0fee3e04659ee7d3792baf6 Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Fri, 31 Aug 2018 12:44:09 +0200 Subject: selftest: Create included files during provision Files included from smb.conf have to exists, otherwise python fails to load the configuration. Found while trying to run a python test before samba3.blackbox.smbd_error creates the included file. Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Andrew Bartlett --- selftest/target/Samba3.pm | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'selftest') diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 63c24377e96..a86a37aa8f0 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1645,6 +1645,8 @@ sub provision($$$$$$$$$) my $conffile="$libdir/server.conf"; my $dfqconffile="$libdir/dfq.conf"; + my $errorinjectconf="$libdir/error_inject.conf"; + my $delayinjectconf="$libdir/delay_inject.conf"; my $nss_wrapper_pl = "$ENV{PERL} $self->{srcdir}/third_party/nss_wrapper/nss_wrapper.pl"; my $nss_wrapper_passwd = "$privatedir/passwd"; @@ -2270,7 +2272,7 @@ sub provision($$$$$$$$$) [error_inject] copy = tmp vfs objects = error_inject - include = $libdir/error_inject.conf + include = $errorinjectconf [delay_inject] copy = tmp @@ -2278,7 +2280,7 @@ sub provision($$$$$$$$$) kernel share modes = no kernel oplocks = no posix locking = no - include = $libdir/delay_inject.conf + include = $delayinjectconf [aio_delay_inject] copy = tmp @@ -2302,6 +2304,18 @@ sub provision($$$$$$$$$) return undef; } + unless (open(ERRORCONF, ">$errorinjectconf")) { + warn("Unable to open $errorinjectconf"); + return undef; + } + close(ERRORCONF); + + unless (open(DELAYCONF, ">$delayinjectconf")) { + warn("Unable to open $delayinjectconf"); + return undef; + } + close(DELAYCONF); + unless (open(DFQCONF, ">$dfqconffile")) { warn("Unable to open $dfqconffile"); return undef; -- cgit v1.2.1