Specifications:
Verify status S0014 current time plan
-
Given the site is connected
-
Request status
-
Expect status response before timeout
11 12 13 14 15 16 17 18
# File 'spec/site/tlc/signal_plans_spec.rb', line 11 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0014: [:status,:source] } else status_list = { S0014: [:status] } end request_status_and_confirm site, "current time plan", status_list end
-
Verify that we change time plan (signal program) We try switching all programs configured
-
Given the site is connected
-
Verify that there is a Validator.get_config(‘validator’) with a time plan
-
Send command to switch time plan
-
Wait for status “Current timeplan” = requested time plan
-
Verify status S0018 number of time plans Deprecated from 1.2, use S0022 instead.
-
Given the site is connected
-
Request status
-
Expect status response before timeout
44 45 46 47
# File 'spec/site/tlc/signal_plans_spec.rb', line 44 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "number of time plans", { S0018: [:number] } end
-
Verify status S0022 list of time plans
-
Given the site is connected
-
Request status
-
Expect status response before timeout
56 57 58 59
# File 'spec/site/tlc/signal_plans_spec.rb', line 56 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "list of time plans", { S0022: [:status] } end
-
Verify status S0026 week time table
-
Given the site is connected
-
Request status
-
Expect status response before timeout
68 69 70 71
# File 'spec/site/tlc/signal_plans_spec.rb', line 68 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "week time table", { S0026: [:status] } end
-
-
Verify connection
-
Send control command to set week_table
-
Wait for status = true
78 79 80 81 82
# File 'spec/site/tlc/signal_plans_spec.rb', line 78 Validator::Site.connected do |task,supervisor,site| status = "0-1,6-2" prepare task, site set_week_table status end
-
Verify status S0027 time tables
-
Given the site is connected
-
Request status
-
Expect status response before timeout
91 92 93 94
# File 'spec/site/tlc/signal_plans_spec.rb', line 91 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "command table", { S0027: [:status] } end
-
-
Verify connection
-
Send control command to set time_table
-
Wait for status = true
101 102 103 104 105
# File 'spec/site/tlc/signal_plans_spec.rb', line 101 Validator::Site.connected do |task,supervisor,site| status = "12-1-12-59,1-0-23-12" prepare task, site set_day_table status end
-
Verify status S0097 version of traffic program
-
Given the site is connected
-
Request status
-
Expect status response before timeout
114 115 116 117
# File 'spec/site/tlc/signal_plans_spec.rb', line 114 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "version of traffic program", { S0097: [:timestamp,:checksum] } end
-
-
Verify connection
-
Send control command to set cycle time
-
Wait for status = true
124 125 126 127 128 129
# File 'spec/site/tlc/signal_plans_spec.rb', line 124 Validator::Site.connected do |task,supervisor,site| status = 5 plan = 0 prepare task, site set_cycle_time status, plan end
-
Verify status S0023 command table
-
Given the site is connected
-
Request status
-
Expect status response before timeout
138 139 140 141
# File 'spec/site/tlc/signal_plans_spec.rb', line 138 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "command table", { S0023: [:status] } end
-
-
Verify connection
-
Send control command to set dynamic_bands
-
Wait for status = true
148 149 150 151 152 153
# File 'spec/site/tlc/signal_plans_spec.rb', line 148 Validator::Site.connected do |task,supervisor,site| plan = "1" status = "1-12" prepare task, site set_dynamic_bands plan, status end
-
-
Given the site is connected
-
Read dynamic band
-
Set dynamic band to 2x previous value
-
Read band to confirm
-
Set dynamic band to previous value
-
Read dynamic band to confirm
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
# File 'spec/site/tlc/signal_plans_spec.rb', line 164 Validator::Site.connected do |task,supervisor,site| prepare task, site plan = 1 band = 3 value = get_dynamic_bands(plan, band) || 0 expect( value ).to be_a(Integer) new_value = value + 1 set_dynamic_bands plan, "#{band}-#{new_value}" expect( get_dynamic_bands(plan, band) ).to eq(new_value) set_dynamic_bands plan, "#{band}-#{value}" expect( get_dynamic_bands(plan, band) ).to eq(value) end
-
Verify command M0023 timeout of dynamic bands
-
Verify connection
-
When we send command to set timeout
-
Then we should get a confirmation
-
When we send command to disable timeout
-
Then we should get a confirmation
190 191 192 193 194 195 196
# File 'spec/site/tlc/signal_plans_spec.rb', line 190 Validator::Site.connected do |task,supervisor,site| prepare task, site status = 10 set_timeout_for_dynamic_bands status status = 0 set_timeout_for_dynamic_bands status end
-
Verify status S0024 offset time
-
Given the site is connected
-
Request status
-
Expect status response before timeout
205 206 207 208
# File 'spec/site/tlc/signal_plans_spec.rb', line 205 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "offset time", { S0024: [:status] } end
-
-
Verify connection
-
Send control command to set dynamic_bands
-
Wait for status = true
215 216 217 218 219 220
# File 'spec/site/tlc/signal_plans_spec.rb', line 215 Validator::Site.connected do |task,supervisor,site| plan = 1 status = 99 prepare task, site set_offset status, plan end
-
Verify status S0028 cycle time
-
Given the site is connected
-
Request status
-
Expect status response before timeout
229 230 231 232
# File 'spec/site/tlc/signal_plans_spec.rb', line 229 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "cycle time", { S0028: [:status] } end
-
-
Verify connection
-
Send control command to set cycle time
-
Wait for status = true
239 240 241 242 243 244
# File 'spec/site/tlc/signal_plans_spec.rb', line 239 Validator::Site.connected do |task,supervisor,site| status = 5 plan = 0 prepare task, site set_cycle_time status, plan end
-