cosmos 3.3.3 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +2 -0
- data/.travis.yml +2 -1
- data/Gemfile +4 -3
- data/Manifest.txt +22 -0
- data/autohotkey/tools/handbook_creator.ahk +9 -0
- data/autohotkey/tools/packet_viewer.ahk +4 -0
- data/bin/exchndl20-x64.dll +0 -0
- data/bin/exchndl20.dll +0 -0
- data/bin/exchndl21-x64.dll +0 -0
- data/bin/exchndl21.dll +0 -0
- data/bin/exchndl22-x64.dll +0 -0
- data/bin/exchndl22.dll +0 -0
- data/bin/mgwhelp-x64.dll +0 -0
- data/bin/mgwhelp.dll +0 -0
- data/cosmos.gemspec +1 -0
- data/data/crc.txt +30 -24
- data/demo/config/data/crc.txt +3 -3
- data/demo/config/tools/handbook_creator/templates/command_packets.html.erb +3 -1
- data/demo/config/tools/handbook_creator/templates/telemetry_packets.html.erb +3 -1
- data/demo/procedures/cosmos_api_test.rb +1 -1
- data/ext/cosmos/ext/low_fragmentation_array/low_fragmentation_array.c +4 -0
- data/ext/cosmos/ext/platform/platform.c +22 -2
- data/ext/cosmos/ext/structure/structure.c +631 -104
- data/ext/cosmos/ext/telemetry/telemetry.c +3 -2
- data/lib/cosmos/gui/line_graph/line_graph_drawing.rb +71 -92
- data/lib/cosmos/gui/line_graph/overview_graph.rb +1 -1
- data/lib/cosmos/gui/qt.rb +38 -24
- data/lib/cosmos/gui/text/ruby_editor.rb +1 -1
- data/lib/cosmos/packets/binary_accessor.rb +1 -288
- data/lib/cosmos/packets/telemetry.rb +2 -1
- data/lib/cosmos/script/cmd_tlm_server.rb +110 -0
- data/lib/cosmos/script/commands.rb +166 -0
- data/lib/cosmos/script/extract.rb +2 -2
- data/lib/cosmos/script/limits.rb +108 -0
- data/lib/cosmos/script/script.rb +28 -1487
- data/lib/cosmos/script/scripting.rb +889 -0
- data/lib/cosmos/script/telemetry.rb +174 -0
- data/lib/cosmos/script/tools.rb +138 -0
- data/lib/cosmos/streams/stream_protocol.rb +9 -6
- data/lib/cosmos/system/target.rb +55 -38
- data/lib/cosmos/tools/cmd_tlm_server/api.rb +6 -3
- data/lib/cosmos/tools/cmd_tlm_server/connections.rb +0 -1
- data/lib/cosmos/tools/cmd_tlm_server/gui/interfaces_tab.rb +17 -7
- data/lib/cosmos/tools/cmd_tlm_server/interface_thread.rb +15 -4
- data/lib/cosmos/tools/handbook_creator/handbook_creator.rb +15 -8
- data/lib/cosmos/tools/handbook_creator/handbook_creator_config.rb +41 -13
- data/lib/cosmos/tools/packet_viewer/packet_viewer.rb +18 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/canvasline_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/canvaslinevalue_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/limitsbar_widget.rb +1 -1
- data/lib/cosmos/tools/tlm_viewer/widgets/rangebar_widget.rb +1 -1
- data/lib/cosmos/top_level.rb +1 -1
- data/lib/cosmos/utilities/ruby_lex_utils.rb +1 -1
- data/lib/cosmos/version.rb +5 -5
- data/spec/gui/line_graph/line_clip_spec.rb +6 -6
- data/spec/gui/qt_spec.rb +102 -0
- data/spec/interfaces/interface_spec.rb +9 -9
- data/spec/interfaces/linc_interface_spec.rb +72 -15
- data/spec/interfaces/serial_interface_spec.rb +9 -9
- data/spec/interfaces/simulated_target_interface_spec.rb +7 -7
- data/spec/interfaces/stream_interface_spec.rb +4 -4
- data/spec/interfaces/tcpip_client_interface_spec.rb +8 -8
- data/spec/interfaces/tcpip_server_interface_spec.rb +9 -9
- data/spec/interfaces/udp_interface_spec.rb +20 -20
- data/spec/io/json_drb_spec.rb +4 -4
- data/spec/io/raw_logger_pair_spec.rb +20 -20
- data/spec/io/raw_logger_spec.rb +3 -3
- data/spec/io/tcpip_server_spec.rb +9 -9
- data/spec/io/udp_sockets_spec.rb +2 -2
- data/spec/io/win32_serial_driver_spec.rb +2 -2
- data/spec/packets/binary_accessor_spec.rb +143 -6
- data/spec/packets/commands_spec.rb +5 -5
- data/spec/packets/limits_spec.rb +15 -15
- data/spec/packets/packet_config_spec.rb +19 -19
- data/spec/packets/packet_item_limits_spec.rb +3 -3
- data/spec/packets/packet_item_spec.rb +4 -4
- data/spec/packets/packet_spec.rb +33 -33
- data/spec/packets/structure_item_spec.rb +19 -19
- data/spec/packets/telemetry_spec.rb +6 -6
- data/spec/script/cmd_tlm_server_spec.rb +110 -0
- data/spec/script/commands_disconnect_spec.rb +270 -0
- data/spec/script/commands_spec.rb +288 -0
- data/spec/script/limits_spec.rb +153 -0
- data/spec/script/script_spec.rb +32 -696
- data/spec/script/scripting_spec.rb +436 -0
- data/spec/script/telemetry_spec.rb +130 -0
- data/spec/script/tools_spec.rb +117 -0
- data/spec/spec_helper.rb +10 -5
- data/spec/streams/preidentified_stream_protocol_spec.rb +4 -4
- data/spec/streams/serial_stream_spec.rb +8 -8
- data/spec/streams/stream_protocol_spec.rb +4 -4
- data/spec/streams/tcpip_client_stream_spec.rb +3 -3
- data/spec/streams/tcpip_socket_stream_spec.rb +7 -7
- data/spec/streams/template_stream_protocol_spec.rb +1 -1
- data/spec/system/system_spec.rb +6 -6
- data/spec/system/target_spec.rb +2 -0
- data/spec/tools/cmd_tlm_server/api_spec.rb +17 -17
- data/spec/tools/cmd_tlm_server/cmd_tlm_server_config_spec.rb +5 -5
- data/spec/tools/cmd_tlm_server/interface_thread_spec.rb +3 -3
- data/spec/top_level/top_level_spec.rb +8 -8
- data/spec/utilities/csv_spec.rb +3 -3
- data/spec/utilities/message_log_spec.rb +3 -3
- data/spec/utilities/ruby_lex_utils_spec.rb +7 -7
- data/test/performance/config/tools/launcher/launcher_threads.txt +8 -1
- data/test/performance/tools/CmdTlmServerMemProf +1 -1
- data/test/performance/tools/TlmGrapherMemProf +19 -0
- data/test/performance/tools/TlmGrapherMemProf.bat +59 -0
- metadata +38 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# encoding: ascii-8bit
|
|
2
|
+
|
|
3
|
+
# Copyright 2014 Ball Aerospace & Technologies Corp.
|
|
4
|
+
# All Rights Reserved.
|
|
5
|
+
#
|
|
6
|
+
# This program is free software; you can modify and/or redistribute it
|
|
7
|
+
# under the terms of the GNU General Public License
|
|
8
|
+
# as published by the Free Software Foundation; version 3 with
|
|
9
|
+
# attribution addendums as found in the LICENSE.txt
|
|
10
|
+
|
|
11
|
+
require 'spec_helper'
|
|
12
|
+
require 'cosmos'
|
|
13
|
+
require 'cosmos/script/script'
|
|
14
|
+
require 'tempfile'
|
|
15
|
+
|
|
16
|
+
module Cosmos
|
|
17
|
+
|
|
18
|
+
describe Script do
|
|
19
|
+
|
|
20
|
+
before(:all) do
|
|
21
|
+
cts = File.join(Cosmos::USERPATH,'config','tools','cmd_tlm_server','cmd_tlm_server.txt')
|
|
22
|
+
FileUtils.mkdir_p(File.dirname(cts))
|
|
23
|
+
File.open(cts,'w') do |file|
|
|
24
|
+
file.puts 'INTERFACE INST_INT interface.rb'
|
|
25
|
+
file.puts 'TARGET INST'
|
|
26
|
+
end
|
|
27
|
+
System.class_eval('@@instance = nil')
|
|
28
|
+
|
|
29
|
+
require 'cosmos/script'
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
after(:all) do
|
|
33
|
+
clean_config()
|
|
34
|
+
FileUtils.rm_rf File.join(Cosmos::USERPATH,'config','tools')
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
before(:each) do
|
|
38
|
+
allow_any_instance_of(Interface).to receive(:connected?).and_return(true)
|
|
39
|
+
allow_any_instance_of(Interface).to receive(:disconnect)
|
|
40
|
+
allow_any_instance_of(Interface).to receive(:write)
|
|
41
|
+
allow_any_instance_of(Interface).to receive(:read)
|
|
42
|
+
|
|
43
|
+
@server = CmdTlmServer.new
|
|
44
|
+
shutdown_cmd_tlm()
|
|
45
|
+
initialize_script_module()
|
|
46
|
+
sleep 0.1
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
after(:each) do
|
|
50
|
+
@server.stop
|
|
51
|
+
shutdown_cmd_tlm()
|
|
52
|
+
sleep(0.1)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe "display" do
|
|
56
|
+
it "displays a telemetry viewer screen" do
|
|
57
|
+
allow_any_instance_of(JsonDRbObject).to receive(:display)
|
|
58
|
+
display("HI")
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "complains if unable to start telemetry viewer" do
|
|
62
|
+
# Avoid the needless delay by stubbing sleep
|
|
63
|
+
allow_any_instance_of(Object).to receive(:sleep)
|
|
64
|
+
allow(Cosmos).to receive(:run_process)
|
|
65
|
+
expect { display("HI") }.to raise_error(RuntimeError, /HI could not be displayed/)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it "complains if the screen doesn't exist" do
|
|
69
|
+
allow_any_instance_of(JsonDRbObject).to receive(:display).and_raise(Errno::ENOENT)
|
|
70
|
+
expect { display("HI") }.to raise_error(RuntimeError, /HI.txt does not exist/)
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
describe "clear" do
|
|
75
|
+
it "closes a telemetry viewer screen" do
|
|
76
|
+
allow_any_instance_of(JsonDRbObject).to receive(:clear)
|
|
77
|
+
clear("HI")
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it "complains if unable to start telemetry viewer" do
|
|
81
|
+
# Avoid the needless delay by stubbing sleep
|
|
82
|
+
allow_any_instance_of(Object).to receive(:sleep)
|
|
83
|
+
allow(Cosmos).to receive(:run_process)
|
|
84
|
+
expect { clear("HI") }.to raise_error(RuntimeError, /HI could not be cleared/)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it "complains if the screen doesn't exist" do
|
|
88
|
+
allow_any_instance_of(JsonDRbObject).to receive(:clear).and_raise(Errno::ENOENT)
|
|
89
|
+
expect { clear("HI") }.to raise_error(RuntimeError, /HI.txt does not exist/)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
describe "ScriptRunnerFrame methods" do
|
|
94
|
+
it "calls various ScriptRunnerFrame methods" do
|
|
95
|
+
class Dummy; def method_missing(meth, *args, &block); end; end
|
|
96
|
+
class ScriptRunnerFrame
|
|
97
|
+
def self.method_missing(meth, *args, &block); end
|
|
98
|
+
def self.instance; Dummy.new; end
|
|
99
|
+
end
|
|
100
|
+
set_line_delay(1.0)
|
|
101
|
+
get_line_delay
|
|
102
|
+
get_scriptrunner_message_log_filename
|
|
103
|
+
start_new_scriptrunner_message_log
|
|
104
|
+
disable_instrumentation do
|
|
105
|
+
value = 1
|
|
106
|
+
end
|
|
107
|
+
set_stdout_max_lines(1000)
|
|
108
|
+
insert_return
|
|
109
|
+
step_mode
|
|
110
|
+
run_mode
|
|
111
|
+
show_backtrace
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
data/spec/spec_helper.rb
CHANGED
|
@@ -36,6 +36,7 @@ unless ENV['COSMOS_NO_SIMPLECOV']
|
|
|
36
36
|
end
|
|
37
37
|
require 'rspec'
|
|
38
38
|
require 'ruby-prof'
|
|
39
|
+
require 'benchmark/ips'
|
|
39
40
|
require 'cosmos'
|
|
40
41
|
require 'cosmos/utilities/logger'
|
|
41
42
|
|
|
@@ -55,11 +56,6 @@ def exit(*args)
|
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
RSpec.configure do |config|
|
|
58
|
-
config.expect_with :rspec do |c|
|
|
59
|
-
# Explicitly enable the should and expect syntax
|
|
60
|
-
c.syntax = [:should, :expect]
|
|
61
|
-
end
|
|
62
|
-
|
|
63
59
|
# Store standard output global and CONSTANT since we will mess with them
|
|
64
60
|
config.before(:all) do
|
|
65
61
|
$saved_stdout_global = $stdout
|
|
@@ -162,6 +158,15 @@ RSpec.configure do |c|
|
|
|
162
158
|
end
|
|
163
159
|
end
|
|
164
160
|
end
|
|
161
|
+
if ENV.key?("BENCHMARK")
|
|
162
|
+
c.around(:each) do |example|
|
|
163
|
+
Benchmark.ips do |x|
|
|
164
|
+
x.report(example.metadata[:full_description]) do
|
|
165
|
+
example.run
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
end
|
|
169
|
+
end
|
|
165
170
|
# This code causes a new profile file to be created for each test case which is excessive and hard to read
|
|
166
171
|
# c.around(:each) do |example|
|
|
167
172
|
# if ENV.key?("PROFILE")
|
|
@@ -105,14 +105,14 @@ module Cosmos
|
|
|
105
105
|
packet = @psp.read
|
|
106
106
|
expect(packet.target_name).to eql 'COSMOS'
|
|
107
107
|
expect(packet.packet_name).to eql 'VERSION'
|
|
108
|
-
expect(packet.identified?).to
|
|
109
|
-
expect(packet.defined?).to
|
|
108
|
+
expect(packet.identified?).to be true
|
|
109
|
+
expect(packet.defined?).to be false
|
|
110
110
|
|
|
111
111
|
pkt2 = System.telemetry.update!("COSMOS","VERSION",packet.buffer)
|
|
112
112
|
expect(pkt2.read('PKT_ID')).to eql 1
|
|
113
113
|
expect(pkt2.read('COSMOS')).to eql 'TEST'
|
|
114
|
-
expect(pkt2.identified?).to
|
|
115
|
-
expect(pkt2.defined?).to
|
|
114
|
+
expect(pkt2.identified?).to be true
|
|
115
|
+
expect(pkt2.defined?).to be true
|
|
116
116
|
end
|
|
117
117
|
end
|
|
118
118
|
|
|
@@ -25,7 +25,7 @@ module Cosmos
|
|
|
25
25
|
driver = double("driver")
|
|
26
26
|
expect(SerialDriver).to receive(:new).and_return(driver)
|
|
27
27
|
ss = SerialStream.new('COM1',nil,9600,:EVEN,1,nil,nil)
|
|
28
|
-
expect(ss.connected?).to
|
|
28
|
+
expect(ss.connected?).to be true
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
@@ -70,9 +70,9 @@ module Cosmos
|
|
|
70
70
|
expect(driver).to receive(:close)
|
|
71
71
|
expect(SerialDriver).to receive(:new).and_return(driver)
|
|
72
72
|
ss = SerialStream.new('COM1',nil,9600,:EVEN,1,nil,nil)
|
|
73
|
-
expect(ss.connected?).to
|
|
73
|
+
expect(ss.connected?).to be true
|
|
74
74
|
ss.disconnect
|
|
75
|
-
expect(ss.connected?).to
|
|
75
|
+
expect(ss.connected?).to be false
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
it "closes the read driver" do
|
|
@@ -81,9 +81,9 @@ module Cosmos
|
|
|
81
81
|
expect(driver).to receive(:close)
|
|
82
82
|
expect(SerialDriver).to receive(:new).and_return(driver)
|
|
83
83
|
ss = SerialStream.new(nil,'COM1',9600,:EVEN,1,nil,nil)
|
|
84
|
-
expect(ss.connected?).to
|
|
84
|
+
expect(ss.connected?).to be true
|
|
85
85
|
ss.disconnect
|
|
86
|
-
expect(ss.connected?).to
|
|
86
|
+
expect(ss.connected?).to be false
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
it "does not close the driver twice" do
|
|
@@ -92,11 +92,11 @@ module Cosmos
|
|
|
92
92
|
expect(driver).to receive(:close).once
|
|
93
93
|
expect(SerialDriver).to receive(:new).and_return(driver)
|
|
94
94
|
ss = SerialStream.new('COM1','COM1',9600,:EVEN,1,nil,nil)
|
|
95
|
-
expect(ss.connected?).to
|
|
95
|
+
expect(ss.connected?).to be true
|
|
96
96
|
ss.disconnect
|
|
97
|
-
expect(ss.connected?).to
|
|
97
|
+
expect(ss.connected?).to be false
|
|
98
98
|
ss.disconnect
|
|
99
|
-
expect(ss.connected?).to
|
|
99
|
+
expect(ss.connected?).to be false
|
|
100
100
|
end
|
|
101
101
|
end
|
|
102
102
|
|
|
@@ -80,7 +80,7 @@ module Cosmos
|
|
|
80
80
|
|
|
81
81
|
describe "connected" do
|
|
82
82
|
it "returns false if the stream hasn't been set" do
|
|
83
|
-
expect(@sp.connected?).to
|
|
83
|
+
expect(@sp.connected?).to be false
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
it "returns the status of the stream connection" do
|
|
@@ -90,7 +90,7 @@ module Cosmos
|
|
|
90
90
|
end
|
|
91
91
|
stream = MyStream2.new
|
|
92
92
|
@sp.connect(stream)
|
|
93
|
-
expect(@sp.connected?).to
|
|
93
|
+
expect(@sp.connected?).to be true
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
96
|
|
|
@@ -103,9 +103,9 @@ module Cosmos
|
|
|
103
103
|
end
|
|
104
104
|
stream = MyStream3.new
|
|
105
105
|
@sp.connect(stream)
|
|
106
|
-
expect($test).to
|
|
106
|
+
expect($test).to be false
|
|
107
107
|
@sp.disconnect
|
|
108
|
-
expect($test).to
|
|
108
|
+
expect($test).to be true
|
|
109
109
|
end
|
|
110
110
|
end
|
|
111
111
|
|
|
@@ -34,21 +34,21 @@ module Cosmos
|
|
|
34
34
|
it "uses the same socket if read_port == write_port" do
|
|
35
35
|
ss = TcpipClientStream.new('localhost',8888,8888,nil,nil)
|
|
36
36
|
ss.connect
|
|
37
|
-
expect(ss.connected?).to
|
|
37
|
+
expect(ss.connected?).to be true
|
|
38
38
|
ss.disconnect
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
it "creates the write socket" do
|
|
42
42
|
ss = TcpipClientStream.new('localhost',8888,nil,nil,nil)
|
|
43
43
|
ss.connect
|
|
44
|
-
expect(ss.connected?).to
|
|
44
|
+
expect(ss.connected?).to be true
|
|
45
45
|
ss.disconnect
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
it "creates the read socket" do
|
|
49
49
|
ss = TcpipClientStream.new('localhost',nil,8888,nil,nil)
|
|
50
50
|
ss.connect
|
|
51
|
-
expect(ss.connected?).to
|
|
51
|
+
expect(ss.connected?).to be true
|
|
52
52
|
ss.disconnect
|
|
53
53
|
end
|
|
54
54
|
end
|
|
@@ -158,9 +158,9 @@ module Cosmos
|
|
|
158
158
|
expect(write).to receive(:close)
|
|
159
159
|
ss = TcpipSocketStream.new(write,nil,nil,nil)
|
|
160
160
|
ss.connect
|
|
161
|
-
expect(ss.connected?).to
|
|
161
|
+
expect(ss.connected?).to be true
|
|
162
162
|
ss.disconnect
|
|
163
|
-
expect(ss.connected?).to
|
|
163
|
+
expect(ss.connected?).to be false
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
it "closes the read socket" do
|
|
@@ -169,9 +169,9 @@ module Cosmos
|
|
|
169
169
|
expect(read).to receive(:close)
|
|
170
170
|
ss = TcpipSocketStream.new(nil,read,nil,nil)
|
|
171
171
|
ss.connect
|
|
172
|
-
expect(ss.connected?).to
|
|
172
|
+
expect(ss.connected?).to be true
|
|
173
173
|
ss.disconnect
|
|
174
|
-
expect(ss.connected?).to
|
|
174
|
+
expect(ss.connected?).to be false
|
|
175
175
|
end
|
|
176
176
|
|
|
177
177
|
it "does not close the socket twice" do
|
|
@@ -180,11 +180,11 @@ module Cosmos
|
|
|
180
180
|
expect(socket).to receive(:close).once
|
|
181
181
|
ss = TcpipSocketStream.new(socket,socket,nil,nil)
|
|
182
182
|
ss.connect
|
|
183
|
-
expect(ss.connected?).to
|
|
183
|
+
expect(ss.connected?).to be true
|
|
184
184
|
ss.disconnect
|
|
185
|
-
expect(ss.connected?).to
|
|
185
|
+
expect(ss.connected?).to be false
|
|
186
186
|
ss.disconnect
|
|
187
|
-
expect(ss.connected?).to
|
|
187
|
+
expect(ss.connected?).to be false
|
|
188
188
|
end
|
|
189
189
|
end
|
|
190
190
|
|
data/spec/system/system_spec.rb
CHANGED
|
@@ -504,9 +504,9 @@ module Cosmos
|
|
|
504
504
|
tf = Tempfile.new('unittest')
|
|
505
505
|
tf.puts("DISABLE_DNS")
|
|
506
506
|
tf.close
|
|
507
|
-
expect(System.use_dns).to
|
|
507
|
+
expect(System.use_dns).to be true
|
|
508
508
|
System.instance.process_file(tf.path)
|
|
509
|
-
expect(System.use_dns).to
|
|
509
|
+
expect(System.use_dns).to be false
|
|
510
510
|
tf.unlink
|
|
511
511
|
end
|
|
512
512
|
end
|
|
@@ -554,7 +554,7 @@ module Cosmos
|
|
|
554
554
|
tf.puts("ALLOW_ACCESS localhost")
|
|
555
555
|
tf.close
|
|
556
556
|
System.instance.process_file(tf.path)
|
|
557
|
-
expect(System.acl.allow_addr?(["AF_INET",0,"localhost","127.0.0.1"])).to
|
|
557
|
+
expect(System.acl.allow_addr?(["AF_INET",0,"localhost","127.0.0.1"])).to be true
|
|
558
558
|
tf.unlink
|
|
559
559
|
end
|
|
560
560
|
|
|
@@ -565,7 +565,7 @@ module Cosmos
|
|
|
565
565
|
tf.puts("ALLOW_ACCESS #{addr}")
|
|
566
566
|
tf.close
|
|
567
567
|
System.instance.process_file(tf.path)
|
|
568
|
-
expect(System.acl.allow_addr?(["AF_INET",0,"www.google.com",addr])).to
|
|
568
|
+
expect(System.acl.allow_addr?(["AF_INET",0,"www.google.com",addr])).to be true
|
|
569
569
|
tf.unlink
|
|
570
570
|
end
|
|
571
571
|
end
|
|
@@ -627,7 +627,7 @@ module Cosmos
|
|
|
627
627
|
describe "Cosmos.write_exception_file" do
|
|
628
628
|
it "writes a file with the exception" do
|
|
629
629
|
filename = Cosmos.write_exception_file(RuntimeError.new("HELP!"))
|
|
630
|
-
expect(File.exist?(filename)).to
|
|
630
|
+
expect(File.exist?(filename)).to be true
|
|
631
631
|
File.delete(filename)
|
|
632
632
|
end
|
|
633
633
|
|
|
@@ -636,7 +636,7 @@ module Cosmos
|
|
|
636
636
|
# Reset the instance variable so it will read the new config file
|
|
637
637
|
System.instance_eval('@instance = nil')
|
|
638
638
|
filename = Cosmos.write_exception_file(RuntimeError.new("HELP!"))
|
|
639
|
-
expect(File.exist?(filename)).to
|
|
639
|
+
expect(File.exist?(filename)).to be true
|
|
640
640
|
File.delete(filename)
|
|
641
641
|
end
|
|
642
642
|
end
|
data/spec/system/target_spec.rb
CHANGED
|
@@ -49,6 +49,8 @@ module Cosmos
|
|
|
49
49
|
File.open(File.join(cmd_tlm,'cmd2.txt'),'w') {}
|
|
50
50
|
File.open(File.join(cmd_tlm,'tlm1.txt'),'w') {}
|
|
51
51
|
File.open(File.join(cmd_tlm,'tlm2.txt'),'w') {}
|
|
52
|
+
File.open(File.join(cmd_tlm,'tlm2.txt~'),'w') {}
|
|
53
|
+
File.open(File.join(cmd_tlm,'tlm2.txt.mine'),'w') {}
|
|
52
54
|
|
|
53
55
|
tgt = Target.new(tgt_name,nil,tgt_path)
|
|
54
56
|
expect(tgt.dir).to eql File.join(tgt_path,tgt_name)
|
|
@@ -445,12 +445,12 @@ module Cosmos
|
|
|
445
445
|
|
|
446
446
|
describe "get_cmd_hazardous" do
|
|
447
447
|
it "returns whether the command with parameters is hazardous" do
|
|
448
|
-
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"NORMAL"})).to
|
|
449
|
-
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"SPECIAL"})).to
|
|
448
|
+
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"NORMAL"})).to be false
|
|
449
|
+
expect(@api.get_cmd_hazardous("INST","COLLECT",{"TYPE"=>"SPECIAL"})).to be true
|
|
450
450
|
end
|
|
451
451
|
|
|
452
452
|
it "returns whether the command is hazardous" do
|
|
453
|
-
expect(@api.get_cmd_hazardous("INST","CLEAR")).to
|
|
453
|
+
expect(@api.get_cmd_hazardous("INST","CLEAR")).to be true
|
|
454
454
|
end
|
|
455
455
|
end
|
|
456
456
|
|
|
@@ -866,7 +866,7 @@ module Cosmos
|
|
|
866
866
|
end
|
|
867
867
|
|
|
868
868
|
it "returns whether limits are enable for an item" do
|
|
869
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
869
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
870
870
|
end
|
|
871
871
|
end
|
|
872
872
|
|
|
@@ -884,11 +884,11 @@ module Cosmos
|
|
|
884
884
|
end
|
|
885
885
|
|
|
886
886
|
it "enables limits for an item" do
|
|
887
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
887
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
888
888
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
889
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
889
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be false
|
|
890
890
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
891
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
891
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
892
892
|
end
|
|
893
893
|
end
|
|
894
894
|
|
|
@@ -906,9 +906,9 @@ module Cosmos
|
|
|
906
906
|
end
|
|
907
907
|
|
|
908
908
|
it "disables limits for an item" do
|
|
909
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
909
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
910
910
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
911
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
911
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be false
|
|
912
912
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
913
913
|
end
|
|
914
914
|
end
|
|
@@ -966,11 +966,11 @@ module Cosmos
|
|
|
966
966
|
it "enables limits for all items in the group" do
|
|
967
967
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
968
968
|
@api.disable_limits("INST","HEALTH_STATUS","TEMP3")
|
|
969
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
970
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to
|
|
969
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be false
|
|
970
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be false
|
|
971
971
|
@api.enable_limits_group("FIRST")
|
|
972
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
973
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to
|
|
972
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
973
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be true
|
|
974
974
|
end
|
|
975
975
|
end
|
|
976
976
|
|
|
@@ -982,11 +982,11 @@ module Cosmos
|
|
|
982
982
|
it "disables limits for all items in the group" do
|
|
983
983
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP1")
|
|
984
984
|
@api.enable_limits("INST","HEALTH_STATUS","TEMP3")
|
|
985
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
986
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to
|
|
985
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be true
|
|
986
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be true
|
|
987
987
|
@api.disable_limits_group("FIRST")
|
|
988
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to
|
|
989
|
-
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to
|
|
988
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP1")).to be false
|
|
989
|
+
expect(@api.limits_enabled?("INST","HEALTH_STATUS","TEMP3")).to be false
|
|
990
990
|
end
|
|
991
991
|
end
|
|
992
992
|
|