mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-05-14 14:02:45 +00:00
Add Dockerfile and test script for tests
This commit is contained in:
parent
072701c379
commit
ac60f39a88
2 changed files with 21 additions and 0 deletions
9
tests/Dockerfile
Normal file
9
tests/Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM alpine:edge
|
||||
RUN apk add --no-cache cargo rust pkgconfig openssl-dev
|
||||
RUN mkdir /tun2proxy
|
||||
ADD src /tun2proxy/src
|
||||
ADD Cargo.toml /tun2proxy/Cargo.toml
|
||||
ADD tests /tun2proxy/tests
|
||||
WORKDIR /tun2proxy
|
||||
RUN cargo build --tests
|
||||
ENTRYPOINT ["cargo", "test"]
|
12
tests/run-tests.sh
Executable file
12
tests/run-tests.sh
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Run as follows:
|
||||
# sudo SOCKS5_SERVER=<ip>:<port> HTTP_SERVER=<ip>:<port> ./run-tests.sh
|
||||
#
|
||||
# Alternatively, `cargo test` can be used instead of `./run-tests.sh`.
|
||||
# Note that the tests require root privileges and will change
|
||||
# the system's default routes.
|
||||
|
||||
SCRIPT_DIR="$(dirname "$0")"
|
||||
cd "$SCRIPT_DIR/.."
|
||||
docker build -t tun2proxy-tests -f tests/Dockerfile . && docker run -e SOCKS5_SERVER -e HTTP_SERVER --rm -it tun2proxy-tests
|
Loading…
Add table
Add a link
Reference in a new issue