From f799232f2574aeeb1f61697bc1070e8b9303a09a Mon Sep 17 00:00:00 2001 From: changshuaiqiang Date: Mon, 11 May 2020 16:54:50 +0800 Subject: [PATCH] test: add user/authority --- tests/script/general/user/authority.sim | 72 +++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/script/general/user/authority.sim diff --git a/tests/script/general/user/authority.sim b/tests/script/general/user/authority.sim new file mode 100644 index 0000000000..06f0467626 --- /dev/null +++ b/tests/script/general/user/authority.sim @@ -0,0 +1,72 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start +sql connect +sleep 3000 + +print ============= step1 +sql create user read pass 'taosdata' +sql create user write pass 'taosdata' +sql show users +if $rows != 5 then + return -1 +endi + +print ============= step2 +sql close +sql connect read +sleep 2000 + +sql create database dread +sql show databases +if $rows != 1 then + return -1 +endi + +print ============= step3 +sql close +sql connect write +sleep 2000 + +sql create database dwrite +sql show databases +if $rows != 1 then + return -1 +endi + +print ============ step4 +sql close +sql connect +sleep 2000 + +sql show databases +if $row != 2 then + return -1 +endi + +print ============ step5 +sql close +sql connect read +sleep 2000 + +sql drop database dread +sql drop database dwrite -x step51 + +step51: + +sql close +sql connect +sql show databases +if $rows != 1 then + return -1 +endi + +sql close +sql connect +sleep 2000 +sql drop database d1 +sql drop database d2 +sql drop database d3 +sql drop database d4 + +system sh/exec_up.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file