baresip / baresip

Baresip is a modular SIP User-Agent with audio and video support
BSD 3-Clause "New" or "Revised" License
1.71k stars 440 forks source link

tls: Can't read certificate file: ./test/data/sni/other-cert.pem (0) #3087

Closed robert-scheck closed 2 months ago

robert-scheck commented 2 months ago

Building baresip 3.14.0 from the release tarball leads to the following test failure in the Fedora build system:

+ cd baresip-3.14.0
+ cd redhat-linux-build
+ ./test/selftest
tls: Can't read certificate file: ./test/data/sni/other-cert.pem (0)

running baresip selftest version 3.14.0 with 54 tests
[ RUN      ] test_account (rx main)
[       OK ]
[ RUN      ] test_account_uri_complete (rx main)
[       OK ]
[ RUN      ] test_call_answer (rx main)
[       OK ]
[ RUN      ] test_call_answer_hangup_a (rx main)
[       OK ]
[ RUN      ] test_call_answer_hangup_b (rx main)
[       OK ]
[ RUN      ] test_call_aulevel (rx main)
[       OK ]
[ RUN      ] test_call_custom_headers (rx main)
[       OK ]
[ RUN      ] test_call_dtmf (rx main)
[       OK ]
[ RUN      ] test_call_format_float (rx main)
[       OK ]
[ RUN      ] test_call_max (rx main)
[       OK ]
[ RUN      ] test_call_mediaenc (rx main)
[       OK ]
[ RUN      ] test_call_medianat (rx main)
[       OK ]
[ RUN      ] test_call_multiple (rx main)
[       OK ]
[ RUN      ] test_call_progress (rx main)
[       OK ]
[ RUN      ] test_call_reject (rx main)
[       OK ]
[ RUN      ] test_call_rtcp (rx main)
[       OK ]
[ RUN      ] test_call_rtp_timeout (rx main)
[       OK ]
[ RUN      ] test_call_tcp (rx main)
[       OK ]
[ RUN      ] test_call_deny_udp (rx main)
[       OK ]
[ RUN      ] test_call_transfer (rx main)
[       OK ]
[ RUN      ] test_call_transfer_fail (rx main)
[       OK ]
[ RUN      ] test_call_attended_transfer (rx main)
[       OK ]
[ RUN      ] test_call_video (rx main)
[       OK ]
[ RUN      ] test_call_change_videodir (rx main)
[       OK ]
[ RUN      ] test_call_webrtc (rx main)
[       OK ]
[ RUN      ] test_call_bundle (rx main)
srtp: failed to decrypt RTCP packet with 16 bytes (Bad message [74])
srtp: failed to decrypt RTCP packet with 16 bytes (Bad message [74])
srtp: failed to decrypt RTP packet with 34 bytes (Unknown error -39 [-39])
[       OK ]
[ RUN      ] test_call_ipv6ll (rx main)
[       OK ]
[ RUN      ] test_call_100rel_audio (rx main)
[       OK ]
[ RUN      ] test_call_100rel_video (rx main)
[       OK ]
[ RUN      ] test_call_hold_resume (rx main)
[       OK ]
[ RUN      ] test_call_srtp_tx_rekey (rx main)
srtp: failed to decrypt RTCP packet with 30 bytes (Unknown error -39 [-39])
[       OK ]
[ RUN      ] test_call_sni (rx main)
ua: tls_alloc() failed: Invalid argument [22]
ua: init failed (Invalid argument [22])
TEST_ERR: /builddir/build/BUILD/baresip-3.14.0-build/baresip-3.14.0/test/call.c:3288: (Invalid argument [22])
Cancel Rules:
Agents:
  --- Agent a ---
    close_scode: 0
    failed: no
    n_incoming: 0
    n_progress: 0
    n_established: 0
    n_closed: 0
    n_transfer_fail: 0
    n_dtmf_recv: 0
    n_transfer: 0
    n_mediaenc: 0
    n_rtpestab: 0
    n_rtcp: 0
    n_audio_estab: 0
    n_video_estab: 0
    n_offer_cnt: 0
    n_answer_cnt: 0
    n_hold_cnt: 0
    n_resume_cnt: 0
    n_auframe: 0
    n_audebug: 0
    n_vidframe: 0
  --- Agent b ---
    close_scode: 0
    failed: no
    n_incoming: 0
    n_progress: 0
    n_established: 0
    n_closed: 0
    n_transfer_fail: 0
    n_dtmf_recv: 0
    n_transfer: 0
    n_mediaenc: 0
    n_rtpestab: 0
    n_rtcp: 0
    n_audio_estab: 0
    n_video_estab: 0
    n_offer_cnt: 0
    n_answer_cnt: 0
    n_hold_cnt: 0
    n_resume_cnt: 0
    n_auframe: 0
    n_audebug: 0
    n_vidframe: 0
test_call_sni (rx main): test failed (Invalid argument [22])
test failed (Invalid argument [22])
re main loop:
  maxfds:       1024
  nfds:         3
  method:       epoll
  polling:      0
  sig:          0
  timers:       1
  mutex:        0x55730e4b4550
  tid:          0x7f9036acfb80
  thread_enter: 0
  async:        0x55730e4b4810

Note that cmake builds happen out-of-tree at Fedora.

sreimers commented 2 months ago
  • cd redhat-linux-build
  • ./test/selftest

Can you try:

redhat-linux-build/test/selftest

the default data path is relative ./test/data or you can provide a path with selftest -d ../path/to/test/data

robert-scheck commented 2 months ago

the default data path is relative ./test/data or you can provide a path with selftest -d ../path/to/test/data

Yes…thank you, missed -d.

By the way, redhat-linux-build/test/selftest does not work:

+ cd baresip-3.14.0
+ redhat-linux-build/test/selftest -d test/data/ -v
dl: mod: ./g711.so (./g711.so: cannot open shared object file: No such file or directory)

running baresip selftest version 3.14.0 with 54 tests
Local network addresses:
  None available for net_interface: -
[ RUN      ] test_account (rx main)
using stunserver: 'stun:stunserver.org'
[       OK ]
[ RUN      ] test_account_uri_complete (rx main)
[       OK ]
[ RUN      ] test_call_answer (rx main)
module g711.so: No such file or directory [2]
TEST_ERR: /builddir/build/BUILD/baresip-3.14.0-build/baresip-3.14.0/test/call.c:888: (No such file or directory [2])
ERROR: Module g711 is not currently loaded
ua: stop all (forced=1)
test_call_answer (rx main): test failed (No such file or directory [2])
test failed (No such file or directory [2])
re main loop:
  maxfds:       1024
  nfds:         3
  method:       epoll
  polling:      0
  sig:          0
  timers:       1
  mutex:        0x55b179122550
  tid:          0x7f5302975b80
  thread_enter: 0
  async:        0x55b179122810
ua: stop all (forced=1)