mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-25 00:10:26 +08:00
节点如果没有设置DNS线路就使用默认线路
This commit is contained in:
29
internal/db/models/dns/dnsutils/dns_utils_test.go
Normal file
29
internal/db/models/dns/dnsutils/dns_utils_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
|
||||
|
||||
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
|
||||
}
|
||||
issues, err := CheckClusterDNS(tx, cluster)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
logs.PrintAsJSON(issues, t)
|
||||
}
|
||||
Reference in New Issue
Block a user