提供检查域名是否重复接口

This commit is contained in:
刘祥超
2021-02-06 21:19:19 +08:00
parent 7e397671ec
commit 3252c08fb6
4 changed files with 72 additions and 1 deletions

View File

@@ -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)
}
}