升级数据库时同时升级edgeClientAgentIPs中的countIPs字段值

This commit is contained in:
GoEdgeLab
2023-01-07 10:29:08 +08:00
parent 4ee8a50b06
commit f96ff94264
3 changed files with 55 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import (
)
func TestSQLExecutor_Run(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
var executor = NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&multiStatements=true",
@@ -19,7 +19,7 @@ func TestSQLExecutor_Run(t *testing.T) {
}
func TestSQLExecutor_checkCluster(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
var executor = NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&multiStatements=true",
@@ -40,7 +40,7 @@ func TestSQLExecutor_checkCluster(t *testing.T) {
}
func TestSQLExecutor_checkMetricItems(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
var executor = NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&multiStatements=true",
@@ -61,7 +61,7 @@ func TestSQLExecutor_checkMetricItems(t *testing.T) {
}
func TestSQLExecutor_checkNS(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
var executor = NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&multiStatements=true",
@@ -80,3 +80,24 @@ func TestSQLExecutor_checkNS(t *testing.T) {
}
t.Log("ok")
}
func TestSQLExecutor_checkClientAgents(t *testing.T) {
var executor = NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge?charset=utf8mb4&multiStatements=true",
})
db, err := dbs.NewInstanceFromConfig(executor.dbConfig)
if err != nil {
t.Fatal(err)
}
defer func() {
_ = db.Close()
}()
err = executor.checkClientAgents(db)
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}