提交 ca102bdc 编写于 作者: wafwerar's avatar wafwerar

test: fix mnode leader follower order error

上级 4bf6eac5
......@@ -63,10 +63,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step3
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] != follower then
if $leaderNum == 0 then
goto step3
endi
if $data(3)[2] != offline then
......@@ -97,10 +101,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step4
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] != follower then
if $leaderNum == 0 then
goto step4
endi
if $data(3)[2] != follower then
......@@ -132,10 +140,14 @@ print $data[0][0] $data[0][1] $data[0][2] $data[0][3] $data[0][4]
print $data[1][0] $data[1][1] $data[1][2] $data[1][3] $data[1][4]
print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $data(1)[2] != leader then
goto step5
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] != follower then
if $leaderNum == 0 then
goto step5
endi
if $data(3)[2] != offline then
......@@ -169,10 +181,14 @@ print $data[2][0] $data[2][1] $data[2][2] $data[2][3] $data[2][4]
if $rows != 2 then
goto step6
endi
if $data(1)[2] != leader then
goto step6
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] != follower then
if $leaderNum == 0 then
goto step6
endi
if $data(3)[2] != null then
......
......@@ -68,13 +68,17 @@ step31:
return -1
endi
sql show mnodes
if $data(1)[2] != leader then
goto step31
$leaderNum = 0
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(2)[2] != follower then
goto step31
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] != follower then
if $data(3)[2] == leader then
$leaderNum = 1
endi
if $leaderNum == 0 then
goto step31
endi
......@@ -302,10 +306,10 @@ print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
$leaderNum = 0
if $data(2)[2] == leader then
if $data(1)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
if $data(2)[2] == leader then
$leaderNum = 1
endi
if $data(3)[2] == leader then
......
echo '2020-1-1 1:1:1','abc','device',123,'9876', 'abc', 'net', 'mno', 'province', 'city', 'al' > C:\\Windows\\Temp\\data.sql
echo '2020-1-2 1:1:1','abc','device',123,'9876', 'abc', 'net', 'mno', 'province', 'city', 'al' >> C:\\Windows\\Temp\\data.sql
echo '2020-1-3 1:1:1','abc','device',123,'9876', 'abc', 'net', 'mno', 'province', 'city', 'al' >> C:\\Windows\\Temp\\data.sql
......@@ -7,8 +7,11 @@ sql drop database if exists indb
sql create database if not exists indb
sql use indb
$inFileName = '/tmp/data.csv'
$numOfRows = 10000
$inFileName = '/tmp/data.sql'
system_content printf %OS%
if $system_content == Windows_NT then
$inFileName = 'C:\\Windows\\Temp\\data.sql'
endi
system tsim/parser/gendata.sh
sql create table stbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16), imsi BINARY(16), imei BINARY(16), mdn BINARY(10), net_type BINARY(4), mno NCHAR(4), province NCHAR(10), city NCHAR(16), alarm BINARY(2)) tags(a int, b binary(12));
......@@ -16,8 +19,8 @@ sql create table stbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16
sql create table tbx (ts TIMESTAMP, collect_area NCHAR(12), device_id BINARY(16), imsi BINARY(16), imei BINARY(16), mdn BINARY(10), net_type BINARY(4), mno NCHAR(4), province NCHAR(10), city NCHAR(16), alarm BINARY(2))
print ====== create tables success, starting insert data
sql insert into tbx file '/tmp/data.sql'
sql import into tbx file '/tmp/data.sql'
sql insert into tbx file $inFileName
sql import into tbx file $inFileName
sql select count(*) from tbx
if $rows != 1 then
......@@ -31,8 +34,8 @@ endi
sql drop table tbx;
sql insert into tbx using stbx tags(1,'abc') file '/tmp/data.sql';
sql insert into tbx using stbx tags(1,'abc') file '/tmp/data.sql';
sql insert into tbx using stbx tags(1,'abc') file $inFileName ;
sql insert into tbx using stbx tags(1,'abc') file $inFileName ;
sql select count(*) from tbx
if $rows != 1 then
......@@ -44,7 +47,7 @@ if $data00 != 3 then
endi
sql drop table tbx;
sql insert into tbx using stbx(b) tags('abcf') file '/tmp/data.sql';
sql insert into tbx using stbx(b) tags('abcf') file $inFileName ;
sql select ts,a,b from tbx;
if $rows != 3 then
......@@ -64,6 +67,6 @@ if $data02 != @abcf@ then
return -1
endi
system rm -f /tmp/data.sql
system rm -f $inFileName
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -91,4 +91,5 @@ goto :eof
:CheckSkipCase
set skipCase=false
if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=true )
echo %* | grep "\-R" && set skipCase=true
:goto eof
\ No newline at end of file
......@@ -328,7 +328,7 @@ if __name__ == "__main__":
conn = taos.connect(host,config=tdDnodes.getSimCfgPath())
else:
conn = taosrest.connect(url=f"http://{host}:6041")
tdLog.info(tdDnodes.getSimCfgPath(),host)
# tdLog.info(tdDnodes.getSimCfgPath(),host)
if createDnodeNums == 1:
createDnodeNums=dnodeNums
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册