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

32 lines
584 B
Go
Raw Normal View History

2021-09-12 20:21:42 +08:00
//go:build plus
// +build plus
2020-08-30 16:12:00 +08:00
package models
import (
2021-09-12 20:21:42 +08:00
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
2020-08-30 16:12:00 +08:00
_ "github.com/go-sql-driver/mysql"
2021-09-12 20:21:42 +08:00
"github.com/iwind/TeaGo/dbs"
"testing"
2020-08-30 16:12:00 +08:00
)
2021-09-12 20:21:42 +08:00
func TestNodeIPAddressDAO_FireThresholds(t *testing.T) {
dbs.NotifyReady()
var tx *dbs.Tx
var nodeId int64 = 126
node, err := SharedNodeDAO.FindEnabledNode(tx, nodeId)
if err != nil {
t.Fatal(err)
}
if node == nil {
t.Log("node not found")
return
}
err = SharedNodeIPAddressDAO.FireThresholds(tx, nodeconfigs.NodeRoleNode, nodeId)
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}