2024-05-17 18:27:26 +08:00
|
|
|
// Copyright 2021 GoEdge CDN goedge.cdn@gmail.com. All rights reserved.
|
2021-08-25 17:16:24 +08:00
|
|
|
|
|
|
|
|
package dnsutils
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/TeaOSLab/EdgeAPI/internal/db/models"
|
|
|
|
|
"github.com/iwind/TeaGo/dbs"
|
|
|
|
|
"github.com/iwind/TeaGo/logs"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestNodeClusterDAO_CheckClusterDNS(t *testing.T) {
|
|
|
|
|
dbs.NotifyReady()
|
|
|
|
|
|
|
|
|
|
var tx *dbs.Tx
|
|
|
|
|
cluster, err := models.SharedNodeClusterDAO.FindEnabledNodeCluster(tx, 34)
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
if cluster == nil {
|
|
|
|
|
t.Log("cluster not found, skip the test")
|
|
|
|
|
return
|
|
|
|
|
}
|
2022-09-23 09:28:19 +08:00
|
|
|
issues, err := CheckClusterDNS(tx, cluster, true)
|
2021-08-25 17:16:24 +08:00
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
logs.PrintAsJSON(issues, t)
|
|
|
|
|
}
|