mirror of
https://github.com/openharmony/developtools_integration_verification.git
synced 2026-07-25 06:05:30 -04:00
!231 在properties文件中写入状态码和冒烟时间
Merge pull request !231 from chengjian-com/master
This commit is contained in:
@@ -16,6 +16,7 @@ from core.run import *
|
||||
from aw.Common.Constant import CONSTANT
|
||||
from util.log_info import logger
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
param_file = sys.argv[1]
|
||||
@@ -27,5 +28,11 @@ if __name__ == "__main__":
|
||||
if errcode != 0:
|
||||
logger.printLog("执行失败:错误信息:" + CONSTANT.ENVERRMESSAGE)
|
||||
logger.printLog("UPGRADE_STATUS_%s" % errcode)
|
||||
from func.liteOsUpgrade.liteOsUpgrade_RK3568_app import total_time
|
||||
try:
|
||||
with open(param_file, "a+") as f:
|
||||
f.write("\nstatus=UPGRADE_STATUS_%s\nsmoke_duration=%s" % (errcode, total_time))
|
||||
except Exception as p:
|
||||
logger.error(p)
|
||||
os._exit(errcode)
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import re
|
||||
import shutil
|
||||
import random
|
||||
|
||||
|
||||
from core.base import BaseApp, dec_stepmsg
|
||||
from util.file_locker import FileLock
|
||||
from util.log_info import logger
|
||||
@@ -18,13 +17,14 @@ from aw.Common.Constant import CONSTANT
|
||||
from aw.Common.Common import getFileName
|
||||
from aw.ExtractFile.ExtractFile import *
|
||||
from aw.Common.Common import getHostIp, copyFile, copyDirectory
|
||||
|
||||
total_time = ""
|
||||
lock_suffix = CONSTANT.File.LOCK_SUFFIX
|
||||
suc_file = CONSTANT.File.SUC_FILE
|
||||
failed_file = CONSTANT.File.FAILED_FILE
|
||||
REBOOT_TIMEOUT = 20000000
|
||||
|
||||
|
||||
|
||||
class liteOsUpgrade_RK3568(BaseApp):
|
||||
'''
|
||||
@author: cwx1076044
|
||||
@@ -439,6 +439,7 @@ def start_cmd(sn):
|
||||
|
||||
@timeout(900)
|
||||
def cmd_test(screenshot_path, py_path, new_report_path, resource_path, sn, test_num, pr_url):
|
||||
global total_time
|
||||
save_screenshot_path = os.path.join(new_report_path, "screenshot_result")
|
||||
logger.info(save_screenshot_path)
|
||||
time_sleep = random.randint(1, 5)
|
||||
@@ -457,7 +458,11 @@ def cmd_test(screenshot_path, py_path, new_report_path, resource_path, sn, test_
|
||||
config_path = os.path.join(screenshot_path, "resource", "app_capture_screen_test_config.json")
|
||||
py_cmd = "python %s --config %s --anwser_path %s --save_path %s --device_num %s --test_num %s --tools_path %s --pr_url %s" \
|
||||
% (py_path, config_path, resource_path, save_screenshot_path, sn, test_num, screenshot_path, pr_url)
|
||||
time1 = time.time()
|
||||
result = outCmd(py_cmd, save_screenshot_path, base_screenshot_path, resource_path)
|
||||
time2 = time.time()
|
||||
total_time = int(time2 - time1)
|
||||
logger.info("total_time: %s" % total_time)
|
||||
if result == 1:
|
||||
return True
|
||||
if result == 98:
|
||||
|
||||
Reference in New Issue
Block a user