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
@@ -20,7 +20,7 @@ module Cosmos
|
|
20
20
|
end
|
21
21
|
|
22
22
|
describe "connect" do
|
23
|
-
it "
|
23
|
+
it "passes a new TcpipClientStream to the stream protocol" do
|
24
24
|
stream = double("stream")
|
25
25
|
allow(stream).to receive(:connect)
|
26
26
|
expect(TcpipClientStream).to receive(:new) { stream }
|
@@ -28,9 +28,9 @@ module Cosmos
|
|
28
28
|
expect(stream).to receive(:raw_logger_pair=) { nil }
|
29
29
|
i = LincInterface.new('localhost','8888')
|
30
30
|
i.target_names << "INST"
|
31
|
-
i.connected
|
31
|
+
expect(i.connected?).to be_falsey
|
32
32
|
i.connect
|
33
|
-
i.connected
|
33
|
+
expect(i.connected?).to be_truthy
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -44,55 +44,55 @@ module Cosmos
|
|
44
44
|
expect(stream).to receive(:raw_logger_pair=) { nil }
|
45
45
|
@i = LincInterface.new('localhost','8888','true','2','nil','5','0','16','4','GSE_HDR_GUID','BIG_ENDIAN','GSE_HDR_LEN')
|
46
46
|
@i.target_names << "INST"
|
47
|
-
@i.connected
|
47
|
+
expect(@i.connected?).to be_falsey
|
48
48
|
@i.connect
|
49
|
-
@i.connected
|
49
|
+
expect(@i.connected?).to be_truthy
|
50
50
|
end
|
51
51
|
|
52
|
-
it "
|
52
|
+
it "returns an exception if its not connected" do
|
53
53
|
i = LincInterface.new('localhost','8888')
|
54
54
|
expect { i.write(Packet.new("TGT","PKT")) }.to raise_error("Interface not connected")
|
55
55
|
end
|
56
56
|
|
57
|
-
it "
|
57
|
+
it "adds to the ignored list upon an error ignore command" do
|
58
58
|
cmd = System.commands.packet("INST","COSMOS_ERROR_IGNORE")
|
59
59
|
cmd.restore_defaults
|
60
60
|
cmd.write("CODE", 0x55)
|
61
61
|
@i.write(cmd)
|
62
|
-
@i.instance_variable_get(:@ignored_error_codes).
|
62
|
+
expect(@i.instance_variable_get(:@ignored_error_codes)).to include(0x55)
|
63
63
|
end
|
64
64
|
|
65
|
-
it "
|
65
|
+
it "removes from the ignored list upon an error handle command" do
|
66
66
|
@i.instance_variable_get(:@ignored_error_codes) << 0x66
|
67
|
-
@i.instance_variable_get(:@ignored_error_codes).
|
67
|
+
expect(@i.instance_variable_get(:@ignored_error_codes)).to include(0x66)
|
68
68
|
cmd = System.commands.packet("INST","COSMOS_ERROR_HANDLE")
|
69
69
|
cmd.restore_defaults
|
70
70
|
cmd.write("CODE", 0x66)
|
71
71
|
@i.write(cmd)
|
72
|
-
@i.instance_variable_get(:@ignored_error_codes).
|
72
|
+
expect(@i.instance_variable_get(:@ignored_error_codes)).not_to include(0x66)
|
73
73
|
end
|
74
74
|
|
75
|
-
it "
|
75
|
+
it "enables and disable handshakes upon command" do
|
76
76
|
enable = System.commands.packet("INST","COSMOS_HANDSHAKE_EN")
|
77
77
|
enable.restore_defaults
|
78
78
|
disable = System.commands.packet("INST","COSMOS_HANDSHAKE_DS")
|
79
79
|
disable.restore_defaults
|
80
80
|
|
81
81
|
@i.write(enable)
|
82
|
-
@i.instance_variable_get(:@handshake_enabled).
|
82
|
+
expect(@i.instance_variable_get(:@handshake_enabled)).to be_truthy
|
83
83
|
@i.write(disable)
|
84
|
-
@i.instance_variable_get(:@handshake_enabled).
|
84
|
+
expect(@i.instance_variable_get(:@handshake_enabled)).to be_falsey
|
85
85
|
@i.write(enable)
|
86
|
-
@i.instance_variable_get(:@handshake_enabled).
|
86
|
+
expect(@i.instance_variable_get(:@handshake_enabled)).to be_truthy
|
87
87
|
end
|
88
88
|
|
89
|
-
it "
|
89
|
+
it "timeouts waiting for handshake" do
|
90
90
|
cmd = System.commands.packet("INST","LINC_COMMAND")
|
91
91
|
cmd.restore_defaults
|
92
92
|
expect { @i.write(cmd) }.to raise_error(/Timeout/)
|
93
93
|
end
|
94
94
|
|
95
|
-
it "
|
95
|
+
it "does not timeout if handshakes disabled" do
|
96
96
|
disable = System.commands.packet("INST","COSMOS_HANDSHAKE_DS")
|
97
97
|
disable.restore_defaults
|
98
98
|
@i.write(disable)
|
@@ -125,7 +125,7 @@ module Cosmos
|
|
125
125
|
allow_any_instance_of(LengthStreamProtocol).to receive(:read).and_return(@handshake)
|
126
126
|
end
|
127
127
|
|
128
|
-
it "
|
128
|
+
it "does not timeout if the handshake is received" do
|
129
129
|
t = Thread.new do
|
130
130
|
sleep 1
|
131
131
|
@i.read
|
@@ -134,9 +134,9 @@ module Cosmos
|
|
134
134
|
t.join
|
135
135
|
end
|
136
136
|
|
137
|
-
it "
|
137
|
+
it "warns if an error code is set" do
|
138
138
|
expect(Logger).to receive(:warn) do |msg|
|
139
|
-
msg.
|
139
|
+
expect(msg).to eql "Warning sending command (12345): BAD"
|
140
140
|
end
|
141
141
|
t = Thread.new do
|
142
142
|
sleep 1
|
@@ -146,7 +146,7 @@ module Cosmos
|
|
146
146
|
t.join
|
147
147
|
end
|
148
148
|
|
149
|
-
it "
|
149
|
+
it "raises an exception if the status is 'ERROR'" do
|
150
150
|
@handshake.write("STATUS", "ERROR")
|
151
151
|
t = Thread.new do
|
152
152
|
sleep 1
|
@@ -168,12 +168,12 @@ module Cosmos
|
|
168
168
|
expect(stream).to receive(:raw_logger_pair=) { nil }
|
169
169
|
@i = LincInterface.new('localhost','8888','true','2','nil','5','0','16','4','GSE_HDR_GUID','BIG_ENDIAN','GSE_HDR_LEN')
|
170
170
|
@i.target_names << "INST"
|
171
|
-
@i.connected
|
171
|
+
expect(@i.connected?).to be_falsey
|
172
172
|
@i.connect
|
173
|
-
@i.connected
|
173
|
+
expect(@i.connected?).to be_truthy
|
174
174
|
end
|
175
175
|
|
176
|
-
it "
|
176
|
+
it "handles local commands" do
|
177
177
|
@handshake = System.telemetry.packet("INST","HANDSHAKE")
|
178
178
|
@handshake.write("GSE_HDR_ID", 1001)
|
179
179
|
@handshake.write("ORIGIN", 1)
|
@@ -181,13 +181,13 @@ module Cosmos
|
|
181
181
|
allow_any_instance_of(LengthStreamProtocol).to receive(:read).and_return(@handshake)
|
182
182
|
|
183
183
|
expect(Logger).to receive(:info) do |msg|
|
184
|
-
msg.
|
184
|
+
expect(msg).to match(/External Command/)
|
185
185
|
end
|
186
186
|
|
187
187
|
@i.read
|
188
188
|
end
|
189
189
|
|
190
|
-
it "
|
190
|
+
it "handles response overflows" do
|
191
191
|
@handshake = System.telemetry.packet("INST","HANDSHAKE")
|
192
192
|
@handshake.write("GSE_HDR_ID", 1001)
|
193
193
|
@handshake.write("ORIGIN", 0)
|
@@ -16,38 +16,38 @@ module Cosmos
|
|
16
16
|
describe SerialInterface do
|
17
17
|
|
18
18
|
describe "initialize" do
|
19
|
-
it "
|
19
|
+
it "initializes the instance variables" do
|
20
20
|
i = SerialInterface.new('COM1','COM1','9600','NONE','1','0','0','burst')
|
21
|
-
i.name.
|
21
|
+
expect(i.name).to eql "Cosmos::SerialInterface"
|
22
22
|
end
|
23
23
|
|
24
|
-
it "
|
24
|
+
it "is not writeable if no write port given" do
|
25
25
|
i = SerialInterface.new('nil','COM1','9600','NONE','1','0','0','burst')
|
26
|
-
i.name.
|
27
|
-
i.write_allowed
|
28
|
-
i.write_raw_allowed
|
29
|
-
i.read_allowed
|
26
|
+
expect(i.name).to eql "Cosmos::SerialInterface"
|
27
|
+
expect(i.write_allowed?).to be_falsey
|
28
|
+
expect(i.write_raw_allowed?).to be_falsey
|
29
|
+
expect(i.read_allowed?).to be_truthy
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
32
|
+
it "is not readable if no read port given" do
|
33
33
|
i = SerialInterface.new('COM1','nil','9600','NONE','1','0','0','burst')
|
34
|
-
i.name.
|
35
|
-
i.write_allowed
|
36
|
-
i.write_raw_allowed
|
37
|
-
i.read_allowed
|
34
|
+
expect(i.name).to eql "Cosmos::SerialInterface"
|
35
|
+
expect(i.write_allowed?).to be_truthy
|
36
|
+
expect(i.write_raw_allowed?).to be_truthy
|
37
|
+
expect(i.read_allowed?).to be_falsey
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
describe "connect" do
|
42
|
-
it "
|
42
|
+
it "passes a new SerialStream to the stream protocol" do
|
43
43
|
# Ensure the 'NONE' parity is coverted to a symbol
|
44
44
|
if Kernel.is_windows?
|
45
45
|
i = SerialInterface.new('COM1','COM1','9600','NONE','1','0','0','burst')
|
46
|
-
i.connected
|
46
|
+
expect(i.connected?).to be_falsey
|
47
47
|
i.connect
|
48
|
-
i.connected
|
48
|
+
expect(i.connected?).to be_truthy
|
49
49
|
i.disconnect
|
50
|
-
i.connected
|
50
|
+
expect(i.connected?).to be_falsey
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -45,17 +45,17 @@ end
|
|
45
45
|
end
|
46
46
|
|
47
47
|
describe "initialize" do
|
48
|
-
it "
|
48
|
+
it "complains if the simulated target file doesn't exist" do
|
49
49
|
expect { SimulatedTargetInterface.new("doesnt_exist.rb") }.to raise_error(/Unable to require doesnt_exist.rb/)
|
50
50
|
end
|
51
51
|
|
52
|
-
it "
|
52
|
+
it "creates the simulated target class" do
|
53
53
|
SimulatedTargetInterface.new("test_inst.rb")
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
57
|
describe "connect" do
|
58
|
-
it "
|
58
|
+
it "creates the simulated target" do
|
59
59
|
sti = SimulatedTargetInterface.new("test_inst.rb")
|
60
60
|
sti.target_names = ['COSMOS']
|
61
61
|
sti.connect
|
@@ -63,63 +63,63 @@ end
|
|
63
63
|
end
|
64
64
|
|
65
65
|
describe "connected?" do
|
66
|
-
it "
|
66
|
+
it "initiallies be false" do
|
67
67
|
sti = SimulatedTargetInterface.new("test_inst.rb")
|
68
68
|
sti.target_names = ['COSMOS']
|
69
|
-
sti.connected
|
69
|
+
expect(sti.connected?).to be_falsey
|
70
70
|
sti.connect
|
71
|
-
sti.connected
|
71
|
+
expect(sti.connected?).to be_truthy
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
describe "read" do
|
76
|
-
it "
|
76
|
+
it "complains if disconnected" do
|
77
77
|
expect { SimulatedTargetInterface.new("test_inst.rb").read }.to raise_error("Interface not connected")
|
78
78
|
end
|
79
79
|
|
80
|
-
it "
|
80
|
+
it "returns a simulated packet" do
|
81
81
|
sti = SimulatedTargetInterface.new("test_inst.rb")
|
82
82
|
sti.target_names = ['COSMOS']
|
83
|
-
sti.connected
|
83
|
+
expect(sti.connected?).to be_falsey
|
84
84
|
sti.connect
|
85
85
|
pkt = sti.read
|
86
|
-
pkt.target_name.
|
87
|
-
pkt.packet_name.
|
86
|
+
expect(pkt.target_name).to eql "COSMOS"
|
87
|
+
expect(pkt.packet_name).to eql "VERSION"
|
88
88
|
pkt = sti.read
|
89
|
-
pkt.target_name.
|
90
|
-
pkt.packet_name.
|
89
|
+
expect(pkt.target_name).to eql "COSMOS"
|
90
|
+
expect(pkt.packet_name).to eql "VERSION"
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
94
94
|
describe "write" do
|
95
|
-
it "
|
95
|
+
it "complains if disconnected" do
|
96
96
|
expect { SimulatedTargetInterface.new("test_inst.rb").write(nil) }.to raise_error("Interface not connected")
|
97
97
|
end
|
98
98
|
|
99
|
-
it "
|
99
|
+
it "writes commands to the simulator" do
|
100
100
|
sti = SimulatedTargetInterface.new("test_inst.rb")
|
101
101
|
sti.target_names = ['COSMOS']
|
102
|
-
sti.connected
|
102
|
+
expect(sti.connected?).to be_falsey
|
103
103
|
sti.connect
|
104
104
|
sti.write(Packet.new("COSMOS","SETLOGLABEL"))
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
108
|
describe "write_raw" do
|
109
|
-
it "
|
109
|
+
it "raises an exception" do
|
110
110
|
expect { SimulatedTargetInterface.new("test_inst.rb").write_raw("") }.to raise_error(/not implemented/)
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
114
114
|
describe "disconnect" do
|
115
|
-
it "
|
115
|
+
it "disconnects from the simulator" do
|
116
116
|
sti = SimulatedTargetInterface.new("test_inst.rb")
|
117
117
|
sti.target_names = ['COSMOS']
|
118
|
-
sti.connected
|
118
|
+
expect(sti.connected?).to be_falsey
|
119
119
|
sti.connect
|
120
|
-
sti.connected
|
120
|
+
expect(sti.connected?).to be_truthy
|
121
121
|
sti.disconnect
|
122
|
-
sti.connected
|
122
|
+
expect(sti.connected?).to be_falsey
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
@@ -23,27 +23,27 @@ module Cosmos
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "initialize" do
|
26
|
-
it "
|
26
|
+
it "complains if the stream protocol doesn't exist" do
|
27
27
|
File.delete(@file) if File.exist?(@file)
|
28
28
|
expect { StreamInterface.new("test") }.to raise_error(/Unable to require test_stream_protocol.rb/)
|
29
29
|
expect { StreamInterface.new("test") }.to raise_error(/Ensure test_stream_protocol.rb is in the COSMOS lib directory./)
|
30
30
|
end
|
31
31
|
|
32
|
-
it "
|
32
|
+
it "complains if the stream protocol has a bug" do
|
33
33
|
File.open(@file, 'w') {|file| file.puts "blah" }
|
34
34
|
expect { StreamInterface.new("test") }.to raise_error(/Unable to require test_stream_protocol.rb/)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
describe "connect" do
|
39
|
-
it "
|
39
|
+
it "raises an exception" do
|
40
40
|
si = StreamInterface.new("burst")
|
41
41
|
expect { si.connect }.to raise_error("Interface connect method not implemented")
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
45
|
describe "connected?, disconnect, bytes_read, bytes_written" do
|
46
|
-
it "
|
46
|
+
it "defers to the stream protocol" do
|
47
47
|
File.open(@file, 'w') do |file|
|
48
48
|
file.puts "class TestStreamProtocol"
|
49
49
|
file.puts "attr_accessor :bytes_read, :bytes_written"
|
@@ -56,17 +56,17 @@ module Cosmos
|
|
56
56
|
load @file
|
57
57
|
|
58
58
|
si = StreamInterface.new("test")
|
59
|
-
si.connected
|
60
|
-
si.disconnect.
|
59
|
+
expect(si.connected?).to eql 1
|
60
|
+
expect(si.disconnect).to eql 2
|
61
61
|
si.bytes_read = 10
|
62
|
-
si.bytes_read.
|
62
|
+
expect(si.bytes_read).to eql 10
|
63
63
|
si.bytes_written = 20
|
64
|
-
si.bytes_written.
|
64
|
+
expect(si.bytes_written).to eql 20
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
describe "read" do
|
69
|
-
it "
|
69
|
+
it "reads from the stream interface and count the packet" do
|
70
70
|
File.open(@file, 'w') do |file|
|
71
71
|
file.puts "class TestStreamProtocol"
|
72
72
|
file.puts "def interface=(i); i; end"
|
@@ -77,13 +77,13 @@ module Cosmos
|
|
77
77
|
load @file
|
78
78
|
|
79
79
|
si = StreamInterface.new("test")
|
80
|
-
si.read.
|
81
|
-
si.read_count.
|
80
|
+
expect(si.read).to eql 1
|
81
|
+
expect(si.read_count).to eql 1
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
85
|
describe "write, write_raw" do
|
86
|
-
it "
|
86
|
+
it "complains if the stream interface isn't connected" do
|
87
87
|
File.open(@file, 'w') do |file|
|
88
88
|
file.puts "class TestStreamProtocol"
|
89
89
|
file.puts "def interface=(i); i; end"
|
@@ -98,7 +98,7 @@ module Cosmos
|
|
98
98
|
expect { si.write_raw(nil) }.to raise_error(/Interface not connected/)
|
99
99
|
end
|
100
100
|
|
101
|
-
it "
|
101
|
+
it "disconnects after write errors" do
|
102
102
|
$disconnect = false
|
103
103
|
File.open(@file, 'w') do |file|
|
104
104
|
file.puts "class TestStreamProtocol"
|
@@ -112,27 +112,27 @@ module Cosmos
|
|
112
112
|
# Ensure we reload since TestStreamProtocol is used throughout
|
113
113
|
load @file
|
114
114
|
|
115
|
-
$disconnect.
|
115
|
+
expect($disconnect).to be_falsey
|
116
116
|
si = StreamInterface.new("test")
|
117
117
|
begin
|
118
118
|
si.write(nil)
|
119
119
|
rescue
|
120
120
|
end
|
121
|
-
si.write_count.
|
122
|
-
$disconnect.
|
121
|
+
expect(si.write_count).to eql 0
|
122
|
+
expect($disconnect).to be_truthy
|
123
123
|
|
124
124
|
$disconnect = false
|
125
|
-
$disconnect.
|
125
|
+
expect($disconnect).to be_falsey
|
126
126
|
si = StreamInterface.new("test")
|
127
127
|
begin
|
128
128
|
si.write_raw(nil)
|
129
129
|
rescue
|
130
130
|
end
|
131
|
-
si.write_count.
|
132
|
-
$disconnect.
|
131
|
+
expect(si.write_count).to eql 0
|
132
|
+
expect($disconnect).to be_truthy
|
133
133
|
end
|
134
134
|
|
135
|
-
it "
|
135
|
+
it "writes to the stream interface and count the packet" do
|
136
136
|
File.open(@file, 'w') do |file|
|
137
137
|
file.puts "class TestStreamProtocol"
|
138
138
|
file.puts "def interface=(i); i; end"
|
@@ -146,9 +146,9 @@ module Cosmos
|
|
146
146
|
|
147
147
|
si = StreamInterface.new("test")
|
148
148
|
si.write(nil)
|
149
|
-
si.write_count.
|
149
|
+
expect(si.write_count).to eql 1
|
150
150
|
si.write_raw(nil)
|
151
|
-
si.write_count.
|
151
|
+
expect(si.write_count).to eql 2
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
@@ -16,38 +16,38 @@ module Cosmos
|
|
16
16
|
describe TcpipClientInterface do
|
17
17
|
|
18
18
|
describe "initialize" do
|
19
|
-
it "
|
19
|
+
it "initializes the instance variables" do
|
20
20
|
i = TcpipClientInterface.new('localhost','8888','8889','5','5','burst')
|
21
21
|
end
|
22
22
|
|
23
|
-
it "
|
23
|
+
it "is not writeable if no write port given" do
|
24
24
|
i = TcpipClientInterface.new('localhost','nil','8889','nil','5','burst')
|
25
|
-
i.name.
|
26
|
-
i.write_allowed
|
27
|
-
i.write_raw_allowed
|
28
|
-
i.read_allowed
|
25
|
+
expect(i.name).to eql "Cosmos::TcpipClientInterface"
|
26
|
+
expect(i.write_allowed?).to be_falsey
|
27
|
+
expect(i.write_raw_allowed?).to be_falsey
|
28
|
+
expect(i.read_allowed?).to be_truthy
|
29
29
|
end
|
30
30
|
|
31
|
-
it "
|
31
|
+
it "is not readable if no read port given" do
|
32
32
|
i = TcpipClientInterface.new('localhost','8888','nil','5','nil','burst')
|
33
|
-
i.name.
|
34
|
-
i.write_allowed
|
35
|
-
i.write_raw_allowed
|
36
|
-
i.read_allowed
|
33
|
+
expect(i.name).to eql "Cosmos::TcpipClientInterface"
|
34
|
+
expect(i.write_allowed?).to be_truthy
|
35
|
+
expect(i.write_raw_allowed?).to be_truthy
|
36
|
+
expect(i.read_allowed?).to be_falsey
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
describe "connect" do
|
41
|
-
it "
|
41
|
+
it "passes a new TcpipClientStream to the stream protocol" do
|
42
42
|
stream = double("stream")
|
43
43
|
allow(stream).to receive(:connect)
|
44
44
|
expect(TcpipClientStream).to receive(:new) { stream }
|
45
45
|
expect(stream).to receive(:connected?) { true }
|
46
46
|
expect(stream).to receive(:raw_logger_pair=) { nil }
|
47
47
|
i = TcpipClientInterface.new('localhost','8888','8889','5','5','burst')
|
48
|
-
i.connected
|
48
|
+
expect(i.connected?).to be_falsey
|
49
49
|
i.connect
|
50
|
-
i.connected
|
50
|
+
expect(i.connected?).to be_truthy
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|