Files
EdgeAPI/internal/db/models/http_firewall_policy_dao_test.go

40 lines
828 B
Go
Raw Normal View History

2020-09-20 20:12:47 +08:00
package models
import (
2024-07-27 14:15:25 +08:00
"testing"
2020-09-20 20:12:47 +08:00
_ "github.com/go-sql-driver/mysql"
"github.com/iwind/TeaGo/dbs"
2020-09-20 20:12:47 +08:00
)
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)
}