diff --git a/tests/pytest/functions/variable_httpDbNameMandatory.py b/tests/pytest/functions/variable_httpDbNameMandatory.py index 1cd2516ec9303f2f038bc22a69afcd01bce3a930..09f141ce7aef6de5baa17f0692d094e0e910acd0 100644 --- a/tests/pytest/functions/variable_httpDbNameMandatory.py +++ b/tests/pytest/functions/variable_httpDbNameMandatory.py @@ -130,7 +130,13 @@ 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 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']))