minor: add comments about WESHER_E2E_TESTS envvar

[skip ci]
This commit is contained in:
Leo Antunes 2019-07-13 11:01:50 +02:00
parent 1c26b706f8
commit 89cab211bc
2 changed files with 2 additions and 0 deletions

View File

@ -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=' "$@"

View File

@ -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
}