Update test_passwd.py

This commit is contained in:
Feng Chao 2024-11-06 11:35:42 +08:00 committed by GitHub
parent e5098f82fa
commit aaddf18e00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -28,16 +28,18 @@ class TDTestCase(TBase):
p = subprocess.Popen(f"cd {apiPath} && make", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if 0 != p.returncode:
tdLog.exit(f"Test script passwdTest.c make failed with error: {err}")
tdLog.info(f"Test script passwdTest.c make failed with error: {err}")
test_file_cmd = os.sep.join([apiPath, "passwdTest localhost"])
else:
tdLog.exit("passwdTest.c not found")
try:
p = subprocess.Popen(test_file_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if 0 != p.returncode:
tdLog.exit("Failed to run passwd test with output: %s \n error: %s" % (out, err))
tdLog.success(f"{__file__} successfully executed")
except Exception as e:
tdLog.exit(f"Failed to execute {__file__} with error: {e}")
tdCases.addLinux(__file__, TDTestCase())
tdCases.addWindows(__file__, TDTestCase())