AdGuardHome/internal/util/network_test.go
Ainar Garipov 73c30590e0 Pull request: all: fix lint and naming issues vol. 4
Merge in DNS/adguard-home from 2276-fix-lint-4 to master

Updates #2276.

Squashed commit of the following:

commit 15d49184cd8ce1f8701bf3221e69418ca1778b36
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Dec 8 15:51:34 2020 +0300

    util: fix naming

commit 3b9a86a0feb8c6e0b167e6e23105e8137b0dda76
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Tue Dec 8 15:41:10 2020 +0300

    all: fix lint and naming issues vol. 4
2020-12-08 16:01:13 +03:00

23 lines
420 B
Go

package util
import (
"testing"
)
func TestGetValidNetInterfacesForWeb(t *testing.T) {
ifaces, err := GetValidNetInterfacesForWeb()
if err != nil {
t.Fatalf("Cannot get net interfaces: %s", err)
}
if len(ifaces) == 0 {
t.Fatalf("No net interfaces found")
}
for _, iface := range ifaces {
if len(iface.Addresses) == 0 {
t.Fatalf("No addresses found for %s", iface.Name)
}
t.Logf("%v", iface)
}
}