Lines Matching refs:GP
17 # 1. 修改 GP 中字段
47 class GP(object):
245 if not os.path.exists(os.path.join(GP.local_path, file)):
260 '--title=HDC Test Report 'f"{GP.get_version()}",
270 print(f"Test over, the script version is {GP.get_version()},"
272 f"=======>The device hdcd ROM size is {GP.hdcd_rom}.\n"
293 return os.path.join(GP.local_path, path)
297 return f"{GP.remote_path}/{path}"
309 cmd = f"{GP.hdc_head} {cmd}"
326 cmd = f"{GP.hdc_head} {cmd}"
340 cmd = f"{GP.hdc_head} shell md5sum {remote}/*"
342 cmd = f'{GP.hdc_head} shell find {remote} -type f -exec md5sum {{}} \;'
368 elif GP.remote_path in remote:
369 file_name = file_name.split(GP.remote_dir_path)[1].replace("/", "\\")
372 file_path = os.path.join(os.getcwd(), GP.local_path) + file_name # 构建完整的文件路径
407 cmd = f"{GP.hdc_head} list targets"
408 print(GP.device_name)
409 return check_shell(cmd, GP.device_name)
413 local_path = os.path.join(GP.local_path, local)
414 remote_path = f"{GP.remote_path}/{remote}"
420 local_path = os.path.join(GP.local_path, local)
421 remote_path = f"{GP.remote_path}/{remote}"
427 app = os.path.join(GP.local_path, app)
444 app = os.path.join(GP.local_path, app)
519 GP.hdc_head = f"{GP.hdc_exe} -t {GP.device_name}"
534 if not GP.remote_ip: # skip tcp check
537 if GP.remote_ip == "auto":
542 GP.remote_ip = ipconf.split(":")[1].split()[0]
543 print(f"fetch remote ip: {GP.remote_ip}")
544 ret = check_hdc_cmd(f"tmode port {GP.remote_port}")
547 res = check_hdc_cmd(f"tconn {GP.remote_ip}:{GP.remote_port}", "Connect OK")
549 GP.hdc_head = f"{GP.hdc_exe} -t {GP.remote_ip}:{GP.remote_port}"
592 gen_file(os.path.join(GP.local_path, "empty"), 0)
595 gen_file(os.path.join(GP.local_path, "small"), 102400)
598 gen_file(os.path.join(GP.local_path, "medium"), 200 * 1024 ** 2)
601 gen_file(os.path.join(GP.local_path, "large"), 2 * 1024 ** 3)
605 os.symlink("small", os.path.join(GP.local_path, "soft_small"))
610 gen_zero_file(os.path.join(GP.local_path, "word_100M.txt"), 100 * 1024 ** 2)
613 if not os.path.exists(os.path.join(GP.local_path, "package")):
614 os.mkdir(os.path.join(GP.local_path, "package"))
616 gen_file(os.path.join(GP.local_path, "package", f"fake.hap.{i}"), 20 * 1024 ** 2)
620 deep_path = os.path.join(GP.local_path, "deep_dir")
630 dir_path = os.path.join(GP.local_path, "problem_dir")
646 dir_path = os.path.join(GP.local_path, "empty_dir")
651 gen_file(os.path.join(GP.local_path, GP.get_version()), 0)
656 dir_path = os.path.join(GP.local_path, "app_dir")
659 app = os.path.join(GP.local_path, "entry-default-signed-debug.hap")
660 dst_dir = os.path.join(GP.local_path, "app_dir")
668 if os.path.exists(os.path.join(GP.local_path, GP.get_version())):
669 print(f"hdc test version is {GP.get_version}, check ok, skip prepare.")
671 print(f"in prepare {GP.local_path},wait for 2 mins.")
674 if os.path.exists(GP.local_path):
676 for file in os.listdir(GP.local_path):
679 file_path = os.path.join(GP.local_path, file)
682 os.mkdir(GP.local_path)
688 deep_path = os.path.join(GP.local_path, "deep_test_dir")
698 recv_dir = os.path.join(GP.local_path, "recv_test_dir")
704 deep_path = os.path.join(GP.local_path, "deep_test_dir")
715 recv_dir = os.path.join(GP.local_path, "recv_test_dir")
723 GP.print_options()
728 if not GP.set_options():
730 GP.dump()
734 if not GP.load_testcase():
743 if not GP.load_testcase:
815 test_cmd = f"{GP.hdc_head} {result}"
828 file_list = [f"{GP.hdc_head} file send {local} {remote}_{i}" for i in range(num)]
830 file_list = [f"{GP.hdc_head} file recv {remote}_{i} {local}_{i}" for i in range(num)]
835 file_list = [f"{GP.hdc_head} file send {local} {remote}" for _ in range(num)]
837 file_list = [f"{GP.hdc_head} file recv {remote} {local}" for _ in range(num)]
886 test_cmd = f"{GP.hdc_head} {cmd}"
894 cmd_list = [f"{GP.hdc_head} {cmd}" for _ in range(num)]
919 cmd = f"{GP.hdc_head} -v"
945 subprocess.check_output(f"{GP.hdc_head} {cmd}".split())
956 print(f"{GP.hdc_head} {cmd}耗时最大值:{max_value}")
957 print(f"{GP.hdc_head} {cmd}耗时最小值:{min_value}")
958 print(f"{GP.hdc_head} {cmd}耗时中位数:{median_value}")
964 print(f"{GP.hdc_head} {cmd}耗时平均值 {timecost}")
987 cmd_hdcd = f"{GP.hdc_head} shell du system/bin/hdcd"
990 cmd_libhdc = f"{GP.hdc_head} shell du system/lib/libhdc.dylib.so"
993 cmd_libhdc64 = f"{GP.hdc_head} shell du system/lib64/libhdc.dylib.so"
1002 GP.hdcd_rom = all_size
1004 GP.hdcd_rom = "error"
1007 GP.hdcd_rom = f"{all_size} KB"