From 0abddd790e8d3328facb7ea5d6c33066d99da8fe Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 26 Jan 2022 14:53:48 +0800 Subject: [PATCH] [TD-13276]fix case error when using taosadapter --- .../pytest/functions/variable_httpDbNameMandatory.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/pytest/functions/variable_httpDbNameMandatory.py b/tests/pytest/functions/variable_httpDbNameMandatory.py index 1cd2516ec9..40415f4d9b 100644 --- a/tests/pytest/functions/variable_httpDbNameMandatory.py +++ b/tests/pytest/functions/variable_httpDbNameMandatory.py @@ -130,10 +130,17 @@ class TDTestCase: if 'httpDbNameMandatory' not in rj: tdLog.info('has no httpDbNameMandatory shown') tdLog.exit(1) - if rj['httpDbNameMandatory'] != '1': + val = None + pname = 'taosadapter' #httpDbNameMandatory doesn't work in taosadapter + cmd = 'ps -ef|grep %s|grep -v "grep"' % pname + p = subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE) + if p.wait() == 0: + val = p.stdout.read() + if rj['httpDbNameMandatory'] != '1' and pname not in str(val): tdLog.info('httpDbNameMandatory data:%s == expect:0'%rj['httpDbNameMandatory']) tdLog.exit(1) - tdLog.info("httpDbNameMandatory by restful query data:%s == expect:1" % (rj['httpDbNameMandatory'])) + if pname not in str(val): + tdLog.info("httpDbNameMandatory by restful query data:%s == expect:1" % (rj['httpDbNameMandatory'])) def run(self): -- GitLab