netmaker/controllers/dns_test.go

438 lines
14 KiB
Go
Raw Normal View History

2021-05-06 05:24:24 +08:00
package controller
import (
2023-01-21 06:38:32 +08:00
"net"
2021-10-17 23:47:25 +08:00
"os"
2021-05-06 05:24:24 +08:00
"testing"
2023-01-21 06:38:32 +08:00
"github.com/google/uuid"
2021-05-06 05:24:24 +08:00
"github.com/stretchr/testify/assert"
2023-01-21 06:38:32 +08:00
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"github.com/gravitl/netmaker/logic"
"github.com/gravitl/netmaker/models"
2021-05-06 05:24:24 +08:00
)
2023-01-21 06:38:32 +08:00
var dnsHost models.Host
2021-10-17 23:47:25 +08:00
func TestGetAllDNS(t *testing.T) {
deleteAllDNS(t)
deleteAllNetworks()
createNet()
2023-01-21 06:38:32 +08:00
createHost()
2021-10-17 23:47:25 +08:00
t.Run("NoEntries", func(t *testing.T) {
2021-12-08 01:46:55 +08:00
entries, err := logic.GetAllDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, []models.DNSEntry(nil), entries)
})
t.Run("OneEntry", func(t *testing.T) {
2023-01-21 06:38:32 +08:00
entry := models.DNSEntry{
Address: "10.0.0.3", Name: "newhost", Network: "skynet",
2023-01-21 06:38:32 +08:00
}
_, err := logic.CreateDNS(entry)
assert.Nil(t, err)
2021-12-08 01:46:55 +08:00
entries, err := logic.GetAllDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 1, len(entries))
})
t.Run("MultipleEntry", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.7", Name: "anotherhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
assert.Nil(t, err)
2021-12-08 01:46:55 +08:00
entries, err := logic.GetAllDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 2, len(entries))
})
}
2021-05-06 05:24:24 +08:00
func TestGetNodeDNS(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
2021-09-10 04:20:21 +08:00
deleteAllNetworks()
createNet()
2023-01-21 06:38:32 +08:00
createHost()
2021-10-17 23:47:25 +08:00
t.Run("NoNodes", func(t *testing.T) {
2023-06-28 00:45:36 +08:00
dns, _ := logic.GetNodeDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Equal(t, []models.DNSEntry(nil), dns)
})
t.Run("NodeExists", func(t *testing.T) {
2023-01-21 06:38:32 +08:00
createHost()
_, ipnet, _ := net.ParseCIDR("10.0.0.1/32")
tmpCNode := models.CommonNode{
ID: uuid.New(),
Network: "skynet",
Address: *ipnet,
DNSOn: true,
}
createnode := models.Node{
CommonNode: tmpCNode,
}
err := logic.AssociateNodeToHost(&createnode, &dnsHost)
2022-12-19 18:52:47 +08:00
assert.Nil(t, err)
2021-12-08 01:46:55 +08:00
dns, err := logic.GetNodeDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, "10.0.0.1", dns[0].Address)
})
t.Run("MultipleNodes", func(t *testing.T) {
2023-01-21 06:38:32 +08:00
_, ipnet, _ := net.ParseCIDR("10.100.100.3/32")
tmpCNode := models.CommonNode{
ID: uuid.New(),
Network: "skynet",
Address: *ipnet,
DNSOn: true,
}
createnode := models.Node{
CommonNode: tmpCNode,
}
err := logic.AssociateNodeToHost(&createnode, &dnsHost)
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-12-08 01:46:55 +08:00
dns, err := logic.GetNodeDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 2, len(dns))
})
2021-05-06 05:24:24 +08:00
}
func TestGetCustomDNS(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
2021-09-10 04:20:21 +08:00
deleteAllNetworks()
2021-10-17 23:47:25 +08:00
t.Run("NoNetworks", func(t *testing.T) {
2021-10-27 00:27:29 +08:00
dns, err := logic.GetCustomDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.EqualError(t, err, "could not find any records")
assert.Equal(t, []models.DNSEntry(nil), dns)
})
t.Run("NoNodes", func(t *testing.T) {
createNet()
2021-10-27 00:27:29 +08:00
dns, err := logic.GetCustomDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.EqualError(t, err, "could not find any records")
assert.Equal(t, []models.DNSEntry(nil), dns)
})
t.Run("NodeExists", func(t *testing.T) {
createTestNode()
2021-10-27 00:27:29 +08:00
dns, err := logic.GetCustomDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.EqualError(t, err, "could not find any records")
assert.Equal(t, 0, len(dns))
})
t.Run("EntryExist", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.3", Name: "custom1", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
2023-01-25 00:20:06 +08:00
assert.Nil(t, err)
2021-10-27 00:27:29 +08:00
dns, err := logic.GetCustomDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 1, len(dns))
})
t.Run("MultipleEntries", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.4", Name: "host4", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
assert.Nil(t, err)
2021-10-27 00:27:29 +08:00
dns, err := logic.GetCustomDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 2, len(dns))
})
2021-05-06 05:24:24 +08:00
}
2021-10-17 23:47:25 +08:00
2021-05-06 05:24:24 +08:00
func TestGetDNSEntryNum(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
2021-09-10 04:20:21 +08:00
deleteAllNetworks()
createNet()
2021-10-17 23:47:25 +08:00
t.Run("NoNodes", func(t *testing.T) {
2021-12-08 01:46:55 +08:00
num, err := logic.GetDNSEntryNum("myhost", "skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 0, num)
})
t.Run("NodeExists", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-12-08 01:46:55 +08:00
num, err := logic.GetDNSEntryNum("newhost", "skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Equal(t, 1, num)
})
2021-05-06 05:24:24 +08:00
}
func TestGetDNS(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
2021-09-10 04:20:21 +08:00
deleteAllNetworks()
2021-10-17 23:47:25 +08:00
createNet()
t.Run("NoEntries", func(t *testing.T) {
2021-10-27 00:27:29 +08:00
dns, err := logic.GetDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Nil(t, dns)
})
t.Run("CustomDNSExists", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-10-27 00:27:29 +08:00
dns, err := logic.GetDNS("skynet")
2021-10-17 23:47:25 +08:00
t.Log(dns)
assert.Nil(t, err)
assert.NotNil(t, dns)
assert.Equal(t, "skynet", dns[0].Network)
assert.Equal(t, 1, len(dns))
})
t.Run("NodeExists", func(t *testing.T) {
deleteAllDNS(t)
createTestNode()
2021-10-27 00:27:29 +08:00
dns, err := logic.GetDNS("skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.NotNil(t, dns)
assert.Equal(t, "skynet", dns[0].Network)
assert.Equal(t, 1, len(dns))
})
t.Run("NodeAndCustomDNS", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
2022-06-17 03:42:32 +08:00
assert.Nil(t, err)
2021-10-27 00:27:29 +08:00
dns, err := logic.GetDNS("skynet")
2021-10-17 23:47:25 +08:00
t.Log(dns)
assert.Nil(t, err)
assert.NotNil(t, dns)
assert.Equal(t, "skynet", dns[0].Network)
assert.Equal(t, "skynet", dns[1].Network)
assert.Equal(t, 2, len(dns))
})
2021-05-06 05:24:24 +08:00
}
2021-10-17 23:47:25 +08:00
2021-05-06 05:24:24 +08:00
func TestCreateDNS(t *testing.T) {
2021-09-10 04:20:21 +08:00
deleteAllDNS(t)
2021-10-17 23:47:25 +08:00
deleteAllNetworks()
2021-05-06 05:24:24 +08:00
createNet()
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
dns, err := logic.CreateDNS(entry)
2021-05-06 05:24:24 +08:00
assert.Nil(t, err)
2021-10-17 23:47:25 +08:00
assert.Equal(t, "newhost", dns.Name)
}
func TestSetDNS(t *testing.T) {
deleteAllDNS(t)
deleteAllNetworks()
t.Run("NoNetworks", func(t *testing.T) {
2021-10-27 00:27:29 +08:00
err := logic.SetDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
assert.Equal(t, int64(0), info.Size())
})
t.Run("NoEntries", func(t *testing.T) {
createNet()
2021-10-27 00:27:29 +08:00
err := logic.SetDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
assert.Equal(t, int64(0), info.Size())
})
t.Run("NodeExists", func(t *testing.T) {
createTestNode()
2021-10-27 00:27:29 +08:00
err := logic.SetDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
2022-01-07 04:05:38 +08:00
content, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2023-01-21 06:38:32 +08:00
assert.Contains(t, string(content), "linuxhost.skynet")
2021-10-17 23:47:25 +08:00
})
t.Run("EntryExists", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.3", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, err := logic.CreateDNS(entry)
assert.Nil(t, err)
err = logic.SetDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
info, err := os.Stat("./config/dnsconfig/netmaker.hosts")
assert.Nil(t, err)
assert.False(t, info.IsDir())
2022-01-07 04:05:38 +08:00
content, err := os.ReadFile("./config/dnsconfig/netmaker.hosts")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
assert.Contains(t, string(content), "newhost.skynet")
})
2021-05-06 05:24:24 +08:00
}
2021-10-17 23:47:25 +08:00
2021-05-06 05:24:24 +08:00
func TestGetDNSEntry(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
2021-09-10 04:20:21 +08:00
deleteAllNetworks()
createNet()
createTestNode()
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, _ = logic.CreateDNS(entry)
2021-10-17 23:47:25 +08:00
t.Run("wrong net", func(t *testing.T) {
entry, err := GetDNSEntry("newhost", "w286 Toronto Street South, Uxbridge, ONirecat")
assert.EqualError(t, err, "no result found")
assert.Equal(t, models.DNSEntry{}, entry)
})
t.Run("wrong host", func(t *testing.T) {
entry, err := GetDNSEntry("badhost", "skynet")
assert.EqualError(t, err, "no result found")
assert.Equal(t, models.DNSEntry{}, entry)
})
t.Run("good host", func(t *testing.T) {
entry, err := GetDNSEntry("newhost", "skynet")
assert.Nil(t, err)
assert.Equal(t, "newhost", entry.Name)
})
t.Run("node", func(t *testing.T) {
entry, err := GetDNSEntry("testnode", "skynet")
assert.EqualError(t, err, "no result found")
assert.Equal(t, models.DNSEntry{}, entry)
})
2021-05-06 05:24:24 +08:00
}
2021-12-08 01:46:55 +08:00
2021-05-06 05:24:24 +08:00
func TestDeleteDNS(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
deleteAllNetworks()
createNet()
entry := models.DNSEntry{Address: "10.0.0.2", Name: "newhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, _ = logic.CreateDNS(entry)
2021-05-06 05:24:24 +08:00
t.Run("EntryExists", func(t *testing.T) {
2021-12-08 01:46:55 +08:00
err := logic.DeleteDNS("newhost", "skynet")
2021-05-06 05:24:24 +08:00
assert.Nil(t, err)
})
2021-10-17 23:47:25 +08:00
t.Run("NodeExists", func(t *testing.T) {
2021-12-08 01:46:55 +08:00
err := logic.DeleteDNS("myhost", "skynet")
2021-05-06 05:24:24 +08:00
assert.Nil(t, err)
})
2021-10-17 23:47:25 +08:00
t.Run("NoEntries", func(t *testing.T) {
2021-12-08 01:46:55 +08:00
err := logic.DeleteDNS("myhost", "skynet")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
})
2021-05-06 05:24:24 +08:00
}
2021-05-10 01:31:50 +08:00
2021-05-06 05:24:24 +08:00
func TestValidateDNSUpdate(t *testing.T) {
2021-10-17 23:47:25 +08:00
deleteAllDNS(t)
deleteAllNetworks()
createNet()
entry := models.DNSEntry{Address: "10.0.0.2", Name: "myhost", Network: "skynet"}
2021-05-06 05:24:24 +08:00
t.Run("BadNetwork", func(t *testing.T) {
change := models.DNSEntry{Address: "10.0.0.2", Name: "myhost", Network: "badnet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Network' failed on the 'network_exists' tag")
})
t.Run("EmptyNetwork", func(t *testing.T) {
// this can't actually happen as change.Network is populated if is blank
change := models.DNSEntry{Address: "10.0.0.2", Name: "myhost"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Network' failed on the 'network_exists' tag")
})
2022-04-26 01:28:00 +08:00
// t.Run("EmptyAddress", func(t *testing.T) {
// //this can't actually happen as change.Address is populated if is blank
// change := models.DNSEntry{"", "", "myhost", "skynet"}
// err := logic.ValidateDNSUpdate(change, entry)
// assert.NotNil(t, err)
// assert.Contains(t, err.Error(), "Field validation for 'Address' failed on the 'required' tag")
// })
2021-05-06 05:24:24 +08:00
t.Run("BadAddress", func(t *testing.T) {
change := models.DNSEntry{Address: "10.0.256.1", Name: "myhost", Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Address' failed on the 'ip' tag")
})
t.Run("EmptyName", func(t *testing.T) {
// this can't actually happen as change.Name is populated if is blank
change := models.DNSEntry{Address: "10.0.0.2", Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'required' tag")
})
t.Run("NameTooLong", func(t *testing.T) {
name := ""
2021-09-10 04:20:21 +08:00
for i := 1; i < 194; i++ {
2021-05-06 05:24:24 +08:00
name = name + "a"
}
change := models.DNSEntry{Address: "10.0.0.2", Name: name, Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'max' tag")
})
t.Run("NameUnique", func(t *testing.T) {
change := models.DNSEntry{Address: "10.0.0.2", Name: "myhost", Network: "wirecat"}
2023-01-21 06:38:32 +08:00
_, _ = logic.CreateDNS(entry)
_, _ = logic.CreateDNS(change)
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSUpdate(change, entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'name_unique' tag")
// cleanup
2021-12-08 01:46:55 +08:00
err = logic.DeleteDNS("myhost", "wirecat")
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-05-06 05:24:24 +08:00
})
}
func TestValidateDNSCreate(t *testing.T) {
2021-12-08 01:46:55 +08:00
_ = logic.DeleteDNS("mynode", "skynet")
2021-05-06 05:24:24 +08:00
t.Run("NoNetwork", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Name: "myhost", Network: "badnet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSCreate(entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Network' failed on the 'network_exists' tag")
})
2022-04-26 04:48:36 +08:00
// t.Run("EmptyAddress", func(t *testing.T) {
// entry := models.DNSEntry{"", "", "myhost", "skynet"}
// err := logic.ValidateDNSCreate(entry)
// assert.NotNil(t, err)
// assert.Contains(t, err.Error(), "Field validation for 'Address' failed on the 'required' tag")
// })
2021-05-06 05:24:24 +08:00
t.Run("BadAddress", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.256.1", Name: "myhost", Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSCreate(entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Address' failed on the 'ip' tag")
})
t.Run("EmptyName", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSCreate(entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'required' tag")
})
t.Run("NameTooLong", func(t *testing.T) {
name := ""
2021-09-10 04:20:21 +08:00
for i := 1; i < 194; i++ {
2021-05-06 05:24:24 +08:00
name = name + "a"
}
entry := models.DNSEntry{Address: "10.0.0.2", Name: name, Network: "skynet"}
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSCreate(entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'max' tag")
})
t.Run("NameUnique", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.0.0.2", Name: "myhost", Network: "skynet"}
2023-01-21 06:38:32 +08:00
_, _ = logic.CreateDNS(entry)
2021-12-08 01:46:55 +08:00
err := logic.ValidateDNSCreate(entry)
2021-05-06 05:24:24 +08:00
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'name_unique' tag")
})
t.Run("WhiteSpace", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.10.10.5", Name: "white space", Network: "skynet"}
err := logic.ValidateDNSCreate(entry)
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'whitespace' tag")
})
t.Run("AllSpaces", func(t *testing.T) {
entry := models.DNSEntry{Address: "10.10.10.5", Name: " ", Network: "skynet"}
err := logic.ValidateDNSCreate(entry)
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Field validation for 'Name' failed on the 'whitespace' tag")
})
2021-05-06 05:24:24 +08:00
}
2021-09-10 04:20:21 +08:00
2023-01-21 06:38:32 +08:00
func createHost() {
k, _ := wgtypes.ParseKey("DM5qhLAE20PG9BbfBCger+Ac9D2NDOwCtY1rbYDLf34=")
dnsHost = models.Host{
ID: uuid.New(),
PublicKey: k.PublicKey(),
HostPass: "password",
OS: "linux",
Name: "dnshost",
}
_ = logic.CreateHost(&dnsHost)
}
2021-09-10 04:20:21 +08:00
func deleteAllDNS(t *testing.T) {
2021-12-08 01:46:55 +08:00
dns, err := logic.GetAllDNS()
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-09-10 04:20:21 +08:00
for _, record := range dns {
2021-12-08 01:46:55 +08:00
err := logic.DeleteDNS(record.Name, record.Network)
2021-10-17 23:47:25 +08:00
assert.Nil(t, err)
2021-09-10 04:20:21 +08:00
}
}