Skip to content

Commit

Permalink
quic: clean up test code
Browse files Browse the repository at this point in the history
- Remove test_quic_txn.c which is replaced by 'fddev txn'
- Remove stray includes in test_quic_server.c
- Lower defaults in fd_quic_limits_from_env
- Fix default gig page cnt in test_quic_server.c
  • Loading branch information
riptl authored and ripatel-fd committed May 15, 2024
1 parent b8aaf7c commit 974a02b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 265 deletions.
3 changes: 0 additions & 3 deletions src/app/fddev/txn.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ txn_cmd_fn( args_t * args,
fd_quic_t * quic = fd_quic_join( fd_quic_new( mem, &quic_limits ) );
FD_TEST( quic );

if( FD_UNLIKELY( 32UL!=getrandom( quic->config.identity_public_key, 32UL, 0 ) ) )
FD_LOG_ERR(( "failed to generate identity key: getrandom(32,0) failed" ));

/* Signer */
fd_rng_t _rng[1]; fd_rng_t * rng = fd_rng_join( fd_rng_new( _rng, 0U, 0UL ) );
fd_tls_test_sign_ctx_t * sign_ctx = fd_wksp_alloc_laddr( wksp, alignof(fd_tls_test_sign_ctx_t), sizeof(fd_tls_test_sign_ctx_t), 1UL );
Expand Down
14 changes: 7 additions & 7 deletions src/waltz/quic/fd_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,12 @@ fd_quic_limits_from_env( int * pargc,

if( FD_UNLIKELY( !limits ) ) return NULL;

limits->conn_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-conns", "QUIC_CONN_CNT", 1024UL );
limits->conn_id_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-conn-ids", "QUIC_CONN_ID_CNT", 16UL );
ulong stream_cnt = fd_env_strip_cmdline_uint ( pargc, pargv, "--quic-streams", "QUIC_STREAM_CNT", 2048UL );
limits->handshake_cnt = fd_env_strip_cmdline_uint ( pargc, pargv, "--quic-handshakes", "QUIC_HANDSHAKE_CNT", 1024UL );
limits->inflight_pkt_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-inflight-pkts", "QUIC_MAX_INFLIGHT_PKTS", 512UL );
limits->tx_buf_sz = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-tx-buf-sz", "QUIC_TX_BUF_SZ", 1UL<<12UL );
limits->conn_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-conns", "QUIC_CONN_CNT", 512UL );
limits->conn_id_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-conn-ids", "QUIC_CONN_ID_CNT", 16UL );
ulong stream_cnt = fd_env_strip_cmdline_uint ( pargc, pargv, "--quic-streams", "QUIC_STREAM_CNT", 16384UL );
limits->handshake_cnt = fd_env_strip_cmdline_uint ( pargc, pargv, "--quic-handshakes", "QUIC_HANDSHAKE_CNT", 512UL );
limits->inflight_pkt_cnt = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-inflight-pkts", "QUIC_MAX_INFLIGHT_PKTS", 2500UL );
limits->tx_buf_sz = fd_env_strip_cmdline_ulong( pargc, pargv, "--quic-tx-buf-sz", "QUIC_TX_BUF_SZ", 4096UL );

limits->stream_cnt[ FD_QUIC_STREAM_TYPE_BIDI_CLIENT ] = 0UL;
limits->stream_cnt[ FD_QUIC_STREAM_TYPE_BIDI_SERVER ] = 0UL;
Expand All @@ -243,7 +243,7 @@ fd_quic_limits_from_env( int * pargc,
limits->initial_stream_cnt[ FD_QUIC_STREAM_TYPE_UNI_CLIENT ] = stream_cnt;
limits->initial_stream_cnt[ FD_QUIC_STREAM_TYPE_UNI_SERVER ] = 0UL;

limits->stream_pool_cnt = limits->conn_cnt * stream_cnt;
limits->stream_pool_cnt = stream_cnt;

return limits;
}
Expand Down
3 changes: 1 addition & 2 deletions src/waltz/quic/fd_quic.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ struct __attribute__((aligned(16UL))) fd_quic_config {

/* TLS config ********************************************/

/* identity_key: Ed25519 public key of node identity
(Can be random bytes) */
/* identity_key: Ed25519 public key of node identity */
uchar identity_public_key[ 32 ];

/* Callback for signing TLS 1.3 certificate verify payload */
Expand Down
1 change: 0 additions & 1 deletion src/waltz/quic/tests/Local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ $(call run-unit-test,test_quic_crypto)
# Manual test programs
$(call make-unit-test,test_quic_client_flood,test_quic_client_flood,fd_quic fd_tls fd_aio fd_ballet fd_waltz fd_util)
$(call make-unit-test,test_quic_server,test_quic_server, fd_quic fd_tls fd_aio fd_ballet fd_waltz fd_util)
$(call make-unit-test,test_quic_txn, test_quic_txn, fd_quic fd_tls fd_aio fd_ballet fd_waltz fd_util)
$(call make-unit-test,test_quic_txns, test_quic_txns, fd_quic fd_tls fd_aio fd_ballet fd_waltz fd_util)

$(call make-unit-test,test_quic_frames,test_frames,fd_quic fd_util)
Expand Down
10 changes: 1 addition & 9 deletions src/waltz/quic/tests/test_quic_server.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
#include <math.h>

#include <linux/if_xdp.h>

#include "../../../util/fd_util_base.h"
#include "../../../util/net/fd_eth.h"
#include "../../../util/net/fd_ip4.h"

#include "../fd_quic.h"
#include "fd_quic_test_helpers.h"
#include "../../tls/test_tls_helper.h"
Expand All @@ -32,7 +24,7 @@ main( int argc, char ** argv ) {
if( cpu_idx>=fd_shmem_cpu_cnt() ) cpu_idx = 0UL;

char const * _page_sz = fd_env_strip_cmdline_cstr ( &argc, &argv, "--page-sz", NULL, "gigantic" );
ulong page_cnt = fd_env_strip_cmdline_ulong ( &argc, &argv, "--page-cnt", NULL, 1UL );
ulong page_cnt = fd_env_strip_cmdline_ulong ( &argc, &argv, "--page-cnt", NULL, 2UL );
ulong numa_idx = fd_env_strip_cmdline_ulong ( &argc, &argv, "--numa-idx", NULL, fd_shmem_numa_idx(cpu_idx) );

ulong page_sz = fd_cstr_to_shmem_page_sz( _page_sz );
Expand Down
243 changes: 0 additions & 243 deletions src/waltz/quic/tests/test_quic_txn.c

This file was deleted.

0 comments on commit 974a02b

Please sign in to comment.