Test OpenVPN log/event parsing against captured session logs #26
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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_devicefrom #15 ishalfway 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 parsingagainst captured API fixtures.
Done across
85ff065andf978b8a:mgmt.parse_event) with the management-interface migration; log parsing shrank to theparse_tun_devicefallback 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 fromtests/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.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.