diff --git a/tests/entrypoint.sh b/tests/entrypoint.sh index 840d02c..a37e223 100755 --- a/tests/entrypoint.sh +++ b/tests/entrypoint.sh @@ -6,6 +6,7 @@ mkdir -p /dev/net mknod /dev/net/tun c 10 200 wireguard-go wgoverlay +# this disables kernel-mode interface creation; see wireguard.go:createWgInterface() export WESHER_E2E_TESTS=1 /app/wesher --log-level debug --cluster-key 'ILICZ3yBMCGAWNIq5Pn0bewBVimW3Q2yRVJ/Be+b1Uc=' "$@" \ No newline at end of file diff --git a/wireguard.go b/wireguard.go index e3fb1d8..a823696 100644 --- a/wireguard.go +++ b/wireguard.go @@ -137,6 +137,7 @@ func (wg *wgState) nodesToPeerConfigs(nodes []node) ([]wgtypes.PeerConfig, error func (wg *wgState) createWgInterface() error { if _, err := wg.client.Device(wg.iface); err == nil { // device already exists, but we are running e2e tests, so we're using the user-mode implementation + // see tests/entrypoint.sh if _, e2e := os.LookupEnv("WESHER_E2E_TESTS"); e2e { return nil }