[TC Added] dotnettool option(--inputbubble, --print-cmd) test in TOOL
authorj-h.choi <j-h.choi@samsung.com>
Mon, 17 Jan 2022 06:38:49 +0000 (15:38 +0900)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Mon, 24 Jan 2022 02:07:51 +0000 (11:07 +0900)
Change-Id: I2e5b9ac79bae205b5fd430677d4c42b021d61a25

tests/TCs/6_TOOL/README.md
tests/TCs/6_TOOL/TOOL.py

index ac1d6d0..cd5664c 100644 (file)
@@ -121,12 +121,22 @@ launcher/tests/TCs/6_TOOL$ ./TOOL.py TC_01
 ```
  1. Regenerated NI files of read-only application is stored at "/opt/usr/dotnet/apps/[PkgID]/bin/.native_image/".
  2. The assembly in the "/opt/usr/dotnet/apps/[PkgId]/bin/.native/image/" should be loaded when running the application.
-----
 * TC_19
 ```
   PASS : The `Launcher_TC_TOOL_09` application of read-only type generates native image.
 ```
   1. sh-3.2# dotnettool --ni-ro-pkg org.tizen.example.Launcher_TC_TOOL_09.Tizen
+* TC_20
+```
+ PASS : Print command and option while creating native image for Tizen.dll.
+```
+ 1. sh-3.2# dotnettool --ni-dll --print-cmd /usr/share/dotnet.tizen/framework/Tizen.dll
+* TC_21
+```
+ PASS : Create native image for netstandard.dll by adding options --inputbubble and --compilebubblegenerics.
+```
+ 1. sh-3.2# dotnettool --ni-dll --inputbubble /usr/share/dotnet.tizen/netcoreapp/netstandard.dll
+----
 
 ### Note
 
index 60b41f9..331d583 100755 (executable)
@@ -9,6 +9,7 @@ from Utils import *
 
 module_name = "TOOL"
 
+
 # The `dotnettool` works normally.
 def TC_01():
     if not exist("/usr/bin/dotnettool"):
@@ -124,7 +125,10 @@ def TC_07():
 # Displays detailed information while creating native image for Tizen.Log.dll.
 def TC_08():
     raw = cmd(f"shell dotnettool --verbose --ni-dll {FRAMEWORK_DIR}Tizen.Log.dll")
-    if ("Tizen.Log.ni.dll generated successfully." not in raw):
+    if ("Tizen.Log.ni.dll generated successfully." not in raw) or \
+       ("Processing " not in raw) or \
+       (" dependencies" not in raw) or \
+       ("Moved to phase " not in raw):
         return "FAIL : Displays detailed information while creating native image for Tizen.Log.dll"
 
     return "PASS"
@@ -542,9 +546,43 @@ def TC_19():
 
     return "PASS"
 
-#def TC_20():
-#dotnettool --resolve-all-app
+# Print command and option while creating native image for Tizen.dll.
+def TC_20():
+    raw = cmd(f"shell dotnettool --print-cmd --ni-dll {FRAMEWORK_DIR}Tizen.dll")
+    if ("Tizen.ni.dll generated successfully." not in raw) or \
+       ("==================== NI Commands =========================" not in raw) or \
+       ("+ /usr/share/dotnet.tizen/netcoreapp/corerun" not in raw) or \
+       ("+ /usr/share/dotnet.tizen/netcoreapp/crossgen2/crossgen2.dll" not in raw) or \
+       ("+ --jitpath" not in raw) or \
+       ("+ /usr/share/dotnet.tizen/netcoreapp/libclrjit.so" not in raw) or \
+       ("+ --targetarch" not in raw) or \
+       ("+ armel" not in raw) or \
+       ("+ --out-near-input" not in raw) or \
+       ("+ --single-file-compilation" not in raw) or \
+       ("+ --resilient" not in raw) or \
+       ("+ -O" not in raw) or \
+       ("+ -r:/usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.0/*.dll" not in raw) or \
+       ("+ -r:/usr/share/dotnet.tizen/framework/*.dll" not in raw) or \
+       ("+ -r:/usr/share/dotnet.tizen/framework/ref/*.dll" not in raw) or \
+       (f"+ {FRAMEWORK_DIR}Tizen.dll" not in raw) or \
+       ("+ (null)" not in raw):
+        return "FAIL : Print command and option while creating native image for Tizen.dll"
+
+    return "PASS"
+
+# Create native image for netstandard.dll by adding options --inputbubble and --compilebubblegenerics.
+def TC_21():
+    raw = cmd(f"shell dotnettool --ni-dll --inputbubble {RUNTIME_DIR}netstandard.dll")
+    if ("netstandard.ni.dll generated successfully." not in raw) or \
+       (f"Moving R2R PE file: /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.0/netstandard.ni.dll.tmp to /usr/share/dotnet/shared/Microsoft.NETCore.App/6.0.0/netstandard.ni.dll" not in raw):
+        return "FAIL : Create native image for netstandard.dll by adding options --inputbubble"
+
+    return "PASS"
 
+#def TC_22():
+#dotnettool --rm-app-profile
+#dotnettool --rm-alll-app-profile
+#dotnettool --no-pipeline --inputbubbleref --ref
 
 # Run the test
 def run():
@@ -577,7 +615,7 @@ def clean():
     cmd(f"shell rm {FRAMEWORK_DIR}Tizen.Log.ni.dll")
     cmd(f"shell rm {RUNTIME_DIR}netstandard.ni.dll")
 
-    cmd(f"shell rm -rf {IBCDATA_DIR}")
+#    cmd(f"shell rm -rf {IBCDATA_DIR}")
 
     cmd(f"shell rm -rf {DOTNET_DIR}apps/org.tizen.example.Launcher_TC_TOOL_08.Tizen")
     cmd(f"shell rm -rf {DOTNET_DIR}apps/org.tizen.example.Launcher_TC_TOOL_09.Tizen")
@@ -599,7 +637,7 @@ def main():
                 tc_array.append(funcMap[tc_num])
     else:
         # skip TC_07 (--r2r), TC_09 (--ibc-dir)
-        tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_08, TC_10, TC_11, TC_12, TC_13, TC_14, TC_15, TC_16, TC_17, TC_18, TC_19]
+        tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_08, TC_10, TC_11, TC_12, TC_13, TC_14, TC_15, TC_16, TC_17, TC_18, TC_19, TC_20, TC_21]
 
     global serial
     if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]:
@@ -621,10 +659,11 @@ def main():
 funcMap = {
 'TC_01': TC_01, 'TC_02': TC_02, 'TC_03': TC_03, 'TC_04': TC_04, 'TC_05': TC_05, 'TC_06': TC_06,
 'TC_07': TC_07, 'TC_08': TC_08, 'TC_09': TC_09, 'TC_10': TC_10, 'TC_11': TC_11, 'TC_12': TC_12,
-'TC_13': TC_13, 'TC_14': TC_14, 'TC_15': TC_15, 'TC_16': TC_16, 'TC_17': TC_17, 'TC_18': TC_17_18, 'TC_19': TC_19,
+'TC_13': TC_13, 'TC_14': TC_14, 'TC_15': TC_15, 'TC_16': TC_16, 'TC_17': TC_17, 'TC_18': TC_17_18,
+'TC_19': TC_19, 'TC_20': TC_20, 'TC_21': TC_21,
 'TOOL_TC_01': TC_01, 'TOOL_TC_02': TC_02, 'TOOL_TC_03': TC_03, 'TOOL_TC_04': TC_04, 'TOOL_TC_05': TC_05, 'TOOL_TC_06': TC_06,
 'TOOL_TC_07': TC_07, 'TOOL_TC_08': TC_08, 'TOOL_TC_09': TC_09, 'TOOL_TC_10': TC_10, 'TOOL_TC_11': TC_11, 'TOOL_TC_12': TC_12,
-'TOOL_TC_13': TC_13, 'TOOL_TC_14': TC_14, 'TOOL_TC_15': TC_15, 'TOOL_TC_16': TC_16, 'TOOL_TC_17': TC_17, 'TOOL_TC_18': TC_17_18, 'TOOL_TC_19': TC_19
+'TOOL_TC_13': TC_13, 'TOOL_TC_14': TC_14, 'TOOL_TC_15': TC_15, 'TOOL_TC_16': TC_16, 'TOOL_TC_17': TC_17, 'TOOL_TC_18': TC_17_18, 'TOOL_TC_19': TC_19, 'TOOL_TC_20': TC_20, 'TOOL_TC_21': TC_21
 }