27 lines
497 B
Go
27 lines
497 B
Go
package openwrt
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestNetworkListInterfaces(t *testing.T) {
|
|
net := NewNetwork()
|
|
iface := net.ListInterfaces()
|
|
for _, ife := range iface {
|
|
fmt.Printf("%s\n", ife.Name)
|
|
}
|
|
}
|
|
|
|
func TestListWirelessInterfaces(t *testing.T) {
|
|
net := NewNetwork()
|
|
res := net.ListWirelessInterfaces("./testdata/proc_net_wireless.txt")
|
|
|
|
if len(res) != 0 {
|
|
t.Error("The wireless interfaces list is not empty !!")
|
|
}
|
|
for _, el := range res {
|
|
fmt.Printf("[%s]\n", el.Name)
|
|
}
|
|
}
|