Skip to content

Commit

Permalink
cleanup and streamline test configs
Browse files Browse the repository at this point in the history
  • Loading branch information
emiltin committed Jan 3, 2025
1 parent 5b7c985 commit 76ecb6b
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 180 deletions.
65 changes: 12 additions & 53 deletions config/cross_rs4s.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# Config for testing a site running on localhost (e.g. from the rsmp gem)
# Config for testing Cross RS4S traffic light controller.
# The settings are used for starting a local supervisor listening for the site tested
# see https://rsmp-nordic.github.io/rsmp_validator/config/
type: tlc
sxl: tlc # Traffic Light Controller. We are testing a site, not a server.
# See https://rsmp-nordic.github.io/rsmp_validator/config/
sxl: tlc
sxl_version: '1.2.1'
port: 12111
ips: all
rsmp_versions: all

intervals:
timer: 1
watchdog: 60
# timer: 0.1
# watchdog: 0.1
timeouts:
watchdog: 65
acknowledgement: 1
Expand All @@ -24,68 +17,34 @@ timeouts:
command: 300
command_response: 30
alarm: 3
disconnect: 20 # RSMP_WATCHDOG_TIMEOUT_MSEC + RSMP_WATCHDOG_PERIOD_MSEC
disconnect: 20
startup_sequence: 45
functional_position: 60
priority_completion: 5
yellow_flash: 2
secrets:
security_codes:
1: '1111' #spec/site/tlc/invalid_command_spec.rb has hardcoded security code 1111
2: 'r;PwL7%U?SN2E.5'
components:
main:
CZ+76000=101TC001:
ntsOId: CZ+76000=101TC001
signal_group:
CZ+76000=101SG001:
CZ+76000=101SG002:
CZ+76000=101SG003:
CZ+76000=101SG004:
CZ+76000=101SG005:
CZ+76000=101SG006:
CZ+76000=101SG007:
CZ+76000=101SG008:
CZ+76000=101SG009:
CZ+76000=101SG010:
CZ+76000=101SG011:
CZ+76000=101SG012:
CZ+76000=101SG013:
CZ+76000=101SG014:
CZ+76000=101SG015:
CZ+76000=101SG016:
CZ+76000=101SG017:
CZ+76000=101SG018:
CZ+76000=101SG019:
CZ+76000=101SG020:
CZ+76000=101SG021:
CZ+76000=101SG022:
detector_logic:
CZ+76000=101DL001:
CZ+76000=101DL002:
CZ+76000=101DL003:
CZ+76000=101DL004:
CZ+76000=101DL005:
CZ+76000=101DL006:
CZ+76000=101DL007:
CZ+76000=101DL008:
CZ+76000=101DL009:
CZ+76000=101DL010:
items:
plans: [1,2,3,4,5]

traffic_situations: []
# emergency_routes: [1,2,3,4,5,6]
emergency_routes: [1] #no support for multiple simultaneous emergency routes

emergency_routes: [1] # only one emergency route
inputs: [1,3,8]
force_input: 5
outputs: [1,3,8]
startup_sequence: 'efg'
alarms:
A0302:
activation_input: 1
alarm_triggers:
A0302:
input: 7
component: CZ+76000=101DL001
log:
watchdogs: false
acknowledgements: false
secrets:
security_codes:
1: '1111'
2: 'r;PwL7%U?SN2E.5'
20 changes: 8 additions & 12 deletions config/gem_tlc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Config for testing a site running on localhost (e.g. from the rsmp gem)
# Config for testing RSMP Nordic traffic light controller emulator.
# The settings are used for starting a local supervisor listening for the site tested
# See https://rsmp-nordic.github.io/rsmp_validator/config/
port: 13111
sxl: tlc
sxl_version: '1.2.1'
intervals:
timer: 0.1
Expand All @@ -24,7 +26,6 @@ timeouts:
components:
main:
TC:
ntsOId: KK+AG9998=001TC000
signal_group:
A1:
A2:
Expand All @@ -33,23 +34,18 @@ components:
detector_logic:
DL1:
DL2:
inputs:
total: 8
programming:
7:
raise_alarm: A0302
component: DL1
items:
plans: [1,2]
traffic_situations: [1,2]
emergency_routes: [1,2]
inputs: [1,3,8]
outputs: [1,3,8]
startup_sequence: 'efg'
alarm_triggers:
A0302:
input: 7
component: DL1
secrets:
security_codes:
1: '1111'
2: '2222'
log:
watchdogs: false
acknowledgements: false
2: '2222'
71 changes: 12 additions & 59 deletions config/kapsch_etx.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Config for testing a site running on localhost (e.g. from the rsmp gem)
# Config for testing Kapsch ETX traffic light controller.
# The settings are used for starting a local supervisor listening for the site tested
# see https://rsmp-nordic.github.io/rsmp_validator/config/
type: tlc
sxl: tlc # Traffic Light Controller. We are testing a site, not a server.
port: 12111
ips: all
rsmp_versions: all

# See https://rsmp-nordic.github.io/rsmp_validator/config/
sxl: tlc
sxl_version: '1.2.1'
intervals:
timer: 1
watchdog: 60
Expand All @@ -26,72 +22,29 @@ timeouts:
functional_position: 60
priority_completion: 5
yellow_flash: 3
secrets:
security_codes:
1: '1111'
2: '2222'
components:
main:
KTT+TC=101TC001:
ntsOId: KTT+TC=101TC001
signal_group:
KTT+TC=101SG001:
KTT+TC=101SG002:
KTT+TC=101SG003:
KTT+TC=101SG004:
KTT+TC=101SG005:
KTT+TC=101SG006:
KTT+TC=101SG007:
KTT+TC=101SG008:
KTT+TC=101SG009:
KTT+TC=101SG010:
KTT+TC=101SG011:
KTT+TC=101SG012:
KTT+TC=101SG013:
KTT+TC=101SG014:
KTT+TC=101SG015:
KTT+TC=101SG016:
KTT+TC=101SG017:
KTT+TC=101SG018:
KTT+TC=101SG019:
KTT+TC=101SG020:
KTT+TC=101SG021:
KTT+TC=101SG022:
KTT+TC=101SG023:
KTT+TC=101SG024:
KTT+TC=101SG025:
KTT+TC=101SG026:
KTT+TC=101SG027:
KTT+TC=101SG028:
KTT+TC=101SG029:
KTT+TC=101SG030:
KTT+TC=101SG031:
KTT+TC=101SG032:
detector_logic:
KTT+TC=101DL001:
KTT+TC=101DL002:
KTT+TC=101DL003:
KTT+TC=101DL004:
KTT+TC=101DL005:
KTT+TC=101DL006:
KTT+TC=101DL007:
KTT+TC=101DL008:
KTT+TC=101DL009:
KTT+TC=101DL010:
items:
plans: [1,2]
traffic_situations: []
emergency_routes: []
inputs: [1,2,3,4]
force_input: 1
outputs: [1,2,3,4]
startup_sequence: 'efg'
#alarms:
# A0302:
# activation_input: 1
# component: KTT+TC=101DL001
restrict_testing:
sxl_version: 1.2.1
log:
watchdogs: false
acknowledgements: false
alarm_triggers:
#A0302:
# input: 7
# component: DL1
secrets:
security_codes:
1: '1111'
2: '2222'
42 changes: 8 additions & 34 deletions config/semaforica_cartesio.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
port: 12111
ips: all
core_version: '3.2.2'
sxl: tlc # Traffic Light Controller. We are testing a site, not a server.
# Config for testing Cross RS4S traffic light controller.
# The settings are used for starting a local supervisor listening for the site tested
# See https://rsmp-nordic.github.io/rsmp_validator/config/
sxl: tlc
sxl_version: '1.2.1'
intervals:
timer: 1 # main validator timer resolution in seconds
Expand Down Expand Up @@ -30,48 +30,22 @@ components:
CAR_SG_001:
CAR_SG_002:
CAR_SG_003:
CAR_SG_004:
CAR_SG_005:
CAR_SG_006:
CAR_SG_007:
CAR_SG_008:
CAR_SG_009:
CAR_SG_010:
CAR_SG_011:
CAR_SG_012:
CAR_SG_013:
CAR_SG_014:
CAR_SG_015:
detector_logic: # Each detector logic must be specified manually
CAR_DL_001:
CAR_DL_002:
CAR_DL_003:
CAR_DL_004:
CAR_DL_005:
CAR_DL_006:
CAR_DL_007:
CAR_DL_008:
CAR_DL_009:
CAR_DL_010:
CAR_DL_011:
CAR_DL_012:
CAR_DL_013:
CAR_DL_014:
CAR_DL_015:
CAR_DL_016:
items:
plans: [1,2,3,4]
traffic_situations: [1,2,3,4]
emergency_routes: [1]
inputs: [1,2,3,4]
force_input: 1
outputs: [1,2,3,4]
startup_sequence: 'efg'
alarm_triggers:
A0302:
input: 16
component: CAR_DL_001
secrets:
security_codes:
1: 1234
2: 12341234
alarms:
A0302:
activation_input: 16 # input 2 activates the control block
component: CAR_DL_016 # detector logic 2 is set to error by control block.
20 changes: 10 additions & 10 deletions config/swarco_itc3.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
port: 12111
core_version: '3.2.0'
sxl: tlc # Traffic Light Controller. We are testing a site, not a server.
# Config for testing Swarco ITC-3 traffic light controller.
# The settings are used for starting a local supervisor listening for the site tested
# See https://rsmp-nordic.github.io/rsmp_validator/config/
sxl: tlc
sxl_version: '1.0.15'
intervals:
timer: 1 # main validator timer resolution in seconds
Expand Down Expand Up @@ -35,16 +36,15 @@ items:
traffic_situations: [1]
emergency_routes: [1]
inputs: [1]
force_input: 1
outputs: [1]
startup_sequence: 'efg'
skip_validation:
- Alarm
alarm_triggers:
A0302:
input: 2
component: AA+BBCCC=DDDDL002
secrets:
security_codes:
1: default
2: default
skip_validation:
- Alarm
alarms:
A0302:
activation_input: 2 # input 2 activates the control block
component: AA+BBCCC=DDDDL002 # detector logic 2 is set to error by control block.
15 changes: 3 additions & 12 deletions spec/support/programming_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
module Validator::ProgrammingHelpers
def find_alarm_programming alarm_code_id
action = Validator.config.dig('inputs','programming')
skip "Alarm #{alarm_code_id} is not configured" unless action

action = action.find do |input,options|
options['raise_alarm'] == alarm_code_id
end
skip "Alarm #{alarm_code_id} is not configured" unless action

input = action.first
component_id = action.last['component']

return input, component_id
action = Validator.config.dig('alarm_triggers',alarm_code_id)
skip "Alarm trigger #{alarm_code_id} not configured" unless action
return action["input"], action["component"]
end
end

0 comments on commit 76ecb6b

Please sign in to comment.