Skip to content

Commit

Permalink
Test get_packet_loggers, post_server_message in no_gui
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Oct 10, 2017
1 parent 44488c9 commit 1434938
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cosmos/script/cmd_tlm_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def get_tlm_cnt(target_name, packet_name)
return $cmd_tlm_server.get_tlm_cnt(target_name, packet_name)
end

def get_packet_loggers
return $cmd_tlm_server.get_packet_loggers
end

def get_packet_logger_info(packet_logger_name)
return $cmd_tlm_server.get_packet_logger_info(packet_logger_name)
end
Expand Down
1 change: 1 addition & 0 deletions lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def self.no_gui_handle_string_output
@string_output.string = @string_output.string[string.length..-1]
string.each_line {|out_line| lines_to_write << out_line }
@message_log.write(lines_to_write)
CmdTlmServer.instance.post_server_message(lines_to_write)
STDOUT.print lines_to_write if STDIN.isatty # Have a console
end
end
Expand Down
7 changes: 7 additions & 0 deletions spec/script/cmd_tlm_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ module Cosmos
end
end

describe "get_packet_loggers" do
it "returns all the packet logger names" do
loggers = get_packet_loggers()
expect(loggers).to include("DEFAULT")
end
end

describe "get_packet_logger_info" do
it "returns packet logger info" do
interfaces, cmd_logging, cmd_q_size, cmd_filename, cmd_file_size,
Expand Down
1 change: 1 addition & 0 deletions spec/tools/cmd_tlm_server/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ def test_tlm_unknown(method)
@api.get_cmd_cnt("INST", "COLLECT")
@api.get_tlm_cnt("INST", "HEALTH_STATUS")
@api.get_router_info("ROUTE")
@api.get_packet_loggers
@api.get_packet_logger_info('DEFAULT')
@api.get_router_names
@api.connect_router("ROUTE")
Expand Down

0 comments on commit 1434938

Please sign in to comment.