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:
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:
./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
Option | Usage |
---|---|
-1 | Force 1RTT. |
-6 | IPv6 |
-A | Multipath request accelerate on. default is 0(off). |
-a | Server addr. |
-b | batch |
-B | Max connection num. default is 1000. |
-c | Congestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+ P:copa |
-C | Pacing on. |
-D | Process num. default is 2. |
-d | Drop rate ‰ |
-E | load balance id encryption on |
-e | Echo. Send received body. |
-f | Debug endless loop. |
-F | Abs_timeout to close conn. >=0 |
-g | Enable FEC on. |
-G | GET on. Default is POST |
-h | Host & sni. eg. test.xquic.com |
-H | Header. eg. key:value |
-i | multi-path interface option. |
-J | Random CID. default is 0. |
-K | load balance id encryption key |
-L | Endless_sending on. default is off. |
-M | Enable multi-path on. |
-N | No encryption. |
-o | Output log file path, default ./slog |
-P | Number of Parallel requests per single connection. Default 1. |
-Q | Multipath backup path standby, set backup_mode on(1). default backup_mode is 0(off). |
-R | Enable reinjection. Default is 0, no reinjection. |
-S | server sid. |
-t | Connection timeout. Default 3 seconds. |
-T | Transport layer. No HTTP3. |
-u | Url. default https://test.xquic.com/path/resource |
-V | Force cert verification. 0: don't allow self-signed cert. 1: allow self-signed cert. |
-v | Negotiate multipath version. 4: Multipath-04. 5: Multipath-05. |
-w | Write received body to file. |
-x | Test case ID. |
-y | multipath backup path standby option. |
-z | periodically send request option. |
test_server
Option | Usage |
---|---|
-a | Server addr. |
-b | batch |
-c | Congestion Control Algorithm. r:reno b:bbr c:cubic B:bbr2 bbr+ bbr2+ P:copa |
-C | Pacing on. |
-E | load balance id encryption on |
-f | Enable FEC on. |
-K | load balance id encryption key |
-L | Endless_sending on. default is off. |
-M | Enable multi-path on. |
-o | Output log file path, default ./slog |
-Q | Multipath backup path standby, set backup_mode on(1). default backup_mode is 0(off). |
-R | Enable reinjection. Default is 0, no reinjection |
-S | server sid |
-U | option send_datagram: 0 (off), 1 (on), 2(on + batch). |
-y | multipath backup path standby option. |
-H | disable h3_ext option. |
-m | Set mpshell on |
-s | Body size to send. |
-w | Write received body to file. |
-r | Read sending body from file. priority e > s > r |
-l | Log level. e:error d:debug. |
-u | Url. default https://test.xquic.com/path/resource |
-x | Test case ID. |
-6 | IPv6. |
-e | Echo. Send received body. |