oauth: Add unit tests for multiplexer handling

(This is a late cherry-pick of 4e1e41733, now that the new suite has
proven its stability, to ensure coverage for this code in PG18 as the
later branches diverge.)

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 <[email protected]>
Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: 
https://postgr.es/m/caoymi+ndzxjhawj9_jrsyf8umtocadamofjeggskw-ky7au...@mail.gmail.com
Discussion: 
https://postgr.es/m/CAOYmi+m=xy0p_uazap_884uf-ghq3wrinegwc9aenb6fyxv...@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/fff8c86759659a070e014ffd7295e93a11a1479c

Modified Files
--------------
src/interfaces/libpq-oauth/Makefile          |  36 +-
src/interfaces/libpq-oauth/meson.build       |  35 ++
src/interfaces/libpq-oauth/t/001_oauth.pl    |  24 ++
src/interfaces/libpq-oauth/test-oauth-curl.c | 527 +++++++++++++++++++++++++++
4 files changed, 618 insertions(+), 4 deletions(-)

Reply via email to