def init_env(currentTime=1,repeatTime=1): ''' Run preset test cases. Lead data(SU.update()). You must update the data(SU.update()),before you run the preset test case. Because some preset case will use data which in data(SU.update()). ''' init_logging_file(current_number,global_number,TEST_ENV_DIR) #clear the last crash dir clear_crash() if not init_acessibility_socket(): return if not is_in_reboot_status(): init_settings()
import os import sys from performance import html from logging_wrapper import init_logging_file import settings.update as SU l = len("performance_report.py") TEST_ENV_DIR = sys.argv[0][0:-l] TEST_DATE_PATH = "" TEST_REPORT_PATH = "" print sys.argv if len(sys.argv) >= 3: TEST_DATE_PATH = sys.argv[1]#get test_main.py file location TEST_REPORT_PATH = sys.argv[2]#get the report result else: print >> sys.stderr, "You should give me a path of the KPI data and the path of the report" exit(1) os.chdir(TEST_ENV_DIR) SU.update() init_logging_file(test_env_xxx=TEST_ENV_DIR) print html(TEST_DATE_PATH,TEST_REPORT_PATH) exit(0)