diff options
Diffstat (limited to 'test/integration/test_ed25519_pkeys.rb')
-rw-r--r-- | test/integration/test_ed25519_pkeys.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/integration/test_ed25519_pkeys.rb b/test/integration/test_ed25519_pkeys.rb index d42cbfd..3358af7 100644 --- a/test/integration/test_ed25519_pkeys.rb +++ b/test/integration/test_ed25519_pkeys.rb @@ -10,7 +10,7 @@ unless ENV['NET_SSH_NO_ED25519'] # and usually connecting to net_ssh_2 user password foo2pwd class TestED25519PKeys < NetSSHTest include IntegrationTestHelpers - + def test_in_file_no_password Dir.mktmpdir do |dir| sh "rm -rf #{dir}/id_rsa_ed25519 #{dir}/id_rsa_ed25519.pub" @@ -22,8 +22,8 @@ unless ENV['NET_SSH_NO_ED25519'] end assert_equal "hello from:net_ssh_1\n", ret end - end - + end + def test_ssh_agent Dir.mktmpdir do |dir| with_agent do @@ -31,10 +31,10 @@ unless ENV['NET_SSH_NO_ED25519'] sh "ssh-keygen -q -f #{dir}/id_rsa_ed25519 -t ed25519 -N 'pwd'" set_authorized_key('net_ssh_1',"#{dir}/id_rsa_ed25519.pub") ssh_add("#{dir}/id_rsa_ed25519","pwd") - + # TODO: fix bug in net ssh which reads public key even if private key is there sh "mv #{dir}/id_rsa_ed25519.pub #{dir}/id_rsa_ed25519.pub.hidden" - + ret = Net::SSH.start("localhost", "net_ssh_1") do |ssh| ssh.exec! 'echo "hello from:$USER"' end @@ -42,23 +42,23 @@ unless ENV['NET_SSH_NO_ED25519'] end end end - + def test_in_file_with_password Dir.mktmpdir do |dir| sh "rm -rf #{dir}/id_rsa_ed25519 #{dir}/id_rsa_ed25519.pub" sh "ssh-keygen -q -f #{dir}/id_rsa_ed25519 -t ed25519 -N 'pwd'" set_authorized_key('net_ssh_1',"#{dir}/id_rsa_ed25519.pub") - + # TODO: fix bug in net ssh which reads public key even if private key is there sh "mv #{dir}/id_rsa_ed25519.pub #{dir}/id_rsa_ed25519.pub.hidden" - ret = Net::SSH.start("localhost", "net_ssh_1", { keys: "#{dir}/id_rsa_ed25519", passphrase:'pwd' }) do |ssh| + ret = Net::SSH.start("localhost", "net_ssh_1", { keys: "#{dir}/id_rsa_ed25519", passphrase: 'pwd' }) do |ssh| ssh.exec! 'echo "hello from:$USER"' end assert_equal "hello from:net_ssh_1\n", ret end end - + def test_with_only_ed25519_host_key config_lines = File.read('/etc/ssh/sshd_config').split("\n") config_lines = config_lines.map do |line| @@ -68,7 +68,7 @@ unless ENV['NET_SSH_NO_ED25519'] line end end - + Tempfile.open('empty_kh') do |f| f.close with_sshd_config(config_lines.join("\n")) do |