-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontrol_events.py
executable file
·85 lines (67 loc) · 2.16 KB
/
control_events.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3.10
'''
Simple runner for message network checks
'''
import sys
import logging
import olcbchecker.setup
import check_ev10_ida
import check_ev20_idg
import check_ev30_ip
import check_ev40_ic
def prompt() :
print("\nEvent Exchange Standard checking")
print(" a Run all in sequence")
print(" 1 Identify Event Addressed checking")
print(" 2 Identify Event Global checking")
print(" 3 Identify Producer checking")
print(" 4 Identify Consumer checking")
print(" ")
print(" q go back")
def checkAll(logger=logging.getLogger("EVENTS")) :
result = 0
logger.info("Identify Event Addressed checking")
result += check_ev10_ida.check()
logger.info("Identify Event Global checking")
result += check_ev20_idg.check()
logger.info("Identify Producer checking")
result += check_ev30_ip.check()
logger.info("Identify Consumer checking")
result += check_ev40_ic.check()
if result == 0 :
logger.info("Success - all event checks passed")
else:
logger.warning("At least one event check failed")
return result
def main() :
logger = logging.getLogger("EVENT")
if olcbchecker.setup.configure.runimmediate :
return (checkAll(logger))
'''
loop to check against Event Transport Standard
'''
while True :
prompt()
selection = input(">> ").lower()
match selection :
case "1" :
print("\nIdentify Event Addressed checking")
check_ev10_ida.check()
case "2" :
print("\nIdentify Event Global checking")
check_ev20_idg.check()
case "3" :
print("\nIdentify Producer checking")
check_ev30_ip.check()
case "4" :
print("\nIdentify Consumer checking")
check_ev40_ic.check()
case "a" :
checkAll(logger)
case "q" | "quit" : return
case _ : continue
return
if __name__ == "__main__":
result = main()
olcbchecker.setup.interface.close()
sys.exit(result)