summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklós Fazekas <mfazekas@szemafor.com>2021-08-04 09:24:56 +0200
committerMiklós Fazekas <mfazekas@szemafor.com>2021-08-04 09:24:56 +0200
commita6b00bb2d054ce821d70180940e2901e8655f2f4 (patch)
treec3913a783501ba2a2247c0747c7916cb7b6b6a92
parent1ada3e8ab87f6b1c6261dae5ba394c421e2747a1 (diff)
downloadnet-ssh-mfazekas/gh-actions-int-test.tar.gz
-rw-r--r--test/integration/common.rb1
-rw-r--r--test/integration/test_forward.rb16
-rw-r--r--test/integration/test_proxy.rb2
3 files changed, 9 insertions, 10 deletions
diff --git a/test/integration/common.rb b/test/integration/common.rb
index 684726a..73eadf8 100644
--- a/test/integration/common.rb
+++ b/test/integration/common.rb
@@ -113,6 +113,7 @@ 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 port_open?(port)
+
pid = spawn('sudo', '/opt/net-ssh-openssh/sbin/sshd', '-D', '-f', path, '-p', port) # '-E', "#{path}-log.txt")
sshpidfile = pidpath
yield pid, port
diff --git a/test/integration/test_forward.rb b/test/integration/test_forward.rb
index 1e08430..e7c87da 100644
--- a/test/integration/test_forward.rb
+++ b/test/integration/test_forward.rb
@@ -434,15 +434,13 @@ class TestForward < ForwardTestBase
remote_port = got_remote_port.pop
puts "Remote port:#{remote_port}"
Thread.start do
- begin
- client = TCPSocket.new(localhost, remote_port)
- data = client.read(4096)
- client.close
- client_done << data
- puts "Received: #{data}"
- rescue StandardError
- client_done << $!
- end
+ client = TCPSocket.new(localhost, remote_port)
+ data = client.read(4096)
+ client.close
+ client_done << data
+ puts "Received: #{data}"
+ rescue StandardError
+ client_done << $!
end
Timeout.timeout(5) do
session.loop(0.1) { client_done.empty? }
diff --git a/test/integration/test_proxy.rb b/test/integration/test_proxy.rb
index 89a0ee1..f1419f8 100644
--- a/test/integration/test_proxy.rb
+++ b/test/integration/test_proxy.rb
@@ -99,7 +99,7 @@ class TestProxy < NetSSHTest
ok = Net::SSH.start(*ssh_start_params(proxy: proxy)) do |ssh|
with_spurious_write_wakeup_emulate do
ret = ssh.exec! "echo \"$USER:#{large_msg}\""
- assert_match /\/bin\/.*sh: Argument list too long\n/, ret
+ assert_match(%r{/bin/.*sh: Argument list too long\n}, ret)
hello_count = 1000
ret = ssh.exec! "ruby -e 'puts \"Hello\"*#{hello_count}'"
assert_equal "Hello" * hello_count + "\n", ret