diff --git a/DeployDevice/src/func/liteOsUpgrade/liteOsUpgrade_RK3568_app.py b/DeployDevice/src/func/liteOsUpgrade/liteOsUpgrade_RK3568_app.py index a024f15f..21a4ca91 100644 --- a/DeployDevice/src/func/liteOsUpgrade/liteOsUpgrade_RK3568_app.py +++ b/DeployDevice/src/func/liteOsUpgrade/liteOsUpgrade_RK3568_app.py @@ -7,6 +7,7 @@ import time import re import shutil import random +import platform from core.base import BaseApp, dec_stepmsg from util.file_locker import FileLock @@ -89,7 +90,9 @@ class liteOsUpgrade_RK3568(BaseApp): # @return: True or Flase #=================================================================================== ''' - global local_image_path, loader_tool_path, sn, LocationID ,test_num + global local_image_path, loader_tool_path, sn, LocationID ,test_num, system_type + system_type = platform.system() + logger.printLog("******系统为:%s ******" % system_type) version_savepath = self.params_dict.get("img_path") upgrade_test_type = self.params_dict.get("UpgradeTestType") sn = self.params_dict.get("sn") @@ -98,14 +101,20 @@ class liteOsUpgrade_RK3568(BaseApp): pr_url = self.params_dict.get("pr_url") logFilePath = self.logFilePath logger.info(logFilePath) - r = logFilePath.rfind("\\") + if system_type == "Windows": + r = logFilePath.rfind("\\") + else: + r = logFilePath.rfind("/") report_path = logFilePath[:r] logger.info(report_path) scriptpath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))) logger.info(scriptpath) local_image_path = os.path.join(version_savepath) logger.info(local_image_path) - loader_tool_path = os.path.join(scriptpath, "resource", "RK3568_tool", "upgrade_tool.exe") + if system_type == "Windows": + loader_tool_path = os.path.join(scriptpath, "resource", "RK3568_tool", "upgrade_tool.exe") + else: + loader_tool_path = os.path.join(scriptpath, "resource", "RK3568_tool", "upgrade_tool") logger.info(loader_tool_path) mini_path = os.path.join(local_image_path, "mini_system_test", "L2_mini_system_test.py") archive_path = os.path.join(version_savepath) diff --git a/DeployDevice/src/util/time_info.py b/DeployDevice/src/util/time_info.py index e3ce9327..dd6f5fc3 100644 --- a/DeployDevice/src/util/time_info.py +++ b/DeployDevice/src/util/time_info.py @@ -14,6 +14,7 @@ import datetime import sys import threading import time +import platform from util.log_info import logger thead = [] @@ -97,7 +98,11 @@ def timeout(seconds = 300): thd.setDaemon(True) thd.start() thd.join(seconds) - alive = thd.isAlive() + system_type = platform.system() + if system_type == "Windows": + alive = thd.isAlive() + else: + alive = thd.is_Alive() thd.kill() if alive: raise Timeout(u"function run too long, timeout %d seconds." % seconds)