mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-03 07:00:26 +08:00
提供检查域名是否重复接口
This commit is contained in:
@@ -106,3 +106,33 @@ func TestServerDAO_CheckPortIsUsing(t *testing.T) {
|
||||
t.Log("isUsing:", isUsing)
|
||||
}
|
||||
}
|
||||
|
||||
func TestServerDAO_ExistServerNameInCluster(t *testing.T) {
|
||||
dbs.NotifyReady()
|
||||
|
||||
var tx *dbs.Tx
|
||||
{
|
||||
exist, err := SharedServerDAO.ExistServerNameInCluster(tx, 18, "hello.teaos.cn", 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(exist)
|
||||
}
|
||||
|
||||
{
|
||||
exist, err := SharedServerDAO.ExistServerNameInCluster(tx, 18, "cdn.teaos.cn", 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(exist)
|
||||
}
|
||||
|
||||
{
|
||||
exist, err := SharedServerDAO.ExistServerNameInCluster(tx, 18, "cdn.teaos.cn", 23)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log(exist)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user