Skip to content

Commit

Permalink
fixup! Add tests for OSX and x86
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Oct 27, 2024
1 parent 71dfe84 commit af43fd8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 16 additions & 15 deletions test/LibSSHTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,24 +285,25 @@ end
@test client.callback_log[:message_request] == [(ssh.RequestType_ChannelOpen, lib.SSH_CHANNEL_DIRECT_TCPIP)]
end

# @testset "Keyboard-interactive authentication" begin
# @show readchomp(`which expect`)

# demo_server, _ = DemoServer(2222; auth_methods=[ssh.AuthMethod_Interactive]) do
# # Run the script
# script_path = joinpath(@__DIR__, "interactive_ssh.sh")
# proc = run(`expect -f $script_path`; wait=false)
# wait(proc)
# end
@show readchomp(`which ssh`)
@testset "Keyboard-interactive authentication" begin
@show readchomp(`which expect`)

demo_server, _ = DemoServer(2222; auth_methods=[ssh.AuthMethod_Interactive]) do
# Run the script
script_path = joinpath(@__DIR__, "interactive_ssh.sh")
proc = run(`expect -f $script_path`; wait=false)
wait(proc)
end

# client = demo_server.clients[1]
client = demo_server.clients[1]

# # Check that authentication succeeded
# @test client.authenticated
# Check that authentication succeeded
@test client.authenticated

# # And the command was executed
# @test client.callback_log[:channel_exec_request] == ["'whoami'"]
# end
# And the command was executed
@test client.callback_log[:channel_exec_request] == ["'whoami'"]
end

@testset "Multiple connections" begin
demo_server, _ = DemoServer(2222; password="bar") do
Expand Down
2 changes: 1 addition & 1 deletion test/interactive_ssh.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/expect
#! expect

set timeout 5

Expand Down

0 comments on commit af43fd8

Please sign in to comment.