diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 8e0f6314e07843db1ea16d68aed1da4d931730bd..fd5aa4ecf06b16ed6faa9d020cc4c598c65ffb9e 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -183,3 +183,6 @@ python3 ./test.py -f functions/function_stddev.py python3 ./test.py -f functions/function_sum.py python3 ./test.py -f functions/function_top.py python3 ./test.py -f functions/function_twa.py + +# tools +python3 test.py -f tools/taosdemo.py diff --git a/tests/pytest/regressiontest.sh b/tests/pytest/regressiontest.sh index 20f4b4dc3b4ccea7d1e6f59555d337a0b21491ae..b69ee37a555da02e98c8227a6ea5ed81bdb58365 100755 --- a/tests/pytest/regressiontest.sh +++ b/tests/pytest/regressiontest.sh @@ -177,3 +177,6 @@ python3 ./test.py -f functions/function_stddev.py python3 ./test.py -f functions/function_sum.py python3 ./test.py -f functions/function_top.py python3 ./test.py -f functions/function_twa.py + +# tools +python3 test.py -f tools/taosdemo.py \ No newline at end of file diff --git a/tests/pytest/tools/taosdemo.py b/tests/pytest/tools/taosdemo.py new file mode 100644 index 0000000000000000000000000000000000000000..54d33c90f36bc5f5b817f7ea9ec6d8787a3f0d78 --- /dev/null +++ b/tests/pytest/tools/taosdemo.py @@ -0,0 +1,44 @@ +################################################################### +# 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 +import os +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) + + self.numberOfTables = 10000 + self.numberOfRecords = 100 + + def run(self): + tdSql.prepare() + + os.system("yes | taosdemo -t %d -n %d" % (self.numberOfTables, self.numberOfRecords)) + + tdSql.execute("use test") + tdSql.query("select count(*) from meters") + tdSql.checkData(0, 0, self.numberOfTables * self.numberOfRecords) + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase())