From: 최종헌/Common Platform Lab(SR)/삼성전자 Date: Wed, 9 Feb 2022 05:16:36 +0000 (+0900) Subject: [TC Fix/Add] dotnettool option(inputbubble, inputbubbleref, ref, print-cmd, no-pipeli... X-Git-Tag: submit/tizen/20220222.013136~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=861d72660cf4c9afa6ce5f6fba1f23b6355c5122;p=platform%2Fcore%2Fdotnet%2Flauncher.git [TC Fix/Add] dotnettool option(inputbubble, inputbubbleref, ref, print-cmd, no-pipeline) test in TOOL (#378) Change-Id: I8c8d1305ecbc96ec19bc5e1f47e11806b2526afb --- diff --git a/tests/TCs/6_TOOL/README.md b/tests/TCs/6_TOOL/README.md index cd5664c..2dd0dd8 100644 --- a/tests/TCs/6_TOOL/README.md +++ b/tests/TCs/6_TOOL/README.md @@ -135,7 +135,22 @@ launcher/tests/TCs/6_TOOL$ ./TOOL.py TC_01 ``` 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 + 1. sh-3.2# dotnettool --ni-dll --inputbubble --print-cmd /usr/share/dotnet.tizen/netcoreapp/netstandard.dll +* TC_22 +``` + PASS : Create native image for System.dll by adding options --inputbubble and --inputbubbleref. +``` + 1. sh-3.2# dotnettool --ni-dll --inputbubble --inputbubbleref /usr/share/dotnet.tizen/netcoreapp/crossgen2 --print-cmd /usr/share/dotnet.tizen/netcoreapp/System.dll +* TC_23 +``` + PASS : Create native image for System.Console.dll by adding option --ref. +``` + 1. sh-3.2# dotnettool --ni-dll --ref /usr/share/dotnet.tizen/netcoreapp:/usr/share/dotnet.tizen/netcoreapp/crossgen2 --print-cmd /usr/share/dotnet.tizen/netcoreapp/System.Console.dll +* TC_24 +``` + PASS : Create native image for mscorlib.dll by adding option --no-pipeline. +``` + 1. sh-3.2# dotnettool --ni-dll --no-pipeline --print-cmd /usr/share/dotnet.tizen/netcoreapp/mscorlib.dll ---- ### Note diff --git a/tests/TCs/6_TOOL/TOOL.py b/tests/TCs/6_TOOL/TOOL.py index 331d583..e331316 100755 --- a/tests/TCs/6_TOOL/TOOL.py +++ b/tests/TCs/6_TOOL/TOOL.py @@ -548,6 +548,7 @@ def TC_19(): # Print command and option while creating native image for Tizen.dll. def TC_20(): + cmd(f"shell mount -o remount,rw /") 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 \ @@ -556,14 +557,10 @@ def TC_20(): ("+ --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" @@ -572,17 +569,51 @@ def TC_20(): # 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") + cmd(f"shell mount -o remount,rw /") + raw = cmd(f"shell dotnettool --ni-dll --inputbubble --print-cmd {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" + ("+ --inputbubble" not in raw) or \ + ("+ --compilebubblegenerics" not in raw): + return "FAIL : Create native image for netstandard.dll by adding options --inputbubble and --compilebubblegenereics" + + return "PASS" + +# Create native image for System.dll by adding options --inputbubble and --inputbubbleref. +def TC_22(): + cmd(f"shell mount -o remount,rw /") + raw = cmd(f"shell dotnettool --ni-dll --inputbubble --inputbubbleref {RUNTIME_DIR}crossgen2 --print-cmd {RUNTIME_DIR}System.dll") + if ("System.ni.dll generated successfully." not in raw) or \ + ("+ --inputbubble" not in raw) or \ + ("+ --inputbubbleref:/usr/share/dotnet.tizen/netcoreapp/crossgen2/*.dll" not in raw): + return "FAIL : Create native image for System.dll by adding options --inputbubble and --inputbubbleref" + + return "PASS" + +# Create native image for System.Console.dll by adding option --ref. +def TC_23(): + cmd(f"shell mount -o remount,rw /") + raw = cmd(f"shell dotnettool --ni-dll --ref {RUNTIME_DIR}:{RUNTIME_DIR}crossgen2 --print-cmd {RUNTIME_DIR}System.Console.dll") + if ("System.Console.ni.dll generated successfully." not in raw) or \ + (f"+ -r:{RUNTIME_DIR}/*.dll" not in raw) or \ + (f"+ -r:{RUNTIME_DIR}crossgen2/*.dll" not in raw): + return "FAIL : Create native image for System.Console.dll by adding option --ref" + + return "PASS" + +# Create native image for mscorlib.dll by adding option --no-pipeline +def TC_24(): + cmd(f"shell mount -o remount,rw /") + raw = cmd(f"shell dotnettool --ni-dll --no-pipeline --print-cmd {RUNTIME_DIR}mscorlib.dll") + if ("mscorlib.ni.dll generated successfully." not in raw) or \ + ("+ -o" not in raw) or \ + ("/mscorlib.ni.dll" not in raw): + return "FAIL : Create native image for mscorlib.dll by adding option --no-pipeline" return "PASS" -#def TC_22(): +#def TC_25(): #dotnettool --rm-app-profile -#dotnettool --rm-alll-app-profile -#dotnettool --no-pipeline --inputbubbleref --ref +#dotnettool --rm-all-app-profile # Run the test def run(): @@ -614,6 +645,9 @@ def clean(): cmd(f"shell rm {FRAMEWORK_DIR}Tizen.ni.dll") cmd(f"shell rm {FRAMEWORK_DIR}Tizen.Log.ni.dll") cmd(f"shell rm {RUNTIME_DIR}netstandard.ni.dll") + cmd(f"shell rm {RUNTIME_DIR}System.ni.dll") + cmd(f"shell rm {RUNTIME_DIR}System.Console.ni.dll") + cmd(f"shell rm {RUNTIME_DIR}mscorlib.ni.dll") # cmd(f"shell rm -rf {IBCDATA_DIR}") @@ -637,7 +671,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_20, TC_21] + 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, TC_22, TC_23, TC_24] global serial if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]: @@ -660,10 +694,10 @@ 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_20': TC_20, 'TC_21': TC_21, +'TC_19': TC_19, 'TC_20': TC_20, 'TC_21': TC_21, 'TC_22' : TC_22, 'TC_23' : TC_23, 'TC_24' : TC_24, '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_20': TC_20, 'TOOL_TC_21': TC_21 +'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, 'TOOL_TC_22' : TC_22, 'TOOL_TC_23' : TC_23, 'TOOL_TC_24' : TC_24 }