h2o / picotls

TLS 1.3 implementation in C (master supports RFC8446 as well as draft-26, -27, -28)
527 stars 140 forks source link

test-openssl.t has a few failing tests #516

Closed sshock closed 3 months ago

sshock commented 3 months ago

With a clean build of master, I see a few failing tests in test-openssl.t.

    # Subtest: cert-verify
    ok 1 - /home/sshock/git/quic/picotls/t/openssl.c 278
    not ok 2 - /home/sshock/git/quic/picotls/t/openssl.c 283
    not ok 3 - /home/sshock/git/quic/picotls/t/openssl.c 285
    not ok 4 - /home/sshock/git/quic/picotls/t/openssl.c 290
    1..4
not ok 7 - cert-verify
kazuho commented 3 months ago

Could you please let us know your enviroment (e.g., operating system, OpenSSL version)?

We do not see failures in the CI: https://github.com/h2o/picotls/actions/runs/8150381033.

sshock commented 3 months ago

Sure, here is my environment:

sshock commented 3 months ago

I think I figured out why it's failing for me. When building projects with cmake I'm in the habit of creating a build/ folder and doing the build inside there (starting with cmake ..), just to keep build files separate from source code.

So when I run ./test-openssl.t while inside the build directory, it must be failing to load the test-ca.cert on line 282:

ret = X509_LOOKUP_load_file(lookup, "t/assets/test-ca.crt", X509_FILETYPE_PEM);

Sure enough, when I run it from the parent folder instead it works just fine.

Feel free to close this out, unless you'd like to embed the test-ca.crt inside the code (like you've done with RSA_PRIVATE_KEY and RSA_CERTIFICATE) so it could run from anywhere.

kazuho commented 3 months ago

Ah I see.

Yes, the expectation behind the test scripts / programs are that they are run from the source directory.