Add NCDB startup hook support.
[platform/core/dotnet/launcher.git] / tests / TCs / 6_TOOL / README.md
1 # Test Case for dotnet-launcher - DOTNETTOOL
2
3 This script(TOOL.py) is a test that verifies the behavior of **dotnettool**.
4 Check each option of the dotnettool.
5 ```
6 sh-3.2# dotnettool -h
7
8 Dotnet Tool Version: 1.0
9 ...
10 ```
11
12 ### Usage
13
14 * Build tpk
15
16   Must be run(./BuildTPK.py) at least once.
17 ```
18 launcher/tests/Apps$ ./BuildTPK.py
19 ```
20
21 * Run **DOTNETTOOL** test
22 ```
23 launcher/tests/TCs$ ./6_TOOL/TOOL.py
24 launcher/tests/TCs/6_TOOL$ ./TOOL.py
25 ```
26
27 * Run individual test
28 ```
29 launcher/tests/TCs/6_TOOL$ ./TOOL.py TC_01
30 ```
31
32 ### Description
33 * TC_01
34 ```
35   PASS : The dotnettool works normally.
36 ```
37   1. sh-3.2# dotnettool -h
38 * TC_02
39 ```
40   PASS : The native image is generated normally.
41 ```
42   1. sh-3.2# dotnettool --ni-system
43 * TC_03
44 ```
45   PASS : Remove the platform native image.
46 ```
47   1. sh-3.2# dotnettool --ni-reset-system
48 * TC_04
49 ```
50   PASS : Create native image for System.Private.CoreLib.dll.
51 ```
52   1. sh-3.2# dotnettool --ni-dll /usr/share/dotnet.tizen/netcoreapp/System.Private.CoreLib.dll
53 * TC_05
54 ```
55   PASS : The file name of .dll and .ni.dll must match in the framework.
56 ```
57   1. sh-3.2# dotnettool --ni-dir /usr/share/dotnet.tizen/framework/
58 * TC_06
59 ```
60   PASS : The .ni.dll files should not exist in the framework.
61 ```
62   1. sh-3.2# dotnettool --ni-reset-dir /usr/share/dotnet.tizen/framework/
63 * TC_07
64 ```
65   PASS : Create native image for Tizen.dll in R2Rmode.
66 ```
67   1. sh-3.2# dotnettool --r2r --ni-dll /usr/share/dotnet.tizen/framework/Tizen.dll
68 * TC_08
69 ```
70   PASS : Displays detailed information while creating native image for Tizen.Log.dll.
71 ```
72   1. sh-3.2# dotnettool --verbose --ni-dll /usr/share/dotnet.tizen/framework/Tizen.Log.dll
73 * TC_09
74 ```
75   PASS : Create a native image for netstandard.dll by specifying the directory containing the IBC files.
76 ```
77   1. sh-3.2# dotnettool --ibc-dir /usr/share/dotnet.tizen/ibcdata/ --ni-dll /usr/share/dotnet.tizen/netcoreapp/netstandard.dll
78 * TC_10
79 ```
80   PASS : The Launcher_TC_TOOL_01 application does not have native image.
81 ```
82   1. sh-3.2# dotnettool --ni-reset-pkg org.tizen.example.Launcher_TC_TOOL_01.Tizen
83 * TC_11
84 ```
85   PASS : The Launcher_TC_TOOL_02 application generates native image.
86 ```
87   1. sh-3.2# dotnettool --ni-pkg org.tizen.example.Launcher_TC_TOOL_02.Tizen
88 * TC_12
89 ```
90   PASS : The prefer_dotnet_aot metadata value of true will regenerates the native image in all .NET applications.
91 ```
92   1. sh-3.2# dotnettool --ni-regen-all-app
93 * TC_13
94 ```
95   PASS : The prefer_nuget_cache metadata value of true will regenerates the native image in the TAC.
96 ```
97   1. sh-3.2# dotnettool --tac-regen-all
98 * TC_14
99 ```
100   PASS : The Launcher_TC_TOOL_05 application must not have TAC applied.
101 ```
102   1. sh-3.2# dotnettool --tac-disable-pkg org.tizen.example.Launcher_TC_TOOL_05.Tizen
103 * TC_15
104 ```
105   PASS : The Launcher_TC_TOOL_06 application must have TAC applied.
106 ```
107   1. sh-3.2# dotnettool --tac-enable-pkg org.tizen.example.Launcher_TC_TOOL_06.Tizen
108 * TC_16
109 ```
110   PASS : The Database of the restored TAC and TLC must be a valid value.
111 ```
112   1. sh-3.2# dotnettool --tac-restore-db
113 * TC_17
114 ```
115   PASS : The prefer_dotnet_aot metadata value of true will regenerates the native image in all .NET applications of read-only type.
116 ```
117   1. sh-3.2# dotnettool --ni-regen-all-ro-app
118 * TC_18
119 ```
120   PASS : The Launcher_TC_TOOL_08 application should load the newly generated native image.
121 ```
122  1. Regenerated NI files of read-only application is stored at "/opt/usr/dotnet/apps/[PkgID]/bin/.native_image/".
123  2. The assembly in the "/opt/usr/dotnet/apps/[PkgId]/bin/.native/image/" should be loaded when running the application.
124 * TC_19
125 ```
126   PASS : The `Launcher_TC_TOOL_09` application of read-only type generates native image.
127 ```
128   1. sh-3.2# dotnettool --ni-ro-pkg org.tizen.example.Launcher_TC_TOOL_09.Tizen
129 * TC_20
130 ```
131  PASS : Print command and option while creating native image for Tizen.dll.
132 ```
133  1. sh-3.2# dotnettool --ni-dll --print-cmd /usr/share/dotnet.tizen/framework/Tizen.dll
134 * TC_21
135 ```
136  PASS : Create native image for netstandard.dll by adding options --inputbubble and --compilebubblegenerics.
137 ```
138  1. sh-3.2# dotnettool --ni-dll --inputbubble --print-cmd /usr/share/dotnet.tizen/netcoreapp/netstandard.dll
139 * TC_22
140 ```
141  PASS : Create native image for System.dll by adding options --inputbubble and --inputbubbleref.
142 ```
143  1. sh-3.2# dotnettool --ni-dll --inputbubble --inputbubbleref /usr/share/dotnet.tizen/netcoreapp/crossgen2 --print-cmd /usr/share/dotnet.tizen/netcoreapp/System.dll
144 * TC_23
145 ```
146  PASS : Create native image for System.Console.dll by adding option --ref.
147 ```
148  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
149 * TC_24
150 ```
151  PASS : Create native image for mscorlib.dll by adding option --no-pipeline.
152 ```
153  1. sh-3.2# dotnettool --ni-dll --no-pipeline --print-cmd /usr/share/dotnet.tizen/netcoreapp/mscorlib.dll
154 ----
155
156 ### Note
157
158 * Precondition
159   - Clone the **dotnet-launcher** repository.
160   - The prerequisites are **sdb** and **python3.6+**.
161   - The script must be run on the **host PC**.
162
163 * SDBs
164
165     sdb with a smart device selector.
166 ```
167 [1] 192.168.250.250 - 0
168 [2] 002c02f56c7d6c66 - TW3
169 Select a device [1-2]: 2
170 ```