global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
# The `Launcher_TC_PLUGIN_02` application must have a library of Tizen OS.
def TC_02():
+ if not check_tc_support():
+ return "NONE - TC_02 is not supported on this platform"
+
sln_name = "Launcher_TC_PLUGIN_02.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_PLUGIN_07` application must not have TLC applied.
def TC_07():
+ if not check_tc_support():
+ return "NONE - TC_07 is not supported on this platform"
+
sln_name = "Launcher_TC_PLUGIN_07.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_PLUGIN_08` application must have TLC applied.
def TC_08():
+ if not check_tc_support():
+ return "NONE - TC_08 is not supported on this platform"
+
sln_name = "Launcher_TC_PLUGIN_08.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
# The `Launcher_TC_TLC_01` application must have TLC applied.
def TC_01():
+ if not check_tc_support():
+ return "NONE - TC_01 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_01.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_TLC_02` application must have TLC applied.
def TC_02():
+ if not check_tc_support():
+ return "NONE - TC_02 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_02.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_TLC_03` application should not apply TLC when updating.
def TC_03():
+ if not check_tc_support():
+ return "NONE - TC_03 is not supported on this platform"
+
pkg_id = f"org.tizen.example.Launcher_TC_TLC_00.Tizen"
root_path = get_root_path(f"{pkg_id}")
# The `Launcher_TC_TLC_04` application is normally TLC applied when updating.
def TC_04():
+ if not check_tc_support():
+ return "NONE - TC_04 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_04.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_TLC_05` application is normally TLC applied when updating.
def TC_05():
+ if not check_tc_support():
+ return "NONE - TC_05 is not supported on this platform"
+
pkg_id = f"org.tizen.example.Launcher_TC_TLC_00.Tizen"
root_path = get_root_path(f"{pkg_id}")
# The `Launcher_TC_TLC_06` application should not apply TLC when updating.
def TC_06():
+ if not check_tc_support():
+ return "NONE - TC_06 is not supported on this platform"
+
pkg_id = f"org.tizen.example.Launcher_TC_TLC_00.Tizen"
root_path = get_root_path(f"{pkg_id}")
# The `Launcher_TC_TLC_07`, `Launcher_TC_TLC_08` applications using the same nuget are normally TLC applied.
def TC_07():
+ if not check_tc_support():
+ return "NONE - TC_07 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_07.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
# The `Launcher_TC_TLC_09` application is normally TLC applied when uninstall.
def TC_08():
+ if not check_tc_support():
+ return "NONE - TC_08 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_09.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
return f"FAIL : Get the root path for {pkg_id}"
if not exist(f"{root_path}/bin/libSkiaSharp.so"):
- return "FAIL : The libSkiaSharp.so library should exist"
+ return "FAIL : The libSkiaSharp.so library should exist in the application"
raw = cmd(f"shell ls -alZ {root_path}/bin/libSkiaSharp.so")
if (f"{root_path}/bin/libSkiaSharp.so" not in raw) or \
# The `Launcher_TC_TLC_10` application should match the information of nuget with the value of TLC database.
def TC_09():
+ if not check_tc_support():
+ return "NONE - TC_09 is not supported on this platform"
+
sln_name = "Launcher_TC_TLC_10.Tizen"
tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
raw = cmd(f"shell find {root_path}/bin/ -name lib*.so*")
lines1 = [l for l in raw.splitlines()]
if len(lines1) == 0:
- return "FAIL : The library should exist in the application"
+ return "FAIL : The libraries should exist in the application"
raw = subprocess.run((f"sdb -s {serial} shell sqlite3 {DOTNET_DIR}.TLC.App.list.db").split(), stdout=subprocess.PIPE, input=f"select * from TLC;\n.q\n", encoding="utf-8").stdout
lines2 = [l for l in raw.splitlines() if f"{pkg_id}" in l]
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
cmd(f"shell chmod 644 /usr/share/aul/dotnet.loader")
cmd(f"shell reboot -f")
- sleep(30)
+ sleep(60)
if "." in serial:
subprocess.run((f"sdb connect {serial}").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
global tpk_list
tpk_list = search_tpk(f"{module_name}")
- p = run_tc_array(module_name, tc_array)
- f = len(tc_array) - p
- r = round(((p / len(tc_array)) * 100), 2)
- print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
+ pn = run_tc_array(module_name, tc_array)
+ p = int(pn.split(":")[0])
+ n = int(pn.split(":")[1])
+ r = 0.0
+ f = len(tc_array) - p - n
+ if (len(tc_array) - n) != 0:
+ r = round(((p / (len(tc_array) - n)) * 100), 2)
+ print(f"--- {module_name} TCT Result ---\nNONE : [{n}] / FAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
# Uninstall the application and restore to original state
def clean():
pid = raw.split()[1]
return f"OK : {pid}"
+# Get the device arch
+def get_device_arch():
+ raw = cmd("capability")
+ line = [l for l in raw.splitlines() if "cpu_arch" in l]
+ return line[0].split(":")[1]
+
# Check the library type
def check_library_arch(rootpath, library):
raw = cmd(f"pull {rootpath}/bin/{library} {library}")
if "1 file(s) pulled. 0 file(s) skipped." not in raw:
return "FAIL"
- raw = cmd("capability")
- line = [l for l in raw.splitlines() if "cpu_arch" in l]
- target_arch = line[0].split(":")[1]
raw = subprocess.run((f"file ./{library}").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
- if "armv7" == target_arch:
+ subprocess.run((f"rm ./{library}").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
+
+ device_arch = get_device_arch()
+ if "armv7" == device_arch:
if "ARM" not in raw:
return "FAIL"
- elif "x86" == target_arch:
+ elif "x86" == device_arch:
if "Intel 80386" not in raw:
return "FAIL"
else:
return "FAIL"
- subprocess.run((f"rm ./{library}").split(), encoding="utf-8", stdout=subprocess.PIPE).stdout
return "OK"
# Check if the file or directory exists
# Run the test array
def run_tc_array(module_name, tc_array):
p = 0
+ n = 0
for tc in tc_array:
print(f">{module_name}_{tc.__name__}...", end="\r")
ret = tc()
print(f">{module_name}_{tc.__name__} : {ret}")
if "PASS" == ret: p += 1
+ if "NONE" in ret: n += 1
sleep(3)
- return p
+ return str(p) + ":" + str(n)
+
+def check_tc_support():
+ if "armv8" == get_device_arch():
+ return False
+ else:
+ return True