aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-06-01 14:13:29 -0700
committerAnton Tananaev <anton@traccar.org>2024-06-01 14:13:29 -0700
commit47d4ab2bad1806e3943a0e05ced7f8df7f8e1aca (patch)
treee34ddf17fd267a2e6a6420b01e9337ef85a7989d
parent040066dc87fa9845726f9e8646c8a5ad9b95e22a (diff)
downloadtrackermap-server-47d4ab2bad1806e3943a0e05ced7f8df7f8e1aca.tar.gz
trackermap-server-47d4ab2bad1806e3943a0e05ced7f8df7f8e1aca.tar.bz2
trackermap-server-47d4ab2bad1806e3943a0e05ced7f8df7f8e1aca.zip
Update integration test script
-rwxr-xr-xtools/test-integration.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/test-integration.py b/tools/test-integration.py
index f31ad7a82..29c741390 100755
--- a/tools/test-integration.py
+++ b/tools/test-integration.py
@@ -9,6 +9,7 @@ import json
import socket
import time
import threading
+import re
messages = {
'gps103' : 'imei:123456789012345,help me,1201011201,,F,120100.000,A,6000.0000,N,13000.0000,E,0.00,;',
@@ -137,11 +138,11 @@ debug = '-v' in sys.argv
def load_ports():
ports = {}
dir = os.path.dirname(os.path.abspath(__file__))
- root = xml.etree.ElementTree.parse(dir + '/../setup/default.xml').getroot()
- for entry in root.findall('entry'):
- key = entry.attrib['key']
- if key.endswith('.port'):
- ports[key[:-5]] = int(entry.text)
+ with open(dir + '/../src/main/java/org/traccar/config/PortConfigSuffix.java', 'r') as file:
+ content = file.read()
+ pattern = re.compile(r'PORTS\.put\("([^"]+)",\s*(\d+)\);')
+ matches = pattern.findall(content)
+ ports = {protocol: int(port) for protocol, port in matches}
if debug:
print('\nports: {ports!r}\n')
return ports