Github Actions: Smoke test
This change adds a new Github Action, a 3 node smoke test. It starts three docker containers (one lighthouse and two standard nodes) and tests that they can all ping each other. This should hopefully detect any basic runtime failures in PRs.
This commit is contained in:
1
.github/workflows/smoke/.gitignore
vendored
Normal file
1
.github/workflows/smoke/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
5
.github/workflows/smoke/Dockerfile
vendored
Normal file
5
.github/workflows/smoke/Dockerfile
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
FROM debian:buster
|
||||
|
||||
ADD ./build /
|
||||
|
||||
ENTRYPOINT ["/nebula"]
|
21
.github/workflows/smoke/build.sh
vendored
Executable file
21
.github/workflows/smoke/build.sh
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e -x
|
||||
|
||||
rm -rf ./build
|
||||
mkdir ./build
|
||||
|
||||
(
|
||||
cd build
|
||||
|
||||
cp ../../../../nebula .
|
||||
cp ../../../../nebula-cert .
|
||||
cp ../*.yml .
|
||||
|
||||
./nebula-cert ca -name "Smoke Test"
|
||||
./nebula-cert sign -name "lighthouse1" -ip "192.168.100.1/24"
|
||||
./nebula-cert sign -name "host2" -ip "192.168.100.2/24"
|
||||
./nebula-cert sign -name "host3" -ip "192.168.100.3/24"
|
||||
)
|
||||
|
||||
docker build -t nebula:smoke .
|
31
.github/workflows/smoke/host2.yml
vendored
Normal file
31
.github/workflows/smoke/host2.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /host2.crt
|
||||
key: /host2.key
|
||||
|
||||
static_host_map:
|
||||
"192.168.100.1": ["172.17.0.2:4242"]
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: false
|
||||
interval: 60
|
||||
hosts:
|
||||
- "192.168.100.1"
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
31
.github/workflows/smoke/host3.yml
vendored
Normal file
31
.github/workflows/smoke/host3.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /host3.crt
|
||||
key: /host3.key
|
||||
|
||||
static_host_map:
|
||||
"192.168.100.1": ["172.17.0.2:4242"]
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: false
|
||||
interval: 60
|
||||
hosts:
|
||||
- "192.168.100.1"
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
25
.github/workflows/smoke/lighthouse1.yml
vendored
Normal file
25
.github/workflows/smoke/lighthouse1.yml
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
pki:
|
||||
ca: /ca.crt
|
||||
cert: /lighthouse1.crt
|
||||
key: /lighthouse1.key
|
||||
|
||||
lighthouse:
|
||||
am_lighthouse: true
|
||||
|
||||
listen:
|
||||
host: 0.0.0.0
|
||||
port: 4242
|
||||
|
||||
tun:
|
||||
dev: nebula1
|
||||
|
||||
firewall:
|
||||
outbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
||||
|
||||
inbound:
|
||||
- port: any
|
||||
proto: any
|
||||
host: any
|
34
.github/workflows/smoke/smoke.sh
vendored
Executable file
34
.github/workflows/smoke/smoke.sh
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e -x
|
||||
|
||||
docker run --name lighthouse1 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm nebula:smoke -config lighthouse1.yml &
|
||||
sleep 1
|
||||
docker run --name host2 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm nebula:smoke -config host2.yml &
|
||||
sleep 1
|
||||
docker run --name host3 --device /dev/net/tun:/dev/net/tun --cap-add NET_ADMIN --rm nebula:smoke -config host3.yml &
|
||||
sleep 1
|
||||
|
||||
set +x
|
||||
echo
|
||||
echo " *** Testing ping from lighthouse1"
|
||||
echo
|
||||
set -x
|
||||
docker exec lighthouse1 ping -c1 192.168.100.2
|
||||
docker exec lighthouse1 ping -c1 192.168.100.3
|
||||
|
||||
set +x
|
||||
echo
|
||||
echo " *** Testing ping from host2"
|
||||
echo
|
||||
set -x
|
||||
docker exec host2 ping -c1 192.168.100.1
|
||||
docker exec host2 ping -c1 192.168.100.3
|
||||
|
||||
set +x
|
||||
echo
|
||||
echo " *** Testing ping from host3"
|
||||
echo
|
||||
set -x
|
||||
docker exec host3 ping -c1 192.168.100.1
|
||||
docker exec host3 ping -c1 192.168.100.2
|
Reference in New Issue
Block a user