diff options
author | Miklós Fazekas <mfazekas@szemafor.com> | 2021-03-12 18:43:22 +0100 |
---|---|---|
committer | Miklós Fazekas <mfazekas@szemafor.com> | 2021-03-12 18:43:22 +0100 |
commit | 1a18e975c43cb36da31431d498463899d91da656 (patch) | |
tree | 137458b57ca19b7ffc6220d75a565c731c4588eb | |
parent | b617edaf67f49ef28d3c8d7608cc1bfa268be400 (diff) | |
download | net-ssh-1a18e975c43cb36da31431d498463899d91da656.tar.gz |
Fixed more opensshd kill
-rw-r--r-- | test/integration/common.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/integration/common.rb b/test/integration/common.rb index 9ccdedd..add77ff 100644 --- a/test/integration/common.rb +++ b/test/integration/common.rb @@ -110,13 +110,16 @@ module IntegrationTestHelpers with_lines_as_tempfile(config) do |path, pidpath| # puts "DEBUG - SSH LOG: #{path}-log.txt" raise "A leftover sshd is already running" if is_port_open?(port) - pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-f', path, '-p', port, '-E', "#{path}-log.txt") + pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-f', path, '-p', port) # '-E', "#{path}-log.txt") sshpidfile = pidpath yield pid, port end else - pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-p', port) - yield pid, port + with_lines_as_tempfile('') do |path, pidpath| + pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-f', path, '-p', port) + sshpidfile = pidpath + yield pid, port + end end ensure # Our pid is sudo and not sshd, -9 (KILL) on sudo will not clean up its children |