showOfflineThresholdIs864000.py 1.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
###################################################################
#           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
A
AlexDuan 已提交
15 16
import numpy as np

17 18 19 20 21 22 23 24 25 26 27 28
from util.log import *
from util.cases import *
from util.sql import *
from util.dnodes import *


class TDTestCase:
    def init(self, conn, logSql):
        tdLog.debug(f"start to execute {__file__}")
        tdSql.init(conn.cursor(), logSql)

    def run(self):
A
AlexDuan 已提交
29 30 31 32 33 34 35
        # tdSql.query("show variables")
        # tdSql.checkData(54, 1, 864000)
        tdSql.execute("show variables")
        res = tdSql.cursor.fetchall()
        resList = np.array(res)
        index = np.where(resList == "offlineThreshold")
        index_value = np.dstack((index[0])).squeeze()
36
        tdSql.query("show variables")
A
AlexDuan 已提交
37 38 39
        tdSql.checkData(index_value, 1, 864000)
        pass

40 41 42 43 44 45 46

    def stop(self):
        tdSql.close()
        tdLog.success(f"{__file__} successfully executed")


tdCases.addWindows(__file__, TDTestCase())
47
tdCases.addLinux(__file__, TDTestCase())