创建集群时自动创建缓存策略和WAF策略

This commit is contained in:
GoEdgeLab
2021-08-25 11:18:37 +08:00
parent 60f23bfacd
commit c3d138b6f6
7 changed files with 187 additions and 7 deletions

View File

@@ -18,6 +18,24 @@ func TestSQLExecutor_Run(t *testing.T) {
t.Log("ok")
}
func TestSQLExecutor_checkCluster(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",
Prefix: "edge",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&multiStatements=true",
})
db, err := dbs.NewInstanceFromConfig(executor.dbConfig)
if err != nil {
t.Fatal(err)
}
err = executor.checkCluster(db)
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}
func TestSQLExecutor_checkMetricItems(t *testing.T) {
executor := NewSQLExecutor(&dbs.DBConfig{
Driver: "mysql",