From d05b7e3cf8a0567cdc71e0b2b286a308a32d0639 Mon Sep 17 00:00:00 2001 From: Gun Kim Date: Fri, 30 Nov 2012 16:09:32 +0900 Subject: [PATCH] [Title] added test case for native-ide [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: Iea238e8ec524af6202f389e5c38cd7feed1bd9ec --- vts/script/main.lua | 2 + vts/script/tc_compliance_native_ide.lua | 190 ++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 vts/script/tc_compliance_native_ide.lua diff --git a/vts/script/main.lua b/vts/script/main.lua index 0f3b53d..bd1d7b1 100644 --- a/vts/script/main.lua +++ b/vts/script/main.lua @@ -28,6 +28,7 @@ dofile(script_path .. "tc_camera.lua") dofile(script_path .. "tc_event_injector.lua") dofile(script_path .. "tc_skinserver.lua") dofile(script_path .. "tc_compliance_web_ide.lua") +dofile(script_path .. "tc_compliance_native_ide.lua") tclib.kill_emulator(); @@ -39,6 +40,7 @@ test_audio_video(); --test_camera(); test_event_injector(); test_compliance_web_ide(env); +test_compliance_native_ide(env); tclib.kill_emulator(); test_skinserver(); diff --git a/vts/script/tc_compliance_native_ide.lua b/vts/script/tc_compliance_native_ide.lua new file mode 100644 index 0000000..d260b0a --- /dev/null +++ b/vts/script/tc_compliance_native_ide.lua @@ -0,0 +1,190 @@ +nativeidelib={} + +--------------------------------------------------------- +-- native ide module +--------------------------------------------------------- +--/////////////////////////////////////////////////////// +--// author : Gun Kim (gune.kim@samsung.com) +--// created date : 2012/11/28 +--// updated date : ... +--// comments : native ide test module +--/////////////////////////////////////////////////////// + +-- Test - install, launch +function add_project_test(native_ide_suite) + print (" === test for native project === "); + + -- /usr/bin/pkgcmd + local pkgcmd = ssdb("/usr/bin/pkgcmd"); + pkgcmd:AddParam1("which pkgcmd"); + pkgcmd:SetSuccessToken("/usr/bin/pkgcmd"); + + -- /usr/bin/launch_app + local launch_app = ssdb("/usr/bin/launch_app"); + launch_app:AddParam1("which launch_app"); + launch_app:SetSuccessToken("/usr/bin/launch_app"); + + -- make tc, and added case + tc_project = cmd_suite("test for native project"); + tc_project:AddCmdTest(pkgcmd); + tc_project:AddCmdTest(launch_app); + + tc_project:SetLevel(1); + + -- add Test suite + native_ide_suite:AddTest(tc_project); +end + +-- Test - logs view +function add_logs_view_test(native_ide_suite) + print (" === test for logs view === "); + + -- /usr/bin/dlogutil + local dlogutil = ssdb("/usr/bin/dlogutil"); + dlogutil:AddParam1("which dlogutil"); + dlogutil:SetSuccessToken("/usr/bin/dlogutil"); + + -- make tc, and added case + tc_logs_view = cmd_suite("test for logs view"); + tc_logs_view:AddCmdTest(dlogutil); + + tc_logs_view:SetLevel(1); + + -- add Test suite + native_ide_suite:AddTest(tc_logs_view); +end + +-- Test - connection explorer +function add_connection_explorer_test(native_ide_suite) + print (" === test for connection explorer === "); + + -- /bin/mkdir + local mkdir = ssdb("/bin/mkdir"); + mkdir:AddParam1("which mkdir"); + mkdir:SetSuccessToken("/bin/mkdir"); + + -- /bin/ls + local ls = ssdb("/bin/ls"); + ls:AddParam1("which ls"); + ls:SetSuccessToken("/bin/ls"); + + -- /bin/touch + local touch = ssdb("/bin/touch"); + touch:AddParam1("which touch"); + touch:SetSuccessToken("/bin/touch"); + + -- /bin/rm + local rm = ssdb("/bin/rm"); + rm:AddParam1("which rm"); + rm:SetSuccessToken("/bin/rm"); + + -- /bin/mv + local mv = ssdb("/bin/mv"); + mv:AddParam1("which mv"); + mv:SetSuccessToken("/bin/mv"); + + -- make tc, and added case + tc_connection_explorer = cmd_suite("test for connection explorer"); + tc_connection_explorer:AddCmdTest(mkdir); + tc_connection_explorer:AddCmdTest(ls); + tc_connection_explorer:AddCmdTest(touch); + tc_connection_explorer:AddCmdTest(rm); + tc_connection_explorer:AddCmdTest(mv); + + tc_connection_explorer:SetLevel(1); + + -- add Test suite + native_ide_suite:AddTest(tc_connection_explorer); +end + +-- Test - on-demand +function add_on_demand_test(native_ide_suite) + print (" === test for on-demand === "); + + -- /bin/cat + local cat = ssdb("/bin/cat"); + cat:AddParam1("which cat"); + cat:SetSuccessToken("/bin/cat"); + + -- /bin/echo + local echo = ssdb("/bin/echo"); + echo:AddParam1("which echo"); + echo:SetSuccessToken("/bin/echo"); + + -- /bin/tar + local tar = ssdb("/bin/tar"); + tar:AddParam1("which tar"); + tar:SetSuccessToken("/bin/tar"); + + -- /bin/grep + local grep = ssdb("/bin/grep"); + grep:AddParam1("which grep"); + grep:SetSuccessToken("/bin/grep"); + + -- /bin/rpm + local rpm = ssdb("/bin/rpm"); + rpm:AddParam1("which rpm"); + rpm:SetSuccessToken("/bin/rpm"); + + -- make tc, and added case + tc_on_demand = cmd_suite("test for on-demand"); + tc_on_demand:AddCmdTest(cat); + tc_on_demand:AddCmdTest(echo); + tc_on_demand:AddCmdTest(tar); + tc_on_demand:AddCmdTest(grep); + tc_on_demand:AddCmdTest(rpm); + + tc_on_demand:SetLevel(1); + + -- add Test suite + native_ide_suite:AddTest(tc_on_demand); +end + +-- Test - miscellaneous +function add_misc_test(native_ide_suite) + print (" === test for miscellaneous === "); + + -- /opt/share/hidden_storage/SLP_debug + local SLP_debug = ssdb("core dump location: /opt/share/hidden_storage/SLP_debug"); + SLP_debug:AddParam1("ls /opt/share/hidden_storage/SLP_debug ; echo $?"); + SLP_debug:SetSuccessToken("0"); + + -- /opt/bs/core + local core = ssdb("core dump location: /opt/bs/core"); + core:AddParam1("ls /opt/bs/core ; echo $?"); + core:SetSuccessToken("0"); + + -- make tc, and added case + tc_misc = cmd_suite("test for miscellaneous"); + tc_misc:AddCmdTest(SLP_debug); + tc_misc:AddCmdTest(core); + + tc_misc:SetLevel(1); + + -- add Test suite + native_ide_suite:AddTest(tc_misc); +end + + + +-- all test +function test_compliance_native_ide(env) + + print (" ===================== native ide compliance test start!!! ===================== "); + + -- create test suite about IDE + native_ide_suite = TsIDE("compliance-native-ide-test"); + + -- add test case + add_project_test(native_ide_suite) + add_logs_view_test(native_ide_suite) + add_connection_explorer_test(native_ide_suite) + add_on_demand_test(native_ide_suite) + add_misc_test(native_ide_suite) + + -- start + native_ide_suite:runTest(); + + print (" ===================== native ide compliance test end!!! ===================== "); +end + -- 2.7.4