oauth: Add unit tests for multiplexer handling
authorJacob Champion <jchampion@postgresql.org>
Mon, 25 Aug 2025 16:27:45 +0000 (09:27 -0700)
committerJacob Champion <jchampion@postgresql.org>
Mon, 25 Aug 2025 16:27:45 +0000 (09:27 -0700)
commit4e1e417330d42cb19c7d439cd50eea20f25c7518
tree6bf4d74acf3973d20559127001a6cfeb7d11afd8
parent52ecd05aeef851b7d3688b0f0a633132c691eb32
oauth: Add unit tests for multiplexer handling

To better record the internal behaviors of oauth-curl.c, add a unit test
suite for the socket and timer handling code. This is all based on TAP
and driven by our existing Test::More infrastructure.

This commit is a replay of 1443b6c0e, which was reverted due to
buildfarm failures. Compared with that, this version protects the build
targets in the Makefile with a with_libcurl conditional, and it tweaks
the code style in 001_oauth.pl.

Reviewed-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/CAOYmi+nDZxJHaWj9_jRSyf8uMToCADAmOfJEggsKW-kY7aUwHA@mail.gmail.com
Discussion: https://postgr.es/m/CAOYmi+m=xY0P_uAzAP_884uF-GhQ3wrineGwc9AEnb6fYxVqVQ@mail.gmail.com
src/interfaces/libpq-oauth/Makefile
src/interfaces/libpq-oauth/meson.build
src/interfaces/libpq-oauth/t/001_oauth.pl [new file with mode: 0644]
src/interfaces/libpq-oauth/test-oauth-curl.c [new file with mode: 0644]