Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S0098 config #468

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions spec/site/tlc/signal_plans_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,36 @@
{ S0097: [:timestamp,:checksum] }
end
end
#
# Verify status S0098 configuration of traffic parameters
#
# 1. Given the site is connected
# 2. Request status
# 3. Expect status response before timeout
specify 'config is read with S0098', sxl: '>=1.0.15' do |example|
Validator::Site.connected do |task,supervisor,site|
result = request_status_and_confirm site, "config of traffic parameters",
{ S0098: [:timestamp,:config,:version] }

# the site should have stored the received status
message = result[:collector].messages.first
expect(message).to be_an(RSMP::StatusResponse)
values = message.attributes['sS'].map { |item| [item['n'], item['s']] }.to_h

expect(values['timestamp']).not_to be_empty
expect(values['config']).not_to be_empty
expect(values['timestamp']).not_to be_empty
end
end

# 1. Verify connection
# 2. Send control command to set cycle time
# 3. Wait for status = true
it 'M0018 set cycle time', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = 5
plan = Validator.get_config('items','plans').first
prepare task, site
plan = Validator.get_config('items','plans').first
status = 10
set_cycle_time status, plan
end
end
Expand Down Expand Up @@ -238,9 +259,9 @@
# 3. Wait for status = true
specify 'cycle time is set with M0018', sxl: '>=1.0.13' do |example|
Validator::Site.connected do |task,supervisor,site|
status = 5
plan = Validator.get_config('items','plans').first
prepare task, site
plan = Validator.get_config('items','plans').first
status = 10
set_cycle_time status, plan
end
end
Expand Down
Loading