Merge pull request #27403 from taosdata/test/TD-31528
add a clusterBasic case
This commit is contained in:
commit
2324ca14ae
|
@ -0,0 +1,82 @@
|
||||||
|
###################################################################
|
||||||
|
# Copyright (c) 2016 by TAOS Technologies, Inc.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is proprietary and confidential to TAOS Technologies.
|
||||||
|
# No part of this file may be reproduced, stored, transmitted,
|
||||||
|
# disclosed or used in any form or by any means other than as
|
||||||
|
# expressly provided by the written permission from Jianhui Tao
|
||||||
|
#
|
||||||
|
###################################################################
|
||||||
|
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
import random
|
||||||
|
|
||||||
|
import taos
|
||||||
|
import frame
|
||||||
|
import frame.etool
|
||||||
|
|
||||||
|
|
||||||
|
from frame.log import *
|
||||||
|
from frame.cases import *
|
||||||
|
from frame.sql import *
|
||||||
|
from frame.caseBase import *
|
||||||
|
from frame import *
|
||||||
|
from frame.srvCtl import *
|
||||||
|
from frame.clusterCommonCheck import clusterComCheck
|
||||||
|
|
||||||
|
class TDTestCase(TBase):
|
||||||
|
def init(self, conn, logSql, replicaVar=3):
|
||||||
|
super(TDTestCase, self).init(conn, logSql, replicaVar=3, db="db")
|
||||||
|
self.dnodeNum = 3
|
||||||
|
self.mnodeNum = 3
|
||||||
|
tdSql.init(conn.cursor(), logSql)
|
||||||
|
|
||||||
|
def checkClusterEmptyDB(self):
|
||||||
|
while 1:
|
||||||
|
if clusterComCheck.checkDnodes(3): break
|
||||||
|
tdSql.query("show cluster alive;")
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
|
||||||
|
sc.dnodeStop(3)
|
||||||
|
while 1:
|
||||||
|
if clusterComCheck.checkDnodes(2): break
|
||||||
|
tdSql.query("show cluster alive;")
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
|
||||||
|
|
||||||
|
def checkClusterWithDB(self):
|
||||||
|
sc.dnodeStart(3)
|
||||||
|
while 1:
|
||||||
|
if clusterComCheck.checkDnodes(3): break
|
||||||
|
tdSql.execute(f'drop database if exists {self.db}')
|
||||||
|
tdSql.execute(f'create database {self.db} replica 3')
|
||||||
|
tdSql.query("show cluster alive;")
|
||||||
|
print(tdSql.getResult("show cluster alive;"))
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
|
||||||
|
sc.dnodeStop(3)
|
||||||
|
while 1:
|
||||||
|
if clusterComCheck.checkDnodes(2): break
|
||||||
|
tdSql.query("show cluster alive;")
|
||||||
|
print(tdSql.getResult("show cluster alive;"))
|
||||||
|
tdSql.checkData(0, 0, 1)
|
||||||
|
|
||||||
|
|
||||||
|
# run
|
||||||
|
def run(self):
|
||||||
|
tdLog.debug(f"start to excute {__file__}")
|
||||||
|
self.checkClusterEmptyDB()
|
||||||
|
self.checkClusterWithDB()
|
||||||
|
|
||||||
|
def stop(self):
|
||||||
|
sc.dnodeStop(2)
|
||||||
|
sc.dnodeStop(1)
|
||||||
|
tdSql.close()
|
||||||
|
tdLog.success(f"{__file__} successfully executed")
|
||||||
|
|
||||||
|
tdCases.addLinux(__file__, TDTestCase())
|
||||||
|
tdCases.addWindows(__file__, TDTestCase())
|
|
@ -23,6 +23,7 @@
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_desc.py -N 3 -L 3 -D 2
|
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_desc.py -N 3 -L 3 -D 2
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_null.py
|
,,y,army,./pytest.sh python3 ./test.py -f query/fill/fill_null.py
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f cluster/incSnapshot.py -N 3
|
,,y,army,./pytest.sh python3 ./test.py -f cluster/incSnapshot.py -N 3
|
||||||
|
,,y,army,./pytest.sh python3 ./test.py -f cluster/clusterBasic.py -N 3
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/query_basic.py -N 3
|
,,y,army,./pytest.sh python3 ./test.py -f query/query_basic.py -N 3
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f query/accuracy/test_query_accuracy.py
|
,,y,army,./pytest.sh python3 ./test.py -f query/accuracy/test_query_accuracy.py
|
||||||
,,y,army,./pytest.sh python3 ./test.py -f insert/insert_basic.py -N 3
|
,,y,army,./pytest.sh python3 ./test.py -f insert/insert_basic.py -N 3
|
||||||
|
|
Loading…
Reference in New Issue