Configurable log levels

Allow ssh log_level to be set - this will help to debug connection
issues.
This commit is contained in:
Donal McBreen
2023-08-15 16:36:06 +01:00
parent 715cd94bbf
commit 1163c3de07
6 changed files with 33 additions and 7 deletions

View File

@@ -17,16 +17,20 @@ class ConfigurationSshTest < ActiveSupport::TestCase
assert_equal "root", @config.ssh.options[:user]
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(ssh: { "user" => "app" }) })
assert_equal "app", @config.ssh.options[:user]
assert_equal "app", config.ssh.options[:user]
assert_equal 4, config.ssh.options[:logger].level
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(ssh: { "log_level" => "debug" }) })
assert_equal 0, config.ssh.options[:logger].level
end
test "ssh options with proxy host" do
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(ssh: { "proxy" => "1.2.3.4" }) })
assert_equal "root@1.2.3.4", @config.ssh.options[:proxy].jump_proxies
assert_equal "root@1.2.3.4", config.ssh.options[:proxy].jump_proxies
end
test "ssh options with proxy host and user" do
config = Mrsk::Configuration.new(@deploy.tap { |c| c.merge!(ssh: { "proxy" => "app@1.2.3.4" }) })
assert_equal "app@1.2.3.4", @config.ssh.options[:proxy].jump_proxies
assert_equal "app@1.2.3.4", config.ssh.options[:proxy].jump_proxies
end
end