Specifications:
Verify status S0020 control mode
-
Given the site is connected
-
Request status
-
Expect status response before timeout
11 12 13 14
# File 'spec/site/tlc/modes_spec.rb', line 11 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "control mode", { S0020: [:controlmode,:intersection] } end
-
Verify status S0005 traffic controller starting by intersection statusByIntersection requires core >= 3.2, since it uses the array data type.
-
Given the site is connected
-
Request status
-
Expect status response before timeout
23 24 25 26
# File 'spec/site/tlc/modes_spec.rb', line 23 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic controller starting (true/false)", { S0005: [:statusByIntersection] } end
-
Verify status S0005 traffic controller starting by intersection statusByIntersection requires core >= 3.2, since it uses the array data type.
-
Given the site is connected
-
Request status
-
Expect status response before timeout
23 24 25 26
# File 'spec/site/tlc/modes_spec.rb', line 23 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "traffic controller starting (true/false)", { S0005: [:statusByIntersection] } end
-
Verify status S0007 controller switched on, source attribute
-
Given the site is connected
-
Request status
-
Expect status response before timeout
48 49 50 51
# File 'spec/site/tlc/modes_spec.rb', line 48 Validator::Site.connected do |task,supervisor,site| status_list = { S0007: [:status,:intersection,:source] } request_status_and_confirm site, "controller switch on (dark mode=off)", status_list end
-
Verify status S0007 controller switched on, source attribute
-
Given the site is connected
-
Request status
-
Expect status response before timeout
48 49 50 51
# File 'spec/site/tlc/modes_spec.rb', line 48 Validator::Site.connected do |task,supervisor,site| status_list = { S0007: [:status,:intersection,:source] } request_status_and_confirm site, "controller switch on (dark mode=off)", status_list end
-
Verify status S0008 manual control
-
Given the site is connected
-
Request status
-
Expect status response before timeout
72 73 74 75 76 77 78 79
# File 'spec/site/tlc/modes_spec.rb', line 72 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0008: [:status,:intersection,:source] } else status_list = { S0008: [:status,:intersection] } end request_status_and_confirm site, "manual control status", status_list end
-
Verify status S0009 fixed time control
-
Given the site is connected
-
Request status
-
Expect status response before timeout
88 89 90 91 92 93 94 95
# File 'spec/site/tlc/modes_spec.rb', line 88 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0009: [:status,:intersection,:source] } else status_list = { S0009: [:status,:intersection] } end request_status_and_confirm site, "fixed time control status", status_list end
-
Verify command M0007 fixed time control
-
Verify connection
-
Send command to switch to fixed time = true
-
Wait for status = true
-
Send command to switch to fixed time = false
-
Wait for status = false
106 107 108 109 110
# File 'spec/site/tlc/modes_spec.rb', line 106 Validator::Site.connected do |task,supervisor,site| prepare task, site switch_fixed_time 'True' switch_fixed_time 'False' end
-
Verify status S0010 isolated control
-
Given the site is connected
-
Request status
-
Expect status response before timeout
119 120 121 122 123 124 125 126
# File 'spec/site/tlc/modes_spec.rb', line 119 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0010: [:status,:intersection,:source] } else status_list = { S0010: [:status,:intersection] } end request_status_and_confirm site, "isolated control status", status_list end
-
Verify status S0032 coordinated control
-
Given the site is connected
-
Request status
-
Expect status response before timeout
135 136 137 138
# File 'spec/site/tlc/modes_spec.rb', line 135 Validator::Site.connected do |task,supervisor,site| status_list = { S0032: [:status,:intersection,:source] } request_status_and_confirm site, "coordinated control status", status_list end
-
Verify status S0011 yellow flash
-
Given the site is connected
-
Request status
-
Expect status response before timeout
147 148 149 150 151 152 153 154
# File 'spec/site/tlc/modes_spec.rb', line 147 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0011: [:status,:intersection,:source] } else status_list = { S0011: [:status,:intersection] } end request_status_and_confirm site, "yellow flash status", status_list end
-
Verify that we can activate yellow flash
-
Given the site is connected
-
Send the control command to switch to Yellow flash
-
Wait for status Yellow flash
-
Send command to switch to normal control
-
Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true“
165 166 167 168 169
# File 'spec/site/tlc/modes_spec.rb', line 165 Validator::Site.connected do |task,supervisor,site| prepare task, site switch_yellow_flash switch_normal_control end
-
Verify that we can yellow flash causes all groups to go to state ‘c’
-
Given the site is connected
-
Send the control command to switch to Yellow flash
-
Wait for all groups to go to group ‘c’
-
Send command to switch to normal control
-
Wait for all groups to switch do something else that ‘c’
180 181 182 183 184 185 186 187 188 189
# File 'spec/site/tlc/modes_spec.rb', line 180 Validator::Site.connected do |task,supervisor,site| prepare task, site timeout = Validator.get_config('timeouts','yellow_flash') switch_yellow_flash wait_for_groups 'c', timeout: timeout # c mean s yellow flash switch_normal_control wait_for_groups '[^c]', timeout: timeout # not c, ie. not yellow flash end
-
Verify status S0012 all red
-
Given the site is connected
-
Request status
-
Expect status response before timeout
198 199 200 201 202 203 204 205
# File 'spec/site/tlc/modes_spec.rb', line 198 Validator::Site.connected do |task,supervisor,site| if RSMP::Proxy.version_meets_requirement?( site.sxl_version, '>=1.1' ) status_list = { S0012: [:status,:intersection,:source] } else status_list = { S0012: [:status,:intersection] } end request_status_and_confirm site, "all-red status", status_list end
-
Verify status S0013 police key
-
Given the site is connected
-
Request status
-
Expect status response before timeout
214 215 216 217
# File 'spec/site/tlc/modes_spec.rb', line 214 Validator::Site.connected do |task,supervisor,site| request_status_and_confirm site, "police key", { S0013: [:status] } end
-
Verify that we can activate dark mode
-
Given the site is connected
-
Send the control command to switch todarkmode
-
Wait for status“Controller on” = false
-
Send command to switch to normal control
-
Wait for status “Yellow flash” = false, “Controller starting”= false, “Controller on”= true“
228 229 230 231 232
# File 'spec/site/tlc/modes_spec.rb', line 228 Validator::Site.connected do |task,supervisor,site| prepare task, site switch_dark_mode switch_normal_control end
-
Verify that we can activate yellow flash and after 1 minute goes back to NormalControl
-
Given the site is connected
-
Send the control command to switch to Normal Control, and wait for this
-
Send the control command to switch to Yellow flash
-
Wait for status Yellow flash
-
Wait for automatic revert to Normal Control
243 244 245 246 247 248 249
# File 'spec/site/tlc/modes_spec.rb', line 243 Validator::Site.connected do |task,supervisor,site| prepare task, site switch_normal_control minutes = 1 switch_yellow_flash timeout_minutes: minutes wait_normal_control timeout: minutes*60 + Validator.get_config('timeouts','functional_position') end
-