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.
2018-09-20 16:43:31 +02:00
|
|
|
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()
|
2018-09-21 14:36:06 +02:00
|
|
|
res := net.ListWirelessInterfaces("./testdata/proc_net_wireless.txt")
|
2018-09-24 17:38:17 +02:00
|
|
|
|
|
|
|
if len(res) != 0 {
|
|
|
|
t.Error("The wireless interfaces list is not empty !!")
|
|
|
|
}
|
2018-09-20 16:43:31 +02:00
|
|
|
for _, el := range res {
|
2018-09-24 17:38:17 +02:00
|
|
|
fmt.Printf("[%s]\n", el.Name)
|
2018-09-20 16:43:31 +02:00
|
|
|
}
|
|
|
|
}
|