Skip to content

Run Tests

Current page is for testing XQUIC using test_client and test_server. If the relevant environment has not been set, please refer to the Getting started document.

Before running

Before running test_server, it's needed to generate certification file first:

bash
cd build
keyfile=server.key
certfile=server.crt
openssl req -newkey rsa:2048 -x509 -nodes -keyout "$keyfile" -new -out "$certfile" -subj /CN=test.xquic.com

Running tests

After that, it's capable to run test_client and test_server, let's take the following command as an example:

bash
./test_server -l d > /dev/null &
./test_client -a 127.0.0.1 -p 8443 -s 1024000 -E

As for test_client, session tickets, transport parameters, and tokens may be incompatible between different servers.

Additionally, using test_client with different domains to connect to the same server may also failed, because different domains may be configured with different certificates.

Therefore, remenber to delete test_session, tp_localhost, and xqc_token files in build file if domains are changed.

Parameters

All the following parameters are described in function usage() in tests/test_client.c and tests/test_server.c, and please note that if there is differences in the parameters, please refer to the latest code.

You are likely to find the following parameters used in ./script/case_test.sh, which serves as a example of testing different features with these parameters.

test_client

OptionUsage
-1Force 1RTT.
-6IPv6
-AMultipath request accelerate on. default is 0(off).
-aServer addr.
-bbatch
-BMax connection num. default is 1000.
-cCongestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+ P:copa
-CPacing on.
-DProcess num. default is 2.
-dDrop rate ‰
-Eload balance id encryption on
-eEcho. Send received body.
-fDebug endless loop.
-FAbs_timeout to close conn. >=0
-gEnable FEC on.
-GGET on. Default is POST
-hHost & sni. eg. test.xquic.com
-HHeader. eg. key:value
-imulti-path interface option.
-JRandom CID. default is 0.
-Kload balance id encryption key
-LEndless_sending on. default is off.
-MEnable multi-path on.
-NNo encryption.
-oOutput log file path, default ./slog
-PNumber of Parallel requests per single connection. Default 1.
-QMultipath backup path standby, set backup_mode on(1). default backup_mode is 0(off).
-REnable reinjection. Default is 0, no reinjection.
-Sserver sid.
-tConnection timeout. Default 3 seconds.
-TTransport layer. No HTTP3.
-uUrl. default https://test.xquic.com/path/resource
-VForce cert verification. 0: don't allow self-signed cert. 1: allow self-signed cert.
-vNegotiate multipath version. 4: Multipath-04. 5: Multipath-05.
-wWrite received body to file.
-xTest case ID.
-ymultipath backup path standby option.
-zperiodically send request option.

test_server

OptionUsage
-aServer addr.
-bbatch
-cCongestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+ P:copa
-CPacing on.
-Eload balance id encryption on
-fEnable FEC on.
-Kload balance id encryption key
-LEndless_sending on. default is off.
-MEnable multi-path on.
-oOutput log file path, default ./slog
-QMultipath backup path standby, set backup_mode on(1). default backup_mode is 0(off).
-REnable reinjection. Default is 0, no reinjection
-Sserver sid
-Uoption send_datagram: 0 (off), 1 (on), 2(on + batch).
-ymultipath backup path standby option.
-Hdisable h3_ext option.
-mSet mpshell on
-sBody size to send.
-wWrite received body to file.
-rRead sending body from file. priority e > s > r
-lLog level. e:error d:debug.
-uUrl. default https://test.xquic.com/path/resource
-xTest case ID.
-6IPv6.
-eEcho. Send received body.