haproxy/tests/unit
William Lallemand 09457111bb TESTS: jws: register a unittest for jwk
Add a way to test the jwk converter in the unit test system

    $ make TARGET=linux-glibc USE_OPENSSL=1 CFLAGS="-DDEBUG_UNIT=1"
    $ ./haproxy -U jwk foobar.pem.rsa
    {
        "kty": "RSA",
        "n":   "...",
        "e":   "AQAB"
    }
    $ ./haproxy -U jwk foobar.pem.ecdsa
    {
        "kty": "EC",
        "crv": "P-384",
        "x":   "...",
        "y":   "..."
    }

This is then tested by a shell script:

    $ HAPROXY_PROGRAM=${PWD}/haproxy tests/unit/jwk/test.sh
    + readlink -f tests/unit/jwk/test.sh
    + BASENAME=/haproxy/tests/unit/jwk/test.sh
    + dirname /haproxy/tests/unit/jwk/test.sh
    + TESTDIR=/haproxy/tests/unit/jwk
    + HAPROXY_PROGRAM=/haproxy/haproxy
    + mktemp
    + FILE1=/tmp/tmp.iEICxC5yNK
    + /haproxy/haproxy -U jwk /haproxy/tests/unit/jwk/ecdsa.key
    + diff -Naurp /haproxy/tests/unit/jwk/ecdsa.pub.jwk /tmp/tmp.iEICxC5yNK
    + rm /tmp/tmp.iEICxC5yNK
    + mktemp
    + FILE2=/tmp/tmp.EIrGZGaCDi
    + /haproxy/haproxy -U jwk /haproxy/tests/unit/jwk/rsa.key
    + diff -Naurp /haproxy/tests/unit/jwk/rsa.pub.jwk /tmp/tmp.EIrGZGaCDi
    + rm /tmp/tmp.EIrGZGaCDi

    $ echo $?
    0
2025-03-03 12:43:32 +01:00
..
jwk TESTS: jws: register a unittest for jwk 2025-03-03 12:43:32 +01:00
ist.c MINOR: ist: define iststrip() new function 2024-04-26 11:29:25 +02:00
test-1-among.c TESTS: add a unit test for one_among_mask() 2022-06-21 20:29:57 +02:00
test-arg.c TESTS: slightly reorganize the code in the tests/ directory 2021-04-02 10:51:12 +02:00
test-inherited-fd.py TESTS: slightly reorganize the code in the tests/ directory 2021-04-02 10:51:12 +02:00
test-int-range.c TESTS: add a unit test for the multi-byte range checks 2024-04-24 16:05:38 +02:00
test-list.c MAJOR: import: update mt_list to support exponential back-off (try #2) 2024-07-09 16:46:38 +02:00
test-sockpair.py TESTS: slightly reorganize the code in the tests/ directory 2021-04-02 10:51:12 +02:00