litespeed-quic/test/unittests/CMakeLists.txt

240 lines
9.9 KiB
CMake
Raw Normal View History

2017-09-22 21:00:03 +00:00
# Copyright (c) 2017 LiteSpeed Technologies Inc. See LICENSE.
include_directories( BEFORE ../../ssl/include )
include_directories( ../../include )
include_directories( ../../src/liblsquic )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-value")
enable_testing()
add_executable(test_rechist test_rechist.c)
target_link_libraries(test_rechist lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(rechist test_rechist)
add_executable(test_senhist test_senhist.c)
target_link_libraries(test_senhist lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(senhist test_senhist)
add_executable(test_rtt test_rtt.c)
target_link_libraries(test_rtt lsquic m ${FIULIB})
add_test(rtt test_rtt)
add_executable(test_set test_set.c)
target_link_libraries(test_set lsquic m ${FIULIB})
add_test(set test_set)
add_executable(test_engine_ctor test_engine_ctor.c)
target_link_libraries(test_engine_ctor lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(engine_ctor test_engine_ctor)
add_executable(test_stream test_stream.c)
target_link_libraries(test_stream lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(stream test_stream)
add_test(stream_hash test_stream -h)
add_test(stream_A test_stream -A)
add_test(stream_hash_A test_stream -A -h)
add_executable(test_spi test_spi.c)
target_link_libraries(test_spi lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(spi test_spi)
add_executable(test_malo test_malo.c)
target_link_libraries(test_malo lsquic m ${FIULIB})
add_test(malo test_malo)
add_executable(test_conn_hash test_conn_hash.c)
target_link_libraries(test_conn_hash lsquic m ${FIULIB})
add_test(conn_hash test_conn_hash)
add_executable(test_lsquic_hash test_lsquic_hash.c)
target_link_libraries(test_lsquic_hash lsquic m ${FIULIB})
add_test(lsquic_hash test_lsquic_hash)
add_executable(test_blocked_gquic_le test_blocked_gquic_le.c)
target_link_libraries(test_blocked_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(blocked_gquic_le test_blocked_gquic_le)
add_executable(test_blocked_gquic_be test_blocked_gquic_be.c)
target_link_libraries(test_blocked_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(blocked_gquic_be test_blocked_gquic_be)
add_executable(test_rst_stream_gquic_le test_rst_stream_gquic_le.c)
target_link_libraries(test_rst_stream_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(rst_stream_gquic_le test_rst_stream_gquic_le)
add_executable(test_rst_stream_gquic_be test_rst_stream_gquic_be.c)
target_link_libraries(test_rst_stream_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(rst_stream_gquic_be test_rst_stream_gquic_be)
add_executable(test_rst_stream_ietf test_rst_stream_ietf.c)
target_link_libraries(test_rst_stream_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(rst_stream_ietf test_rst_stream_ietf)
add_executable(test_conn_close_gquic_le test_conn_close_gquic_le.c)
target_link_libraries(test_conn_close_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(conn_close_gquic_le test_conn_close_gquic_le)
add_executable(test_conn_close_gquic_be test_conn_close_gquic_be.c)
target_link_libraries(test_conn_close_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(conn_close_gquic_be test_conn_close_gquic_be)
add_executable(test_goaway_gquic_le test_goaway_gquic_le.c)
target_link_libraries(test_goaway_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(goaway_gquic_le test_goaway_gquic_le)
add_executable(test_goaway_gquic_be test_goaway_gquic_be.c)
target_link_libraries(test_goaway_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(goaway_gquic_be test_goaway_gquic_be)
add_executable(test_wuf_gquic_le test_wuf_gquic_le.c)
target_link_libraries(test_wuf_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(wuf_gquic_le test_wuf_gquic_le)
add_executable(test_wuf_gquic_be test_wuf_gquic_be.c)
target_link_libraries(test_wuf_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(wuf_gquic_be test_wuf_gquic_be)
add_executable(test_ackparse_gquic_le test_ackparse_gquic_le.c)
target_link_libraries(test_ackparse_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackparse_gquic_le test_ackparse_gquic_le)
add_executable(test_ackparse_gquic_be test_ackparse_gquic_be.c)
target_link_libraries(test_ackparse_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackparse_gquic_be test_ackparse_gquic_be)
add_executable(test_ackparse_gquic_ietf test_ackparse_gquic_ietf.c)
target_link_libraries(test_ackparse_gquic_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackparse_gquic_ietf test_ackparse_gquic_ietf)
add_executable(test_ackgen_gquic_le test_ackgen_gquic_le.c)
target_link_libraries(test_ackgen_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackgen_gquic_le test_ackgen_gquic_le)
add_executable(test_ackgen_gquic_be test_ackgen_gquic_be.c)
target_link_libraries(test_ackgen_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackgen_gquic_be test_ackgen_gquic_be)
add_executable(test_ackgen_gquic_ietf test_ackgen_gquic_ietf.c)
target_link_libraries(test_ackgen_gquic_ietf lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ackgen_gquic_ietf test_ackgen_gquic_ietf)
add_executable(test_sfcw test_sfcw.c)
Latest changes - [API Change] Sendfile-like functionality is gone. The stream no longer opens files and deals with file descriptors. (Among other things, this makes the code more portable.) Three writing functions are provided: lsquic_stream_write lsquic_stream_writev lsquic_stream_writef (NEW) lsquic_stream_writef() is given an abstract reader that has function pointers for size() and read() functions which the user can implement. This is the most flexible way. lsquic_stream_write() and lsquic_stream_writev() are now both implemented as wrappers around lsquic_stream_writef(). - [OPTIMIZATION] When writing to stream, be it within or without the on_write() callback, place data directly into packet buffer, bypassing auxiliary data structures. This reduces amount of memory required, for the amount of data that can be written is limited by the congestion window. To support writes outside the on_write() callback, we keep N outgoing packet buffers per connection which can be written to by any stream. One half of these are reserved for the highest priority stream(s), the other half for all other streams. This way, low-priority streams cannot write instead of high-priority streams and, on the other hand, low-priority streams get a chance to send their packets out. The algorithm is as follows: - When user writes to stream outside of the callback: - If this is the highest priority stream, place it onto the reserved N/2 queue or fail. (The actual size of this queue is dynamic -- MAX(N/2, CWND) -- rather than N/2, allowing high-priority streams to write as much as can be sent.) - If the stream is not the highest priority, try to place the data onto the reserved N/2 queue or fail. - When tick occurs *and* more packets can be scheduled: - Transfer packets from the high N/2 queue to the scheduled queue. - If more scheduling is allowed: - Call on_write callbacks for highest-priority streams, placing resulting packets directly onto the scheduled queue. - If more scheduling is allowed: - Transfer packets from the low N/2 queue to the scheduled queue. - If more scheduling is allowed: - Call on_write callbacks for non-highest-priority streams, placing resulting packets directly onto the scheduled queue The number N is currently 20, but it could be varied based on resource usage. - If stream is created due to incoming headers, make headers readable from on_new. - Outgoing packets are no longer marked non-writeable to prevent placing more than one STREAM frame from the same stream into a single packet. This property is maintained via code flow and an explicit check. Packets for stream data are allocated using a special function. - STREAM frame elision is cheaper, as we only perform it if a reset stream has outgoing packets referencing it. - lsquic_packet_out_t is smaller, as stream_rec elements are now inside a union.
2017-10-31 13:35:58 +00:00
target_link_libraries(test_sfcw lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(sfcw test_sfcw)
add_executable(test_alarmset test_alarmset.c)
target_link_libraries(test_alarmset lsquic m ${FIULIB})
add_test(alarmset test_alarmset)
add_executable(graph_cubic graph_cubic.c)
target_link_libraries(graph_cubic lsquic m ${FIULIB})
add_executable(test_streamparse test_streamparse.c)
target_link_libraries(test_streamparse lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(streamparse test_streamparse)
add_executable(test_packet_out test_packet_out.c)
target_link_libraries(test_packet_out lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(packet_out test_packet_out)
add_executable(test_reg_pkt_headergen test_reg_pkt_headergen.c)
target_link_libraries(test_reg_pkt_headergen lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(reg_pkt_headergen test_reg_pkt_headergen)
add_executable(test_ver_nego test_ver_nego.c)
target_link_libraries(test_ver_nego lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(ver_nego test_ver_nego)
add_executable(test_packno_len test_packno_len.c)
target_link_libraries(test_packno_len lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(packno_len test_packno_len)
add_executable(test_streamgen test_streamgen.c)
target_link_libraries(test_streamgen lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(streamgen test_streamgen)
add_executable(test_some_packets test_some_packets.c)
target_link_libraries(test_some_packets lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(some_packets test_some_packets)
add_executable(test_elision test_elision.c)
target_link_libraries(test_elision lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(elision test_elision)
add_executable(test_stop_waiting_gquic_le test_stop_waiting_gquic_le.c)
target_link_libraries(test_stop_waiting_gquic_le lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(stop_waiting_gquic_le test_stop_waiting_gquic_le)
add_executable(test_stop_waiting_gquic_be test_stop_waiting_gquic_be.c)
target_link_libraries(test_stop_waiting_gquic_be lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(stop_waiting_gquic_be test_stop_waiting_gquic_be)
add_executable(test_parse_packet_in test_parse_packet_in.c)
target_link_libraries(test_parse_packet_in lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(parse_packet_in test_parse_packet_in)
add_executable(test_quic_le_floats test_quic_le_floats.c)
target_link_libraries(test_quic_le_floats lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(quic_le_floats test_quic_le_floats)
add_executable(test_quic_be_floats test_quic_be_floats.c)
target_link_libraries(test_quic_be_floats lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(quic_be_floats test_quic_be_floats)
add_executable(test_export_key test_export_key.c)
target_link_libraries(test_export_key lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(export_key test_export_key)
add_executable(test_frame_reader test_frame_reader.c)
target_link_libraries(test_frame_reader lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(frame_reader test_frame_reader)
add_executable(test_frame_writer test_frame_writer.c)
target_link_libraries(test_frame_writer lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(frame_writer test_frame_writer)
add_executable(test_frame_chop test_frame_chop.c)
target_link_libraries(test_frame_chop lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(frame_chop test_frame_chop)
IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_executable(test_frame_rw test_frame_rw.c)
target_link_libraries(test_frame_rw lsquic pthread libssl.a libcrypto.a z m ${FIULIB})
add_test(frame_rw test_frame_rw)
ENDIF()
2017-09-22 21:00:03 +00:00
add_executable(test_hpack test_hpack.c)
target_link_libraries(test_hpack lsquic m ${FIULIB})
add_test(hpack test_hpack)
add_executable(test_hkdf test_hkdf.c)
target_link_libraries(test_hkdf lsquic pthread libssl.a libcrypto.a m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(hkdf test_hkdf)
add_executable(test_attq test_attq.c)
target_link_libraries(test_attq lsquic pthread libssl.a libcrypto.a m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(attq test_attq)
add_executable(test_arr test_arr.c)
target_link_libraries(test_arr lsquic pthread libssl.a libcrypto.a m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(arr test_arr)
add_executable(test_buf test_buf.c)
target_link_libraries(test_buf lsquic pthread libssl.a libcrypto.a m ${FIULIB})
2017-09-22 21:00:03 +00:00
add_test(buf test_buf)
Latest changes - [API Change] lsquic_engine_connect() returns pointer to the connection object. - [API Change] Add lsquic_conn_get_engine() to get engine object from connection object. - [API Change] Add lsquic_conn_status() to query connection status. - [API Change] Add add lsquic_conn_set_ctx(). - [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345 - [OPTIMIZATION] Process handshake STREAM frames as soon as packet arrives. - [OPTIMIZATION] Do not compile expensive send controller sanity check by default. - [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header. - [OPTIMIZATION] Only make squeeze function call if necessary. - [OPTIMIZATION] Speed up Q039 ACK frame parsing. - [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes. - [OPTIMIZATION] Keep track of scheduled bytes instead of calculating. - [OPTIMIZATION] Prefetch next unacked packet when processing ACK. - [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are. ordered. - [OPTIMIZATION] Reduce function pointer use for STREAM frame generation - Fix: reset incoming streams that arrive after we send GOAWAY. - Fix: delay client on_new_conn() call until connection is fully set up. - Fixes to buffered packets logic: splitting, STREAM frame elision. - Fix: do not dispatch on_write callback if no packets are available. - Fix WINDOW_UPDATE send and resend logic. - Fix STREAM frame extension code. - Fix: Drop unflushed data when stream is reset. - Switch to tracking CWND using bytes rather than packets. - Fix TCP friendly adjustment in cubic. - Fix: do not generate invalid STOP_WAITING frames during high packet loss. - Pacer fixes.
2018-02-26 21:01:16 +00:00
add_executable(test_cubic test_cubic.c)
target_link_libraries(test_cubic lsquic pthread libssl.a libcrypto.a m ${FIULIB})
add_test(cubic test_cubic)
2017-09-22 21:00:03 +00:00
add_executable(test_dec test_dec.c)
target_link_libraries(test_dec libssl.a libcrypto.a z m pthread ${FIULIB})