g3/scripts/coverage/g3proxy
2025-07-09 18:55:04 +08:00
..
0000_all_resolver g3proxy: add ci for failover resolver 2025-05-10 21:51:55 +08:00
0001_base_http_proxy add testcase for masque/http and HTTP proxytunnel 2025-07-09 18:55:04 +08:00
0002_base_socks_proxy g3proxy: enable curl chunked request in CI 2025-06-25 13:41:01 +08:00
0003_base_tcp_stream coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0003_chain_tcp_stream g3proxy: add proxy_protocol support in direct_fixed escaper 2025-02-28 12:09:57 +08:00
0004_base_http_gateway coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0005_transparent_proxy coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0006_chain_http_proxy add testcase for masque/http and HTTP proxytunnel 2025-07-09 18:55:04 +08:00
0007_chain_socks_proxy g3proxy: enable metrics in CI test 2024-11-21 17:32:10 +08:00
0008_base_user_auth coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0009_anonymous_user coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0010_escaper_direct_float g3proxy: add h2 testcase 2024-11-22 18:35:56 +08:00
0011_escaper_proxy_float g3proxy: enable metrics in CI test 2024-11-21 17:32:10 +08:00
0012_intelli_proxy coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0013_dynamic_user g3proxy: enable metrics in CI test 2024-11-21 17:32:10 +08:00
0014_escaper_failover coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0015_escaper_geoip coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0016_resolve_failover g3proxy: add ci for failover resolver 2025-05-10 21:51:55 +08:00
0020_audit_base coverage: update SSL CA cert file env var name 2025-02-22 19:22:25 +08:00
0021_audit_icap_preview add testcase for masque/http and HTTP proxytunnel 2025-07-09 18:55:04 +08:00
0022_audit_icap_no_preview add testcase for masque/http and HTTP proxytunnel 2025-07-09 18:55:04 +08:00
0023_audit_user g3-icap-client: allow to disable preview 2025-05-21 15:03:29 +08:00
1000_worker_base support multi-threaded runtime in worker 2025-02-10 18:10:08 +08:00
1001_worker_sched support multi-threaded runtime in worker 2025-02-10 18:10:08 +08:00
1002_worker_listen support multi-threaded runtime in worker 2025-02-10 18:10:08 +08:00
1003_worker_multi_rt support multi-threaded runtime in worker 2025-02-10 18:10:08 +08:00
.gitignore initial commit 2023-03-09 17:55:45 +08:00
dnsmasq.conf add g3proxy coverage test CI (#362) 2024-11-13 12:39:44 +08:00
docker_run.sh initial commit 2023-03-09 17:55:45 +08:00
fluent-bit.conf g3proxy: install fluent-bit in CI 2024-11-21 17:32:10 +08:00
g3fcgen.yaml enable metrics for g3fcgen and g3iploc in coverage CI 2024-12-17 10:28:16 +08:00
g3iploc.yaml enable metrics for g3fcgen and g3iploc in coverage CI 2024-12-17 10:28:16 +08:00
g3proxy.yaml g3proxy: delete outdated CI testcase 2024-11-25 06:52:07 +08:00
g3statsd.yaml g3statsd: allow to listen to unix statsd socket 2025-06-02 15:43:55 +08:00
ip_location.csv g3proxy: add coverage CI for route_geoip escaper 2024-12-17 10:28:16 +08:00
mkcert.sh drop use of mkcert 2023-06-12 12:01:42 +08:00
nginx.conf g3proxy: enable curl chunked request in CI 2025-06-25 13:41:01 +08:00
README.md update coverage README 2025-05-09 10:17:05 +08:00
run.sh g3proxy: enable curl chunked request in CI 2025-06-25 13:41:01 +08:00
testcases.sh g3proxy: add h2 testcase 2024-11-22 18:35:56 +08:00

Setup for g3proxy coverage tests

Install Required Tools

We use the following tools in the coverage scripts:

docker

We use docker containers to run various target services, i.e. httpbin.

Install on Debian:

apt install docker.io

dnsmasq

We use dnsmasq to add local dns records, and also use it as the target dns server.

You have 2 choices to run dnsmasq:

  • NetworkManager Plugin

    If you have enabled dnsmasq plugin in NetworkManager, then there is nothing to do. The conf directory will be /etc/NetworkManager/dnsmasq.d/.

  • Standalone dnsmasq Service

    If not, you have to install dnsmasq as a standalone service. The conf directory will be /etc/dnsmasq.d/.

    Install on Debian:

    apt install dnsmasq
    

Setup local DNS

Save the following conf file to dnsmasq.d/g3proxy-ci.conf:

address=/httpbin.local/127.0.0.1
address=/g3proxy.local/127.0.0.1

Then restart NetworkManager or dnsmasq which should respawn the real dnsmasq process.

Run the Docker Containers

httpbin

docker run -p 127.0.0.1:80:80 -d --name httpbin kennethreitz/httpbin

vsftpd

mkdir /tmp/vsftpd
docker run -d -v /tmp/vsftpd:/home/vsftpd \
                -p 127.0.0.1:20:20 \
                -p 127.0.0.1:21:21 \
                -p 127.0.0.1:47400-47470:47400-47470 \
                -e FTP_USER=ftpuser \
                -e FTP_PASS=ftppass \
                -e PASV_ADDRESS=127.0.0.1 \
                --name ftp \
                -d bogem/ftp

influxdb

  1. Run the container

    docker pull influxdb:3-core
    docker run -p 127.0.0.1:8181:8181 --rm influxdb:3-core --node-id local --object-store=memory
    
  2. Create the auth token

    curl -X POST http://127.0.0.1:8181/api/v3/configure/token/admin | jq ".token" -r
    
  3. Export the auth token as variable INFLUXDB3_AUTH_TOKEN.

graphite

docker pull graphiteapp/graphite-statsd:latest
docker run -p 127.0.0.1:2003:2003 --rm graphiteapp/graphite-statsd