Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests with scheduled runs #22

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Wireguard test environment",
"dockerComposeFile": "../docker-compose.test.yml",
"service": "sut",
"shutdownAction": "stopCompose",
"workspaceFolder": "/test-project"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
OCI_BUILDER_BIN ?= docker buildx
OCI_IMAGE_BUILDER ?= docker buildx
COMPOSE_RUNNER ?= docker compose

.PHONY: image
image:
$(OCI_BUILDER_BIN) build . -t ghcr.io/bryopsida/wireguard:local
$(OCI_IMAGE_BUILDER) build . -t ghcr.io/bryopsida/wireguard:local

.PHONY: test
test:
$(COMPOSE_RUNNER) -f docker-compose.test.yml run sut
18 changes: 18 additions & 0 deletions WireGuard Test.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"info": {
"_postman_id": "0df49b10-2cad-4602-9bbc-cb1422a211aa",
"name": "WireGuard Test",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "227389"
},
"item": [
{
"name": "Echo Test",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
}
33 changes: 33 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "2"
services:
httpbin:
image: kennethreitz/httpbin
expose:
- 80
networks:
- wg
wg:
image: ghcr.io/bryopsida/wireguard:${TAG:-main}
expose:
- 51820
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
net.ipv4.conf.all.src_valid_mark: 1
volumes:
- ./wg0.test.conf:/etc/wireguard/wg0.conf
networks:
- test
- wg
sut:
depends_on:
- wg
build:
context: .
dockerfile: test.Dockerfile
networks:
- test
networks:
test:
wg:
Loading