[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Wed Jan 29 11:07:02 UTC 2020


The branch, master has been updated
       via  3f0e0ee274f selftest: Exit skipped daemons on close(STDIN)
       via  5bc5b681c03 selftest: Close STDIN_PIPE's write end for skipped daemons
      from  2d5b7c9a50d lib: asn1.c: Prevent ASN1_ENUMERATED from wrapping.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3f0e0ee274fd6a64b67970c2b3c8dbe64ccb7781
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 28 14:46:09 2020 +0100

    selftest: Exit skipped daemons on close(STDIN)
    
    Without this, teardown_env() will take ages for environments with
    skipped daemons
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Wed Jan 29 11:06:53 UTC 2020 on sn-devel-184

commit 5bc5b681c037ed1e8e119b7c062ab397bafb9571
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 28 14:41:11 2020 +0100

    selftest: Close STDIN_PIPE's write end for skipped daemons
    
    Without this, any environment that skips any daemon will not shut down
    properly. If a copy of a pipe's write end remains, closing one of them
    won't cause the read end to be readable, i.e. the daemons waiting for
    that won't exit properly.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 selftest/target/Samba.pm | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba.pm b/selftest/target/Samba.pm
index 9319f301327..a908a7ade7c 100644
--- a/selftest/target/Samba.pm
+++ b/selftest/target/Samba.pm
@@ -10,6 +10,7 @@ use target::Samba3;
 use target::Samba4;
 use POSIX;
 use Cwd qw(abs_path);
+use IO::Poll qw(POLLIN);
 
 sub new($$$$$) {
 	my ($classname, $bindir, $srcdir, $server_maxtime) = @_;
@@ -664,6 +665,11 @@ sub fork_and_exec
 		set_env_for_process($daemon_ctx->{NAME}, $env_vars,
 				    $daemon_ctx->{ENV_VARS});
 
+		# we close the child's write-end of the pipe and redirect the read-end
+		# to its stdin. That way the daemon will receive an EOF on stdin when
+		# parent selftest process closes its write-end.
+		close($env_vars->{STDIN_PIPE});
+
 		# not all s3 daemons run in all testenvs (e.g. fileserver doesn't
 		# run winbindd). In which case, the child process just sleeps
 		if (defined($daemon_ctx->{SKIP_DAEMON})) {
@@ -672,16 +678,14 @@ sub fork_and_exec
 				print("Skip $daemon_ctx->{NAME} received signal $signame");
 				exit 0;
 			};
-			sleep($self->{server_maxtime});
+			my $poll = IO::Poll->new();
+			$poll->mask($STDIN_READER, POLLIN);
+			$poll->poll($self->{server_maxtime});
 			exit 0;
 		}
 
 		$ENV{MAKE_TEST_BINARY} = $daemon_ctx->{BINARY_PATH};
 
-		# we close the child's write-end of the pipe and redirect the read-end
-		# to its stdin. That way the daemon will receive an EOF on stdin when
-		# parent selftest process closes its write-end.
-		close($env_vars->{STDIN_PIPE});
 		open STDIN, ">&", $STDIN_READER or die "can't dup STDIN_READER to STDIN: $!";
 
 		# if using kernel namespaces, prepend the command so the process runs in


-- 
Samba Shared Repository



More information about the samba-cvs mailing list