This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/openwrt/network_test.go

27 lines
497 B
Go
Raw Normal View History

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)
}
}