[TC Fixed] Change the 'find' command
[platform/core/dotnet/launcher.git] / tests / TCs / 5_TLC / TLC.py
index 5736742..2da7cf6 100755 (executable)
@@ -26,6 +26,9 @@ def TC_01():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -69,6 +72,9 @@ def TC_02():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -103,6 +109,9 @@ def TC_03():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -127,8 +136,7 @@ def TC_03():
     if sha in raw:
         return f"FAIL : The libSkiaSharp.so library should not exist in {DOTNET_DIR}"
 
-    raw = cmd(f"shell find {root_path}/bin/ -name libSkiaSharp.so")
-    if f"{root_path}/bin/libSkiaSharp.so" in raw:
+    if exist(f"{root_path}/bin/libSkiaSharp.so"):
         return "FAIL : The libSkiaSharp.so library should not exist in the application"
 
     pid = launch_and_get_pid(f"-e", f"{pkg_id}")
@@ -172,6 +180,9 @@ def TC_04():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -206,6 +217,9 @@ def TC_05():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -230,6 +244,9 @@ def TC_05():
     if sha in raw:
         return f"FAIL : The libSkiaSharp.so library should not exist in {DOTNET_DIR}"
 
+    if not exist(f"{root_path}/bin/libSkiaSharp.so"):
+        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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -276,6 +293,9 @@ def TC_06():
     if root_path == "None":
         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 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 \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):
@@ -300,9 +320,10 @@ def TC_06():
     if sha in raw:
         return f"FAIL : The libSkiaSharp.so library should not exist in {DOTNET_DIR}"
 
+    if not exist(f"{root_path}/bin/libSkiaSharp.so"):
+        return "FAIL : The libSkiaSharp.so library should exist only in the application"
+
     raw = cmd(f"shell ls -alZ {root_path}/bin/libSkiaSharp.so")
-    if f"{root_path}/bin/libSkiaSharp.so" not in raw:
-        return "FAIL : The libSkiaSharp.so library should exist only"
     if "->" in raw:
         return "FAIL : The libSkiaSharp.so library should not be a symbolic link"
 
@@ -355,6 +376,9 @@ def TC_07():
     if root_path == "None":
         return f"FAIL : Get the root path for {pkg_id1}"
 
+    if not exist(f"{root_path}/bin/libHarfBuzzSharp.so"):
+        return "FAIL : The libHarfBuzzSharp.so library should exist in the application"
+
     raw = cmd(f"shell ls -alZ {root_path}/bin/libHarfBuzzSharp.so")
     if (f"{root_path}/bin/libHarfBuzzSharp.so" not in raw) or \
        (f"{DOTNET_DIR}Libraries/libHarfBuzzSharp.so.." not in raw):
@@ -381,10 +405,14 @@ def TC_07():
     if root_path == "None":
         return f"FAIL : Get the root path for {pkg_id2}"
 
-    raw = cmd(f"shell ls -alZ {root_path}/bin/libHarfBuzzSharp.so")
-    if f"{root_path}/bin/libHarfBuzzSharp.so" not in raw:
+    if not exist(f"{root_path}/bin/libHarfBuzzSharp.so"):
         return "FAIL : The libHarfBuzzSharp.so library should exist"
 
+    raw = cmd(f"shell ls -alZ {root_path}/bin/libHarfBuzzSharp.so")
+    if (f"{root_path}/bin/libHarfBuzzSharp.so" not in raw) or \
+       (f"{DOTNET_DIR}Libraries/libHarfBuzzSharp.so.." not in raw):
+        return "FAIL : The libHarfBuzzSharp.so library should exist or be a symbolic link"
+
     if "OK" not in check_library_arch(f"{root_path}", "libHarfBuzzSharp.so"):
         return "FAIL : The arch of the target and the arch of the library must match"
 
@@ -430,6 +458,9 @@ def TC_08():
     if root_path == "None":
         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"
+
     raw = cmd(f"shell ls -alZ {root_path}/bin/libSkiaSharp.so")
     if (f"{root_path}/bin/libSkiaSharp.so" not in raw) or \
        (f"{DOTNET_DIR}Libraries/libSkiaSharp.so.." not in raw):