summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFlorian Wininger <florian@cyberwatch.fr>2021-07-01 22:17:46 +0200
committerFlorian Wininger <florian@cyberwatch.fr>2021-07-01 22:17:46 +0200
commitb11dc6e755bbc03058bb12c623961a0695538fb0 (patch)
tree567f524185abc09ec6bb2a6a593b5a4abb78393d /test
parent093a84100e51365db9680d8ebd0755a4f1ebb455 (diff)
downloadnet-ssh-b11dc6e755bbc03058bb12c623961a0695538fb0.tar.gz
Fix empty line for code clarity
Diffstat (limited to 'test')
-rw-r--r--test/authentication/methods/common.rb2
-rw-r--r--test/authentication/methods/test_abstract.rb1
-rw-r--r--test/authentication/methods/test_hostbased.rb2
-rw-r--r--test/authentication/methods/test_keyboard_interactive.rb2
-rw-r--r--test/authentication/methods/test_none.rb2
-rw-r--r--test/authentication/methods/test_password.rb2
-rw-r--r--test/authentication/methods/test_publickey.rb2
-rw-r--r--test/authentication/test_agent.rb5
-rw-r--r--test/authentication/test_ed25519.rb2
-rw-r--r--test/authentication/test_key_manager.rb2
-rw-r--r--test/authentication/test_session.rb2
-rw-r--r--test/connection/test_channel.rb3
-rw-r--r--test/connection/test_session.rb3
-rw-r--r--test/integration/common.rb4
-rw-r--r--test/integration/test_channel.rb1
-rw-r--r--test/integration/test_proxy.rb1
-rw-r--r--test/manual/test_pageant.rb2
-rw-r--r--test/transport/hmac/test_md5.rb2
-rw-r--r--test/transport/hmac/test_md5_96.rb2
-rw-r--r--test/transport/hmac/test_none.rb2
-rw-r--r--test/transport/hmac/test_ripemd160.rb2
-rw-r--r--test/transport/hmac/test_sha1.rb2
-rw-r--r--test/transport/hmac/test_sha1_96.rb2
-rw-r--r--test/transport/hmac/test_sha2_256.rb1
-rw-r--r--test/transport/hmac/test_sha2_256_96.rb2
-rw-r--r--test/transport/hmac/test_sha2_256_etm.rb1
-rw-r--r--test/transport/hmac/test_sha2_512.rb1
-rw-r--r--test/transport/hmac/test_sha2_512_96.rb2
-rw-r--r--test/transport/hmac/test_sha2_512_etm.rb1
-rw-r--r--test/transport/kex/test_diffie_hellman_group14_sha1.rb1
-rw-r--r--test/transport/kex/test_diffie_hellman_group14_sha256.rb1
-rw-r--r--test/transport/kex/test_diffie_hellman_group1_sha1.rb2
-rw-r--r--test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb3
-rw-r--r--test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb2
-rw-r--r--test/transport/test_algorithms.rb3
-rw-r--r--test/transport/test_cipher_factory.rb2
-rw-r--r--test/transport/test_hmac.rb2
-rw-r--r--test/transport/test_identity_cipher.rb2
-rw-r--r--test/transport/test_packet_stream.rb2
-rw-r--r--test/transport/test_session.rb2
-rw-r--r--test/transport/test_state.rb4
-rw-r--r--test/win_integration/test_pageant.rb3
42 files changed, 18 insertions, 69 deletions
diff --git a/test/authentication/methods/common.rb b/test/authentication/methods/common.rb
index 8cf2ca2..5546e1c 100644
--- a/test/authentication/methods/common.rb
+++ b/test/authentication/methods/common.rb
@@ -1,6 +1,5 @@
module Authentication
module Methods
-
module Common
include Net::SSH::Authentication::Constants
@@ -31,6 +30,5 @@ module Authentication
end
end
-
end
end
diff --git a/test/authentication/methods/test_abstract.rb b/test/authentication/methods/test_abstract.rb
index a839699..4f930a9 100644
--- a/test/authentication/methods/test_abstract.rb
+++ b/test/authentication/methods/test_abstract.rb
@@ -4,7 +4,6 @@ require 'net/ssh/authentication/methods/abstract'
module Authentication
module Methods
-
class TestAbstract < NetSSHTest
include Common
diff --git a/test/authentication/methods/test_hostbased.rb b/test/authentication/methods/test_hostbased.rb
index 4fbd37a..5e4eb0f 100644
--- a/test/authentication/methods/test_hostbased.rb
+++ b/test/authentication/methods/test_hostbased.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestHostbased < NetSSHTest
include Common
@@ -57,6 +56,7 @@ module Authentication
def signature_parameters(key)
Proc.new do |given_key, data|
next false unless given_key.to_blob == key.to_blob
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_string == "abcxyz123" && # session-id
buffer.read_byte == USERAUTH_REQUEST && # type
diff --git a/test/authentication/methods/test_keyboard_interactive.rb b/test/authentication/methods/test_keyboard_interactive.rb
index 9fad914..e18f02c 100644
--- a/test/authentication/methods/test_keyboard_interactive.rb
+++ b/test/authentication/methods/test_keyboard_interactive.rb
@@ -4,7 +4,6 @@ require_relative 'common'
module Authentication
module Methods
-
class TestKeyboardInteractive < NetSSHTest
include Common
@@ -128,6 +127,5 @@ module Authentication
subject(options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_none.rb b/test/authentication/methods/test_none.rb
index 8e31c08..223b33c 100644
--- a/test/authentication/methods/test_none.rb
+++ b/test/authentication/methods/test_none.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestNone < NetSSHTest
include Common
@@ -38,6 +37,5 @@ module Authentication
@subject ||= Net::SSH::Authentication::Methods::None.new(session(options), options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_password.rb b/test/authentication/methods/test_password.rb
index d119fae..a5ddf85 100644
--- a/test/authentication/methods/test_password.rb
+++ b/test/authentication/methods/test_password.rb
@@ -5,7 +5,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestPassword < NetSSHTest
include Common
@@ -93,6 +92,5 @@ module Authentication
@subject ||= Net::SSH::Authentication::Methods::Password.new(session(options), options)
end
end
-
end
end
diff --git a/test/authentication/methods/test_publickey.rb b/test/authentication/methods/test_publickey.rb
index 8f2cc73..4f5765d 100644
--- a/test/authentication/methods/test_publickey.rb
+++ b/test/authentication/methods/test_publickey.rb
@@ -4,7 +4,6 @@ require 'authentication/methods/common'
module Authentication
module Methods
-
class TestPublickey < NetSSHTest
include Common
@@ -110,6 +109,7 @@ module Authentication
def signature_parameters(key)
Proc.new do |given_key, data|
next false unless given_key.to_blob == key.to_blob
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_string == "abcxyz123" && # session-id
buffer.read_byte == USERAUTH_REQUEST && # type
diff --git a/test/authentication/test_agent.rb b/test/authentication/test_agent.rb
index 9dea16e..3b4ef37 100644
--- a/test/authentication/test_agent.rb
+++ b/test/authentication/test_agent.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/agent'
module Authentication
-
class TestAgent < NetSSHTest
SSH2_AGENT_REQUEST_VERSION = 1
SSH2_AGENT_REQUEST_IDENTITIES = 11
@@ -322,6 +321,7 @@ module Authentication
def test_add_ed25519_identity
return unless Net::SSH::Authentication::ED25519Loader::LOADED
+
ed25519 = Net::SSH::Authentication::ED25519::PrivKey.read(ED25519, nil)
socket.expect do |s,type,buffer|
assert_equal SSH2_AGENT_ADD_IDENTITY, type
@@ -339,6 +339,7 @@ module Authentication
def test_add_ed25519_cert_identity
return unless Net::SSH::Authentication::ED25519Loader::LOADED
+
cert = make_cert(Net::SSH::Authentication::ED25519::PrivKey.read(ED25519, nil))
socket.expect do |s,type,buffer|
assert_equal SSH2_AGENT_ADD_IDENTITY, type
@@ -433,6 +434,7 @@ module Authentication
def send(data, flags)
raise "got #{data.inspect} but no packet was expected" unless @expectation
+
buffer = Net::SSH::Buffer.new(data)
buffer.read_long # skip the length
type = buffer.read_byte
@@ -470,5 +472,4 @@ module Authentication
@agent_socket_factory ||= -> {"/foo/bar.sock"}
end
end
-
end
diff --git a/test/authentication/test_ed25519.rb b/test/authentication/test_ed25519.rb
index 7430541..279aa85 100644
--- a/test/authentication/test_ed25519.rb
+++ b/test/authentication/test_ed25519.rb
@@ -6,7 +6,6 @@ unless ENV['NET_SSH_NO_ED25519']
require 'base64'
module Authentication
-
class TestED25519 < NetSSHTest
def setup
raise "No ED25519 set NET_SSH_NO_ED25519 to ignore this test" unless Net::SSH::Authentication::ED25519Loader::LOADED
@@ -158,7 +157,6 @@ unless ENV['NET_SSH_NO_ED25519']
'SHA256:u6mXnY8P1b0FODGp8mckqOB33u8+jvkSCtJbD5Q9klg'
end
end
-
end
end
diff --git a/test/authentication/test_key_manager.rb b/test/authentication/test_key_manager.rb
index c40779f..79900a8 100644
--- a/test/authentication/test_key_manager.rb
+++ b/test/authentication/test_key_manager.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/key_manager'
module Authentication
-
class TestKeyManager < NetSSHTest
def test_key_files_and_known_identities_are_empty_by_default
assert manager.key_files.empty?
@@ -381,5 +380,4 @@ module Authentication
@manager ||= Net::SSH::Authentication::KeyManager.new(nil, { password_prompt: prompt }.merge(options))
end
end
-
end
diff --git a/test/authentication/test_session.rb b/test/authentication/test_session.rb
index db37467..3e46def 100644
--- a/test/authentication/test_session.rb
+++ b/test/authentication/test_session.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/authentication/session'
module Authentication
-
class TestSession < NetSSHTest
include Net::SSH::Transport::Constants
include Net::SSH::Authentication::Constants
@@ -292,5 +291,4 @@ module Authentication
EOF
end
end
-
end
diff --git a/test/connection/test_channel.rb b/test/connection/test_channel.rb
index abda254..75ea309 100644
--- a/test/connection/test_channel.rb
+++ b/test/connection/test_channel.rb
@@ -2,7 +2,6 @@ require 'common'
require 'net/ssh/connection/channel'
module Connection
-
class TestChannel < NetSSHTest
include Net::SSH::Connection::Constants
@@ -457,6 +456,7 @@ module Connection
def send_message(msg)
raise "#{msg.to_s.inspect} received but no message was expected" unless @expectation
+
packet = Net::SSH::Packet.new(msg.to_s)
callback, @expectation = @expectation, nil
callback.call(self, packet)
@@ -483,5 +483,4 @@ module Connection
&block)
end
end
-
end
diff --git a/test/connection/test_session.rb b/test/connection/test_session.rb
index 91e3ea9..47255e4 100644
--- a/test/connection/test_session.rb
+++ b/test/connection/test_session.rb
@@ -2,7 +2,6 @@ require_relative '../common'
require 'net/ssh/connection/session'
module Connection
-
class TestSession < NetSSHTest
include Net::SSH::Connection::Constants
@@ -536,6 +535,7 @@ module Connection
data.each_slice(2) do |type, datum|
next if datum.empty?
+
if type == :stdout
t2.return(CHANNEL_DATA, :long, p[:remote_id], :string, datum)
else
@@ -583,5 +583,4 @@ module Connection
session.process { (i += 1) < n }
end
end
-
end
diff --git a/test/integration/common.rb b/test/integration/common.rb
index e9d2546..ada7cad 100644
--- a/test/integration/common.rb
+++ b/test/integration/common.rb
@@ -64,11 +64,13 @@ module IntegrationTestHelpers
pid, status = Process.wait2 pid
end
raise "Command: #{command} failed:#{status.exitstatus}" unless status
+
status.exitstatus
end
def with_sshd_config(sshd_config, &block)
raise "Failed to copy config" unless system("sudo cp -f /etc/ssh/sshd_config /etc/ssh/sshd_config.original")
+
begin
Tempfile.open('sshd_config') do |f|
f.write(sshd_config)
@@ -77,6 +79,7 @@ module IntegrationTestHelpers
end
system("sudo chmod 0644 /etc/ssh/sshd_config")
raise "Failed to restart sshd" unless system("sudo service ssh restart")
+
yield
ensure
system("sudo cp -f /etc/ssh/sshd_config.original /etc/ssh/sshd_config")
@@ -110,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 is_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_channel.rb b/test/integration/test_channel.rb
index 84c09d4..46f5fd5 100644
--- a/test/integration/test_channel.rb
+++ b/test/integration/test_channel.rb
@@ -34,6 +34,7 @@ class TestChannel < NetSSHTest
ssh.open_channel do |channel|
channel.exec(command) do |_ch, success|
raise "could not execute command: #{command.inspect}" unless success
+
channel_success_handler.call
channel.on_data do |ch2, data|
yield(ch2, :stdout, data)
diff --git a/test/integration/test_proxy.rb b/test/integration/test_proxy.rb
index d73b7ba..64809bb 100644
--- a/test/integration/test_proxy.rb
+++ b/test/integration/test_proxy.rb
@@ -137,6 +137,7 @@ class TestProxy < NetSSHTest
@io
end
end
+
def test_does_close_proxy_on_proxy_failure
setup_ssh_env do
proxy = DbgProxy.new(Net::SSH::Proxy::Command.new('sleep 2 && ssh -W %h:%p -o "PreferredAuthentications none" user@localhost'))
diff --git a/test/manual/test_pageant.rb b/test/manual/test_pageant.rb
index 0f8b591..e9a72da 100644
--- a/test/manual/test_pageant.rb
+++ b/test/manual/test_pageant.rb
@@ -15,7 +15,6 @@ require_relative '../common'
require 'net/ssh/authentication/agent'
module Authentication
-
class TestPageapnt < NetSSHTest
def test_agent_should_be_able_to_negotiate
begin
@@ -37,5 +36,4 @@ module Authentication
end
end
end
-
end
diff --git a/test/transport/hmac/test_md5.rb b/test/transport/hmac/test_md5.rb
index 16ee10f..714eee0 100644
--- a/test/transport/hmac/test_md5.rb
+++ b/test/transport/hmac/test_md5.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/md5'
module Transport
module HMAC
-
class TestMD5 < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::MD5, subject.digest_class
@@ -38,6 +37,5 @@ module Transport
Net::SSH::Transport::HMAC::MD5
end
end
-
end
end
diff --git a/test/transport/hmac/test_md5_96.rb b/test/transport/hmac/test_md5_96.rb
index b45d505..13f4a8a 100644
--- a/test/transport/hmac/test_md5_96.rb
+++ b/test/transport/hmac/test_md5_96.rb
@@ -6,7 +6,6 @@ require 'net/ssh/transport/hmac/md5_96'
module Transport
module HMAC
-
class TestMD5_96 < TestMD5
def test_expected_mac_length
assert_equal 12, subject.mac_length
@@ -24,6 +23,5 @@ module Transport
Net::SSH::Transport::HMAC::MD5_96
end
end
-
end
end
diff --git a/test/transport/hmac/test_none.rb b/test/transport/hmac/test_none.rb
index ae8fe7e..c2661f8 100644
--- a/test/transport/hmac/test_none.rb
+++ b/test/transport/hmac/test_none.rb
@@ -3,7 +3,6 @@ require 'net/ssh/transport/hmac/none'
module Transport
module HMAC
-
class TestNone < NetSSHTest
def test_expected_digest_class
assert_nil subject.digest_class
@@ -31,6 +30,5 @@ module Transport
Net::SSH::Transport::HMAC::None
end
end
-
end
end
diff --git a/test/transport/hmac/test_ripemd160.rb b/test/transport/hmac/test_ripemd160.rb
index bcc14f8..63ebbbd 100644
--- a/test/transport/hmac/test_ripemd160.rb
+++ b/test/transport/hmac/test_ripemd160.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/ripemd160'
module Transport
module HMAC
-
class TestRipemd160 < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::RIPEMD160, subject.digest_class
@@ -33,6 +32,5 @@ module Transport
Net::SSH::Transport::HMAC::RIPEMD160
end
end
-
end
end
diff --git a/test/transport/hmac/test_sha1.rb b/test/transport/hmac/test_sha1.rb
index 468da6d..efb9f4e 100644
--- a/test/transport/hmac/test_sha1.rb
+++ b/test/transport/hmac/test_sha1.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/sha1'
module Transport
module HMAC
-
class TestSHA1 < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::SHA1, subject.digest_class
@@ -33,6 +32,5 @@ module Transport
Net::SSH::Transport::HMAC::SHA1
end
end
-
end
end
diff --git a/test/transport/hmac/test_sha1_96.rb b/test/transport/hmac/test_sha1_96.rb
index 72cb6ca..1dcf0cd 100644
--- a/test/transport/hmac/test_sha1_96.rb
+++ b/test/transport/hmac/test_sha1_96.rb
@@ -6,7 +6,6 @@ require 'net/ssh/transport/hmac/sha1_96'
module Transport
module HMAC
-
class TestSHA1_96 < TestSHA1
def test_expected_mac_length
assert_equal 12, subject.mac_length
@@ -24,6 +23,5 @@ module Transport
Net::SSH::Transport::HMAC::SHA1_96
end
end
-
end
end
diff --git a/test/transport/hmac/test_sha2_256.rb b/test/transport/hmac/test_sha2_256.rb
index 8a2e07d..834967b 100644
--- a/test/transport/hmac/test_sha2_256.rb
+++ b/test/transport/hmac/test_sha2_256.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/sha2_256'
module Transport
module HMAC
-
class TestSHA2_256 < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::SHA256, subject.digest_class
diff --git a/test/transport/hmac/test_sha2_256_96.rb b/test/transport/hmac/test_sha2_256_96.rb
index 07799fe..3a659fc 100644
--- a/test/transport/hmac/test_sha2_256_96.rb
+++ b/test/transport/hmac/test_sha2_256_96.rb
@@ -6,7 +6,6 @@ require 'net/ssh/transport/hmac/sha2_256_96'
module Transport
module HMAC
-
class TestSHA2_256_96 < TestSHA2_256
def test_expected_mac_length
assert_equal 12, subject.mac_length
@@ -24,6 +23,5 @@ module Transport
Net::SSH::Transport::HMAC::SHA2_256_96
end
end
-
end
end
diff --git a/test/transport/hmac/test_sha2_256_etm.rb b/test/transport/hmac/test_sha2_256_etm.rb
index f66afda..5a50cef 100644
--- a/test/transport/hmac/test_sha2_256_etm.rb
+++ b/test/transport/hmac/test_sha2_256_etm.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/sha2_256_etm'
module Transport
module HMAC
-
class TestSHA2_256_Etm < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::SHA256, subject.digest_class
diff --git a/test/transport/hmac/test_sha2_512.rb b/test/transport/hmac/test_sha2_512.rb
index 886c683..a1b7048 100644
--- a/test/transport/hmac/test_sha2_512.rb
+++ b/test/transport/hmac/test_sha2_512.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/sha2_512'
module Transport
module HMAC
-
class TestSHA2_512 < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::SHA512, subject.digest_class
diff --git a/test/transport/hmac/test_sha2_512_96.rb b/test/transport/hmac/test_sha2_512_96.rb
index 955da06..16732bf 100644
--- a/test/transport/hmac/test_sha2_512_96.rb
+++ b/test/transport/hmac/test_sha2_512_96.rb
@@ -6,7 +6,6 @@ require 'net/ssh/transport/hmac/sha2_512_96'
module Transport
module HMAC
-
class TestSHA2_512_96 < TestSHA2_512
def test_expected_mac_length
assert_equal 12, subject.mac_length
@@ -24,6 +23,5 @@ module Transport
Net::SSH::Transport::HMAC::SHA2_512_96
end
end
-
end
end
diff --git a/test/transport/hmac/test_sha2_512_etm.rb b/test/transport/hmac/test_sha2_512_etm.rb
index 364905e..0805b97 100644
--- a/test/transport/hmac/test_sha2_512_etm.rb
+++ b/test/transport/hmac/test_sha2_512_etm.rb
@@ -5,7 +5,6 @@ require 'net/ssh/transport/hmac/sha2_512_etm'
module Transport
module HMAC
-
class TestSHA2_512_Etm < NetSSHTest
def test_expected_digest_class
assert_equal OpenSSL::Digest::SHA512, subject.digest_class
diff --git a/test/transport/kex/test_diffie_hellman_group14_sha1.rb b/test/transport/kex/test_diffie_hellman_group14_sha1.rb
index 6d5f8f8..ac15266 100644
--- a/test/transport/kex/test_diffie_hellman_group14_sha1.rb
+++ b/test/transport/kex/test_diffie_hellman_group14_sha1.rb
@@ -5,7 +5,6 @@ require 'ostruct'
module Transport
module Kex
-
class TestDiffieHellmanGroup14SHA1 < TestDiffieHellmanGroup1SHA1
def subject
Net::SSH::Transport::Kex::DiffieHellmanGroup14SHA1
diff --git a/test/transport/kex/test_diffie_hellman_group14_sha256.rb b/test/transport/kex/test_diffie_hellman_group14_sha256.rb
index a64f2f1..db15d5b 100644
--- a/test/transport/kex/test_diffie_hellman_group14_sha256.rb
+++ b/test/transport/kex/test_diffie_hellman_group14_sha256.rb
@@ -3,7 +3,6 @@ require_relative './test_diffie_hellman_group14_sha1'
module Transport
module Kex
-
class TestDiffieHellmanGroup14SHA256 < TestDiffieHellmanGroup14SHA1
def subject
Net::SSH::Transport::Kex::DiffieHellmanGroup14SHA256
diff --git a/test/transport/kex/test_diffie_hellman_group1_sha1.rb b/test/transport/kex/test_diffie_hellman_group1_sha1.rb
index 60042c2..ddde23c 100644
--- a/test/transport/kex/test_diffie_hellman_group1_sha1.rb
+++ b/test/transport/kex/test_diffie_hellman_group1_sha1.rb
@@ -4,7 +4,6 @@ require 'ostruct'
module Transport
module Kex
-
class TestDiffieHellmanGroup1SHA1 < NetSSHTest
include Net::SSH::Transport::Constants
@@ -167,6 +166,5 @@ module Transport
Net::SSH::Buffer.from(*args)
end
end
-
end
end
diff --git a/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb b/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
index 800a8c6..b709dda 100644
--- a/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
+++ b/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb
@@ -4,7 +4,6 @@ require 'net/ssh/transport/kex/diffie_hellman_group_exchange_sha1'
module Transport
module Kex
-
class TestDiffieHellmanGroupExchangeSHA1 < TestDiffieHellmanGroup1SHA1
KEXDH_GEX_GROUP = 31
KEXDH_GEX_INIT = 32
@@ -49,6 +48,7 @@ module Transport
def need_minimum(bits=1024)
return @dh_options[:minimum_dh_bits] if @dh_options && @dh_options[:minimum_dh_bits]
+
bits
end
@@ -104,6 +104,5 @@ module Transport
end
end
end
-
end
end
diff --git a/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb b/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
index 6355c18..95f4152 100644
--- a/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
+++ b/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb
@@ -4,7 +4,6 @@ require 'transport/kex/test_diffie_hellman_group_exchange_sha1'
module Transport
module Kex
-
class TestDiffieHellmanGroupExchangeSHA256 < TestDiffieHellmanGroupExchangeSHA1
private
@@ -16,6 +15,5 @@ module Transport
OpenSSL::Digest::SHA256
end
end
-
end
end
diff --git a/test/transport/test_algorithms.rb b/test/transport/test_algorithms.rb
index 53262a1..6928737 100644
--- a/test/transport/test_algorithms.rb
+++ b/test/transport/test_algorithms.rb
@@ -3,7 +3,6 @@ require 'logger'
require 'net/ssh/transport/algorithms'
module Transport
-
class TestAlgorithms < NetSSHTest
include Net::SSH::Transport::Constants
@@ -338,6 +337,7 @@ module Transport
Net::SSH::Transport::Kex::MAP.each do |name, klass|
next if klass == kex
+
klass.expects(:new).never
end
@@ -441,5 +441,4 @@ module Transport
@transport ||= MockTransport.new(transport_options)
end
end
-
end
diff --git a/test/transport/test_cipher_factory.rb b/test/transport/test_cipher_factory.rb
index 49ff2cd..768fbf8 100644
--- a/test/transport/test_cipher_factory.rb
+++ b/test/transport/test_cipher_factory.rb
@@ -4,7 +4,6 @@ require 'common'
require 'net/ssh/transport/cipher_factory'
module Transport
-
class TestCipherFactory < NetSSHTest
def self.if_supported?(name)
yield if Net::SSH::Transport::CipherFactory.supported?(name)
@@ -308,5 +307,4 @@ module Transport
[first, second]
end
end
-
end
diff --git a/test/transport/test_hmac.rb b/test/transport/test_hmac.rb
index 4e2238b..3672204 100644
--- a/test/transport/test_hmac.rb
+++ b/test/transport/test_hmac.rb
@@ -2,7 +2,6 @@ require 'common'
require 'net/ssh/transport/hmac'
module Transport
-
class TestHMAC < NetSSHTest
Net::SSH::Transport::HMAC::MAP.each do |name, value|
method = name.tr("-", "_")
@@ -30,5 +29,4 @@ module Transport
end
end
end
-
end
diff --git a/test/transport/test_identity_cipher.rb b/test/transport/test_identity_cipher.rb
index a8f87d6..3f332db 100644
--- a/test/transport/test_identity_cipher.rb
+++ b/test/transport/test_identity_cipher.rb
@@ -2,7 +2,6 @@ require 'common'
require 'net/ssh/transport/identity_cipher'
module Transport
-
class TestIdentityCipher < NetSSHTest
def test_block_size_should_be_8
assert_equal 8, cipher.block_size
@@ -34,5 +33,4 @@ module Transport
Net::SSH::Transport::IdentityCipher
end
end
-
end
diff --git a/test/transport/test_packet_stream.rb b/test/transport/test_packet_stream.rb
index 25c6b32..2cb47e1 100644
--- a/test/transport/test_packet_stream.rb
+++ b/test/transport/test_packet_stream.rb
@@ -5,7 +5,6 @@ require 'timeout'
require 'net/ssh/transport/packet_stream'
module Transport
-
class TestPacketStream < NetSSHTest # rubocop:disable Metrics/ClassLength
include Net::SSH::Transport::Constants
@@ -1129,5 +1128,4 @@ module Transport
end
end
end
-
end
diff --git a/test/transport/test_session.rb b/test/transport/test_session.rb
index 1b3747a..117fb89 100644
--- a/test/transport/test_session.rb
+++ b/test/transport/test_session.rb
@@ -10,7 +10,6 @@ require 'logger'
Object.send(:undef_method, :verify) if Object.instance_methods.any? { |v| v.to_sym == :verify }
module Transport
-
class TestSession < NetSSHTest
include Net::SSH::Transport::Constants
@@ -421,5 +420,4 @@ module Transport
# version makes it look more like the session is being instantiated
alias session! session
end
-
end
diff --git a/test/transport/test_state.rb b/test/transport/test_state.rb
index 1f9b9ce..b08fda7 100644
--- a/test/transport/test_state.rb
+++ b/test/transport/test_state.rb
@@ -4,7 +4,6 @@ require 'common'
require 'net/ssh/transport/state'
module Transport
-
class TestState < NetSSHTest
def setup
@socket = @state = @deflater = @inflater = nil
@@ -119,6 +118,7 @@ module Transport
# JRuby Zlib implementation (1.4 & 1.5) does not have byte-to-byte compatibility with MRI's.
# skip this test under JRuby.
return if defined?(JRUBY_VERSION)
+
assert_equal "x\234\312H\315\311\311WH-K-\252L\312O\251\004\000\000\000\377\377", state.compress("hello everybody")
end
@@ -127,6 +127,7 @@ module Transport
# JRuby Zlib implementation (1.4 & 1.5) does not have byte-to-byte compatibility with MRI's.
# skip this test under JRuby.
return if defined?(JRUBY_VERSION)
+
assert_equal "hello everybody", state.decompress("x\234\312H\315\311\311WH-K-\252L\312O\251\004\000\000\000\377\377")
end
@@ -176,5 +177,4 @@ module Transport
@state ||= Net::SSH::Transport::State.new(socket, :test)
end
end
-
end
diff --git a/test/win_integration/test_pageant.rb b/test/win_integration/test_pageant.rb
index 374433f..f87fe59 100644
--- a/test/win_integration/test_pageant.rb
+++ b/test/win_integration/test_pageant.rb
@@ -2,13 +2,13 @@ require_relative '../common'
require 'net/ssh/authentication/agent'
module Authentication
-
unless RUBY_PLATFORM == "java"
class TestPageapnt < NetSSHTest
def with_pagent
pageant_path = 'C:\ProgramData\chocolatey\lib\putty.portable\tools\pageant.exe'
raise "No pageant found at:#{pageant_path}" unless File.executable?(pageant_path)
+
pageant_pid = Process.spawn(pageant_path)
sleep 4
yield
@@ -40,5 +40,4 @@ module Authentication
end
end
-
end