diff --git a/tests/script/tsim/mnode/basic4.sim b/tests/script/tsim/mnode/basic4.sim index 41524946beaec8a49d5661c67a866599214a7d66..0ffcdd8c000dd8ec12c3db52d4d2eb76ba5d9a9b 100644 --- a/tests/script/tsim/mnode/basic4.sim +++ b/tests/script/tsim/mnode/basic4.sim @@ -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 diff --git a/tests/script/tsim/mnode/basic5.sim b/tests/script/tsim/mnode/basic5.sim index c017d7f23f509c76b55b6fe7d22681046e9386ab..f23be019f7651cfb8abcd2ce058fbef5c1b2de93 100644 --- a/tests/script/tsim/mnode/basic5.sim +++ b/tests/script/tsim/mnode/basic5.sim @@ -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 diff --git a/tests/script/tsim/parser/gendata.bat b/tests/script/tsim/parser/gendata.bat new file mode 100644 index 0000000000000000000000000000000000000000..cd6b858bf96ca58182437c2331de1c0cc7e6a4c6 --- /dev/null +++ b/tests/script/tsim/parser/gendata.bat @@ -0,0 +1,4 @@ + +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 diff --git a/tests/script/tsim/parser/import_file.sim b/tests/script/tsim/parser/import_file.sim index 0250af16b3a8883c0cd2bdb0fe303982aeefcfde..e031e0249dd5a3b9efec7b9fed2505671f645e2c 100644 --- a/tests/script/tsim/parser/import_file.sim +++ b/tests/script/tsim/parser/import_file.sim @@ -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 diff --git a/tests/system-test/test-all.bat b/tests/system-test/test-all.bat index 2af23596a325c76ee4c379d5daa7fff5e0c0e245..22b10fa01faf92cc8aeb99203126678205b65efb 100644 --- a/tests/system-test/test-all.bat +++ b/tests/system-test/test-all.bat @@ -91,4 +91,6 @@ goto :eof :CheckSkipCase set skipCase=false if "%*" == "python3 ./test.py -f 1-insert/insertWithMoreVgroup.py" ( set skipCase=true ) +if "%*" == "python3 ./test.py -f 2-query/queryQnode.py" ( set skipCase=true ) +echo %* | grep "\-R" && set skipCase=true :goto eof \ No newline at end of file diff --git a/tests/system-test/test.py b/tests/system-test/test.py index eccd12aca6b0ad7ba702b1a6fc920ee4ed2ddc20..5dc6139410bf7d53da8e8fd36e047bb81a7e5eae 100644 --- a/tests/system-test/test.py +++ b/tests/system-test/test.py @@ -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: