diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-03-02 18:01:13 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-03-02 12:30:05 +0100 |
commit | 0d94d681c4a829b2a0bdadf5800c11c05edd2fa4 (patch) | |
tree | 9aa3a32382dce5166c613b1424258173b86453b1 | |
parent | 6c1c092f079492d359437c76eb5319a0bf20f013 (diff) | |
download | samba-0d94d681c4a829b2a0bdadf5800c11c05edd2fa4.tar.gz samba-0d94d681c4a829b2a0bdadf5800c11c05edd2fa4.tar.bz2 samba-0d94d681c4a829b2a0bdadf5800c11c05edd2fa4.zip |
selftest: Put stdin pipe on the environment
This seems to help us close the right pipe at cleanup time.
Andrew Bartlett
-rw-r--r-- | selftest/target/Samba4.pm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm index 12c7e0a905..361152b928 100644 --- a/selftest/target/Samba4.pm +++ b/selftest/target/Samba4.pm @@ -158,7 +158,7 @@ sub check_or_start($$$) } print "DONE\n"; - open(DATA, ">$env_vars->{SAMBA_TEST_FIFO}"); + open($env_vars->{STDIN_PIPE}, ">$env_vars->{SAMBA_TEST_FIFO}"); return $pid; } @@ -1354,20 +1354,19 @@ sub teardown_env($$) my ($self, $envvars) = @_; my $pid; - close(DATA); + # This should cause samba to terminate gracefully + close($envvars->{STDIN_PIPE}); if (open(IN, "<$envvars->{PIDDIR}/samba.pid")) { $pid = <IN>; close(IN); - - # Give the process 20 seconds to exit. gcov needs - # this time to write out the covarge data my $count = 0; + until (kill(0, $pid) == 0) { - # if no process sucessfully signalled, then we are done - sleep(1); - $count++; - last if $count > 20; + # This should give it time to write out the gcov data + sleep(1); + $count++; + last if $count > 20; } # If it is still around, kill it |