Files
EdgeAPI/internal/db/models/http_firewall_policy_dao_test.go
2021-01-17 16:48:00 +08:00

39 lines
827 B
Go

package models
import (
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
"testing"
)
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)
}