24 lines
487 B
Go
24 lines
487 B
Go
|
package owrt
|
||
|
|
||
|
import (
|
||
|
"io/ioutil"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestUCILoadFirewall(t *testing.T) {
|
||
|
config, err := ioutil.ReadFile("./testdata/uci_show_firewall.txt")
|
||
|
if err != nil {
|
||
|
t.Fatal(err)
|
||
|
}
|
||
|
|
||
|
exec := createMockExecutor(string(config), "", 0)
|
||
|
uci := NewUCIWithExecutor(exec, "")
|
||
|
if err := uci.LoadFirewallConf(); err != nil {
|
||
|
t.Fatalf("%s", err.Error())
|
||
|
}
|
||
|
|
||
|
//if uci.Firewall.Rules[13].Name != "MyTestRule" {
|
||
|
// t.Fatalf("Something is wrong with the last firewall rule")
|
||
|
//}
|
||
|
}
|