mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 15:00:27 +08:00
40 lines
828 B
Go
40 lines
828 B
Go
package models
|
|
|
|
import (
|
|
"testing"
|
|
|
|
_ "github.com/go-sql-driver/mysql"
|
|
"github.com/iwind/TeaGo/dbs"
|
|
)
|
|
|
|
func TestHTTPFirewallPolicyDAO_FindFirewallPolicyIdsContainsIPList(t *testing.T) {
|
|
dbs.NotifyReady()
|
|
|
|
{
|
|
policyIds, err := SharedHTTPFirewallPolicyDAO.FindEnabledFirewallPolicyIdsWithIPListId(nil, 8)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(policyIds)
|
|
}
|
|
|
|
{
|
|
policyIds, err := SharedHTTPFirewallPolicyDAO.FindEnabledFirewallPolicyIdsWithIPListId(nil, 18)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log(policyIds)
|
|
}
|
|
}
|
|
|
|
func TestHTTPFirewallPolicyDAO_FindEnabledFirewallPolicyIdWithRuleGroupId(t *testing.T) {
|
|
dbs.NotifyReady()
|
|
|
|
var tx *dbs.Tx
|
|
policyIds, err := SharedHTTPFirewallPolicyDAO.FindEnabledFirewallPolicyIdWithRuleGroupId(tx, 160)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
t.Log("policyIds:", policyIds)
|
|
}
|