From bad2bb52b5ab9b889e68fda6a7d6447523b7a971 Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Wed, 16 Aug 2023 18:17:43 +0800 Subject: [PATCH] enh: update test cases for show vnodes --- source/libs/parser/test/parShowToUse.cpp | 4 +-- tests/script/tsim/db/basic1.sim | 32 +++++++++++++----------- tests/system-test/0-others/show.py | 2 +- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/source/libs/parser/test/parShowToUse.cpp b/source/libs/parser/test/parShowToUse.cpp index b7bd0e802c..3e1482d420 100644 --- a/source/libs/parser/test/parShowToUse.cpp +++ b/source/libs/parser/test/parShowToUse.cpp @@ -239,9 +239,9 @@ TEST_F(ParserShowToUseTest, showVgroups) { TEST_F(ParserShowToUseTest, showVnodes) { useDb("root", "test"); - run("SHOW VNODES 1"); + run("SHOW VNODES ON DNODE 1"); - run("SHOW VNODES 'node1:7030'"); + run("SHOW VNODES"); } TEST_F(ParserShowToUseTest, splitVgroup) { diff --git a/tests/script/tsim/db/basic1.sim b/tests/script/tsim/db/basic1.sim index 5d7d0bd9e9..8eb6dce759 100644 --- a/tests/script/tsim/db/basic1.sim +++ b/tests/script/tsim/db/basic1.sim @@ -107,35 +107,39 @@ if $data30 != 12 then return -1 endi -print =============== show vnodes -sql show vnodes 1 +print =============== show vnodes on dnode 1 +sql show vnodes on dnode 1 if $rows != 9 then return -1 endi -if $data(4)[1] != 1 then - return -1 +if $data10 != 1 then + return -1 endi -if $data(4)[2] != leader then - return -1 +if $data11 != 5 then + return -1 endi -if $data(4)[3] != d2 then - return -1 +if $data12 != d2 then + return -1 endi -if $data(4)[4] != 1 then - return -1 +if $data13 != leader then + return -1 endi -if $data(4)[5] != localhost:7100 then - return -1 +print $data14 +print $data15 + +if $data16 != 1 then + return -1 endi -sql show vnodes 'localhost:7100' +print ================ show vnodes +sql show vnodes if $rows != 9 then - return -1 + return -1 endi print =============== drop database diff --git a/tests/system-test/0-others/show.py b/tests/system-test/0-others/show.py index 9d26b3a2ae..4ef323db22 100644 --- a/tests/system-test/0-others/show.py +++ b/tests/system-test/0-others/show.py @@ -128,7 +128,7 @@ class TDTestCase: continue else: tdLog.exit(f"show create database check failed with {key} {value}") - tdSql.query('show vnodes 1') + tdSql.query('show vnodes on dnode 1') tdSql.checkRows(self.vgroups) tdSql.execute(f'use {self.dbname}')