Test OpenVPN log/event parsing against captured session logs #26

Closed
opened 2026-08-17 16:57:01 -04:00 by mysticalsoap · 1 comment
Owner

Highest-value test target, and the one to write first.

The parser's only current test environment is a live VPN session, which is
precisely why its failure went unnoticed until the app was run. Extract the
state reading into a pure function over lines/events -- tun_device from #15 is
halfway there -- and feed it captured real logs: a 2.7.6/DCO session, a
userspace session, an auth failure, a reconnect.

This turns the DCO bug into a fixture rather than a field report, and these
tests become the regression net for the management-interface migration, since
they cover the unit that migration replaces.

Then: config generation (write_config, ovpn_quote), then provider parsing
against captured API fixtures.

Highest-value test target, and the one to write first. The parser's only current test environment is a live VPN session, which is precisely why its failure went unnoticed until the app was run. Extract the state reading into a pure function over lines/events -- `tun_device` from #15 is halfway there -- and feed it captured real logs: a 2.7.6/DCO session, a userspace session, an auth failure, a reconnect. This turns the DCO bug into a fixture rather than a field report, and these tests become the regression net for the management-interface migration, since they cover the unit that migration replaces. Then: config generation (`write_config`, `ovpn_quote`), then provider parsing against captured API fixtures.
Author
Owner

Done across 85ff065 and f978b8a:

  • State reading became a pure function (mgmt.parse_event) with the management-interface migration; log parsing shrank to the parse_tun_device fallback for raw custom configs.
  • tests/fixtures/ now holds real 2.7.6 captures: DCO session and auth failure from the service's own field log, plus userspace session, ping-restart reconnect and auth-failure management-stream transcripts from tests/manual/ovpnlab — a loopback server+client pair in an unprivileged namespace (no root, no VPN account). Re-run the lab after an OpenVPN upgrade and diff against the committed fixtures.
  • The captures already paid out once: userspace mode announces the device a second time as lowercase tun/tap device [tun0] opened, which the regex missed — now matched case-insensitively.

Not done, deliberately: reconnect/userspace stdout log fixtures (nothing parses the log for state anymore), and the config-generation / provider-API fixture idea, which can be its own issue if it ever earns one.

Done across 85ff065 and f978b8a: - State reading became a pure function (`mgmt.parse_event`) with the management-interface migration; log parsing shrank to the `parse_tun_device` fallback for raw custom configs. - `tests/fixtures/` now holds real 2.7.6 captures: DCO session and auth failure from the service's own field log, plus userspace session, ping-restart reconnect and auth-failure **management-stream transcripts** from `tests/manual/ovpnlab` — a loopback server+client pair in an unprivileged namespace (no root, no VPN account). Re-run the lab after an OpenVPN upgrade and diff against the committed fixtures. - The captures already paid out once: userspace mode announces the device a second time as lowercase `tun/tap device [tun0] opened`, which the regex missed — now matched case-insensitively. Not done, deliberately: reconnect/userspace *stdout log* fixtures (nothing parses the log for state anymore), and the config-generation / provider-API fixture idea, which can be its own issue if it ever earns one.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mysticalsoap/aqomui#26
No description provided.