[TC Fixed] Exclude TC not supported by specific platform
authorj-h.choi <j-h.choi@samsung.com>
Tue, 5 Jan 2021 04:50:42 +0000 (13:50 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Thu, 7 Jan 2021 04:38:46 +0000 (13:38 +0900)
Change-Id: I845ebe415eec352e899732751e43012149ad1e26

tests/TCs/1_AOT/AOT.py
tests/TCs/2_PLUGIN/PLUGIN.py
tests/TCs/3_PRELOAD/PRELOAD.py
tests/TCs/4_TAC/TAC.py
tests/TCs/5_TLC/TLC.py
tests/TCs/6_TOOL/TOOL.py
tests/TCs/7_LAUNCH/LAUNCH.py
tests/TCs/Utils.py

index 8be7e0196f6e9df0fb8a569a6c48c8eb7cf88a7d..f2bcccf159e6d7a454b7126204718d5d51f60899 100755 (executable)
@@ -118,10 +118,14 @@ def run():
     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():
index e8cced4616fbcddfde2505245dd4afb296014395..4ffb43cd1cd0738e577388714e2efde8cc68f42f 100755 (executable)
@@ -33,6 +33,9 @@ def TC_01():
 
 # 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}")
@@ -187,6 +190,9 @@ def TC_06():
 
 # 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}")
@@ -216,6 +222,9 @@ def TC_07():
 
 # 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}")
@@ -258,10 +267,14 @@ def run():
     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():
index 611c866b2bcb9b6223cd9553276b75cb24be6a32..34fefc23567669c2723b2668af81774418041663 100755 (executable)
@@ -98,10 +98,14 @@ def run():
     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():
index ef165d23475b39df971dbcf96438d1e19cd3ca2d..287ac2112688b07a08501c4b57fcea8ba95c3472 100755 (executable)
@@ -506,10 +506,14 @@ def run():
     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():
index 2da7cf67fe0c9912b07946e0c07f8b319aaa8aa9..974ede7a02c8afc4a927fa6ec6b897c7178e7623 100755 (executable)
@@ -11,6 +11,9 @@ module_name = "TLC"
 
 # 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}")
@@ -57,6 +60,9 @@ def TC_01():
 
 # 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}")
@@ -103,6 +109,9 @@ def TC_02():
 
 # 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}")
@@ -165,6 +174,9 @@ def TC_02_03():
 
 # 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}")
@@ -211,6 +223,9 @@ def TC_04():
 
 # 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}")
@@ -287,6 +302,9 @@ def TC_04_05():
 
 # 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}")
@@ -361,6 +379,9 @@ def TC_04_05_06():
 
 # 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}")
@@ -443,6 +464,9 @@ def TC_07():
 
 # 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}")
@@ -459,7 +483,7 @@ def TC_08():
         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 \
@@ -487,6 +511,9 @@ def TC_08():
 
 # 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}")
@@ -505,7 +532,7 @@ def TC_09():
     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]
@@ -546,10 +573,14 @@ def run():
     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():
index 241464b342d613ee05d10016b446ccf2abaeda66..73a6c9b6cd5192743cd9753ebeefe89b9a0ec82e 100755 (executable)
@@ -503,10 +503,14 @@ def run():
     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():
index 062e118c7fceec4c4320a6592a690b099ff44097..a343674c531a58d04fb8987884a2a05b76f29e10 100755 (executable)
@@ -145,7 +145,7 @@ def TC_04():
     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
@@ -180,10 +180,14 @@ def run():
     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():
index e4b83900da04ddd4fc4e4bce13ff4b6fb79dfc49..f6a3572ce02ef275e37c3587356e3688592a09c6 100755 (executable)
@@ -145,26 +145,31 @@ def prepare_candidate_process(loader, pkg_id):
     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
@@ -178,10 +183,18 @@ def exist(path):
 # 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