2023-01-27 13:37:20 -08:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2021-02-14 21:09:18 -08:00
|
|
|
|
2021-08-05 15:42:39 -07:00
|
|
|
//go:build linux || (darwin && !ts_macext)
|
2021-02-14 21:09:18 -08:00
|
|
|
|
|
|
|
package interfaces
|
|
|
|
|
2021-03-25 12:24:01 -07:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
2021-02-14 21:09:18 -08:00
|
|
|
|
|
|
|
func TestDefaultRouteInterface(t *testing.T) {
|
2021-03-25 12:24:01 -07:00
|
|
|
// tests /proc/net/route on the local system, cannot make an assertion about
|
|
|
|
// the correct interface name, but good as a sanity check.
|
2021-02-14 21:09:18 -08:00
|
|
|
v, err := DefaultRouteInterface()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
t.Logf("got %q", v)
|
|
|
|
}
|