X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=test%2Fcommon.py;h=7a863106309e61072511641a7a975f5e344abbdf;hb=refs%2Ftags%2F1.90;hp=3bf8f08bee050afef90b38ee1f5e7960bf186654;hpb=bf48ccad4b4b91e7d7e09d1087f5953bc2db97d7;p=loctrkd.git diff --git a/test/common.py b/test/common.py index 3bf8f08..7a86310 100644 --- a/test/common.py +++ b/test/common.py @@ -23,6 +23,8 @@ from time import sleep from typing import Optional from unittest import TestCase +from loctrkd.common import init_protocols + NUMPORTS = 3 @@ -39,32 +41,37 @@ class TestWithServers(TestCase): freeports.append(sk.getsockname()[1]) _, self.tmpfilebase = mkstemp() self.conf = ConfigParser() + self.conf["common"] = { + "protocols": "zx303proto", + } self.conf["collector"] = { "port": str(freeports[0]), "publishurl": "ipc://" + self.tmpfilebase + ".pub", "listenurl": "ipc://" + self.tmpfilebase + ".pul", - "protocols": "zx303proto", } self.conf["storage"] = { "dbfn": self.tmpfilebase + ".storage.sqlite", + "events": "yes", } self.conf["opencellid"] = { "dbfn": self.tmpfilebase + ".opencellid.sqlite", "downloadurl": f"http://localhost:{freeports[2]}/test/262.csv.gz", } - self.conf["lookaside"] = { - "backend": "opencellid", + self.conf["rectifier"] = { + "lookaside": "opencellid", + "publishurl": "ipc://" + self.tmpfilebase + ".rect.pub", } self.conf["wsgateway"] = { "port": str(freeports[1]), } + init_protocols(self.conf) self.children = [] for srvname in args: if srvname == "collector": kwargs = {"handle_hibernate": False} else: kwargs = {} - cls = import_module("gps303." + srvname, package=".") + cls = import_module("loctrkd." + srvname, package=".") if verbose: cls.log.addHandler(StreamHandler(stderr)) cls.log.setLevel(DEBUG) @@ -99,6 +106,7 @@ class TestWithServers(TestCase): for sfx in ( "", ".pub", + ".rect.pub", ".pul", ".storage.sqlite", ".opencellid.sqlite",