change test cases

This commit is contained in:
Hongze Cheng 2022-11-09 15:49:39 +08:00
parent 961e2d7496
commit 683e2cff7c
3 changed files with 22 additions and 15 deletions

View File

@ -38,7 +38,7 @@ endi
print ============= create database
#database_option: {
# | BUFFER value [3~16384, default: 96]
# | BUFFER value [3~16384, default: 256]
# | PAGES value [64~16384, default: 256]
# | CACHEMODEL value ['node', 'last_row', 'last_value', 'both']
# | WAL_FSYNC_PERIOD value [0 ~ 180000 ms]
@ -78,7 +78,7 @@ endi
if $data7_db != 1440000m,1440000m,1440000m then # keep
return -1
endi
if $data8_db != 96 then # buffer
if $data8_db != 256 then # buffer
return -1
endi
if $data9_db != 4 then # pagesize

View File

@ -37,7 +37,7 @@ endi
print ============= create database with all options
#database_option: {
# | BUFFER value [3~16384, default: 96]
# | BUFFER value [3~16384, default: 256]
# | PAGES value [64~16384, default: 256]
# | PAGESIZE value [1~16384, default: 4]
# | CACHEMODEL value ['node', 'last_row', 'last_value', 'both', default: 'node']
@ -98,7 +98,7 @@ endi
if $data7_db != 5256000m,5256000m,5256000m then # keep
return -1
endi
if $data8_db != 96 then # buffer
if $data8_db != 256 then # buffer
return -1
endi
if $data9_db != 4 then # pagesize

View File

@ -10,37 +10,43 @@ from util.sql import *
from util.cases import *
from util.dnodes import *
class TDTestCase:
def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(),logSql)
self.buffer_boundary = [3,4097,8193,12289,16384]
self.buffer_error = [self.buffer_boundary[0]-1,self.buffer_boundary[-1]+1,12289,96]
tdSql.init(conn.cursor(), logSql)
self.buffer_boundary = [3, 4097, 8193, 12289, 16384]
self.buffer_error = [self.buffer_boundary[0] -
1, self.buffer_boundary[-1]+1, 12289, 256]
# pages_boundary >= 64
self.pages_boundary = [64,128,512]
self.pages_boundary = [64, 128, 512]
self.pages_error = [self.pages_boundary[0]-1]
def alter_buffer(self):
tdSql.execute('create database db')
for buffer in self.buffer_boundary:
tdSql.execute(f'alter database db buffer {buffer}')
tdSql.query('select * from information_schema.ins_databases where name = "db"')
tdSql.checkEqual(tdSql.queryResult[0][8],buffer)
tdSql.query(
'select * from information_schema.ins_databases where name = "db"')
tdSql.checkEqual(tdSql.queryResult[0][8], buffer)
tdSql.execute('drop database db')
tdSql.execute('create database db vgroups 10')
for buffer in self.buffer_error:
tdSql.error(f'alter database db buffer {buffer}')
tdSql.execute('drop database db')
def alter_pages(self):
tdSql.execute('create database db')
for pages in self.pages_boundary:
tdSql.execute(f'alter database db pages {pages}')
tdSql.query('select * from information_schema.ins_databases where name = "db"')
tdSql.checkEqual(tdSql.queryResult[0][10],pages)
tdSql.query(
'select * from information_schema.ins_databases where name = "db"')
tdSql.checkEqual(tdSql.queryResult[0][10], pages)
tdSql.execute('drop database db')
tdSql.execute('create database db')
tdSql.query('select * from information_schema.ins_databases where name = "db"')
tdSql.query(
'select * from information_schema.ins_databases where name = "db"')
self.pages_error.append(tdSql.queryResult[0][10])
for pages in self.pages_error:
tdSql.error(f'alter database db pages {pages}')
@ -55,5 +61,6 @@ class TDTestCase:
tdSql.close()
tdLog.success(f"{__file__} successfully executed")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())