Closed ymorin-orange closed 7 months ago
tests 1. to 4. ok:
kvmk8371@yd-89lzhs3:~/Workspace/its-client/python/its-interqueuemanager$ /home/kvmk8371/.local/bin/its-iqm --debug -c iqm.cfg
2024-03-14 10:20:11,615 main: loading config file iqm.cfg...
2024-03-14 10:20:11,616 main: create IQM...
2024-03-14 10:20:11,616 iqm: create
2024-03-14 10:20:11,616 iqm: create local qm
2024-03-14 10:20:11,616 mqtt_client: [local]: create to 127.0.0.1:1883, listening on 5G-root/inQueue/v2x
2024-03-14 10:20:11,616 main: run IQM...
2024-03-14 10:20:11,616 mqtt_client: [local]: starting for 127.0.0.1:1883
2024-03-14 10:20:11,616 file: starting authority file client to /etc/its/neighbours.cfg@60
2024-03-14 10:20:11,616 file: loading neighbours
2024-03-14 10:20:11,617 file: loaded 0 neighbour(s)
2024-03-14 10:20:11,617 iqm: stopping old neighbours (if any)...
2024-03-14 10:20:11,617 iqm: starting new neighbours (if any)...
2024-03-14 10:20:11,617 mqtt_client: [local]: connected to 127.0.0.1:1883
2024-03-14 10:20:11,617 mqtt_client: [local]: subscribed to 5G-root/inQueue/v2x/#
2024-03-14 10:20:28,911 mqtt_client: [local]: received message on 5G-root/inQueue/v2x/cam/0/1/2/3: b'{"type": "cam", '[...]
2024-03-14 10:20:28,911 mqtt_client: [local]: -> forwarding to 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 10:20:28,911 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 10:20:28,911 mqtt_client: [local]: -> forwarding to 5G-root/interQueue/v2x/cam/0/1/2/3
2024-03-14 10:20:28,911 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/interQueue/v2x/cam/0/1/2/3
2024-03-14 10:21:11,677 file: loading neighbours
2024-03-14 10:21:11,677 file: loaded 0 neighbour(s)
2024-03-14 10:21:11,677 iqm: stopping old neighbours (if any)...
2024-03-14 10:21:11,677 iqm: starting new neighbours (if any)...
2024-03-14 10:22:11,737 file: loading neighbours
2024-03-14 10:22:11,737 file: loaded 0 neighbour(s)
2024-03-14 10:22:11,737 iqm: stopping old neighbours (if any)...
2024-03-14 10:22:11,737 iqm: starting new neighbours (if any)...
Test 5. ko : no reload of the config file:
2024-03-14 10:45:12,719 file: loaded 0 neighbour(s)
2024-03-14 10:45:12,719 iqm: stopping old neighbours (if any)...
2024-03-14 10:45:12,719 iqm: starting new neighbours (if any)...
2024-03-14 10:46:12,779 file: loading neighbours
2024-03-14 10:46:12,779 file: loaded 0 neighbour(s)
2024-03-14 10:46:12,779 iqm: stopping old neighbours (if any)...
2024-03-14 10:46:12,779 iqm: starting new neighbours (if any)...
2024-03-14 10:47:12,839 file: loading neighbours
2024-03-14 10:47:12,839 file: loaded 0 neighbour(s)
2024-03-14 10:47:12,839 iqm: stopping old neighbours (if any)...
2024-03-14 10:47:12,839 iqm: starting new neighbours (if any)...
I note a curious log starting authority file client to /etc/its/neighbours.cfg@60
onstead of something like starting authority file client to neighbours.cfg
test 5. and 6. ok if I put the file into the (root) directory /etc/its:
2024-03-14 11:17:08,887 file: loading neighbours
2024-03-14 11:17:08,887 file: loaded 1 neighbour(s)
2024-03-14 11:17:08,887 iqm: stopping old neighbours (if any)...
2024-03-14 11:17:08,887 iqm: starting new neighbours (if any)...
2024-03-14 11:17:14,183 mqtt_client: [neighbour-1]: received message on other-pfx/other-queue/other-sfx/cam/0/1/2/3: b'{"type": "cam", '[...]
2024-03-14 11:17:14,183 mqtt_client: [neighbour-1]: -> forwarding to 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:17:14,183 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/outQueue/v2x/cam/0/1/2/3
tests 7. and 8. ok:
2024-03-14 11:24:09,193 file: loading neighbours
2024-03-14 11:24:09,193 file: loaded 1 neighbour(s)
2024-03-14 11:24:09,193 iqm: stopping old neighbours (if any)...
2024-03-14 11:24:09,193 iqm: stopping neighbour-1...
2024-03-14 11:24:09,193 mqtt_client: [neighbour-1]: stopping for 127.0.0.1:1883
2024-03-14 11:24:09,194 mqtt_client: [neighbour-1]: disconnected from 127.0.0.1:1883
2024-03-14 11:24:09,194 mqtt_client: [neighbour-1]: disconnected (socket) from 127.0.0.1:1883
2024-03-14 11:24:09,194 iqm: starting new neighbours (if any)...
2024-03-14 11:24:09,194 iqm: creating qm for neighbour-1
2024-03-14 11:24:09,194 mqtt_client: [neighbour-1]: create to 127.0.0.1:1883, listening on other-pfx/couic/yadayada
2024-03-14 11:24:09,194 mqtt_client: [neighbour-1]: starting for 127.0.0.1:1883
2024-03-14 11:24:09,195 mqtt_client: [neighbour-1]: connected to 127.0.0.1:1883
2024-03-14 11:24:09,195 mqtt_client: [neighbour-1]: subscribed to other-pfx/couic/yadayada/#
2024-03-14 11:24:38,655 mqtt_client: [local]: received message on 5G-root/inQueue/v2x/cam/0/1/2/3: b'{"type": "cam", '[...]
2024-03-14 11:24:38,655 mqtt_client: [local]: -> forwarding to 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:24:38,655 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:24:38,655 mqtt_client: [local]: -> forwarding to 5G-root/interQueue/v2x/cam/0/1/2/3
2024-03-14 11:24:38,655 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/interQueue/v2x/cam/0/1/2/3
2024-03-14 11:25:07,768 mqtt_client: [neighbour-1]: received message on other-pfx/couic/yadayada/cam/0/1/2/3: b'{"type": "cam", '[...]
2024-03-14 11:25:07,768 mqtt_client: [neighbour-1]: -> forwarding to 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:25:07,768 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:25:09,251 file: loading neighbours
2024-03-14 11:25:09,251 file: loaded 1 neighbour(s)
2024-03-14 11:25:09,251 iqm: stopping old neighbours (if any)...
2024-03-14 11:25:09,251 iqm: starting new neighbours (if any)...
tests 9. to 11. ok:
2024-03-14 11:28:09,388 file: loading neighbours
2024-03-14 11:28:09,388 file: loaded 0 neighbour(s)
2024-03-14 11:28:09,388 iqm: stopping old neighbours (if any)...
2024-03-14 11:28:09,388 iqm: stopping neighbour-1...
2024-03-14 11:28:09,388 mqtt_client: [neighbour-1]: stopping for 127.0.0.1:1883
2024-03-14 11:28:09,388 mqtt_client: [neighbour-1]: disconnected from 127.0.0.1:1883
2024-03-14 11:28:09,389 mqtt_client: [neighbour-1]: disconnected (socket) from 127.0.0.1:1883
2024-03-14 11:28:09,389 iqm: starting new neighbours (if any)...
2024-03-14 11:29:09,449 file: loading neighbours
2024-03-14 11:29:09,449 file: loaded 0 neighbour(s)
2024-03-14 11:29:09,449 iqm: stopping old neighbours (if any)...
2024-03-14 11:29:09,449 iqm: starting new neighbours (if any)...
2024-03-14 11:29:35,772 mqtt_client: [local]: received message on 5G-root/inQueue/v2x/cam/0/1/2/3: b'{"type": "cam", '[...]
2024-03-14 11:29:35,772 mqtt_client: [local]: -> forwarding to 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:29:35,772 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/outQueue/v2x/cam/0/1/2/3
2024-03-14 11:29:35,772 mqtt_client: [local]: -> forwarding to 5G-root/interQueue/v2x/cam/0/1/2/3
2024-03-14 11:29:35,772 mqtt_client: [local]: publishing b'{"type": "cam", '[...] on 5G-root/interQueue/v2x/cam/0/1/2/3
^C2024-03-14 11:30:38,387 file: stopping authority file client to /etc/its/neighbours.cfg
2024-03-14 11:30:38,387 mqtt_client: [local]: stopping for 127.0.0.1:1883
2024-03-14 11:30:38,387 mqtt_client: [local]: disconnected from 127.0.0.1:1883
2024-03-14 11:30:38,388 mqtt_client: [local]: disconnected (socket) from 127.0.0.1:1883
test 13. ko:
kvmk8371@yd-89lzhs3:~/Workspace/its-client/python/its-interqueuemanager$ cat iqm.cfg
[general]
instance-id = iqm-1
prefix = 5G-root
suffix = v2x
[local]
host = 127.0.0.1
port = 1883
[central]
type = mqtt
host = 127.0.0.1
port = 1883
client_id = iqm-1-central
topic = 5G-root/neighbours/iqm-1-central
[neighbours]
client_id = neighbour-1kvmk8371@yd-89lzhs3:~/Workspace/its-client/python/its-interqueuemanager$ /home/kvmk8371/.local/bin/its-iqm --debug -c iqm.cfg
2024-03-14 11:37:26,452 main: loading config file iqm.cfg...
2024-03-14 11:37:26,452 main: create IQM...
2024-03-14 11:37:26,452 iqm: create
2024-03-14 11:37:26,452 iqm: create local qm
2024-03-14 11:37:26,452 mqtt_client: [local]: create to 127.0.0.1:1883, listening on 5G-root/inQueue/v2x
2024-03-14 11:37:26,452 main: run IQM...
2024-03-14 11:37:26,452 mqtt_client: [local]: starting for 127.0.0.1:1883
2024-03-14 11:37:26,453 file: starting authority file client to /etc/its/neighbours.cfg@60
2024-03-14 11:37:26,453 file: loading neighbours
2024-03-14 11:37:26,453 file: loaded 0 neighbour(s)
2024-03-14 11:37:26,453 iqm: stopping old neighbours (if any)...
2024-03-14 11:37:26,453 iqm: starting new neighbours (if any)...
2024-03-14 11:37:26,453 mqtt_client: [local]: connected to 127.0.0.1:1883
2024-03-14 11:37:26,454 mqtt_client: [local]: subscribed to 5G-root/inQueue/v2x/#
The iqm stays in file mode.
Test 5. ko : no reload of the config file: [..] I note a curious log
starting authority file client to /etc/its/neighbours.cfg@60
onstead of something likestarting authority file client to neighbours.cfg
Indeed, I forgot to amend the iqm.cfg
: the configuration section is not central
, but authority
:
[general]
instance-id = iqm-1
prefix = 5G-root
suffix = v2x
[local]
host = 127.0.0.1
port = 1883
[authority] <<=== Here
type = file
reload = 5
path = /home/nyma7486/dev/work/5GCroCo/its-client/iqm-neighbour-config/neighbours.cfg
[neighbours]
client_id = neighbour-1
I've now updated the PR description accordingly...
I suspect that's also the reason why test 13 failed...
Changes:
How to test:
Note: you'll need an MQTT broker that allows anonymous connections, listening on port 1883 on local host. To display the traffic on the broker, start a mosquitto client (
%t
displays the topic,%p
the payload):mosquitto_sub -t '#' -F '%t %p'
Note the installation path (e.g. /home/login/.local/bin).
iqm.cfg
configuration file:neighbours.cfg.tmp
configuration file (note the extension.tmp
):Ctrl-C
.iqm.cfg
configuration file:neighbours.json
configuration file:Ctrl-C
.Expected results:
outQueue
andinterQueue
, the remote CAM is not forwarded:other-pfx/interQueue/other-sfx/#
.outQueue
andinterQueue
, the remote CAM is forwarded to the localoutQueue
:other-pfx/couic/yadayada/#
.outQueue
andinterQueue
, the remote CAM is forwarded to the localoutQueue
:outQueue
andinterQueue
, the remote CAM is not forwarded: