aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2020-12-06 22:51:13 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2020-12-11 00:41:17 +0100
commitf80f7cc5c46bddf63c0f41042f28e7f62aec45af (patch)
treedba00f14b292fd38da244a4fd52e08bec27a0e53
parent1e01a68846abd272118a0c539439c3fb4ae39a3d (diff)
OsmoCtrl: use one global common counter for CTRL IDsneels/ho
It is easier to traverse debugging logs if the CTRL request and response IDs are globally unique across all programs and tests. Before this, we were using 0 almost everywhere. (This is not strictly needed for correctness, since each CTRL client has its own request ID scope; just we open fairly many separate CTRL clients all the time in our tests.) Change-Id: I44c51f4fb5beb6cedf98ea0d6684a24c6aa418c7
-rw-r--r--src/osmo_gsm_tester/obj/osmo_ctrl.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/osmo_gsm_tester/obj/osmo_ctrl.py b/src/osmo_gsm_tester/obj/osmo_ctrl.py
index 6c4ac87..3098960 100644
--- a/src/osmo_gsm_tester/obj/osmo_ctrl.py
+++ b/src/osmo_gsm_tester/obj/osmo_ctrl.py
@@ -39,17 +39,17 @@ class CtrlInterfaceExn(Exception):
pass
class OsmoCtrl(log.Origin):
+ _next_id = 1
def __init__(self, host, port):
super().__init__(log.C_BUS, 'Ctrl', host=host, port=port)
self.host = host
self.port = port
self.sck = None
- self._next_id = 0
def next_id(self):
- ret = self._next_id
- self._next_id += 1
+ ret = OsmoCtrl._next_id
+ OsmoCtrl._next_id += 1
return ret
def prefix_ipa_ctrl_header(self, data):