prepare.sim 2.6 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
scripts  
slguan 已提交
2
sleep 3000
S
slguan 已提交
3
system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
scripts  
slguan 已提交
5
system sh/cfg.sh -n dnode1 -c http -v 1
S
slguan 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
system sh/exec.sh -n dnode1 -s start

sleep 3000
sql connect

print ============================ dnode1 start

print ===============  step1 - prepare data
sql create database d1
sql use d1

sql create table t1 (ts timestamp, i int, b binary(100)) 

sql insert into t1 values('2017-12-25 21:28:41.022', 1, 11)
sql insert into t1 values('2017-12-25 21:28:42.022', 2, '22')
sql insert into t1 values('2017-12-25 21:28:43.022', 3, "33")
sql insert into t1 values('2017-12-25 21:28:44.022', 4, '44"')
sql insert into t1 values('2017-12-25 21:28:45.022', 5, "55'")
sql insert into t1 values('2017-12-25 21:28:46.022', 6, "66'6'")
sql insert into t1 values('2017-12-25 21:28:47.022', 7, '77"7"')
sql insert into t1 values('2017-12-25 21:28:48.022', 8, '88""88')
sql insert into t1 values('2017-12-25 21:28:49.022', 9, '99\99')
sql insert into t1 values('2017-12-25 21:28:51.022', 11, '11\\11')
sql insert into t1 values('2017-12-25 21:28:52.022', 12, '22\\11')
sql insert into t1 values('2017-12-25 21:28:53.022', 13, '33\\"33')
sql insert into t1 values('2017-12-25 21:28:54.022', 14, '44\\""44')

sleep 4000

print ===============  step2 - login

S
Shengliang Guan 已提交
37 38
system_content curl 127.0.0.1:6041/rest/login/root/taosdata
print curl 127.0.0.1:6041/rest/login/root/taosdata -----> $system_content
S
slguan 已提交
39 40 41 42 43 44 45 46 47

if $system_content != @{"status":"succ","code":0,"desc":"/KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04"}@ then
  return -1
endi

return

print ===============  step3 - query data

S
Shengliang Guan 已提交
48 49
system_content curl -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJ3d3cudGFvc2RhdGEuY29tIiwia2V5IjoiYkVsOExjdkxVZDdhOHFkdE5abXRPTnJ5cDIwMW1hMDQiLCJzdWIiOiJyb290In0.k7CkgmpOJImIkLqZqzASlPmkdeEw7Wfk4XUrqGZX-LQ' -d 'select * from t1' 127.0.0.1:6041/rest/sql/d1
print curl 127.0.0.1:6041/rest/sql/d1 -----> $system_content
S
slguan 已提交
50 51 52
if $system_content != @{"status":"succ","head":["ts","i","b"],"data":[["2017-12-25 21:28:54.022",14,"44\\\\\"\"44"],["2017-12-25 21:28:53.022",13,"33\\\\\"33"],["2017-12-25 21:28:52.022",12,"22\\\\11"],["2017-12-25 21:28:51.022",11,"11\\\\11"],["2017-12-25 21:28:49.022",9,"99\\99"],["2017-12-25 21:28:48.022",8,"88\"\"88"],["2017-12-25 21:28:47.022",7,"77\"7\""],["2017-12-25 21:28:46.022",6,"66'6'"],["2017-12-25 21:28:45.022",5,"55'"],["2017-12-25 21:28:44.022",4,"44\""],["2017-12-25 21:28:43.022",3,"33"],["2017-12-25 21:28:42.022",2,"22"],["2017-12-25 21:28:41.022",1,"11"]],"rows":13}@ then
  return -1
endi
S
scripts  
slguan 已提交
53 54

system sh/exec.sh -n dnode1 -s stop -x SIGINT