From 1f434d7d4e064996b1576ca63663cc5db9157c7d Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Tue, 24 Dec 2024 19:05:02 +0800 Subject: [PATCH] Add case for sdbFile.c . --- tests/parallel_test/cases.task | 1 + tests/system-test/6-cluster/mnodeEncrypt.py | 69 +++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 tests/system-test/6-cluster/mnodeEncrypt.py diff --git a/tests/parallel_test/cases.task b/tests/parallel_test/cases.task index 1aef2195db..82bbeaaeb5 100644 --- a/tests/parallel_test/cases.task +++ b/tests/parallel_test/cases.task @@ -777,6 +777,7 @@ ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_insertdatas_querys.py -N 4 -M 1 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/vnode/4dnode1mnode_basic_replica3_vgroups.py -N 4 -M 1 ,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/compactDBConflict.py -N 3 +,,y,system-test,./pytest.sh python3 ./test.py -f 6-cluster/mnodeEncrypt.py 3 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/between.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/distinct.py -Q 2 ,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/varchar.py -Q 2 diff --git a/tests/system-test/6-cluster/mnodeEncrypt.py b/tests/system-test/6-cluster/mnodeEncrypt.py new file mode 100644 index 0000000000..e878611d32 --- /dev/null +++ b/tests/system-test/6-cluster/mnodeEncrypt.py @@ -0,0 +1,69 @@ +from ssl import ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE +from numpy import row_stack +import taos +import sys +import time +import os + +from util.log import * +from util.sql import * +from util.cases import * +from util.dnodes import TDDnodes +from util.dnodes import TDDnode +from util.cluster import * +sys.path.append("./6-cluster") +from clusterCommonCreate import * +from clusterCommonCheck import clusterComCheck + +import time +import socket +import subprocess +from multiprocessing import Process +import threading +import time +import inspect +import ctypes + +class TDTestCase: + + def init(self, conn, logSql, replicaVar=1): + tdLog.debug(f"start to excute {__file__}") + self.TDDnodes = None + tdSql.init(conn.cursor()) + self.host = socket.gethostname() + + + def run(self): + tdSql.execute('create database if not exists db'); + tdSql.execute('use db') + tdSql.execute('create table st (ts timestamp, i int, j float, k double) tags(a int)') + + for i in range(0, 2): + tdSql.execute("create table if not exists db.t%d using db.st tags(%d)" % (i, i)) + + + for i in range(2, 4): + tdSql.execute("create table if not exists db.t%d using db.st tags(%d)" % (i, i)) + + sql = "show db.tables" + tdSql.query(sql) + tdSql.checkRows(4) + + timestamp = 1530374400000 + for i in range (4) : + val = i + sql = "insert into db.t%d values(%d, %d, %d, %d)" % (i, timestamp, val, val, val) + tdSql.execute(sql) + + for i in range ( 4) : + val = i + sql = "select * from db.t%d" % (i) + tdSql.query(sql) + tdSql.checkRows(1) + + def stop(self): + tdSql.close() + tdLog.success(f"{__file__} successfully executed") + +tdCases.addLinux(__file__, TDTestCase()) +tdCases.addWindows(__file__, TDTestCase())