rsmp-validator 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/config/cross_rs4s.yaml +55 -0
- data/config/gem_supervisor.yaml +56 -0
- data/config/gem_tlc.yaml +56 -0
- data/config/gem_tlc_secrets.yaml +3 -0
- data/config/kapsch_etx.yaml +54 -0
- data/config/lightmotion_satellite.yaml +56 -0
- data/config/secrets.yaml +3 -0
- data/config/secrets_example.yaml +6 -0
- data/config/semaforica_cartesio.yaml +56 -0
- data/config/simulator/node_log.yaml +17 -0
- data/config/simulator/supervisor.yaml +11 -0
- data/config/simulator/tlc.yaml +56 -0
- data/config/sus.rb +13 -0
- data/config/swarco_itc3.yaml +55 -0
- data/config/tecsen_tmacs_supervisor.yaml +57 -0
- data/config/validator.rb +37 -0
- data/config/validator.yaml +5 -0
- data/config/validator_example.yaml +23 -0
- data/config/validator_log.yaml +19 -0
- data/exe/rsmp-validator +121 -0
- data/lib/doc_gen/parser.rb +276 -0
- data/lib/doc_gen/renderer.rb +153 -0
- data/lib/rsmp/validator/async_context.rb +15 -0
- data/lib/rsmp/validator/auto_node.rb +82 -0
- data/lib/rsmp/validator/auto_site.rb +30 -0
- data/lib/rsmp/validator/auto_supervisor.rb +23 -0
- data/lib/rsmp/validator/config_normalizer.rb +103 -0
- data/lib/rsmp/validator/configuration/loader.rb +79 -0
- data/lib/rsmp/validator/configuration/secrets.rb +54 -0
- data/lib/rsmp/validator/configuration/validation.rb +115 -0
- data/lib/rsmp/validator/configuration.rb +129 -0
- data/lib/rsmp/validator/helpers/alarms.rb +66 -0
- data/lib/rsmp/validator/helpers/clock.rb +16 -0
- data/lib/rsmp/validator/helpers/connection.rb +73 -0
- data/lib/rsmp/validator/helpers/handshake.rb +110 -0
- data/lib/rsmp/validator/helpers/input.rb +42 -0
- data/lib/rsmp/validator/helpers/security.rb +26 -0
- data/lib/rsmp/validator/helpers/signal_plans.rb +37 -0
- data/lib/rsmp/validator/helpers/signal_priority.rb +130 -0
- data/lib/rsmp/validator/helpers/startup.rb +157 -0
- data/lib/rsmp/validator/helpers/status.rb +22 -0
- data/lib/rsmp/validator/lifecycle.rb +99 -0
- data/lib/rsmp/validator/log.rb +11 -0
- data/lib/rsmp/validator/mode_detection.rb +84 -0
- data/lib/rsmp/validator/options/site_test_options.rb +58 -0
- data/lib/rsmp/validator/options/supervisor_test_options.rb +51 -0
- data/lib/rsmp/validator/site_tester.rb +113 -0
- data/lib/rsmp/validator/supervisor_tester.rb +76 -0
- data/lib/rsmp/validator/tester.rb +101 -0
- data/lib/rsmp/validator/version.rb +5 -0
- data/lib/rsmp/validator/version_filter.rb +44 -0
- data/lib/rsmp/validator.rb +50 -0
- data/schemas/site_test.json +36 -0
- data/schemas/supervisor_test.json +28 -0
- data/test/site/core/aggregated_status_spec.rb +43 -0
- data/test/site/core/connect_spec.rb +104 -0
- data/test/site/core/core_spec.rb +9 -0
- data/test/site/core/disconnect_spec.rb +54 -0
- data/test/site/site_spec.rb +5 -0
- data/test/site/tlc/alarm_spec.rb +134 -0
- data/test/site/tlc/clock_spec.rb +252 -0
- data/test/site/tlc/detector_logics_spec.rb +76 -0
- data/test/site/tlc/emergency_routes_spec.rb +106 -0
- data/test/site/tlc/input_spec.rb +102 -0
- data/test/site/tlc/invalid_command_spec.rb +103 -0
- data/test/site/tlc/invalid_status_spec.rb +70 -0
- data/test/site/tlc/modes_spec.rb +260 -0
- data/test/site/tlc/output_spec.rb +58 -0
- data/test/site/tlc/signal_groups_spec.rb +96 -0
- data/test/site/tlc/signal_plans_spec.rb +287 -0
- data/test/site/tlc/signal_priority_spec.rb +144 -0
- data/test/site/tlc/subscribe_spec.rb +71 -0
- data/test/site/tlc/system_spec.rb +76 -0
- data/test/site/tlc/tlc_spec.rb +7 -0
- data/test/site/tlc/traffic_data_spec.rb +151 -0
- data/test/site/tlc/traffic_situations_spec.rb +50 -0
- data/test/supervisor/aggregated_status_spec.rb +18 -0
- data/test/supervisor/connect_spec.rb +219 -0
- data/test/supervisor/supervisor_spec.rb +11 -0
- metadata +190 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 55ee531553c2e8a6e8a4e92a88a225c84d9eae9cc44226c5ecc57f7c51be87fa
|
|
4
|
+
data.tar.gz: '09a94572268f042111a5799c6c0a5248445eb22422110d624b6c4d455b45cadf'
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 6fc22fafb1e68d93fc092fd90cfd8598892f2a19369dc4b50ca8f3ce4bf524418d08d7e996e05da22ac30e4f937ab0305816572af598338dbebea956ceb42d53
|
|
7
|
+
data.tar.gz: 4f39f0305b3d3a779e1f1c3355f4839f6790fbca9eb8bf049fea8694d85a29688242dd3ef5b9a350d5187af59e7f95a88894f14f8169eeae3b6d437674cd98a7
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Config for testing Cross RS4S traffic light controller.
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
ips: all
|
|
6
|
+
max_sites: 1
|
|
7
|
+
sites:
|
|
8
|
+
default:
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 1
|
|
11
|
+
watchdog: 60
|
|
12
|
+
sxls:
|
|
13
|
+
tlc: '1.2.1'
|
|
14
|
+
timeouts:
|
|
15
|
+
watchdog: 65
|
|
16
|
+
acknowledgement: 5
|
|
17
|
+
connect: 30
|
|
18
|
+
ready: 1
|
|
19
|
+
status_response: 3
|
|
20
|
+
status_update: 5
|
|
21
|
+
subscribe: 1
|
|
22
|
+
command: 300
|
|
23
|
+
command_response: 30
|
|
24
|
+
alarm: 3
|
|
25
|
+
disconnect: 20
|
|
26
|
+
startup_sequence: 45
|
|
27
|
+
functional_position: 60
|
|
28
|
+
priority_completion: 15
|
|
29
|
+
yellow_flash: 2
|
|
30
|
+
components:
|
|
31
|
+
main:
|
|
32
|
+
CZ+76000=101TC001:
|
|
33
|
+
signal_group:
|
|
34
|
+
CZ+76000=101SG001:
|
|
35
|
+
CZ+76000=101SG002:
|
|
36
|
+
CZ+76000=101SG003:
|
|
37
|
+
detector_logic:
|
|
38
|
+
CZ+76000=101DL001:
|
|
39
|
+
CZ+76000=101DL002:
|
|
40
|
+
CZ+76000=101DL003:
|
|
41
|
+
items:
|
|
42
|
+
plans: [1,2] #switching to each plan takes a lot of time
|
|
43
|
+
traffic_situations: [1,2,3]
|
|
44
|
+
emergency_routes: [1] # only one emergency route
|
|
45
|
+
inputs: [1,3,8]
|
|
46
|
+
outputs: [1,3,8]
|
|
47
|
+
startup_sequence: 'efg'
|
|
48
|
+
alarm_triggers:
|
|
49
|
+
A0302:
|
|
50
|
+
input: 7
|
|
51
|
+
component: CZ+76000=101DL001
|
|
52
|
+
secrets:
|
|
53
|
+
security_codes:
|
|
54
|
+
1: '1111'
|
|
55
|
+
2: 'r;PwL7%U?SN2E.5'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Config for testing a supervisor running on localhost (e.g. one from the rsmp gem)
|
|
2
|
+
# The settings are used for starting a local site connecting to the supervisor tested
|
|
3
|
+
local_site:
|
|
4
|
+
type: tlc
|
|
5
|
+
site_id: RN+SI0001
|
|
6
|
+
supervisors:
|
|
7
|
+
- ip: 127.0.0.1
|
|
8
|
+
port: 13111
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 0.1
|
|
11
|
+
watchdog: 0.1
|
|
12
|
+
reconnect: 0.1
|
|
13
|
+
after_connect: 0.2
|
|
14
|
+
secrets:
|
|
15
|
+
security_codes:
|
|
16
|
+
1: '1111'
|
|
17
|
+
2: '2222'
|
|
18
|
+
sxls:
|
|
19
|
+
tlc: '1.2.1'
|
|
20
|
+
components:
|
|
21
|
+
main:
|
|
22
|
+
TC:
|
|
23
|
+
signal_group:
|
|
24
|
+
A1:
|
|
25
|
+
A2:
|
|
26
|
+
B1:
|
|
27
|
+
B2:
|
|
28
|
+
detector_logic:
|
|
29
|
+
DL1:
|
|
30
|
+
signal_plans:
|
|
31
|
+
1:
|
|
32
|
+
cycle_time: 6
|
|
33
|
+
states:
|
|
34
|
+
A1: '111NBB'
|
|
35
|
+
A2: '11NBBB'
|
|
36
|
+
B1: 'BBB11N'
|
|
37
|
+
B2: 'BBB1NB'
|
|
38
|
+
dynamic_bands:
|
|
39
|
+
1: 0
|
|
40
|
+
2: 5
|
|
41
|
+
2:
|
|
42
|
+
cycle_time: 6
|
|
43
|
+
states:
|
|
44
|
+
A1: 'NNNNBB'
|
|
45
|
+
A2: 'NNNNBN'
|
|
46
|
+
B1: 'BBNNNN'
|
|
47
|
+
B2: 'BNNNNN'
|
|
48
|
+
timeouts:
|
|
49
|
+
connect: 1
|
|
50
|
+
ready: 1
|
|
51
|
+
watchdog: 3
|
|
52
|
+
acknowledgement: 1
|
|
53
|
+
secrets:
|
|
54
|
+
security_codes:
|
|
55
|
+
1: '1111'
|
|
56
|
+
2: '2222'
|
data/config/gem_tlc.yaml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Config for testing RSMP Nordic traffic light controller emulator.
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
port: 13111
|
|
6
|
+
ips: all
|
|
7
|
+
max_sites: 1
|
|
8
|
+
proxy_type: tlc
|
|
9
|
+
default:
|
|
10
|
+
intervals:
|
|
11
|
+
timer: 0.1
|
|
12
|
+
watchdog: 0.1
|
|
13
|
+
sxls:
|
|
14
|
+
tlc: '1.2.1'
|
|
15
|
+
timeouts:
|
|
16
|
+
watchdog: 1
|
|
17
|
+
acknowledgement: 1
|
|
18
|
+
connect: 1
|
|
19
|
+
ready: 1
|
|
20
|
+
status_response: 1
|
|
21
|
+
status_update: 1
|
|
22
|
+
subscribe: 1
|
|
23
|
+
command: 1
|
|
24
|
+
command_response: 1
|
|
25
|
+
alarm: 1
|
|
26
|
+
disconnect: 1
|
|
27
|
+
startup_sequence: 5
|
|
28
|
+
functional_position: 2
|
|
29
|
+
priority_completion: 5
|
|
30
|
+
yellow_flash: 2
|
|
31
|
+
components:
|
|
32
|
+
main:
|
|
33
|
+
TC:
|
|
34
|
+
signal_group:
|
|
35
|
+
A1:
|
|
36
|
+
A2:
|
|
37
|
+
B1:
|
|
38
|
+
B2:
|
|
39
|
+
detector_logic:
|
|
40
|
+
DL1:
|
|
41
|
+
DL2:
|
|
42
|
+
items:
|
|
43
|
+
plans: [1,2]
|
|
44
|
+
traffic_situations: [1,2]
|
|
45
|
+
emergency_routes: [1,2]
|
|
46
|
+
inputs: [1,3,8]
|
|
47
|
+
outputs: [1,3,8]
|
|
48
|
+
startup_sequence: 'efg'
|
|
49
|
+
alarm_triggers:
|
|
50
|
+
A0302:
|
|
51
|
+
input: 7
|
|
52
|
+
component: DL1
|
|
53
|
+
secrets:
|
|
54
|
+
security_codes:
|
|
55
|
+
1: '1111'
|
|
56
|
+
2: '2222'
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Config for testing Kapsch ETX traffic light controller.
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
ips: all
|
|
6
|
+
max_sites: 1
|
|
7
|
+
guest:
|
|
8
|
+
intervals:
|
|
9
|
+
timer: 1 # main validator timer resolution in seconds
|
|
10
|
+
watchdog: 60 # send watchdog every x seconds
|
|
11
|
+
sxls:
|
|
12
|
+
tlc: "1.2.1"
|
|
13
|
+
timeouts: # Timeouts used when waiting for messages from site.
|
|
14
|
+
watchdog: 60
|
|
15
|
+
acknowledgement: 10
|
|
16
|
+
connect: 30
|
|
17
|
+
ready: 15
|
|
18
|
+
status_response: 20
|
|
19
|
+
status_update: 20
|
|
20
|
+
subscribe: 20
|
|
21
|
+
command: 30
|
|
22
|
+
command_response: 30
|
|
23
|
+
alarm: 20
|
|
24
|
+
disconnect: 20
|
|
25
|
+
startup_sequence: 10
|
|
26
|
+
functional_position: 10
|
|
27
|
+
priority_completion: 10
|
|
28
|
+
yellow_flash: 3
|
|
29
|
+
components:
|
|
30
|
+
main:
|
|
31
|
+
KTT+TC=101TC001:
|
|
32
|
+
signal_group:
|
|
33
|
+
KTT+TC=101SG001:
|
|
34
|
+
KTT+TC=101SG002:
|
|
35
|
+
KTT+TC=101SG003:
|
|
36
|
+
detector_logic:
|
|
37
|
+
KTT+TC=101DL001:
|
|
38
|
+
KTT+TC=101DL002:
|
|
39
|
+
KTT+TC=101DL003:
|
|
40
|
+
items:
|
|
41
|
+
plans: [1, 2]
|
|
42
|
+
traffic_situations: [1, 2]
|
|
43
|
+
emergency_routes: [4]
|
|
44
|
+
inputs: [1, 2, 3]
|
|
45
|
+
outputs: [1, 2, 3]
|
|
46
|
+
startup_sequence: "efg"
|
|
47
|
+
alarm_triggers:
|
|
48
|
+
A0302:
|
|
49
|
+
input: 4
|
|
50
|
+
component: KTT+TC=101DL004
|
|
51
|
+
secrets:
|
|
52
|
+
security_codes:
|
|
53
|
+
1: "1111"
|
|
54
|
+
2: "2222"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Configuration for testing Lightmotion Satellite RSMP proxy software
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
ips: all
|
|
6
|
+
max_sites: 1
|
|
7
|
+
sites:
|
|
8
|
+
default:
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 1 # main validator timer resolution in seconds
|
|
11
|
+
watchdog: 20 # send watchdog every x seconds
|
|
12
|
+
sxls:
|
|
13
|
+
tlc: '1.2.0'
|
|
14
|
+
timeouts: # Timeouts used when waiting for messages from site.
|
|
15
|
+
watchdog: 60
|
|
16
|
+
acknowledgement: 55
|
|
17
|
+
connect: 120 # Max time to wait for rsmp site to connect to server.
|
|
18
|
+
ready: 20
|
|
19
|
+
status_response: 20
|
|
20
|
+
status_update: 20
|
|
21
|
+
subscribe: 20
|
|
22
|
+
command: 20
|
|
23
|
+
command_response: 20
|
|
24
|
+
alarm: 20
|
|
25
|
+
disconnect: 60
|
|
26
|
+
shutdown: 20
|
|
27
|
+
startup_sequence: 20
|
|
28
|
+
functional_position: 20
|
|
29
|
+
yellow_flash: 20
|
|
30
|
+
priority_completion: 20
|
|
31
|
+
components:
|
|
32
|
+
main:
|
|
33
|
+
AA+BBCCC=DDDEEFFF:
|
|
34
|
+
signal_group: # Each signal group must be specified manually
|
|
35
|
+
AA+BBCCC=DDDSG001:
|
|
36
|
+
AA+BBCCC=DDDSG002:
|
|
37
|
+
AA+BBCCC=DDDSG003:
|
|
38
|
+
AA+BBCCC=DDDSG004:
|
|
39
|
+
detector_logic: # Each detector logic must be specified manually
|
|
40
|
+
AA+BBCCC=DDDDL001:
|
|
41
|
+
AA+BBCCC=DDDDL002:
|
|
42
|
+
items:
|
|
43
|
+
plans: [1]
|
|
44
|
+
traffic_situations: [1]
|
|
45
|
+
emergency_routes: [1]
|
|
46
|
+
inputs: [1]
|
|
47
|
+
outputs: [1]
|
|
48
|
+
startup_sequence: 'efg'
|
|
49
|
+
alarm_triggers:
|
|
50
|
+
A0302:
|
|
51
|
+
input: 1
|
|
52
|
+
component: AA+BBCCC=DDDDL001
|
|
53
|
+
secrets:
|
|
54
|
+
security_codes:
|
|
55
|
+
1: "1234"
|
|
56
|
+
2: "4321"
|
data/config/secrets.yaml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Config for testing Cross RS4S traffic light controller.
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
ips: all
|
|
6
|
+
max_sites: 1
|
|
7
|
+
sites:
|
|
8
|
+
default:
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 1 # main validator timer resolution in seconds
|
|
11
|
+
watchdog: 60 # send watchdog every x seconds
|
|
12
|
+
sxls:
|
|
13
|
+
tlc: '1.2.1'
|
|
14
|
+
timeouts: # Timeouts used when waiting for messages from site.
|
|
15
|
+
watchdog: 60
|
|
16
|
+
acknowledgement: 60
|
|
17
|
+
connect: 120 # Max time to wait for rsmp site to connect to server.
|
|
18
|
+
ready: 60
|
|
19
|
+
status_response: 120
|
|
20
|
+
status_update: 120
|
|
21
|
+
subscribe: 60
|
|
22
|
+
command: 60
|
|
23
|
+
command_response: 60
|
|
24
|
+
alarm: 60
|
|
25
|
+
disconnect: 60
|
|
26
|
+
shutdown: 60
|
|
27
|
+
startup_sequence: 60
|
|
28
|
+
functional_position: 60
|
|
29
|
+
yellow_flash: 60
|
|
30
|
+
priority_completion: 60
|
|
31
|
+
components:
|
|
32
|
+
main:
|
|
33
|
+
CAR_TC_001:
|
|
34
|
+
signal_group: # Each signal group must be specified manually
|
|
35
|
+
CAR_SG_001:
|
|
36
|
+
CAR_SG_002:
|
|
37
|
+
CAR_SG_003:
|
|
38
|
+
detector_logic: # Each detector logic must be specified manually
|
|
39
|
+
CAR_DL_001:
|
|
40
|
+
CAR_DL_002:
|
|
41
|
+
CAR_DL_003:
|
|
42
|
+
items:
|
|
43
|
+
plans: [1,2,3,4]
|
|
44
|
+
traffic_situations: [1,2,3,4]
|
|
45
|
+
emergency_routes: [1]
|
|
46
|
+
inputs: [1,2,3,4]
|
|
47
|
+
outputs: [1,2,3,4]
|
|
48
|
+
startup_sequence: 'efg'
|
|
49
|
+
alarm_triggers:
|
|
50
|
+
A0302:
|
|
51
|
+
input: 16
|
|
52
|
+
component: CAR_DL_016
|
|
53
|
+
secrets:
|
|
54
|
+
security_codes:
|
|
55
|
+
1: 1234
|
|
56
|
+
2: 12341234
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type: tlc
|
|
2
|
+
site_id: RN+SI0001
|
|
3
|
+
supervisors:
|
|
4
|
+
- ip: 127.0.0.1
|
|
5
|
+
port: 13111
|
|
6
|
+
sxls:
|
|
7
|
+
tlc: '1.2.1'
|
|
8
|
+
components:
|
|
9
|
+
main:
|
|
10
|
+
TC:
|
|
11
|
+
ntsOId: KK+AG9998=001TC000
|
|
12
|
+
signal_group:
|
|
13
|
+
A1:
|
|
14
|
+
A2:
|
|
15
|
+
B1:
|
|
16
|
+
B2:
|
|
17
|
+
detector_logic:
|
|
18
|
+
DL1:
|
|
19
|
+
DL2:
|
|
20
|
+
signal_plans:
|
|
21
|
+
1:
|
|
22
|
+
cycle_time: 6
|
|
23
|
+
states:
|
|
24
|
+
A1: '11NBBB'
|
|
25
|
+
A2: '1NBBBB'
|
|
26
|
+
B1: 'BBB11N'
|
|
27
|
+
B2: 'BBB1NB'
|
|
28
|
+
dynamic_bands:
|
|
29
|
+
1: 0
|
|
30
|
+
2: 5
|
|
31
|
+
2:
|
|
32
|
+
cycle_time: 6
|
|
33
|
+
states:
|
|
34
|
+
A1: '111NBB'
|
|
35
|
+
A2: '11NBBB'
|
|
36
|
+
B1: 'BBB11N'
|
|
37
|
+
B2: 'BBB1NB'
|
|
38
|
+
inputs:
|
|
39
|
+
total: 8
|
|
40
|
+
programming:
|
|
41
|
+
7:
|
|
42
|
+
raise_alarm: A0302
|
|
43
|
+
component: DL1
|
|
44
|
+
startup_sequence: 'efg'
|
|
45
|
+
intervals:
|
|
46
|
+
timer: 0.1
|
|
47
|
+
watchdog: 0.1
|
|
48
|
+
reconnect: 0.1
|
|
49
|
+
timeouts:
|
|
50
|
+
connect: 1
|
|
51
|
+
ready: 1
|
|
52
|
+
watchdog: 0.5
|
|
53
|
+
acknowledgement: 0.5
|
|
54
|
+
security_codes:
|
|
55
|
+
1: '1111'
|
|
56
|
+
2: '2222'
|
data/config/sus.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Internal sus config: runs unit/integration tests in test/validator/
|
|
2
|
+
# No RSMP connection or reactor setup needed here.
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# bundle exec sus # runs test/validator/**/*.rb
|
|
6
|
+
# bundle exec sus test/validator
|
|
7
|
+
#
|
|
8
|
+
# To run conformance tests against real equipment, use the rsmp-validator executable:
|
|
9
|
+
# bundle exec rsmp-validator
|
|
10
|
+
|
|
11
|
+
def test_paths
|
|
12
|
+
Dir.glob('test/validator/**/*.rb', base: @root)
|
|
13
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Config for testing Swarco ITC-3 traffic light controller.
|
|
2
|
+
# The settings are used for starting a local supervisor listening for the site tested
|
|
3
|
+
# See https://rsmp-nordic.github.io/rsmp_validator/config/
|
|
4
|
+
local_supervisor:
|
|
5
|
+
ips: all
|
|
6
|
+
max_sites: 1
|
|
7
|
+
sites:
|
|
8
|
+
default:
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 1 # main validator timer resolution in seconds
|
|
11
|
+
watchdog: 20 # send watchdog every x seconds
|
|
12
|
+
sxls:
|
|
13
|
+
tlc: '1.0.15'
|
|
14
|
+
timeouts: # Timeouts used when waiting for messages from site.
|
|
15
|
+
watchdog: 60
|
|
16
|
+
acknowledgement: 60
|
|
17
|
+
connect: 120 # Max time to wait for rsmp site to connect to server.
|
|
18
|
+
ready: 60
|
|
19
|
+
status_response: 120
|
|
20
|
+
status_update: 120
|
|
21
|
+
subscribe: 60
|
|
22
|
+
command: 60
|
|
23
|
+
command_response: 60
|
|
24
|
+
alarm: 60
|
|
25
|
+
disconnect: 60
|
|
26
|
+
shutdown: 60
|
|
27
|
+
startup_sequence: 60
|
|
28
|
+
functional_position: 60
|
|
29
|
+
yellow_flash: 60
|
|
30
|
+
components:
|
|
31
|
+
main:
|
|
32
|
+
AA+BBCCC=DDDEEFFF:
|
|
33
|
+
signal_group: # Each signal group must be specified manually
|
|
34
|
+
AA+BBCCC=DDDSG001:
|
|
35
|
+
detector_logic: # Each detector logic must be specified manually
|
|
36
|
+
AA+BBCCC=DDDDL001:
|
|
37
|
+
AA+BBCCC=DDDDL002:
|
|
38
|
+
AA+BBCCC=DDDDL003:
|
|
39
|
+
items:
|
|
40
|
+
plans: [1,2,3,4]
|
|
41
|
+
traffic_situations: [1]
|
|
42
|
+
emergency_routes: [1]
|
|
43
|
+
inputs: [1]
|
|
44
|
+
outputs: [1]
|
|
45
|
+
startup_sequence: 'efg'
|
|
46
|
+
skip_validation:
|
|
47
|
+
- Alarm
|
|
48
|
+
alarm_triggers:
|
|
49
|
+
A0302:
|
|
50
|
+
input: 2
|
|
51
|
+
component: AA+BBCCC=DDDDL002
|
|
52
|
+
secrets:
|
|
53
|
+
security_codes:
|
|
54
|
+
1: default
|
|
55
|
+
2: default
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# The settings are used for starting a local tlc emulator connecting to the supervisor system to be tested
|
|
2
|
+
|
|
3
|
+
local_site:
|
|
4
|
+
type: tlc
|
|
5
|
+
site_id: CAR_TC_001
|
|
6
|
+
supervisors:
|
|
7
|
+
- ip: rsmp.tmacs.it
|
|
8
|
+
port: 13111
|
|
9
|
+
intervals:
|
|
10
|
+
timer: 0.1
|
|
11
|
+
watchdog: 1
|
|
12
|
+
reconnect: 1
|
|
13
|
+
after_connect: 1
|
|
14
|
+
secrets:
|
|
15
|
+
security_codes:
|
|
16
|
+
1: '1111'
|
|
17
|
+
2: '2222'
|
|
18
|
+
core_version: '3.2.2'
|
|
19
|
+
sxls:
|
|
20
|
+
tlc: '1.2.1'
|
|
21
|
+
components:
|
|
22
|
+
main:
|
|
23
|
+
CAR_TC_001:
|
|
24
|
+
signal_group:
|
|
25
|
+
CAR_SG_001:
|
|
26
|
+
CAR_SG_002:
|
|
27
|
+
CAR_SG_003:
|
|
28
|
+
CAR_SG_004:
|
|
29
|
+
detector_logic:
|
|
30
|
+
CAR_DL_001:
|
|
31
|
+
signal_plans:
|
|
32
|
+
1:
|
|
33
|
+
cycle_time: 6
|
|
34
|
+
states:
|
|
35
|
+
CAR_SG_001: '111NBB'
|
|
36
|
+
CAR_SG_002: '11NBBB'
|
|
37
|
+
CAR_SG_003: 'BBB11N'
|
|
38
|
+
CAR_SG_004: 'BBB1NB'
|
|
39
|
+
dynamic_bands:
|
|
40
|
+
1: 0
|
|
41
|
+
2: 5
|
|
42
|
+
2:
|
|
43
|
+
cycle_time: 6
|
|
44
|
+
states:
|
|
45
|
+
CAR_SG_001: 'NNNNBB'
|
|
46
|
+
CAR_SG_002: 'NNNNBN'
|
|
47
|
+
CAR_SG_003: 'BBNNNN'
|
|
48
|
+
CAR_SG_004: 'BNNNNN'
|
|
49
|
+
timeouts:
|
|
50
|
+
connect: 10
|
|
51
|
+
ready: 100
|
|
52
|
+
watchdog: 5
|
|
53
|
+
acknowledgement: 5
|
|
54
|
+
secrets:
|
|
55
|
+
security_codes:
|
|
56
|
+
1: '1111'
|
|
57
|
+
2: '2222'
|
data/config/validator.rb
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'async'
|
|
2
|
+
require 'active_support'
|
|
3
|
+
require 'active_support/time'
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
require_relative '../lib/rsmp/validator'
|
|
6
|
+
|
|
7
|
+
# Include RSMP::Validator::Log in all test instances so log() is available in all tests
|
|
8
|
+
Sus::Base.include(RSMP::Validator::Log)
|
|
9
|
+
|
|
10
|
+
# Include Connection helpers so with_site/with_supervisor are available in all tests
|
|
11
|
+
Sus::Base.include(RSMP::Validator::Helpers::Connection)
|
|
12
|
+
|
|
13
|
+
# Include AsyncContext so all tests run inside the shared reactor
|
|
14
|
+
Sus::Base.prepend(RSMP::Validator::AsyncContext)
|
|
15
|
+
|
|
16
|
+
# Add eq helper: wraps sus's `be ==` so spec files can use eq(x) for value equality
|
|
17
|
+
Sus::Base.define_method(:eq) { |value| be == value }
|
|
18
|
+
|
|
19
|
+
# Conformance test paths: test/site/ and test/supervisor/
|
|
20
|
+
def test_paths
|
|
21
|
+
Dir.glob('test/site/**/*.rb', base: @root) +
|
|
22
|
+
Dir.glob('test/supervisor/**/*.rb', base: @root)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Called before tests are run: set up reactor, auto-node, initial connection
|
|
26
|
+
def before_tests(assertions, output: self.output)
|
|
27
|
+
super
|
|
28
|
+
|
|
29
|
+
RSMP::Validator.setup(self)
|
|
30
|
+
RSMP::Validator.before_suite
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Called after tests are run: stop auto-node and reactor
|
|
34
|
+
def after_tests(assertions, output: self.output)
|
|
35
|
+
RSMP::Validator.after_suite
|
|
36
|
+
super
|
|
37
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# This file is a template.
|
|
2
|
+
# Copy it to config/validator.yaml and edit the copy to
|
|
3
|
+
# point to the config for the system you're testing
|
|
4
|
+
# You only need either a site or a supervisor key. The right
|
|
5
|
+
# one will be picked depending on what specs you run.
|
|
6
|
+
# But you can leave both, the unused key will just be ignored.
|
|
7
|
+
|
|
8
|
+
# when testing a site, the config describes the local supervisor
|
|
9
|
+
site: config/gem_tlc.yaml
|
|
10
|
+
|
|
11
|
+
# when testing a supervisor, the config describes the local site
|
|
12
|
+
supervisor: config/gem_supervisor.yaml
|
|
13
|
+
|
|
14
|
+
# Optional: Auto Node Feature
|
|
15
|
+
# Automatically start a local site/supervisor to test instead of an external one.
|
|
16
|
+
# This is useful when developing the RSMP gem or the test suite itself.
|
|
17
|
+
# The auto node runs inside the same Async reactor as the validator.
|
|
18
|
+
|
|
19
|
+
# Uncomment to automatically start a local site for testing:
|
|
20
|
+
# auto_site: config/simulator/tlc.yaml
|
|
21
|
+
|
|
22
|
+
# Uncomment to automatically start a local supervisor for testing:
|
|
23
|
+
# auto_supervisor: config/simulator/supervisor.yaml
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
prefix: '[VALIDATOR] '
|
|
2
|
+
style:
|
|
3
|
+
warning:
|
|
4
|
+
color: yellow
|
|
5
|
+
mode: bold
|
|
6
|
+
info:
|
|
7
|
+
color: magenta
|
|
8
|
+
mode: bold
|
|
9
|
+
log:
|
|
10
|
+
color: magenta
|
|
11
|
+
debug:
|
|
12
|
+
color: magenta
|
|
13
|
+
collect:
|
|
14
|
+
color: magenta
|
|
15
|
+
port: true
|
|
16
|
+
json: true
|
|
17
|
+
acknowledgements: true
|
|
18
|
+
watchdogs: true
|
|
19
|
+
debug: false
|