2023-01-27 21:37:20 +00:00
|
|
|
// Copyright (c) Tailscale Inc & AUTHORS
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2021-02-15 05:09:18 +00:00
|
|
|
|
2021-08-05 22:42:39 +00:00
|
|
|
//go:build linux || (darwin && !ts_macext)
|
2021-02-15 05:09:18 +00:00
|
|
|
|
2024-04-28 04:18:18 +00:00
|
|
|
package netmon
|
2021-02-15 05:09:18 +00:00
|
|
|
|
2021-03-25 19:24:01 +00:00
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
2021-02-15 05:09:18 +00:00
|
|
|
|
|
|
|
func TestDefaultRouteInterface(t *testing.T) {
|
2021-03-25 19:24:01 +00: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-15 05:09:18 +00:00
|
|
|
v, err := DefaultRouteInterface()
|
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
|
|
|
t.Logf("got %q", v)
|
|
|
|
}
|