Output
Tests
- Output forcing is read with S0030
- Output forcing is set with M0020
- Output is read with S0004
- Output is read with S0004 with extended output status
Output forcing is read with S0030
Verify that forced output status can be read with S0030
- Given the site is connected
- Request status
- Expect status response before timeout
View Source
it 'forcing is read with S0030' do
with_site(:connected, sxl: '>=1.0.15') do |site_proxy|
site_proxy.request_status_and_collect({ S0030: [:status] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Output forcing is set with M0020
Verify that output can be forced with M0020
- Given the site is connected
- When we force output with M0020
- Wait for status = true
View Source
it 'forcing is set with M0020' do
with_site(:connected, sxl: '>=1.0.15') do |site_proxy|
outputs = RSMP::Validator.get_config('items', 'outputs')
skip('No outputs configured') if outputs.nil? || outputs.empty?
timeout = RSMP::Validator.get_config('timeouts', 'command_response')
outputs.each do |output|
site_proxy.tlc.force_output(output: output, status: 'True', value: 'True', within: timeout)
site_proxy.tlc.force_output(output: output, status: 'True', value: 'False', within: timeout)
ensure
site_proxy.tlc.force_output(output: output, status: 'False', value: 'True', within: timeout)
end
end
end
Output is read with S0004
Verify that output status can be read with S0004
- Given the site is connected
- When we subscribe to S0004
- We should receive a status updated
- And the outputstatus attribute should be a digit string
View Source
it 'is read with S0004' do
with_site(:connected, sxl: ['>=1.2']) do |site_proxy|
site_proxy.request_status_and_collect({ S0004: [:outputstatus] },
within: RSMP::Validator.get_config('timeouts', 'status_response')).ok!
end
end
Output is read with S0004 with extended output status
Verify that output status can be read with S0004, extended output status
- Given the site is connected
- When we subscribe to S0004
- We should receive a status updated
- And the outputstatus attribute should be a digit string
View Source
it 'is read with S0004 with extended output status' do
with_site(:connected, sxl: ['>=1.0.7', '<1.2']) do |site_proxy|
site_proxy.request_status_and_collect(
{ S0004: %i[outputstatus extendedoutputstatus] },
within: RSMP::Validator.get_config('timeouts', 'status_response')
).ok!
end
end