Skip to content

Commit

Permalink
F expect_nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrui committed Feb 24, 2023
1 parent de4ca21 commit 28f8773
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions docs/changelog/v2.4.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [2.4.5]

-- FIX: "expect_nothing" was always TRUE when SSH/Telnet connections fails!
Now when SSH/Telnet connections fails result contains "SSH: NO CONNECTION!"
So "expect_nothing" will fail.

## [2.4.4]

-- Modify: teuton check output colors and exit codes.
Expand Down
9 changes: 6 additions & 3 deletions lib/teuton/case_manager/case/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@ def run_cmd_remote_ssh(input_hostname)
non_interactive: true
)
end
if @sessions[hostname].instance_of? Net::SSH::Connection::Session
text = @sessions[hostname].exec!(@action[:command])
text = if @sessions[hostname].instance_of? Net::SSH::Connection::Session
@sessions[hostname].exec!(@action[:command])
else
"SSH: NO CONNECTION!"
end
rescue Errno::EHOSTUNREACH
@sessions[hostname] = :nosession
Expand Down Expand Up @@ -148,10 +150,11 @@ def run_cmd_remote_telnet(input_hostname)
# "Prompt" => Regexp.new(username[1, 40]))
# "Prompt" => /[$%#>] \z/n)
h.login(username, password)
text = ""
h.cmd(@action[:command]) { |i| text << i }
h.close
@sessions[hostname] = :ok
else
text = "TELNET: NO CONNECTION!"
end
rescue Net::OpenTimeout
@sessions[hostname] = :nosession
Expand Down
12 changes: 6 additions & 6 deletions lib/teuton/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ def new(projectpath)
option :cname, type: :string
option :cpath, type: :string
desc "check [OPTIONS] DIRECTORY", "Check test and config file content"
long_desc <<-LONGDESC
long_desc <<~LONGDESC
(1) teuton check PATH/TO/DIR , Check content of start.rb and config.yaml files.
(1) teuton check PATH/TO/DIR , Check content of start.rb and config.yaml files.
(2) teuton check PATH/TO/DIR --cname=demo , Check content of start.rb and demo.yaml files:
(2) teuton check PATH/TO/DIR --cname=demo , Check content of start.rb and demo.yaml files:
(3) teuton check PATH/TO/DIR --panelconfig , Only show config file recomendations
(3) teuton check PATH/TO/DIR --panelconfig , Only show config file recomendations
(4) teuton check PATH/TO/DIR/foo.rb , Check content of foo.rb and foo.yaml files.
(4) teuton check PATH/TO/DIR/foo.rb , Check content of foo.rb and foo.yaml files.
(5) teuton check PATH/TO/DIR/foo.rb --cname=demo , Check content of foo.rb and demo.yaml files.
(5) teuton check PATH/TO/DIR/foo.rb --cname=demo , Check content of foo.rb and demo.yaml files.
LONGDESC
def check(projectpath)
Expand Down
2 changes: 1 addition & 1 deletion lib/teuton/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Teuton
VERSION = "2.4.4"
VERSION = "2.4.5"
APPNAME = "teuton"
GEMNAME = "teuton"
DOCKERNAME = "dvarrui/#{GEMNAME}"
Expand Down

0 comments on commit 28f8773

Please sign in to comment.