Fix /proc/net/dev/ interface name handling
* Allow any character (UTF-8) for Linux interface names. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
661427f2c1
commit
b10ca77680
5 changed files with 72 additions and 2 deletions
|
|
@ -43,7 +43,7 @@ func TestNetDevStats(t *testing.T) {
|
|||
t.Errorf("want netstat tun0 packets %s, got %s", want, got)
|
||||
}
|
||||
|
||||
if want, got := 7, len(netStats); want != got {
|
||||
if want, got := 9, len(netStats); want != got {
|
||||
t.Errorf("want count of devices to be %d, got %d", want, got)
|
||||
}
|
||||
|
||||
|
|
@ -54,4 +54,8 @@ func TestNetDevStats(t *testing.T) {
|
|||
if want, got := "0", netStats["ibr10:30"]["receive_fifo"]; want != got {
|
||||
t.Error("want fixture interface ibr10:30 to exist, but it does not")
|
||||
}
|
||||
|
||||
if want, got := "72", netStats["💩0"]["receive_multicast"]; want != got {
|
||||
t.Error("want fixture interface 💩0 to exist, but it does not")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue