windows_exporter/collector/net_test.go
Ben Reedy fab77d9d31
feat!: Deprecate whitelist/blacklist flags
Flags have been deprecated in favour of include/exclude terminology.

Signed-off-by: Ben Reedy <breed808@breed808.com>
2023-04-19 06:11:23 +10:00

28 lines
634 B
Go

//go:build windows
// +build windows
package collector
import (
"testing"
)
func TestNetworkToInstanceName(t *testing.T) {
data := map[string]string{
"Intel[R] Dual Band Wireless-AC 8260": "Intel_R__Dual_Band_Wireless_AC_8260",
}
for in, out := range data {
got := mangleNetworkName(in)
if got != out {
t.Error("expected", out, "got", got)
}
}
}
func BenchmarkNetCollector(b *testing.B) {
// Include is not set in testing context (kingpin flags not parsed), causing the collector to skip all interfaces.
localNicInclude := ".+"
nicInclude = &localNicInclude
benchmarkCollector(b, "net", newNetworkCollector)
}