cosmos 3.2.1 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Manifest.txt +195 -0
- data/README.md +3 -3
- data/data/crc.txt +52 -52
- data/lib/cosmos.rb +1 -1
- data/lib/cosmos/core_ext/time.rb +11 -9
- data/lib/cosmos/gui/choosers/telemetry_chooser.rb +0 -2
- data/lib/cosmos/gui/dialogs/about_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/exception_dialog.rb +2 -2
- data/lib/cosmos/gui/dialogs/progress_dialog.rb +11 -5
- data/lib/cosmos/gui/dialogs/splash.rb +32 -10
- data/lib/cosmos/gui/dialogs/tlm_details_dialog.rb +1 -1
- data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +2 -2
- data/lib/cosmos/gui/qt.rb +22 -22
- data/lib/cosmos/io/json_drb.rb +4 -4
- data/lib/cosmos/io/json_rpc.rb +21 -21
- data/lib/cosmos/packet_logs/packet_log_writer.rb +18 -20
- data/lib/cosmos/packets/commands.rb +8 -6
- data/lib/cosmos/packets/limits.rb +3 -2
- data/lib/cosmos/packets/packet.rb +14 -11
- data/lib/cosmos/packets/parsers/limits_parser.rb +1 -1
- data/lib/cosmos/packets/parsers/macro_parser.rb +4 -4
- data/lib/cosmos/packets/parsers/state_parser.rb +1 -1
- data/lib/cosmos/packets/structure.rb +2 -2
- data/lib/cosmos/packets/telemetry.rb +5 -4
- data/lib/cosmos/script/script.rb +6 -6
- data/lib/cosmos/streams/tcpip_socket_stream.rb +2 -1
- data/lib/cosmos/streams/template_stream_protocol.rb +1 -1
- data/lib/cosmos/tools/cmd_sender/cmd_sender.rb +1 -1
- data/lib/cosmos/tools/cmd_tlm_server/cmd_tlm_server_gui.rb +5 -8
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +4 -3
- data/lib/cosmos/tools/cmd_tlm_server/gui/packets_tab.rb +9 -3
- data/lib/cosmos/tools/cmd_tlm_server/gui/status_tab.rb +15 -11
- data/lib/cosmos/tools/data_viewer/data_viewer.rb +1 -1
- data/lib/cosmos/tools/data_viewer/data_viewer_component.rb +2 -2
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +2 -2
- data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +0 -2
- data/lib/cosmos/tools/limits_monitor/limits_monitor.rb +1 -1
- data/lib/cosmos/tools/replay/replay.rb +2 -2
- data/lib/cosmos/tools/script_runner/script_audit.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner.rb +1 -1
- data/lib/cosmos/tools/script_runner/script_runner_frame.rb +3 -7
- data/lib/cosmos/tools/table_manager/table_config.rb +1 -1
- data/lib/cosmos/tools/test_runner/results_writer.rb +1 -1
- data/lib/cosmos/tools/test_runner/test_runner.rb +2 -2
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor.rb +2 -1
- data/lib/cosmos/tools/tlm_extractor/tlm_extractor_processor.rb +1 -1
- data/lib/cosmos/tools/tlm_grapher/data_object_adders/xy_data_object_adder.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/housekeeping_data_object_editor.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/data_object_editors/xy_data_object_editor.rb +1 -0
- data/lib/cosmos/tools/tlm_grapher/tabbed_plots/overview_tabbed_plots.rb +3 -3
- data/lib/cosmos/tools/tlm_viewer/tlm_viewer.rb +1 -3
- data/lib/cosmos/top_level.rb +2 -6
- data/lib/cosmos/utilities/ruby_lex_utils.rb +1 -1
- data/lib/cosmos/version.rb +5 -5
- data/lib/cosmos/win32/win32_main.rb +11 -7
- data/spec/ccsds/ccsds_packet_spec.rb +28 -28
- data/spec/ccsds/ccsds_parser_spec.rb +27 -27
- data/spec/config/config_parser_spec.rb +88 -88
- data/spec/conversions/conversion_spec.rb +3 -3
- data/spec/conversions/generic_conversion_spec.rb +9 -9
- data/spec/conversions/new_packet_log_conversion_spec.rb +4 -4
- data/spec/conversions/polynomial_conversion_spec.rb +7 -7
- data/spec/conversions/processor_conversion_spec.rb +9 -9
- data/spec/conversions/received_count_conversion_spec.rb +7 -7
- data/spec/conversions/received_time_formatted_conversion_spec.rb +9 -9
- data/spec/conversions/received_time_seconds_conversion_spec.rb +9 -9
- data/spec/conversions/segmented_polynomial_conversion_spec.rb +11 -11
- data/spec/conversions/unix_time_formatted_conversion_spec.rb +13 -13
- data/spec/conversions/unix_time_seconds_conversion_spec.rb +13 -13
- data/spec/core_ext/array_spec.rb +76 -76
- data/spec/core_ext/class_spec.rb +3 -3
- data/spec/core_ext/cosmos_io_spec.rb +16 -16
- data/spec/core_ext/exception_spec.rb +19 -19
- data/spec/core_ext/file_spec.rb +16 -16
- data/spec/core_ext/hash_spec.rb +3 -3
- data/spec/core_ext/io_spec.rb +2 -2
- data/spec/core_ext/kernel_spec.rb +2 -2
- data/spec/core_ext/math_spec.rb +43 -43
- data/spec/core_ext/matrix_spec.rb +22 -22
- data/spec/core_ext/objectspace_spec.rb +6 -6
- data/spec/core_ext/range_spec.rb +2 -2
- data/spec/core_ext/socket_spec.rb +4 -4
- data/spec/core_ext/string_spec.rb +67 -67
- data/spec/core_ext/stringio_spec.rb +2 -2
- data/spec/core_ext/time_spec.rb +82 -82
- data/spec/gui/line_graph/line_clip_spec.rb +34 -34
- data/spec/interfaces/interface_spec.rb +46 -46
- data/spec/interfaces/linc_interface_spec.rb +26 -26
- data/spec/interfaces/serial_interface_spec.rb +16 -16
- data/spec/interfaces/simulated_target_interface_spec.rb +21 -21
- data/spec/interfaces/stream_interface_spec.rb +22 -22
- data/spec/interfaces/tcpip_client_interface_spec.rb +14 -14
- data/spec/interfaces/tcpip_server_interface_spec.rb +41 -41
- data/spec/interfaces/udp_interface_spec.rb +46 -46
- data/spec/io/buffered_file_spec.rb +50 -50
- data/spec/io/io_multiplexer_spec.rb +9 -9
- data/spec/io/json_drb_object_spec.rb +7 -7
- data/spec/io/json_drb_spec.rb +55 -55
- data/spec/io/json_rpc_spec.rb +68 -68
- data/spec/io/raw_logger_pair_spec.rb +28 -28
- data/spec/io/raw_logger_spec.rb +22 -22
- data/spec/io/serial_driver_spec.rb +3 -3
- data/spec/io/stderr_spec.rb +2 -2
- data/spec/io/stdout_spec.rb +2 -2
- data/spec/io/tcpip_server_spec.rb +62 -62
- data/spec/io/udp_sockets_spec.rb +19 -19
- data/spec/io/win32_serial_driver_spec.rb +10 -10
- data/spec/packet_logs/meta_packet_log_writer_spec.rb +32 -32
- data/spec/packet_logs/packet_log_reader_spec.rb +138 -138
- data/spec/packet_logs/packet_log_writer_pair_spec.rb +3 -3
- data/spec/packet_logs/packet_log_writer_spec.rb +26 -26
- data/spec/packets/binary_accessor_spec.rb +672 -672
- data/spec/packets/commands_spec.rb +123 -123
- data/spec/packets/limits_response_spec.rb +1 -1
- data/spec/packets/limits_spec.rb +69 -69
- data/spec/packets/packet_config_spec.rb +93 -93
- data/spec/packets/packet_item_limits_spec.rb +46 -46
- data/spec/packets/packet_item_spec.rb +108 -108
- data/spec/packets/packet_spec.rb +364 -348
- data/spec/packets/parsers/format_string_parser_spec.rb +13 -13
- data/spec/packets/parsers/limits_parser_spec.rb +8 -8
- data/spec/packets/parsers/limits_response_parser_spec.rb +9 -9
- data/spec/packets/parsers/macro_parser_spec.rb +34 -6
- data/spec/packets/parsers/packet_parser_spec.rb +6 -6
- data/spec/packets/parsers/processor_parser_spec.rb +7 -7
- data/spec/packets/parsers/state_parser_spec.rb +23 -23
- data/spec/packets/structure_item_spec.rb +62 -62
- data/spec/packets/structure_spec.rb +183 -183
- data/spec/packets/telemetry_spec.rb +174 -174
- data/spec/processors/new_packet_log_processor_spec.rb +4 -4
- data/spec/processors/processor_spec.rb +9 -9
- data/spec/processors/statistics_processor_spec.rb +21 -21
- data/spec/processors/watermark_processor_spec.rb +12 -12
- data/spec/script/script_spec.rb +158 -158
- data/spec/spec_helper.rb +44 -13
- data/spec/streams/burst_stream_protocol_spec.rb +8 -8
- data/spec/streams/fixed_stream_protocol_spec.rb +26 -26
- data/spec/streams/length_stream_protocol_spec.rb +27 -27
- data/spec/streams/preidentified_stream_protocol_spec.rb +25 -25
- data/spec/streams/serial_stream_spec.rb +19 -19
- data/spec/streams/stream_protocol_spec.rb +52 -52
- data/spec/streams/stream_spec.rb +1 -1
- data/spec/streams/tcpip_client_stream_spec.rb +7 -7
- data/spec/streams/tcpip_socket_stream_spec.rb +84 -49
- data/spec/streams/template_stream_protocol_spec.rb +17 -17
- data/spec/streams/terminated_stream_protocol_spec.rb +19 -19
- data/spec/system/system_spec.rb +95 -95
- data/spec/system/target_spec.rb +32 -32
- data/spec/tools/cmd_tlm_server/api_spec.rb +386 -386
- data/spec/tools/cmd_tlm_server/background_task_spec.rb +3 -3
- data/spec/tools/cmd_tlm_server/background_tasks_spec.rb +8 -8
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +57 -57
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_spec.rb +85 -85
- data/spec/tools/cmd_tlm_server/commanding_spec.rb +11 -11
- data/spec/tools/cmd_tlm_server/connections_spec.rb +23 -23
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +57 -57
- data/spec/tools/cmd_tlm_server/interfaces_spec.rb +32 -32
- data/spec/tools/cmd_tlm_server/packet_logging_spec.rb +17 -17
- data/spec/tools/cmd_tlm_server/router_thread_spec.rb +15 -15
- data/spec/tools/cmd_tlm_server/routers_spec.rb +36 -36
- data/spec/top_level/top_level_spec.rb +60 -60
- data/spec/utilities/crc_spec.rb +6 -6
- data/spec/utilities/csv_spec.rb +13 -13
- data/spec/utilities/logger_spec.rb +20 -20
- data/spec/utilities/message_log_spec.rb +13 -13
- data/spec/utilities/quaternion_spec.rb +30 -30
- data/spec/utilities/ruby_lex_utils_spec.rb +14 -14
- data/test/benchmarks/binary_accessor_benchmark.rb +14 -0
- data/test/benchmarks/gsub_benchmark.rb +114 -0
- data/test/performance/PACKETS.bat +1 -0
- data/test/performance/Rakefile +77 -0
- data/test/performance/THREADS.bat +1 -0
- data/test/performance/config/data/attitude.bin +0 -0
- data/test/performance/config/data/crc.txt +206 -0
- data/test/performance/config/data/diamond.STL +58 -0
- data/test/performance/config/data/groundoff.gif +0 -0
- data/test/performance/config/data/groundon.gif +0 -0
- data/test/performance/config/data/hselectoff.gif +0 -0
- data/test/performance/config/data/hselecton.gif +0 -0
- data/test/performance/config/data/hswitchoff.gif +0 -0
- data/test/performance/config/data/hswitchon.gif +0 -0
- data/test/performance/config/data/meta_init.txt +4 -0
- data/test/performance/config/data/position.bin +0 -0
- data/test/performance/config/data/poweroff.gif +0 -0
- data/test/performance/config/data/poweron.gif +0 -0
- data/test/performance/config/data/satellite.gif +0 -0
- data/test/performance/config/data/tada.wav +0 -0
- data/test/performance/config/data/vswitchoff.gif +0 -0
- data/test/performance/config/data/vswitchon.gif +0 -0
- data/test/performance/config/system/system_packets.txt +39 -0
- data/test/performance/config/system/system_threads.txt +59 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_cmds.txt +41 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm/cosmos_server_tlm.txt +15 -0
- data/test/performance/config/targets/COSMOS/cmd_tlm_server.txt +6 -0
- data/test/performance/config/targets/COSMOS/screens/limits_change.txt +20 -0
- data/test/performance/config/targets/COSMOS/screens/version.txt +19 -0
- data/test/performance/config/targets/COSMOS/target.txt +11 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_cmds.txt +17 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm/example_tlm.txt +18 -0
- data/test/performance/config/targets/EXAMPLE/cmd_tlm_server.txt +6 -0
- data/test/performance/config/targets/EXAMPLE/lib/example_interface.rb +22 -0
- data/test/performance/config/targets/EXAMPLE/target.txt +7 -0
- data/test/performance/config/targets/SYSTEM/screens/status.txt +12 -0
- data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_packets.txt +34 -0
- data/test/performance/config/tools/cmd_tlm_server/cmd_tlm_server_threads.txt +68 -0
- data/test/performance/config/tools/data_viewer/data_viewer.txt +11 -0
- data/test/performance/config/tools/handbook_creator/default_toc.xsl +59 -0
- data/test/performance/config/tools/handbook_creator/handbook_creator.txt +66 -0
- data/test/performance/config/tools/handbook_creator/templates/command_packets.html.erb +86 -0
- data/test/performance/config/tools/handbook_creator/templates/command_toc.html.erb +38 -0
- data/test/performance/config/tools/handbook_creator/templates/footer.html.erb +9 -0
- data/test/performance/config/tools/handbook_creator/templates/header.html.erb +25 -0
- data/test/performance/config/tools/handbook_creator/templates/limits_groups.html.erb +13 -0
- data/test/performance/config/tools/handbook_creator/templates/nav.html.erb +27 -0
- data/test/performance/config/tools/handbook_creator/templates/overview.html.erb +1 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_cover.html.erb +23 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_footer.html.erb +33 -0
- data/test/performance/config/tools/handbook_creator/templates/pdf_header.html.erb +41 -0
- data/test/performance/config/tools/handbook_creator/templates/telemetry_packets.html.erb +80 -0
- data/test/performance/config/tools/handbook_creator/templates/telemetry_toc.html.erb +38 -0
- data/test/performance/config/tools/handbook_creator/templates/title.html.erb +1 -0
- data/test/performance/config/tools/launcher/launcher_packets.txt +29 -0
- data/test/performance/config/tools/launcher/launcher_threads.txt +70 -0
- data/test/performance/config/tools/limits_monitor/README.txt +1 -0
- data/test/performance/config/tools/opengl_builder/README.txt +1 -0
- data/test/performance/config/tools/script_runner/script_runner.txt +3 -0
- data/test/performance/config/tools/table_manager/ConfigTables_def.txt +8 -0
- data/test/performance/config/tools/table_manager/ExampleTableDefinition.txt +24 -0
- data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw1_def.txt +25 -0
- data/test/performance/config/tools/table_manager/MCConfigurationTable_fsw2_def.txt +25 -0
- data/test/performance/config/tools/table_manager/PPSSelectionTable_def.txt +8 -0
- data/test/performance/config/tools/table_manager/TLMMonitoringTable_def.txt +248 -0
- data/test/performance/config/tools/test_runner/test_runner.txt +17 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor.txt +13 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor2.txt +2 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor3.txt +2 -0
- data/test/performance/config/tools/tlm_extractor/tlm_extractor4.txt +2 -0
- data/test/performance/config/tools/tlm_grapher/README.txt +1 -0
- data/test/performance/config/tools/tlm_viewer/tlm_viewer.txt +41 -0
- data/test/performance/lib/example_background_task.rb +57 -0
- data/test/performance/lib/example_target.rb +120 -0
- data/test/performance/lib/scpi_target.rb +74 -0
- data/test/performance/lib/user_version.rb +3 -0
- data/test/performance/outputs/handbooks/README.txt +1 -0
- data/test/performance/outputs/logs/README.txt +1 -0
- data/test/performance/outputs/saved_config/README.txt +1 -0
- data/test/performance/outputs/tables/README.txt +1 -0
- data/test/performance/outputs/tmp/README.txt +1 -0
- data/test/performance/procedures/checks.rb +11 -0
- data/test/performance/procedures/clear_util.rb +7 -0
- data/test/performance/procedures/collect.rb +18 -0
- data/test/performance/procedures/collect_util.rb +14 -0
- data/test/performance/procedures/cosmos_api_test.rb +293 -0
- data/test/performance/procedures/disconnect.rb +29 -0
- data/test/performance/procedures/example_test.rb +182 -0
- data/test/performance/procedures/plot_test.rb +8 -0
- data/test/performance/procedures/procedure.rb +3 -0
- data/test/performance/procedures/run_example_test.rb +3 -0
- data/test/performance/procedures/test.rb +51 -0
- data/test/performance/tools/CmdExtractor +14 -0
- data/test/performance/tools/CmdExtractor.bat +59 -0
- data/test/performance/tools/CmdSender +14 -0
- data/test/performance/tools/CmdSender.bat +59 -0
- data/test/performance/tools/CmdTlmServer +16 -0
- data/test/performance/tools/CmdTlmServer.bat +59 -0
- data/test/performance/tools/CmdTlmServerMemProf +20 -0
- data/test/performance/tools/CmdTlmServerMemProf.bat +59 -0
- data/test/performance/tools/DataViewer +14 -0
- data/test/performance/tools/DataViewer.bat +59 -0
- data/test/performance/tools/ExampleTarget +14 -0
- data/test/performance/tools/ExampleTarget.bat +59 -0
- data/test/performance/tools/HandbookCreator +14 -0
- data/test/performance/tools/HandbookCreator.bat +61 -0
- data/test/performance/tools/Launcher +14 -0
- data/test/performance/tools/Launcher.bat +59 -0
- data/test/performance/tools/LimitsMonitor +14 -0
- data/test/performance/tools/LimitsMonitor.bat +59 -0
- data/test/performance/tools/OpenGLBuilder +14 -0
- data/test/performance/tools/OpenGLBuilder.bat +59 -0
- data/test/performance/tools/PacketViewer +14 -0
- data/test/performance/tools/PacketViewer.bat +59 -0
- data/test/performance/tools/Replay +14 -0
- data/test/performance/tools/Replay.bat +59 -0
- data/test/performance/tools/ScpiTarget +14 -0
- data/test/performance/tools/ScpiTarget.bat +59 -0
- data/test/performance/tools/ScriptRunner +14 -0
- data/test/performance/tools/ScriptRunner.bat +59 -0
- data/test/performance/tools/TableManager +14 -0
- data/test/performance/tools/TableManager.bat +59 -0
- data/test/performance/tools/TestRunner +14 -0
- data/test/performance/tools/TestRunner.bat +59 -0
- data/test/performance/tools/TlmExtractor +14 -0
- data/test/performance/tools/TlmExtractor.bat +59 -0
- data/test/performance/tools/TlmGrapher +14 -0
- data/test/performance/tools/TlmGrapher.bat +59 -0
- data/test/performance/tools/TlmViewer +14 -0
- data/test/performance/tools/TlmViewer.bat +59 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/CmdExtractor.rb +15 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/CmdSender.rb +15 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdSender.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/CmdTlmServer.rb +15 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/CmdTlmServer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/DataViewer.rb +15 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/DataViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/HandbookCreator.rb +15 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/HandbookCreator.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/Launcher.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/Launcher.app/Contents/MacOS/Launcher.rb +15 -0
- data/test/performance/tools/mac/Launcher.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/Launcher.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/LimitsMonitor.rb +15 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/LimitsMonitor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/OpenGLBuilder.rb +15 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/OpenGLBuilder.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/PacketViewer.rb +15 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/PacketViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/Replay.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/Replay.app/Contents/MacOS/Replay.rb +15 -0
- data/test/performance/tools/mac/Replay.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/Replay.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/ScriptRunner.rb +15 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/ScriptRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TableManager.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TableManager.app/Contents/MacOS/TableManager.rb +15 -0
- data/test/performance/tools/mac/TableManager.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TableManager.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/TestRunner.rb +15 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TestRunner.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/TlmExtractor.rb +15 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmExtractor.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/TlmGrapher.rb +15 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmGrapher.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/Info.plist +38 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/TlmViewer.rb +15 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/MacOS/main.sh +6 -0
- data/test/performance/tools/mac/TlmViewer.app/Contents/Resources/appIcon.icns +0 -0
- data/test/performance/userpath.txt +1 -0
- metadata +197 -2
@@ -16,21 +16,21 @@ module Cosmos
|
|
16
16
|
describe NewPacketLogProcessor do
|
17
17
|
|
18
18
|
describe "initialize" do
|
19
|
-
it "
|
19
|
+
it "takes a packet log writer name" do
|
20
20
|
a = NewPacketLogProcessor.new('MINE')
|
21
|
-
a.value_type.
|
21
|
+
expect(a.value_type).to eql :CONVERTED
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "call" do
|
26
|
-
it "
|
26
|
+
it "starts logging" do
|
27
27
|
log_name = nil
|
28
28
|
allow(CmdTlmServer).to receive_message_chain(:instance,:start_logging) do |name|
|
29
29
|
log_name = name
|
30
30
|
end
|
31
31
|
a = NewPacketLogProcessor.new()
|
32
32
|
a.call(nil, nil)
|
33
|
-
log_name.
|
33
|
+
expect(log_name).to eql('ALL')
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -16,36 +16,36 @@ module Cosmos
|
|
16
16
|
describe Processor do
|
17
17
|
|
18
18
|
describe "initialize" do
|
19
|
-
it "
|
19
|
+
it "stores an optional value_type" do
|
20
20
|
a = Processor.new(:RAW)
|
21
|
-
a.value_type.
|
21
|
+
expect(a.value_type).to eql :RAW
|
22
22
|
b = Processor.new
|
23
|
-
b.value_type.
|
23
|
+
expect(b.value_type).to eql :CONVERTED
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
describe "call" do
|
28
|
-
it "
|
28
|
+
it "raises an exception" do
|
29
29
|
expect { Processor.new.call(0, 0) }.to raise_error("call method must be defined by subclass")
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
describe "to_s" do
|
34
|
-
it "
|
35
|
-
Processor.new.to_s.
|
34
|
+
it "returns a String" do
|
35
|
+
expect(Processor.new.to_s).to eql "Processor"
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
39
|
describe "name" do
|
40
|
-
it "
|
40
|
+
it "has an assignable name" do
|
41
41
|
a = Processor.new
|
42
42
|
a.name = "Test"
|
43
|
-
a.name.
|
43
|
+
expect(a.name).to eql "TEST"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
describe "reset" do
|
48
|
-
it "
|
48
|
+
it "has a reset method" do
|
49
49
|
a = Processor.new
|
50
50
|
expect { a.reset }.not_to raise_error
|
51
51
|
end
|
@@ -17,42 +17,42 @@ module Cosmos
|
|
17
17
|
describe StatisticsProcessor do
|
18
18
|
|
19
19
|
describe "initialize" do
|
20
|
-
it "
|
20
|
+
it "takes an item_name, samples_to_average, and value_type" do
|
21
21
|
p = StatisticsProcessor.new('TEST', '5', 'RAW')
|
22
|
-
p.value_type.
|
23
|
-
p.instance_variable_get("@item_name").
|
24
|
-
p.instance_variable_get("@samples_to_average").
|
22
|
+
expect(p.value_type).to eql :RAW
|
23
|
+
expect(p.instance_variable_get("@item_name")).to eql 'TEST'
|
24
|
+
expect(p.instance_variable_get("@samples_to_average")).to eql 5
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "call and reset" do
|
29
|
-
it "
|
29
|
+
it "generates statistics" do
|
30
30
|
p = StatisticsProcessor.new('TEST', '5', 'RAW')
|
31
31
|
packet = Packet.new("tgt","pkt")
|
32
32
|
packet.append_item("TEST", 8, :UINT)
|
33
33
|
packet.buffer= "\x01"
|
34
34
|
p.call(packet, packet.buffer)
|
35
|
-
p.results[:MAX].
|
36
|
-
p.results[:MIN].
|
37
|
-
p.results[:MEAN].
|
38
|
-
p.results[:STDDEV].
|
35
|
+
expect(p.results[:MAX]).to eql 1
|
36
|
+
expect(p.results[:MIN]).to eql 1
|
37
|
+
expect(p.results[:MEAN]).to be_within(0.001).of(1.0)
|
38
|
+
expect(p.results[:STDDEV]).to be_within(0.001).of(0.0)
|
39
39
|
packet.buffer= "\x02"
|
40
40
|
p.call(packet, packet.buffer)
|
41
|
-
p.results[:MAX].
|
42
|
-
p.results[:MIN].
|
43
|
-
p.results[:MEAN].
|
44
|
-
p.results[:STDDEV].
|
41
|
+
expect(p.results[:MAX]).to eql 2
|
42
|
+
expect(p.results[:MIN]).to eql 1
|
43
|
+
expect(p.results[:MEAN]).to be_within(0.001).of(1.5)
|
44
|
+
expect(p.results[:STDDEV]).to be_within(0.001).of(0.7071)
|
45
45
|
packet.buffer= "\x00"
|
46
46
|
p.call(packet, packet.buffer)
|
47
|
-
p.results[:MAX].
|
48
|
-
p.results[:MIN].
|
49
|
-
p.results[:MEAN].
|
50
|
-
p.results[:STDDEV].
|
47
|
+
expect(p.results[:MAX]).to eql 2
|
48
|
+
expect(p.results[:MIN]).to eql 0
|
49
|
+
expect(p.results[:MEAN]).to be_within(0.001).of(1.0)
|
50
|
+
expect(p.results[:STDDEV]).to be_within(0.001).of(1.0)
|
51
51
|
p.reset
|
52
|
-
p.results[:MAX].
|
53
|
-
p.results[:MIN].
|
54
|
-
p.results[:MEAN].
|
55
|
-
p.results[:STDDEV].
|
52
|
+
expect(p.results[:MAX]).to eql nil
|
53
|
+
expect(p.results[:MIN]).to eql nil
|
54
|
+
expect(p.results[:MEAN]).to eql nil
|
55
|
+
expect(p.results[:STDDEV]).to eql nil
|
56
56
|
end
|
57
57
|
end
|
58
58
|
end
|
@@ -17,33 +17,33 @@ module Cosmos
|
|
17
17
|
describe WatermarkProcessor do
|
18
18
|
|
19
19
|
describe "initialize" do
|
20
|
-
it "
|
20
|
+
it "takes an item_name and value_type" do
|
21
21
|
p = WatermarkProcessor.new('TEST', 'RAW')
|
22
|
-
p.value_type.
|
23
|
-
p.instance_variable_get("@item_name").
|
22
|
+
expect(p.value_type).to eql :RAW
|
23
|
+
expect(p.instance_variable_get("@item_name")).to eql 'TEST'
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
27
|
describe "call and reset" do
|
28
|
-
it "
|
28
|
+
it "generates a high and low water mark" do
|
29
29
|
p = WatermarkProcessor.new('TEST', 'RAW')
|
30
30
|
packet = Packet.new("tgt","pkt")
|
31
31
|
packet.append_item("TEST", 8, :UINT)
|
32
32
|
packet.buffer= "\x01"
|
33
33
|
p.call(packet, packet.buffer)
|
34
|
-
p.results[:HIGH_WATER].
|
35
|
-
p.results[:LOW_WATER].
|
34
|
+
expect(p.results[:HIGH_WATER]).to eql 1
|
35
|
+
expect(p.results[:LOW_WATER]).to eql 1
|
36
36
|
packet.buffer= "\x02"
|
37
37
|
p.call(packet, packet.buffer)
|
38
|
-
p.results[:HIGH_WATER].
|
39
|
-
p.results[:LOW_WATER].
|
38
|
+
expect(p.results[:HIGH_WATER]).to eql 2
|
39
|
+
expect(p.results[:LOW_WATER]).to eql 1
|
40
40
|
packet.buffer= "\x00"
|
41
41
|
p.call(packet, packet.buffer)
|
42
|
-
p.results[:HIGH_WATER].
|
43
|
-
p.results[:LOW_WATER].
|
42
|
+
expect(p.results[:HIGH_WATER]).to eql 2
|
43
|
+
expect(p.results[:LOW_WATER]).to eql 0
|
44
44
|
p.reset
|
45
|
-
p.results[:HIGH_WATER].
|
46
|
-
p.results[:LOW_WATER].
|
45
|
+
expect(p.results[:HIGH_WATER]).to eql nil
|
46
|
+
expect(p.results[:LOW_WATER]).to eql nil
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
data/spec/script/script_spec.rb
CHANGED
@@ -53,166 +53,166 @@ module Cosmos
|
|
53
53
|
end
|
54
54
|
|
55
55
|
describe "cmd" do
|
56
|
-
it "
|
56
|
+
it "sends a command" do
|
57
57
|
capture_io do |stdout|
|
58
58
|
cmd("INST ABORT")
|
59
|
-
stdout.string.
|
59
|
+
expect(stdout.string).to match /cmd\(\'INST ABORT\'\)/ #'
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
63
|
-
it "
|
63
|
+
it "checks parameter ranges" do
|
64
64
|
expect { cmd("INST COLLECT with TYPE NORMAL, DURATION 20") }.to raise_error(/Command parameter 'INST COLLECT DURATION' = 20 not in valid range/)
|
65
65
|
end
|
66
66
|
|
67
|
-
it "
|
67
|
+
it "prompts for a hazardous command" do
|
68
68
|
capture_io do |stdout|
|
69
69
|
expect(self).to receive(:gets) { 'y' } # Send hazardous command
|
70
70
|
cmd("INST COLLECT with TYPE SPECIAL")
|
71
71
|
|
72
|
-
stdout.string.
|
73
|
-
stdout.string.
|
72
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
73
|
+
expect(stdout.string).to match /cmd\(\'INST COLLECT/ # '
|
74
74
|
stdout.rewind
|
75
75
|
|
76
76
|
expect(self).to receive(:gets) { 'n' } # Don't send hazardous
|
77
77
|
expect(self).to receive(:gets) { 'y' } # Stop running script
|
78
78
|
cmd("INST COLLECT with TYPE SPECIAL")
|
79
|
-
stdout.string.
|
79
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
84
|
describe "cmd_no_range_check" do
|
85
|
-
it "
|
85
|
+
it "sends an out of range command" do
|
86
86
|
expect { cmd_no_range_check("INST COLLECT with TYPE NORMAL, DURATION 20") }.to_not raise_error
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
89
|
+
it "prompts for a hazardous command" do
|
90
90
|
capture_io do |stdout|
|
91
91
|
expect(self).to receive(:gets) { 'y' } # Send hazardous command
|
92
92
|
cmd_no_range_check("INST COLLECT with TYPE SPECIAL")
|
93
93
|
|
94
|
-
stdout.string.
|
95
|
-
stdout.string.
|
94
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
95
|
+
expect(stdout.string).to match /cmd\(\'INST COLLECT/ # '
|
96
96
|
stdout.rewind
|
97
97
|
|
98
98
|
expect(self).to receive(:gets) { 'n' } # Don't send hazardous
|
99
99
|
expect(self).to receive(:gets) { 'y' } # Stop running script
|
100
100
|
cmd_no_range_check("INST COLLECT with TYPE SPECIAL")
|
101
|
-
stdout.string.
|
101
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
106
106
|
describe "cmd_no_hazardous_check" do
|
107
|
-
it "
|
107
|
+
it "checks parameter ranges" do
|
108
108
|
expect { cmd_no_hazardous_check("INST COLLECT with TYPE SPECIAL, DURATION 20") }.to raise_error(/Command parameter 'INST COLLECT DURATION' = 20 not in valid range/)
|
109
109
|
end
|
110
110
|
|
111
|
-
it "
|
111
|
+
it "sends a hazardous command without prompting" do
|
112
112
|
capture_io do |stdout|
|
113
113
|
cmd_no_hazardous_check("INST COLLECT with TYPE SPECIAL")
|
114
114
|
|
115
|
-
stdout.string.
|
116
|
-
stdout.string.
|
115
|
+
expect(stdout.string).to match "Command INST COLLECT being sent ignoring hazardous warnings"
|
116
|
+
expect(stdout.string).to match /cmd\(\'INST COLLECT/ # '
|
117
117
|
end
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
121
|
describe "cmd_no_checks" do
|
122
|
-
it "
|
122
|
+
it "sends an out of range hazardous command without prompting" do
|
123
123
|
capture_io do |stdout|
|
124
124
|
cmd_no_checks("INST COLLECT with TYPE SPECIAL, DURATION 20")
|
125
125
|
|
126
|
-
stdout.string.
|
127
|
-
stdout.string.
|
126
|
+
expect(stdout.string).to match "Command INST COLLECT being sent ignoring hazardous warnings"
|
127
|
+
expect(stdout.string).to match /cmd\(\'INST COLLECT/ # '
|
128
128
|
end
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
132
132
|
describe "cmd_raw" do
|
133
|
-
it "
|
133
|
+
it "sends a command" do
|
134
134
|
capture_io do |stdout|
|
135
135
|
cmd_raw("INST ABORT")
|
136
|
-
stdout.string.
|
136
|
+
expect(stdout.string).to match /cmd_raw\(\'INST ABORT\'\)/ # '
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
140
|
-
it "
|
140
|
+
it "checks parameter ranges" do
|
141
141
|
expect { cmd_raw("INST COLLECT with TYPE 0, DURATION 20") }.to raise_error(/Command parameter 'INST COLLECT DURATION' = 20 not in valid range/) # '
|
142
142
|
end
|
143
143
|
|
144
|
-
it "
|
144
|
+
it "prompts for a hazardous command" do
|
145
145
|
capture_io do |stdout|
|
146
146
|
expect(self).to receive(:gets) { 'y' } # Send hazardous command
|
147
147
|
cmd_raw("INST COLLECT with TYPE 1")
|
148
148
|
|
149
|
-
stdout.string.
|
150
|
-
stdout.string.
|
149
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
150
|
+
expect(stdout.string).to match /cmd_raw\(\'INST COLLECT/ # '
|
151
151
|
stdout.rewind
|
152
152
|
|
153
153
|
expect(self).to receive(:gets) { 'n' } # Don't send hazardous
|
154
154
|
expect(self).to receive(:gets) { 'y' } # Stop running script
|
155
155
|
cmd_raw("INST COLLECT with TYPE 1")
|
156
|
-
stdout.string.
|
156
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
157
157
|
end
|
158
158
|
end
|
159
159
|
end
|
160
160
|
|
161
161
|
describe "cmd_raw_no_range_check" do
|
162
|
-
it "
|
162
|
+
it "sends an out of range command" do
|
163
163
|
expect { cmd_raw_no_range_check("INST COLLECT with TYPE 0, DURATION 20") }.to_not raise_error
|
164
164
|
end
|
165
165
|
|
166
|
-
it "
|
166
|
+
it "prompts for a hazardous command" do
|
167
167
|
capture_io do |stdout|
|
168
168
|
expect(self).to receive(:gets) { 'y' } # Send hazardous command
|
169
169
|
cmd_raw_no_range_check("INST COLLECT with TYPE 1")
|
170
170
|
|
171
|
-
stdout.string.
|
172
|
-
stdout.string.
|
171
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
172
|
+
expect(stdout.string).to match /cmd_raw\(\'INST COLLECT/ # '
|
173
173
|
stdout.rewind
|
174
174
|
|
175
175
|
expect(self).to receive(:gets) { 'n' } # Don't send hazardous
|
176
176
|
expect(self).to receive(:gets) { 'y' } # Stop running script
|
177
177
|
cmd_raw_no_range_check("INST COLLECT with TYPE 1")
|
178
|
-
stdout.string.
|
178
|
+
expect(stdout.string).to match "Warning: Command INST COLLECT is Hazardous"
|
179
179
|
end
|
180
180
|
end
|
181
181
|
end
|
182
182
|
|
183
183
|
describe "cmd_raw_no_hazardous_check" do
|
184
|
-
it "
|
184
|
+
it "checks parameter ranges" do
|
185
185
|
expect { cmd_raw_no_hazardous_check("INST COLLECT with TYPE 1, DURATION 20") }.to raise_error(/Command parameter 'INST COLLECT DURATION' = 20 not in valid range/)
|
186
186
|
end
|
187
187
|
|
188
|
-
it "
|
188
|
+
it "sends a hazardous command without prompting" do
|
189
189
|
capture_io do |stdout|
|
190
190
|
cmd_raw_no_hazardous_check("INST COLLECT with TYPE 1")
|
191
|
-
stdout.string.
|
192
|
-
stdout.string.
|
191
|
+
expect(stdout.string).to match "Command INST COLLECT being sent ignoring hazardous warnings"
|
192
|
+
expect(stdout.string).to match /cmd_raw\(\'INST COLLECT/ #'
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
196
196
|
|
197
197
|
describe "cmd_raw_no_checks" do
|
198
|
-
it "
|
198
|
+
it "sends an out of range hazardous command without prompting" do
|
199
199
|
capture_io do |stdout|
|
200
200
|
cmd_raw_no_checks("INST COLLECT with TYPE 1, DURATION 20")
|
201
|
-
stdout.string.
|
202
|
-
stdout.string.
|
201
|
+
expect(stdout.string).to match "Command INST COLLECT being sent ignoring hazardous warnings"
|
202
|
+
expect(stdout.string).to match /cmd_raw\(\'INST COLLECT/ #'
|
203
203
|
end
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
207
|
describe "send_raw" do
|
208
|
-
it "
|
208
|
+
it "sends data to the write_raw interface method" do
|
209
209
|
expect_any_instance_of(Interface).to receive(:write_raw).with('\x00')
|
210
210
|
send_raw('INST_INT', '\x00')
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
214
|
describe "send_raw_file" do
|
215
|
-
it "
|
215
|
+
it "sends file data to the write_raw interface method" do
|
216
216
|
file = File.open('raw_test_file.bin','wb')
|
217
217
|
file.write '\x00\x01\x02\x03'
|
218
218
|
file.close
|
@@ -226,36 +226,36 @@ module Cosmos
|
|
226
226
|
end
|
227
227
|
|
228
228
|
describe "get_cmd_list" do
|
229
|
-
it "
|
229
|
+
it "returns all the target commands" do
|
230
230
|
list = get_cmd_list("INST")
|
231
231
|
# Only check for the collect command to make this test list dependent
|
232
232
|
# on the demo INST command definition file
|
233
|
-
list.
|
233
|
+
expect(list).to include(["COLLECT", "Starts a collect on the instrument"])
|
234
234
|
end
|
235
235
|
end
|
236
236
|
|
237
237
|
describe "get_cmd_param_list" do
|
238
|
-
it "
|
238
|
+
it "returns all the parameters for a command" do
|
239
239
|
list = get_cmd_param_list("INST", "COLLECT")
|
240
|
-
list.
|
240
|
+
expect(list).to include(["TYPE", 0, {"NORMAL"=>0, "SPECIAL"=>1}, "Collect type", nil, nil, true])
|
241
241
|
end
|
242
242
|
end
|
243
243
|
|
244
244
|
describe "get_cmd_hazardous" do
|
245
|
-
it "
|
246
|
-
get_cmd_hazardous("INST", "COLLECT", {"TYPE"=>"NORMAL"}).
|
247
|
-
get_cmd_hazardous("INST", "COLLECT", {"TYPE"=>"SPECIAL"}).
|
245
|
+
it "returns whether a command is hazardous" do
|
246
|
+
expect(get_cmd_hazardous("INST", "COLLECT", {"TYPE"=>"NORMAL"})).to be_falsey
|
247
|
+
expect(get_cmd_hazardous("INST", "COLLECT", {"TYPE"=>"SPECIAL"})).to be_truthy
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
251
|
describe "tlm, tlm_raw, tlm_formatted, tlm_with_units, tlm_variable, set_tlm, set_tlm_raw" do
|
252
|
-
it "
|
252
|
+
it "passes through to the cmd_tlm_server" do
|
253
253
|
expect {
|
254
|
-
tlm("INST HEALTH_STATUS TEMP1").
|
255
|
-
tlm_raw("INST HEALTH_STATUS TEMP1").
|
256
|
-
tlm_formatted("INST HEALTH_STATUS TEMP1").
|
257
|
-
tlm_with_units("INST HEALTH_STATUS TEMP1").
|
258
|
-
tlm_variable("INST HEALTH_STATUS TEMP1", :RAW).
|
254
|
+
expect(tlm("INST HEALTH_STATUS TEMP1")).to eql -100.0
|
255
|
+
expect(tlm_raw("INST HEALTH_STATUS TEMP1")).to eql 0
|
256
|
+
expect(tlm_formatted("INST HEALTH_STATUS TEMP1")).to eql "-100.000"
|
257
|
+
expect(tlm_with_units("INST HEALTH_STATUS TEMP1")).to eql "-100.000 C"
|
258
|
+
expect(tlm_variable("INST HEALTH_STATUS TEMP1", :RAW)).to eql 0
|
259
259
|
set_tlm("INST HEALTH_STATUS TEMP1 = 1")
|
260
260
|
set_tlm_raw("INST HEALTH_STATUS TEMP1 = 0")
|
261
261
|
}.to_not raise_error
|
@@ -263,53 +263,53 @@ module Cosmos
|
|
263
263
|
end
|
264
264
|
|
265
265
|
describe "get_tlm_packet" do
|
266
|
-
it "
|
267
|
-
get_tlm_packet("INST", "HEALTH_STATUS", :RAW).
|
266
|
+
it "gets the packet values" do
|
267
|
+
expect(get_tlm_packet("INST", "HEALTH_STATUS", :RAW)).to include(["TEMP1", 0, :RED_LOW])
|
268
268
|
end
|
269
269
|
end
|
270
270
|
|
271
271
|
describe "get_tlm_values" do
|
272
|
-
it "
|
272
|
+
it "gets the given values" do
|
273
273
|
vals = get_tlm_values([["INST", "HEALTH_STATUS", "TEMP1"], ["INST", "HEALTH_STATUS", "TEMP2"]])
|
274
|
-
vals[0][0].
|
275
|
-
vals[1][0].
|
276
|
-
vals[2][0].
|
277
|
-
vals[3].
|
274
|
+
expect(vals[0][0]).to eql -100.0
|
275
|
+
expect(vals[1][0]).to eql :RED_LOW
|
276
|
+
expect(vals[2][0]).to eql [-80.0, -70.0, 60.0, 80.0, -20.0, 20.0]
|
277
|
+
expect(vals[3]).to eql :DEFAULT
|
278
278
|
end
|
279
279
|
end
|
280
280
|
|
281
281
|
describe "get_tlm_list" do
|
282
|
-
it "
|
283
|
-
get_tlm_list("INST").
|
282
|
+
it "gets packets for a given target" do
|
283
|
+
expect(get_tlm_list("INST")).to include(["HEALTH_STATUS", "Health and status from the instrument"])
|
284
284
|
end
|
285
285
|
end
|
286
286
|
|
287
287
|
describe "get_tlm_item_list" do
|
288
|
-
it "
|
289
|
-
get_tlm_item_list("INST", "HEALTH_STATUS").
|
288
|
+
it "gets telemetry for a given packet" do
|
289
|
+
expect(get_tlm_item_list("INST", "HEALTH_STATUS")).to include(["TEMP1",nil,"Temperature #1"])
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
293
|
describe "get_tlm_details" do
|
294
|
-
it "
|
294
|
+
it "gets telemetry for a given packet" do
|
295
295
|
details = get_tlm_details([["INST", "HEALTH_STATUS", "TEMP1"], ["INST", "HEALTH_STATUS", "TEMP2"]])
|
296
|
-
details[0]["name"].
|
297
|
-
details[1]["name"].
|
296
|
+
expect(details[0]["name"]).to eql "TEMP1"
|
297
|
+
expect(details[1]["name"]).to eql "TEMP2"
|
298
298
|
end
|
299
299
|
end
|
300
300
|
|
301
301
|
describe "get_out_of_limits" do
|
302
|
-
it "
|
303
|
-
get_out_of_limits.
|
302
|
+
it "gets all out of limits items" do
|
303
|
+
expect(get_out_of_limits).to include(["INST","HEALTH_STATUS","TEMP1",:RED_LOW])
|
304
304
|
end
|
305
305
|
end
|
306
306
|
|
307
307
|
describe "get_overall_limits_state" do
|
308
|
-
it "
|
309
|
-
get_overall_limits_state.
|
308
|
+
it "gets the overall limits state of the system" do
|
309
|
+
expect(get_overall_limits_state).to eql :RED
|
310
310
|
end
|
311
311
|
|
312
|
-
it "
|
312
|
+
it "ignores specified items" do
|
313
313
|
ignore = []
|
314
314
|
ignore << %w(INST HEALTH_STATUS TEMP1)
|
315
315
|
ignore << %w(INST HEALTH_STATUS TEMP2)
|
@@ -317,106 +317,106 @@ module Cosmos
|
|
317
317
|
ignore << %w(INST HEALTH_STATUS TEMP4)
|
318
318
|
ignore << %w(INST HEALTH_STATUS GROUND1STATUS)
|
319
319
|
ignore << %w(INST HEALTH_STATUS GROUND2STATUS)
|
320
|
-
get_overall_limits_state(ignore).
|
320
|
+
expect(get_overall_limits_state(ignore)).to eql :STALE
|
321
321
|
end
|
322
322
|
end
|
323
323
|
|
324
324
|
describe "limits_enabled?, disable_limits, enable_limits" do
|
325
|
-
it "
|
326
|
-
limits_enabled?("INST HEALTH_STATUS TEMP1").
|
325
|
+
it "enables, disable, and check limits for an item" do
|
326
|
+
expect(limits_enabled?("INST HEALTH_STATUS TEMP1")).to be_truthy
|
327
327
|
disable_limits("INST HEALTH_STATUS TEMP1")
|
328
|
-
limits_enabled?("INST HEALTH_STATUS TEMP1").
|
328
|
+
expect(limits_enabled?("INST HEALTH_STATUS TEMP1")).to be_falsey
|
329
329
|
enable_limits("INST HEALTH_STATUS TEMP1")
|
330
|
-
limits_enabled?("INST HEALTH_STATUS TEMP1").
|
330
|
+
expect(limits_enabled?("INST HEALTH_STATUS TEMP1")).to be_truthy
|
331
331
|
end
|
332
332
|
end
|
333
333
|
|
334
334
|
describe "get_limits, set_limits" do
|
335
|
-
it "
|
336
|
-
get_limits("INST", "HEALTH_STATUS", "TEMP1").
|
337
|
-
set_limits("INST", "HEALTH_STATUS", "TEMP1", 1, 2, 5, 6, 3, 4).
|
335
|
+
it "gets and set limits for an item" do
|
336
|
+
expect(get_limits("INST", "HEALTH_STATUS", "TEMP1")).to eql [:DEFAULT, 1, true, -80.0, -70.0, 60.0, 80.0, -20.0, 20.0]
|
337
|
+
expect(set_limits("INST", "HEALTH_STATUS", "TEMP1", 1, 2, 5, 6, 3, 4)).to eql [:CUSTOM, 1, true, 1.0, 2.0, 5.0, 6.0, 3.0, 4.0]
|
338
338
|
end
|
339
339
|
end
|
340
340
|
|
341
341
|
describe "get_limits_groups, enable_limits_group, disable_limits_group" do
|
342
|
-
it "
|
343
|
-
get_limits_groups.
|
342
|
+
it "enables, disable, and get groups" do
|
343
|
+
expect(get_limits_groups).to include("FIRST")
|
344
344
|
enable_limits_group("FIRST")
|
345
345
|
disable_limits_group("FIRST")
|
346
346
|
end
|
347
347
|
end
|
348
348
|
|
349
349
|
describe "get_limits_sets, enable_limits_set, disable_limits_set" do
|
350
|
-
it "
|
350
|
+
it "enables, disable, and get sets CTS-16" do
|
351
351
|
if get_limits_sets.include?(:CUSTOM)
|
352
|
-
get_limits_sets.
|
352
|
+
expect(get_limits_sets).to eql [:DEFAULT,:TVAC,:CUSTOM]
|
353
353
|
else
|
354
|
-
get_limits_sets.
|
354
|
+
expect(get_limits_sets).to eql [:DEFAULT,:TVAC]
|
355
355
|
end
|
356
356
|
set_limits_set(:TVAC)
|
357
|
-
get_limits_set.
|
357
|
+
expect(get_limits_set).to eql :TVAC
|
358
358
|
set_limits_set(:DEFAULT)
|
359
|
-
get_limits_set.
|
359
|
+
expect(get_limits_set).to eql :DEFAULT
|
360
360
|
end
|
361
361
|
end
|
362
362
|
|
363
363
|
describe "get_target_list" do
|
364
|
-
it "
|
365
|
-
get_target_list.
|
364
|
+
it "returns the list of targets" do
|
365
|
+
expect(get_target_list).to include("INST")
|
366
366
|
end
|
367
367
|
end
|
368
368
|
|
369
369
|
describe "subscribe_limits_events, get_limits_event, unsubscribe_limits_events" do
|
370
|
-
it "
|
370
|
+
it "raises an error if non_block and the queue is empty" do
|
371
371
|
id = subscribe_limits_events
|
372
372
|
expect { get_limits_event(id, true) }.to raise_error(ThreadError, "queue empty")
|
373
373
|
unsubscribe_limits_events(id)
|
374
374
|
end
|
375
375
|
|
376
|
-
it "
|
376
|
+
it "subscribes and get limits change events" do
|
377
377
|
id = subscribe_limits_events
|
378
378
|
CmdTlmServer.instance.post_limits_event(:LIMITS_CHANGE, ['TGT','PKT','ITEM',:YELLOW,:RED])
|
379
379
|
result = get_limits_event(id, true)
|
380
|
-
result[0].
|
380
|
+
expect(result[0]).to eql :LIMITS_CHANGE
|
381
381
|
unsubscribe_limits_events(id)
|
382
382
|
end
|
383
383
|
|
384
|
-
it "
|
384
|
+
it "subscribes and get limits settings events" do
|
385
385
|
id = subscribe_limits_events
|
386
386
|
CmdTlmServer.instance.post_limits_event(:LIMITS_SETTINGS, ['TGT','PKT','ITEM',:DEFAULT])
|
387
387
|
result = get_limits_event(id, true)
|
388
|
-
result[0].
|
388
|
+
expect(result[0]).to eql :LIMITS_SETTINGS
|
389
389
|
unsubscribe_limits_events(id)
|
390
390
|
end
|
391
391
|
|
392
|
-
it "
|
392
|
+
it "handles unknown limits events" do
|
393
393
|
id = subscribe_limits_events
|
394
394
|
CmdTlmServer.instance.post_limits_event(:UNKNOWN, "This is a test")
|
395
395
|
result = get_limits_event(id, true)
|
396
|
-
result[0].
|
396
|
+
expect(result[0]).to eql :UNKNOWN
|
397
397
|
unsubscribe_limits_events(id)
|
398
398
|
end
|
399
399
|
end
|
400
400
|
|
401
401
|
describe "subscribe_packet_data, get_packet, unsubscribe_packet_data" do
|
402
|
-
it "
|
402
|
+
it "raises an error if non_block and the queue is empty" do
|
403
403
|
id = subscribe_packet_data([["INST","HEALTH_STATUS"]])
|
404
404
|
expect { get_packet(id, true) }.to raise_error(ThreadError, "queue empty")
|
405
405
|
unsubscribe_packet_data(id)
|
406
406
|
end
|
407
407
|
|
408
|
-
it "
|
408
|
+
it "subscribes and get limits events" do
|
409
409
|
id = subscribe_packet_data([["INST","HEALTH_STATUS"]])
|
410
410
|
CmdTlmServer.instance.post_packet(System.telemetry.packet("INST","HEALTH_STATUS"))
|
411
411
|
packet = get_packet(id, true)
|
412
|
-
packet.target_name.
|
413
|
-
packet.packet_name.
|
412
|
+
expect(packet.target_name).to eql "INST"
|
413
|
+
expect(packet.packet_name).to eql "HEALTH_STATUS"
|
414
414
|
unsubscribe_packet_data(id)
|
415
415
|
end
|
416
416
|
end
|
417
417
|
|
418
418
|
describe "play_wav_file" do
|
419
|
-
it "
|
419
|
+
it "plays a wav file if Qt is available" do
|
420
420
|
module Qt
|
421
421
|
def self.execute_in_main_thread(bool); yield; end
|
422
422
|
class CoreApplication; def self.instance; true; end; end;
|
@@ -428,7 +428,7 @@ module Cosmos
|
|
428
428
|
end
|
429
429
|
|
430
430
|
describe "status_bar" do
|
431
|
-
it "
|
431
|
+
it "sets the ScriptRunner status bar" do
|
432
432
|
class ScriptRunner; end
|
433
433
|
sc = ScriptRunner.new
|
434
434
|
expect(sc).to receive(:script_set_status).with("HI")
|
@@ -437,56 +437,56 @@ module Cosmos
|
|
437
437
|
end
|
438
438
|
|
439
439
|
describe "ask_string, ask" do
|
440
|
-
it "
|
440
|
+
it "gets user input" do
|
441
441
|
$stdout = StringIO.new
|
442
442
|
expect(self).to receive(:gets) { '10' }
|
443
|
-
ask_string("").
|
443
|
+
expect(ask_string("")).to eql '10'
|
444
444
|
expect(self).to receive(:gets) { '10' }
|
445
|
-
ask("").
|
445
|
+
expect(ask("")).to eql 10
|
446
446
|
$stdout = STDOUT
|
447
447
|
end
|
448
448
|
end
|
449
449
|
|
450
450
|
describe "prompt, prompt_message_box" do
|
451
|
-
it "
|
451
|
+
it "prompts the user for input" do
|
452
452
|
$stdout = StringIO.new
|
453
453
|
expect(self).to receive(:gets) { 'message' }
|
454
|
-
prompt("").
|
454
|
+
expect(prompt("")).to eql 'message'
|
455
455
|
expect(self).to receive(:gets) { 'b1' }
|
456
|
-
message_box("",["b1","b2"]).
|
456
|
+
expect(message_box("",["b1","b2"])).to eql 'b1'
|
457
457
|
$stdout = STDOUT
|
458
458
|
end
|
459
459
|
end
|
460
460
|
|
461
461
|
describe "check, check_formatted, check_with_units, check_raw" do
|
462
|
-
it "
|
462
|
+
it "checks a telemetry item vs a condition" do
|
463
463
|
capture_io do |stdout|
|
464
464
|
check("INST HEALTH_STATUS TEMP1 == -100")
|
465
|
-
stdout.string.
|
465
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == -100 success"
|
466
466
|
stdout.rewind
|
467
467
|
|
468
468
|
check("INST","HEALTH_STATUS","TEMP1","== -100")
|
469
|
-
stdout.string.
|
469
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == -100 success"
|
470
470
|
stdout.rewind
|
471
471
|
|
472
472
|
check_formatted("INST HEALTH_STATUS TEMP1 == '-100.000'")
|
473
|
-
stdout.string.
|
473
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == '-100.000' success"
|
474
474
|
stdout.rewind
|
475
475
|
|
476
476
|
check_formatted("INST","HEALTH_STATUS","TEMP1","== '-100.000'")
|
477
|
-
stdout.string.
|
477
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == '-100.000' success"
|
478
478
|
stdout.rewind
|
479
479
|
|
480
480
|
check_with_units("INST HEALTH_STATUS TEMP1 == '-100.000 C'")
|
481
|
-
stdout.string.
|
481
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == '-100.000 C' success"
|
482
482
|
stdout.rewind
|
483
483
|
|
484
484
|
check_with_units("INST","HEALTH_STATUS","TEMP1","== '-100.000 C'")
|
485
|
-
stdout.string.
|
485
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == '-100.000 C' success"
|
486
486
|
stdout.rewind
|
487
487
|
|
488
488
|
check_raw("INST HEALTH_STATUS TEMP1")
|
489
|
-
stdout.string.
|
489
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == 0"
|
490
490
|
end
|
491
491
|
|
492
492
|
check("INST HEALTH_STATUS TEMP1 < 0")
|
@@ -495,17 +495,17 @@ module Cosmos
|
|
495
495
|
end
|
496
496
|
|
497
497
|
describe "check_tolerance, check_tolerance_raw" do
|
498
|
-
it "
|
498
|
+
it "checks a telemetry item vs tolerance" do
|
499
499
|
capture_io do |stdout|
|
500
500
|
check_tolerance("INST HEALTH_STATUS TEMP1", -100.0, 1)
|
501
|
-
stdout.string.
|
501
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within range"
|
502
502
|
stdout.rewind
|
503
503
|
|
504
504
|
expect { check_tolerance("INST HEALTH_STATUS TEMP1", -200.0, 1) }.to raise_error(CheckError, /CHECK: INST HEALTH_STATUS TEMP1 failed to be within range/)
|
505
505
|
stdout.rewind
|
506
506
|
|
507
507
|
check_tolerance_raw("INST HEALTH_STATUS TEMP1", 0, 1)
|
508
|
-
stdout.string.
|
508
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within range"
|
509
509
|
stdout.rewind
|
510
510
|
|
511
511
|
expect { check_tolerance_raw("INST HEALTH_STATUS TEMP1", 100, 1) }.to raise_error(CheckError, /CHECK: INST HEALTH_STATUS TEMP1 failed to be within range/)
|
@@ -515,10 +515,10 @@ module Cosmos
|
|
515
515
|
end
|
516
516
|
|
517
517
|
describe "check_expression" do
|
518
|
-
it "
|
518
|
+
it "checks an arbitrary expression" do
|
519
519
|
capture_io do |stdout|
|
520
520
|
check_expression("true == true")
|
521
|
-
stdout.string.
|
521
|
+
expect(stdout.string).to match "CHECK: true == true is TRUE"
|
522
522
|
end
|
523
523
|
|
524
524
|
expect { check_expression("true == false") }.to raise_error(CheckError, "CHECK: true == false is FALSE")
|
@@ -526,70 +526,70 @@ module Cosmos
|
|
526
526
|
end
|
527
527
|
|
528
528
|
describe "wait, wait_raw, wait_tolerance, wait_tolerance_raw" do
|
529
|
-
it "
|
529
|
+
it "waits for telemetry check to be true" do
|
530
530
|
capture_io do |stdout|
|
531
531
|
# Success
|
532
532
|
wait("INST HEALTH_STATUS TEMP1 == -100.0", 5)
|
533
|
-
stdout.string.
|
533
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 == -100.0"
|
534
534
|
stdout.rewind
|
535
535
|
wait_raw("INST HEALTH_STATUS TEMP1 == 0", 5)
|
536
|
-
stdout.string.
|
536
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 == 0"
|
537
537
|
stdout.rewind
|
538
538
|
wait_tolerance("INST HEALTH_STATUS TEMP1", -100.0, 1, 5)
|
539
|
-
stdout.string.
|
539
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 was within"
|
540
540
|
stdout.rewind
|
541
541
|
wait_tolerance_raw("INST HEALTH_STATUS TEMP1", 0, 1, 5)
|
542
|
-
stdout.string.
|
542
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 was within"
|
543
543
|
stdout.rewind
|
544
544
|
|
545
545
|
# Failure
|
546
546
|
wait("INST HEALTH_STATUS TEMP1 == -200.0", 0.1)
|
547
|
-
stdout.string.
|
547
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 == -200.0 failed"
|
548
548
|
stdout.rewind
|
549
549
|
wait_raw("INST HEALTH_STATUS TEMP1 == 100", 0.1)
|
550
|
-
stdout.string.
|
550
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 == 100 failed"
|
551
551
|
stdout.rewind
|
552
552
|
wait_tolerance("INST HEALTH_STATUS TEMP1", -200.0, 1, 0.1)
|
553
|
-
stdout.string.
|
553
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 failed to be within"
|
554
554
|
stdout.rewind
|
555
555
|
wait_tolerance_raw("INST HEALTH_STATUS TEMP1", 100, 1, 0.1)
|
556
|
-
stdout.string.
|
556
|
+
expect(stdout.string).to match "WAIT: INST HEALTH_STATUS TEMP1 failed to be within"
|
557
557
|
stdout.rewind
|
558
558
|
end
|
559
559
|
end
|
560
560
|
end
|
561
561
|
|
562
562
|
describe "wait_expression" do
|
563
|
-
it "
|
563
|
+
it "waits for an expression to be true" do
|
564
564
|
capture_io do |stdout|
|
565
565
|
# Success
|
566
566
|
wait_expression("true == true", 5)
|
567
|
-
stdout.string.
|
567
|
+
expect(stdout.string).to match "WAIT: true == true is TRUE"
|
568
568
|
stdout.rewind
|
569
569
|
|
570
570
|
# Failure
|
571
571
|
wait_expression("true == false", 0.1)
|
572
|
-
stdout.string.
|
572
|
+
expect(stdout.string).to match "WAIT: true == false is FALSE"
|
573
573
|
stdout.rewind
|
574
574
|
end
|
575
575
|
end
|
576
576
|
end
|
577
577
|
|
578
578
|
describe "wait_check, wait_check_raw, wait_check_tolerance, wait_check_tolerance_raw" do
|
579
|
-
it "
|
579
|
+
it "waits for telemetry check to be true" do
|
580
580
|
capture_io do |stdout|
|
581
581
|
# Success
|
582
582
|
wait_check("INST HEALTH_STATUS TEMP1 == -100.0", 5)
|
583
|
-
stdout.string.
|
583
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == -100.0"
|
584
584
|
stdout.rewind
|
585
585
|
wait_check_raw("INST HEALTH_STATUS TEMP1 == 0", 5)
|
586
|
-
stdout.string.
|
586
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 == 0"
|
587
587
|
stdout.rewind
|
588
588
|
wait_check_tolerance("INST HEALTH_STATUS TEMP1", -100.0, 1, 5)
|
589
|
-
stdout.string.
|
589
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within"
|
590
590
|
stdout.rewind
|
591
591
|
wait_check_tolerance_raw("INST HEALTH_STATUS TEMP1", 0, 1, 5)
|
592
|
-
stdout.string.
|
592
|
+
expect(stdout.string).to match "CHECK: INST HEALTH_STATUS TEMP1 was within"
|
593
593
|
stdout.rewind
|
594
594
|
end
|
595
595
|
|
@@ -604,11 +604,11 @@ module Cosmos
|
|
604
604
|
end
|
605
605
|
|
606
606
|
describe "wait_check_expression" do
|
607
|
-
it "
|
607
|
+
it "waits for an expression to be true" do
|
608
608
|
capture_io do |stdout|
|
609
609
|
# Success
|
610
610
|
wait_check_expression("true == true", 5)
|
611
|
-
stdout.string.
|
611
|
+
expect(stdout.string).to match "CHECK: true == true is TRUE"
|
612
612
|
stdout.rewind
|
613
613
|
end
|
614
614
|
|
@@ -618,7 +618,7 @@ module Cosmos
|
|
618
618
|
end
|
619
619
|
|
620
620
|
describe "wait_packet, wait_check_packet" do
|
621
|
-
it "
|
621
|
+
it "waits for a certain number of packets" do
|
622
622
|
capture_io do |stdout|
|
623
623
|
wait_packet("INST","HEALTH_STATUS",1,0.1)
|
624
624
|
end
|
@@ -628,36 +628,36 @@ module Cosmos
|
|
628
628
|
end
|
629
629
|
|
630
630
|
describe "get_interface_names" do
|
631
|
-
it "
|
632
|
-
get_interface_names.
|
631
|
+
it "returns all interfaces" do
|
632
|
+
expect(get_interface_names).to include("INST_INT")
|
633
633
|
end
|
634
634
|
end
|
635
635
|
|
636
636
|
describe "connect_interface, disconnect_interface, interface_state" do
|
637
|
-
it "
|
637
|
+
it "connects, disconnect and return the state of the interface CTS-3" do
|
638
638
|
connect_interface("INST_INT")
|
639
|
-
interface_state("INST_INT").
|
639
|
+
expect(interface_state("INST_INT")).to eql "CONNECTED"
|
640
640
|
disconnect_interface("INST_INT")
|
641
641
|
end
|
642
642
|
end
|
643
643
|
|
644
644
|
describe "map_target_to_interface" do
|
645
|
-
it "
|
645
|
+
it "maps a target name to an interface" do
|
646
646
|
map_target_to_interface("INST","INST_INT")
|
647
647
|
end
|
648
648
|
end
|
649
649
|
|
650
650
|
describe "connect_router, disconnect_router, get_router_names, router_state" do
|
651
|
-
it "
|
652
|
-
get_router_names.
|
651
|
+
it "returns connect, disconnect, and list the routers CTS-11" do
|
652
|
+
expect(get_router_names).to include("PREIDENTIFIED_ROUTER")
|
653
653
|
connect_router("PREIDENTIFIED_ROUTER")
|
654
|
-
router_state("PREIDENTIFIED_ROUTER").
|
654
|
+
expect(router_state("PREIDENTIFIED_ROUTER")).to eql "CONNECTED"
|
655
655
|
disconnect_router("PREIDENTIFIED_ROUTER")
|
656
656
|
end
|
657
657
|
end
|
658
658
|
|
659
659
|
describe "logging methods" do
|
660
|
-
it "
|
660
|
+
it "starts and stop logging and get filenames CTS-14" do
|
661
661
|
start_logging
|
662
662
|
stop_logging
|
663
663
|
get_cmd_log_filename
|
@@ -678,23 +678,23 @@ module Cosmos
|
|
678
678
|
start_new_server_message_log
|
679
679
|
sleep 0.1
|
680
680
|
filename = get_server_message_log_filename
|
681
|
-
filename.
|
681
|
+
expect(filename).to match /server_messages.txt/
|
682
682
|
end
|
683
683
|
end
|
684
684
|
|
685
685
|
describe "display" do
|
686
|
-
it "
|
686
|
+
it "displays a telemetry viewer screen" do
|
687
687
|
expect { display("HI") }.to raise_error(RuntimeError, /HI could not be displayed/)
|
688
688
|
end
|
689
689
|
end
|
690
690
|
describe "clear" do
|
691
|
-
it "
|
691
|
+
it "closes a telemetry viewer screen" do
|
692
692
|
expect { clear("HI") }.to raise_error(RuntimeError, /HI could not be cleared/)
|
693
693
|
end
|
694
694
|
end
|
695
695
|
|
696
696
|
describe "ScriptRunnerFrame methods" do
|
697
|
-
it "
|
697
|
+
it "calls various ScriptRunnerFrame methods" do
|
698
698
|
class Dummy; def method_missing(meth, *args, &block); end; end
|
699
699
|
class ScriptRunnerFrame
|
700
700
|
def self.method_missing(meth, *args, &block); end
|
@@ -712,22 +712,22 @@ module Cosmos
|
|
712
712
|
end
|
713
713
|
|
714
714
|
describe "start" do
|
715
|
-
it "
|
715
|
+
it "starts a script locally" do
|
716
716
|
class ScriptRunnerFrame; def self.instance; false; end; end
|
717
717
|
start("cosmos.rb")
|
718
718
|
end
|
719
719
|
|
720
|
-
it "
|
720
|
+
it "starts a script without the .rb extension" do
|
721
721
|
class ScriptRunnerFrame; def self.instance; false; end; end
|
722
722
|
start("cosmos")
|
723
723
|
end
|
724
724
|
|
725
|
-
it "
|
725
|
+
it "raises an error if the script can't be found" do
|
726
726
|
class ScriptRunnerFrame; def self.instance; false; end; end
|
727
727
|
expect { start("unknown_script.rb") }.to raise_error(RuntimeError)
|
728
728
|
end
|
729
729
|
|
730
|
-
it "
|
730
|
+
it "starts a script within ScriptRunnerFrame" do
|
731
731
|
class ScriptRunnerFrame
|
732
732
|
@@instrumented_cache = {}
|
733
733
|
def self.instance; true; end
|