2 import os, subprocess, sys, argparse
3 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
11 # The `Launcher_TC_TAC_01` application must have TAC applied.
13 sln_name = "Launcher_TC_TAC_01.Tizen"
15 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
17 return f"FAIL : Get the tpk path for {sln_name}"
19 if "OK" not in app_install(f"{tpk_path}"):
20 return f"FAIL : Install the application for {tpk_path}"
22 pkg_id = f"org.tizen.example.Launcher_TC_TAC_01.Tizen"
24 root_path = get_root_path(f"{pkg_id}")
25 if root_path == "None":
26 return f"FAIL : Get the root path for {pkg_id}"
28 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
29 if ".tac_symlink" not in raw:
30 return "FAIL : The .tac_symlink folder should exist"
32 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
33 lines1 = [l for l in raw.splitlines()]
34 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.6.0.967/ -name *.dll -not -name *.ni.dll")
35 lines2 = [l for l in raw.splitlines()]
36 if len(lines1) != len(lines2):
37 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
39 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
40 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
42 origin_path = dll.split("->")[1].strip()
43 raw = cmd(f"shell ls -alZ {origin_path}")
44 if "No such file or directory" in raw:
45 return "FAIL : The original file of the symbolic link must exist"
47 pid = launch_and_get_pid(f"-e", f"{pkg_id}")
49 return f"FAIL : Get the pid for {pkg_id}"
51 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Xamarin.Forms.*.dll")
52 if (f"{DOTNET_DIR}Xamarin.Forms/4.6.0.967/Xamarin.Forms.Platform.Tizen.dll" not in raw) and \
53 (f"{DOTNET_DIR}Xamarin.Forms/4.6.0.967/Xamarin.Forms.Core.dll" not in raw) and \
54 (f"{DOTNET_DIR}Xamarin.Forms/4.6.0.967/Xamarin.Forms.Platform.dll" not in raw):
55 return "FAIL : The Xamarin.Forms in the TAC should be loaded when running the application"
57 cmd(f"shell app_launcher -t {pkg_id}")
61 # The `Launcher_TC_TAC_02` application must have TAC applied.
63 sln_name = "Launcher_TC_TAC_02.Tizen"
65 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
67 return f"FAIL : Get the tpk path for {sln_name}"
69 if "OK" not in app_install(f"{tpk_path}"):
70 return f"FAIL : Install the application for {tpk_path}"
72 pkg_id = f"org.tizen.example.Launcher_TC_TAC_00.Tizen"
74 root_path = get_root_path(f"{pkg_id}")
75 if root_path == "None":
76 return f"FAIL : Get the root path for {pkg_id}"
78 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
79 if ".tac_symlink" not in raw:
80 return "FAIL : The .tac_symlink folder should exist"
82 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
83 lines1 = [l for l in raw.splitlines()]
84 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.8.0.1364/ -name *.dll -not -name *.ni.dll")
85 lines2 = [l for l in raw.splitlines()]
86 raw = cmd(f"shell find {DOTNET_DIR}Newtonsoft.Json/12.0.1/ -name *.dll -not -name *.ni.dll")
87 lines3 = [l for l in raw.splitlines()]
88 if len(lines1) != len(lines2)+len(lines3):
89 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
91 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
92 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
94 origin_path = dll.split("->")[1].strip()
95 raw = cmd(f"shell ls -alZ {origin_path}")
96 if "No such file or directory" in raw:
97 return "FAIL : The original file of the symbolic link must exist"
99 pid = launch_and_get_pid(f"-e", f"{pkg_id}")
101 return f"FAIL : Get the pid for {pkg_id}"
103 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Xamarin.Forms.*.dll")
104 if (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1364/Xamarin.Forms.Platform.Tizen.dll" not in raw) and \
105 (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1364/Xamarin.Forms.Core.dll" not in raw) and \
106 (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1364/Xamarin.Forms.Platform.dll" not in raw):
107 return "FAIL : The Xamarin.Forms in the TAC should be loaded when running the application"
109 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Newtonsoft.Json.dll")
110 if f"{DOTNET_DIR}Newtonsoft.Json/12.0.1/Newtonsoft.Json.dll" not in raw:
111 return "FAIL : The Newtonsoft.Json in the TAC should be loaded when running the application"
113 cmd(f"shell app_launcher -t {pkg_id}")
117 # The `Launcher_TC_TAC_03` application is normally TAC applied when updating.
119 sln_name = "Launcher_TC_TAC_03.Tizen"
121 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
123 return f"FAIL : Get the tpk path for {sln_name}"
125 if "OK" not in app_install(f"{tpk_path}"):
126 return f"FAIL : Install the application for {tpk_path}"
128 pkg_id = f"org.tizen.example.Launcher_TC_TAC_00.Tizen"
130 root_path = get_root_path(f"{pkg_id}")
131 if root_path == "None":
132 return f"FAIL : Get the root path for {pkg_id}"
134 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
135 if ".tac_symlink" not in raw:
136 return "FAIL : The .tac_symlink folder should exist"
138 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
139 lines1 = [l for l in raw.splitlines()]
140 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.8.0.1687/ -name *.dll -not -name *.ni.dll")
141 lines2 = [l for l in raw.splitlines()]
142 raw = cmd(f"shell find {DOTNET_DIR}sqlite-net-base/1.7.335/ -name *.dll -not -name *.ni.dll")
143 lines3 = [l for l in raw.splitlines()]
144 raw = cmd(f"shell find {DOTNET_DIR}SQLitePCLRaw.core/2.0.3/ -name *.dll -not -name *.ni.dll")
145 lines4 = [l for l in raw.splitlines()]
146 if len(lines1) != len(lines2)+len(lines3)+len(lines4):
147 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
149 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
150 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
152 origin_path = dll.split("->")[1].strip()
153 raw = cmd(f"shell ls -alZ {origin_path}")
154 if "No such file or directory" in raw:
155 return "FAIL : The original file of the symbolic link must exist"
157 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.8.0.1364/ -name *.dll")
158 if "No such file or directory" not in raw:
159 return f"FAIL : The Xamarin.Forms/4.8.0.1364 nuget should not exist in {DOTNET_DIR}"
161 raw = cmd(f"shell find {DOTNET_DIR}Newtonsoft.Json/12.0.1/ -name *.dll")
162 if "No such file or directory" not in raw:
163 return f"FAIL : The Newtonsoft.Json/12.0.1 nuget should not exist in {DOTNET_DIR}"
165 pid = launch_and_get_pid(f"-e", f"{pkg_id}")
167 return f"FAIL : Get the pid for {pkg_id}"
169 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Xamarin.Forms.*.dll")
170 if (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1687/Xamarin.Forms.Platform.Tizen.dll" not in raw) and \
171 (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1687/Xamarin.Forms.Core.dll" not in raw) and \
172 (f"{DOTNET_DIR}Xamarin.Forms/4.8.0.1687/Xamarin.Forms.Platform.dll" not in raw):
173 return "FAIL : The Xamarin.Forms in the TAC should be loaded when running the application"
175 raw = cmd(f"shell cat /proc/{pid}/smaps | grep SQLite-net.dll")
176 if f"{DOTNET_DIR}sqlite-net-base/1.7.335/SQLite-net.dll" not in raw:
177 return "FAIL : The sqlite-net-base in the TAC should be loaded when running the application"
179 raw = cmd(f"shell cat /proc/{pid}/smaps | grep SQLitePCLRaw.core.dll")
180 if f"{DOTNET_DIR}SQLitePCLRaw.core/2.0.3/SQLitePCLRaw.core.dll" not in raw:
181 return "FAIL : The SQLitePCLRaw.core in the TAC should be loaded when running the application"
183 cmd(f"shell app_launcher -t {pkg_id}")
187 # The `Launcher_TC_TAC_04` application should not apply TAC when updating.
189 sln_name = "Launcher_TC_TAC_04.Tizen"
191 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
193 return f"FAIL : Get the tpk path for {sln_name}"
195 if "OK" not in app_install(f"{tpk_path}"):
196 return f"FAIL : Install the application for {tpk_path}"
198 pkg_id = f"org.tizen.example.Launcher_TC_TAC_00.Tizen"
200 root_path = get_root_path(f"{pkg_id}")
201 if root_path == "None":
202 return f"FAIL : Get the root path for {pkg_id}"
204 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
205 if ".tac_symlink" in raw:
206 return "FAIL : The .tac_symlink folder should not exist"
208 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.8.0.1364/ -name *.dll")
209 if "No such file or directory" not in raw:
210 return f"FAIL : The Xamarin.Forms/4.8.0.1364 nuget should not exist in {DOTNET_DIR}"
212 raw = cmd(f"shell find {DOTNET_DIR}Newtonsoft.Json/12.0.1/ -name *.dll")
213 if "No such file or directory" not in raw:
214 return f"FAIL : The Newtonsoft.Json/12.0.1 nuget should not exist in {DOTNET_DIR}"
216 raw = cmd(f"shell find {DOTNET_DIR}sqlite-net-base/1.7.335/ -name *.dll")
217 if "No such file or directory" not in raw:
218 return f"FAIL : The sqlite-net-base/1.7.335 nuget should not exist in {DOTNET_DIR}"
220 raw = cmd(f"shell find {DOTNET_DIR}SQLitePCLRaw.core/2.0.3/ -name *.dll")
221 if "No such file or directory" not in raw:
222 return f"FAIL : The SQLitePCLRaw.core/2.0.3 nuget should not exist in {DOTNET_DIR}"
224 pid = launch_and_get_pid(f"-e", f"{pkg_id}")
226 return f"FAIL : Get the pid for {pkg_id}"
228 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Xamarin.Forms.*.dll")
229 if (f"{root_path}/bin/Xamarin.Forms.Platform.Tizen.dll" not in raw) and \
230 (f"{root_path}/bin/Xamarin.Forms.Core.dll" not in raw) and \
231 (f"{root_path}/bin/Xamarin.Forms.Platform.dll" not in raw):
232 return "FAIL : The Xamarin.Forms in the application should be loaded when running the application"
234 cmd(f"shell app_launcher -t {pkg_id}")
238 # The `Launcher_TC_TAC_05`, `Launcher_TC_TAC_06` applications using the same nuget are normally TAC applied.
240 sln_name = "Launcher_TC_TAC_05.Tizen"
242 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
244 return f"FAIL : Get the tpk path for {sln_name}"
246 if "OK" not in app_install(f"{tpk_path}"):
247 return f"FAIL : Install the application for {tpk_path}"
249 pkg_id1 = f"org.tizen.example.Launcher_TC_TAC_05.Tizen"
251 root_path = get_root_path(f"{pkg_id1}")
252 if root_path == "None":
253 return f"FAIL : Get the root path for {pkg_id1}"
255 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
256 if ".tac_symlink" not in raw:
257 return "FAIL : The .tac_symlink folder should exist"
259 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
260 lines1 = [l for l in raw.splitlines()]
261 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/ -name *.dll -not -name *.ni.dll")
262 lines2 = [l for l in raw.splitlines()]
263 if len(lines1) != len(lines2):
264 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
266 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
267 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
269 origin_path = dll.split("->")[1].strip()
270 raw = cmd(f"shell ls -alZ {origin_path}")
271 if "No such file or directory" in raw:
272 return "FAIL : The original file of the symbolic link must exist"
274 sln_name = "Launcher_TC_TAC_06.Tizen"
276 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
278 return f"FAIL : Get the tpk path for {sln_name}"
280 if "OK" not in app_install(f"{tpk_path}"):
281 return f"FAIL : Install the application for {tpk_path}"
283 pkg_id2 = f"org.tizen.example.Launcher_TC_TAC_06.Tizen"
285 root_path = get_root_path(f"{pkg_id2}")
286 if root_path == "None":
287 return f"FAIL : Get the root path for {pkg_id2}"
289 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
290 if ".tac_symlink" not in raw:
291 return "FAIL : The .tac_symlink folder should exist"
293 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
294 lines1 = [l for l in raw.splitlines()]
295 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/ -name *.dll -not -name *.ni.dll")
296 lines2 = [l for l in raw.splitlines()]
297 if len(lines1) != len(lines2):
298 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
300 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
301 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
303 origin_path = dll.split("->")[1].strip()
304 raw = cmd(f"shell ls -alZ {origin_path}")
305 if "No such file or directory" in raw:
306 return "FAIL : The original file of the symbolic link must exist"
308 raw = cmd(f"uninstall {pkg_id1}")
309 if "key[end] val[ok]" not in raw:
310 return f"FAIL : Uninstall the application for {pkg_id1}"
312 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
313 lines1 = [l for l in raw.splitlines()]
314 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/ -name *.dll -not -name *.ni.dll")
315 lines2 = [l for l in raw.splitlines()]
316 if len(lines1) != len(lines2):
317 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
319 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
320 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
322 origin_path = dll.split("->")[1].strip()
323 raw = cmd(f"shell ls -alZ {origin_path}")
324 if "No such file or directory" in raw:
325 return "FAIL : The original file of the symbolic link must exist"
327 pid = launch_and_get_pid(f"-e", f"{pkg_id2}")
329 return f"FAIL : Get the pid for {pkg_id2}"
331 raw = cmd(f"shell cat /proc/{pid}/smaps | grep Xamarin.Forms.*.dll")
332 if (f"{DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/Xamarin.Forms.Platform.Tizen.dll" not in raw) and \
333 (f"{DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/Xamarin.Forms.Core.dll" not in raw) and \
334 (f"{DOTNET_DIR}Xamarin.Forms/5.0.0.1558-pre3/Xamarin.Forms.Platform.dll" not in raw):
335 return "FAIL : The Xamarin.Forms in the TAC should be loaded when running the application"
337 cmd(f"shell app_launcher -t {pkg_id2}")
341 # The `Launcher_TC_TAC_07` application is normally TAC applied when uninstall.
343 sln_name = "Launcher_TC_TAC_07.Tizen"
345 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
347 return f"FAIL : Get the tpk path for {sln_name}"
349 if "OK" not in app_install(f"{tpk_path}"):
350 return f"FAIL : Install the application for {tpk_path}"
352 pkg_id = f"org.tizen.example.Launcher_TC_TAC_07.Tizen"
354 root_path = get_root_path(f"{pkg_id}")
355 if root_path == "None":
356 return f"FAIL : Get the root path for {pkg_id}"
358 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
359 if ".tac_symlink" not in raw:
360 return "FAIL : The .tac_symlink folder should exist"
362 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
363 lines1 = [l for l in raw.splitlines()]
364 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.4.0.991864/ -name *.dll -not -name *.ni.dll")
365 lines2 = [l for l in raw.splitlines()]
366 if len(lines1) != len(lines2):
367 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
369 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
370 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
372 origin_path = dll.split("->")[1].strip()
373 raw = cmd(f"shell ls -alZ {origin_path}")
374 if "No such file or directory" in raw:
375 return "FAIL : The original file of the symbolic link must exist"
377 raw = cmd(f"uninstall {pkg_id}")
378 if "key[end] val[ok]" not in raw:
379 return f"FAIL : Uninstall the application for {pkg_id}"
381 raw = cmd(f"shell find {DOTNET_DIR}Xamarin.Forms/4.4.0.991864/ -name *.dll")
382 if "No such file or directory" not in raw:
383 return f"FAIL : The Xamarin.Forms/4.4.0.991864 nuget should not exist in {DOTNET_DIR}"
387 # The `Launcher_TC_TAC_08` application should be applied to TAC, but The `Launcher_TC_TAC_09` application should not be applied to TAC.
389 raw = cmd(f"shell find {FRAMEWORK_DIR}/XSF.*")
391 cmd(f"shell mv {FRAMEWORK_DIR}/XSF.dll {FRAMEWORK_DIR}/XSF.dll2")
392 elif "XSF.ni.dll" in raw:
393 cmd(f"shell mv {FRAMEWORK_DIR}/XSF.ni.dll {FRAMEWORK_DIR}/XSF.ni.dll2")
395 sln_name = "Launcher_TC_TAC_08.Tizen"
397 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
399 return f"FAIL : Get the tpk path for {sln_name}"
401 if "OK" not in app_install(f"{tpk_path}"):
402 return f"FAIL : Install the application for {tpk_path}"
404 pkg_id = f"org.tizen.example.Launcher_TC_TAC_08.Tizen"
406 root_path = get_root_path(f"{pkg_id}")
407 if root_path == "None":
408 return f"FAIL : Get the root path for {pkg_id}"
410 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
411 if ".tac_symlink" not in raw:
412 return "FAIL : The .tac_symlink folder should exist"
414 raw = cmd(f"shell find {root_path}/bin/.tac_symlink/ -name *.dll -not -name *.ni.dll")
415 lines1 = [l for l in raw.splitlines()]
416 raw = cmd(f"shell find {DOTNET_DIR}XSF/1.0.0.0/ -name *.dll -not -name *.ni.dll")
417 lines2 = [l for l in raw.splitlines()]
418 if len(lines1) != len(lines2):
419 return "FAIL : The number of .dll in the .tac_symlink and .dll in the TAC must match"
421 raw = cmd(f"shell ls -alZ {root_path}/bin/.tac_symlink/*.dll")
422 lines = [l for l in raw.splitlines() if ".ni.dll" not in l]
424 origin_path = dll.split("->")[1].strip()
425 raw = cmd(f"shell ls -alZ {origin_path}")
426 if "No such file or directory" in raw:
427 return "FAIL : The original file of the symbolic link must exist"
429 sln_name = "Launcher_TC_TAC_09.Tizen"
431 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
433 return f"FAIL : Get the tpk path for {sln_name}"
435 if "OK" not in app_install(f"{tpk_path}"):
436 return f"FAIL : Install the application for {tpk_path}"
438 pkg_id = f"org.tizen.example.Launcher_TC_TAC_09.Tizen"
440 root_path = get_root_path(f"{pkg_id}")
441 if root_path == "None":
442 return f"FAIL : Get the root path for {pkg_id}"
444 raw = cmd(f"shell find {root_path}/bin/.tac_symlink -name XSF.dll -not -name XSF.ni.dll")
445 lines = [l for l in raw.splitlines()]
447 return "FAIL : The version is the same Nuget, but the SHA value is different"
449 pid = launch_and_get_pid(f"-e", f"{pkg_id}")
451 return f"FAIL : Get the pid for {pkg_id}"
453 raw = cmd(f"shell cat /proc/{pid}/smaps | grep XSF.dll")
454 if f"{root_path}/bin/XSF.dll" not in raw:
455 return "FAIL : The XSF in the application should be loaded when running the application"
457 cmd(f"shell app_launcher -t {pkg_id}")
461 # The Launcher_TC_TAC_10 application should match the information of nuget with the value of TAC DB.
463 sln_name = "Launcher_TC_TAC_10.Tizen"
465 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
467 return f"FAIL : Get the tpk path for {sln_name}"
469 if "OK" not in app_install(f"{tpk_path}"):
470 return f"FAIL : Install the application for {tpk_path}"
472 pkg_id = f"org.tizen.example.Launcher_TC_TAC_10.Tizen"
474 root_path = get_root_path(f"{pkg_id}")
475 if root_path == "None":
476 return f"FAIL : Get the root path for {pkg_id}"
478 raw = cmd(f"shell find {root_path}/bin/ -name .tac_symlink")
479 if ".tac_symlink" not in raw:
480 return "FAIL : The .tac_symlink folder should exist"
482 raw = subprocess.run((f"sdb -s {serial} shell sqlite3 {DOTNET_DIR}.TAC.App.list.db").split(), stdout=subprocess.PIPE, input=f"select * from TAC;\n.q\n", encoding="utf-8").stdout
483 lines = [l for l in raw.splitlines() if f"{pkg_id}" in l]
485 if ("Xamarin.Forms/4.8.0.1560" not in rcd) and \
486 ("Google.Apis.Core/1.49.0" not in rcd) and \
487 ("Google.Apis/1.49.0" not in rcd) and \
488 ("Newtonsoft.Json/12.0.3" not in rcd):
489 return "FAIL : TAC database must have a valid value"
493 # The Launcher_TC_TAC_11 application must match the version of the nuget in .deps.json and the version of the nuget in TAC DB.
495 sln_name = "Launcher_TC_TAC_11.Tizen"
497 tpk_path = get_tpk_path(tpk_list, f"{sln_name}")
499 return f"FAIL : Get the tpk path for {sln_name}"
501 if "OK" not in app_install(f"{tpk_path}"):
502 return f"FAIL : Install the application for {tpk_path}"
504 pkg_id = f"org.tizen.example.Launcher_TC_TAC_11.Tizen"
506 root_path = get_root_path(f"{pkg_id}")
507 if root_path == "None":
508 return f"FAIL : Get the root path for {pkg_id}"
510 raw = subprocess.run((f"sdb -s {serial} shell sqlite3 {DOTNET_DIR}.TAC.App.list.db").split(), stdout=subprocess.PIPE, input=f"select * from TAC;\n.q\n", encoding="utf-8").stdout
511 lines = [l for l in raw.splitlines() if f"{pkg_id}" in l]
513 name = nuget.split("|")[3]
514 version = nuget.split("|")[4]
515 raw = cmd(f"shell cat {root_path}/{sln_name}.deps.json | grep {name}/")
516 if f"{version}" not in f"{raw}":
524 cmd(f"shell mount -o remount,rw /")
527 tpk_list = search_tpk(f"{module_name}")
529 p = run_tc_array(module_name, tc_array)
530 f = len(tc_array) - p
531 r = round(((p / len(tc_array)) * 100), 2)
532 print(f"--- {module_name} TCT Result ---\nFAIL : [{f}] / PASS : [{p}] - [{r}%]\n")
534 # Uninstall the application and restore to original state
536 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_01.Tizen")
537 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_00.Tizen")
538 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_06.Tizen")
539 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_07.Tizen")
540 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_08.Tizen")
541 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_09.Tizen")
542 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_10.Tizen")
543 cmd(f"uninstall org.tizen.example.Launcher_TC_TAC_11.Tizen")
545 cmd(f"shell mv {FRAMEWORK_DIR}/XSF.dll2 {FRAMEWORK_DIR}/XSF.dll")
546 cmd(f"shell mv {FRAMEWORK_DIR}/XSF.ni.dll2 {FRAMEWORK_DIR}/XSF.ni.dll")
550 parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter)
551 parser.add_argument("TC_NUMBER", type=str, nargs="*", help="Individual excution")
552 args = parser.parse_args()
555 if args.TC_NUMBER and "TC_" in args.TC_NUMBER[0]:
557 for tc_num in args.TC_NUMBER:
558 if tc_num not in funcMap:
559 print(f"There is no {tc_num} test.")
562 tc_array.append(funcMap[tc_num])
564 tc_array = [TC_01, TC_02, TC_03, TC_04, TC_05, TC_06, TC_07, TC_08, TC_09]
567 if len(sys.argv) >= 2 and "TC_" not in sys.argv[1]:
568 serial = read_serial(sys.argv[1])
570 serial = read_serial(None)
573 print("No connected device(s).")
576 device = get_device_type()
577 print(f"=== Dotnet-Launcher [{device}] Test Case - ({module_name}) ===")
584 '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,
585 'TAC_TC_01': TC_01, 'TAC_TC_02': TC_02, 'TAC_TC_03': TC_03, 'TAC_TC_04': TC_04, 'TAC_TC_05': TC_05,
586 'TAC_TC_06': TC_06, 'TAC_TC_07': TC_07, 'TAC_TC_08': TC_08, 'TAC_TC_09': TC_09
590 if __name__ == "__main__":
593 except KeyboardInterrupt:
594 print("\nExit (Pressed Ctrl+C)")