-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcontrol_datagram.py
executable file
·62 lines (46 loc) · 1.36 KB
/
control_datagram.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
#!/usr/bin/env python3.10
'''
Simple runner for Datagram suite
'''
import sys
import logging
import olcbchecker.setup
import check_da30_dr
def prompt() :
print("\nDatagram Transport Standard checking")
print(" a Run all in sequence")
print(" 1 Datagram Reception checking")
print(" ")
print(" q go back")
def checkAll(logger=logging.getLogger("DATAGRAM")) :
result = 0
logger.info("Datagram Reception checking")
result += check_da30_dr.check()
if result == 0 :
logger.info("Success - all datagram checks passed")
else:
logger.warn("At least one datagram check failed")
return result
def main() :
logger = logging.getLogger("DATAGRAM")
if olcbchecker.setup.configure.runimmediate :
return (checkAll(logger))
'''
loop to check against Datagram Standard
'''
while True :
prompt()
selection = input(">> ").lower()
match selection :
case "1" :
print("\nDatagram Reception checking")
check_da30_dr.check()
case "a" :
checkAll(logger)
case "q" | "quit" : return
case _ : continue
return
if __name__ == "__main__":
result = main()
olcbchecker.setup.interface.close()
sys.exit(result)