g3/scripts/coverage/g3proxy
2024-11-19 17:28:07 +08:00
..
0000_all_resolver g3proxy: add fluentd log in coverage CI (#375) 2024-11-18 22:37:22 +08:00
0001_base_http_proxy g3proxy: delete outdated ci test (#376) 2024-11-19 17:28:07 +08:00
0002_base_socks_proxy g3proxy: add fluentd log in coverage CI (#375) 2024-11-18 22:37:22 +08:00
0003_base_tcp_stream g3proxy: use more log options in CI 2024-11-14 22:22:50 +08:00
0004_base_http_gateway g3proxy: add chained http proxy test CI 2024-11-13 17:53:57 +08:00
0005_transparent_proxy g3proxy: add chained http proxy test CI 2024-11-13 17:53:57 +08:00
0006_chain_http_proxy g3proxy: add ftp over http test script via pycurl 2024-11-19 15:18:21 +08:00
0007_chain_socks_proxy g3proxy: delete outdated ci test (#376) 2024-11-19 17:28:07 +08:00
0008_base_user_auth g3proxy: add ftp over http test script via pycurl 2024-11-19 15:18:21 +08:00
0009_anonymous_user g3proxy: add ftp over http test script via pycurl 2024-11-19 15:18:21 +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
dynamic_users.json initial commit 2023-03-09 17:55:45 +08:00
g3proxy.yaml g3proxy: delete outdated ci test (#376) 2024-11-19 17:28:07 +08:00
mkcert.sh drop use of mkcert 2023-06-12 12:01:42 +08:00
nginx.conf add nginx.conf to run g3proxy CI 2024-09-20 17:24:45 +08:00
README.md update doc 2024-11-13 15:42:54 +08:00
testcases.sh g3proxy: delete outdated ci test (#376) 2024-11-19 17:28:07 +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