提交 d1d61ddc 编写于 作者: C cpwu

fix the show varibels case

上级 6f8a5c4d
...@@ -15,6 +15,7 @@ import sys ...@@ -15,6 +15,7 @@ import sys
import subprocess import subprocess
import random import random
import math import math
import numpy as np
from util.log import * from util.log import *
from util.cases import * from util.cases import *
...@@ -57,16 +58,33 @@ class TDTestCase: ...@@ -57,16 +58,33 @@ class TDTestCase:
def td3690(self): def td3690(self):
tdLog.printNoPrefix("==========TD-3690==========") tdLog.printNoPrefix("==========TD-3690==========")
tdSql.prepare()
tdSql.execute("show variables")
res_off = tdSql.cursor.fetchall()
resList = np.array(res_off)
index = np.where(resList == "offlineThreshold")
index_value = np.dstack((index[0])).squeeze()
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(53, 1, 864000) tdSql.checkData(index_value, 1, 864000)
def td4082(self): def td4082(self):
tdLog.printNoPrefix("==========TD-4082==========") tdLog.printNoPrefix("==========TD-4082==========")
tdSql.prepare()
cfgfile = self.getCfgFile() cfgfile = self.getCfgFile()
max_compressMsgSize = 100000000 max_compressMsgSize = 100000000
tdSql.execute("show variables")
res_com = tdSql.cursor.fetchall()
rescomlist = np.array(res_com)
cpms_index = np.where(rescomlist == "compressMsgSize")
index_value = np.dstack((cpms_index[0])).squeeze()
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(26, 1, -1) tdSql.checkData(index_value, 1, -1)
tdSql.query("show dnodes") tdSql.query("show dnodes")
index = tdSql.getData(0, 0) index = tdSql.getData(0, 0)
...@@ -80,7 +98,7 @@ class TDTestCase: ...@@ -80,7 +98,7 @@ class TDTestCase:
tdDnodes.start(index) tdDnodes.start(index)
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(26, 1, 100000000) tdSql.checkData(index_value, 1, 100000000)
tdDnodes.stop(index) tdDnodes.stop(index)
cmd = f"sed -i '$s/{max_compressMsgSize}/{max_compressMsgSize+10}/g' {cfgfile} " cmd = f"sed -i '$s/{max_compressMsgSize}/{max_compressMsgSize+10}/g' {cfgfile} "
...@@ -91,7 +109,7 @@ class TDTestCase: ...@@ -91,7 +109,7 @@ class TDTestCase:
tdDnodes.start(index) tdDnodes.start(index)
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(26, 1, -1) tdSql.checkData(index_value, 1, -1)
tdDnodes.stop(index) tdDnodes.stop(index)
cmd = f"sed -i '$d' {cfgfile}" cmd = f"sed -i '$d' {cfgfile}"
...@@ -104,8 +122,12 @@ class TDTestCase: ...@@ -104,8 +122,12 @@ class TDTestCase:
def td4097(self): def td4097(self):
tdLog.printNoPrefix("==========TD-4097==========") tdLog.printNoPrefix("==========TD-4097==========")
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")
tdSql.execute("drop database if exists db1") tdSql.execute("drop database if exists db1")
tdDnodes.stop(1)
tdDnodes.start(1)
tdSql.execute("create database if not exists db keep 3650") tdSql.execute("create database if not exists db keep 3650")
tdSql.execute("create database if not exists db1 keep 3650") tdSql.execute("create database if not exists db1 keep 3650")
tdSql.execute("create database if not exists new keep 3650") tdSql.execute("create database if not exists new keep 3650")
...@@ -267,10 +289,22 @@ class TDTestCase: ...@@ -267,10 +289,22 @@ class TDTestCase:
# keep ~ [days,365000] # keep ~ [days,365000]
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")
tdSql.execute("create database if not exists db") tdSql.execute("create database if not exists db")
tdSql.execute("show variables")
res_kp = tdSql.cursor.fetchall()
resList = np.array(res_kp)
keep_index = np.where(resList == "keep")
index_value = np.dstack((keep_index[0])).squeeze()
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(38, 1, 3650) tdSql.checkData(index_value, 1, 3650)
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkData(0,7,"3650,3650,3650") selfPath = os.path.dirname(os.path.realpath(__file__))
if ("community" in selfPath):
tdSql.checkData(0, 7, "3650,3650,3650")
else:
tdSql.checkData(0, 7, 3650)
days = tdSql.getData(0, 6) days = tdSql.getData(0, 6)
tdSql.error("alter database db keep 3650001") tdSql.error("alter database db keep 3650001")
...@@ -289,14 +323,22 @@ class TDTestCase: ...@@ -289,14 +323,22 @@ class TDTestCase:
tdSql.execute("alter database db keep 36500") tdSql.execute("alter database db keep 36500")
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkData(0, 7, "3650,3650,36500") if ("community" in selfPath):
tdSql.checkData(0, 7, "36500,3650,3650")
else:
tdSql.checkData(0, 7, 36500)
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")
tdSql.execute("create database if not exists db1") tdSql.execute("create database if not exists db1")
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkData(0, 7, "3650,3650,3650") if ("community" in selfPath):
tdSql.checkData(0, 7, "3650,3650,3650")
else:
tdSql.checkData(0, 7, 3650)
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(38, 1, 3650) tdSql.checkData(index_value, 1, 3650)
tdSql.execute("alter database db1 keep 365") tdSql.execute("alter database db1 keep 365")
tdSql.execute("drop database if exists db1") tdSql.execute("drop database if exists db1")
...@@ -1007,9 +1049,9 @@ class TDTestCase: ...@@ -1007,9 +1049,9 @@ class TDTestCase:
def run(self): def run(self):
# master branch # master branch
# self.td3690() self.td3690()
# self.td4082() self.td4082()
# self.td4288() self.td4288()
# self.td4724() # self.td4724()
# self.td5798() # self.td5798()
# self.td5935() # self.td5935()
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import numpy as np
from util.log import * from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
...@@ -24,8 +26,17 @@ class TDTestCase: ...@@ -24,8 +26,17 @@ class TDTestCase:
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor(), logSql)
def run(self): def run(self):
# tdSql.query("show variables")
# tdSql.checkData(54, 1, 864000)
tdSql.execute("show variables")
res = tdSql.cursor.fetchall()
resList = np.array(res)
index = np.where(resList == "offlineThreshold")
index_value = np.dstack((index[0])).squeeze()
tdSql.query("show variables") tdSql.query("show variables")
tdSql.checkData(54, 1, 864000) tdSql.checkData(index_value, 1, 864000)
pass
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册