Verify WireGuard IP address is different in CI
This commit is contained in:
parent
8cd200bedc
commit
fe96abc12f
1 changed files with 5 additions and 3 deletions
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
|
@ -10,7 +10,7 @@ on:
|
|||
concurrency: ${{ github.workflow }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
|
@ -46,10 +46,12 @@ jobs:
|
|||
load: true
|
||||
tags: wireguard
|
||||
|
||||
- name: Test curl
|
||||
- name: Test tunnel
|
||||
run: |
|
||||
docker run --rm -d --name wireguard --cap-add NET_ADMIN --cap-add SYS_MODULE --sysctl net.ipv4.conf.all.src_valid_mark=1 -v ${{ github.workspace }}/wireguard.conf:/etc/wireguard/wg0.conf wireguard
|
||||
docker run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io
|
||||
normal_ip=$(docker run --rm curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
|
||||
wireguard_ip=$(docker run --rm --net=container:wireguard curlimages/curl --retry 3 --retry-delay 5 ifconfig.io)
|
||||
if [ "$normal_ip" = "$wireguard_ip" ]; then echo "normal ip and wireguard ip are the same" && exit 1; fi
|
||||
docker stop wireguard
|
||||
|
||||
- name: Test kill switch
|
||||
|
|
Loading…
Reference in a new issue