diff --git a/tests/pytest/client/client.py b/tests/pytest/client/client.py new file mode 100644 index 0000000000000000000000000000000000000000..21df7e6a86b83287a9a6d740c8b7a9dbe260b597 --- /dev/null +++ b/tests/pytest/client/client.py @@ -0,0 +1,49 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + + ret = tdSql.query('select database()') + tdSql.checkData(0, 0, "db") + + ret = tdSql.query('select server_version()') + tdSql.checkData(0, 0, "2.0.0.0") + + ret = tdSql.query('select client_version()') + tdSql.checkData(0, 0, "2.0.0.0") + + ret = tdSql.query('select server_status()') + tdSql.checkData(0, 0, 1) + + ret = tdSql.query('select server_status() as result') + tdSql.checkData(0, 0, 1) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index c042c457a12dbead2ae0edf24465796dce3f1aa4..066dda5d979bbdb971a5bacaec929a6b3724f0a4 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -1,6 +1,7 @@ #!/bin/bash ulimit -c unlimited +python3 ./test.py -f client/client.py python3 ./test.py -f insert/basic.py python3 ./test.py -f insert/int.py python3 ./test.py -f insert/float.py @@ -149,4 +150,4 @@ python3 ./test.py -f stream/stream1.py python3 ./test.py -f stream/stream2.py #alter table -python3 ./test.py -f alter/alter_table_crash.py \ No newline at end of file +python3 ./test.py -f alter/alter_table_crash.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index 955d6aa2ef0e8f60c6b3960817fc5e45acab8a62..0c248f338701d5e49d935b55713ca13dee7a89b2 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -1,6 +1,7 @@ #!/bin/bash ulimit -c unlimited +python3 ./test.py -f client/client.py python3 ./test.py -f insert/basic.py python3 ./test.py -f insert/int.py python3 ./test.py -f insert/float.py diff --git a/tests/pytest/smoketest.sh b/tests/pytest/smoketest.sh index 1c51da397e6301d1d43eb558f2483f60735eac2c..c56a4726ddc0160552928a3fda9c1047c05388c4 100755 --- a/tests/pytest/smoketest.sh +++ b/tests/pytest/smoketest.sh @@ -1,6 +1,10 @@ #!/bin/bash ulimit -c unlimited +# client +python3 ./test.py $1 -f client/client.py +python3 ./test.py $1 -s && sleep 1 + # insert python3 ./test.py $1 -f insert/basic.py python3 ./test.py $1 -s && sleep 1 diff --git a/tests/pytest/valgrind-test.sh b/tests/pytest/valgrind-test.sh index bf42cd59cdca417c6bce0bf27840b74d3e06a64a..9dc9de1b152e5bf6611a2b9353a9879119ffcf04 100755 --- a/tests/pytest/valgrind-test.sh +++ b/tests/pytest/valgrind-test.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# client +PYTHONMALLOC=malloc python3 ./test.py -g -f client/client.py +PYTHONMALLOC=malloc python3 ./test.py -g -s && sleep 1 + # insert PYTHONMALLOC=malloc python3 ./test.py -g -f insert/basic.py PYTHONMALLOC=malloc python3 ./test.py -g -s && sleep 1