From 8e97b4ee3c41dc6b65da7b79b8edaf1227e2911d Mon Sep 17 00:00:00 2001 From: "chengtao.liu" Date: Mon, 10 Feb 2014 18:06:14 +0800 Subject: [PATCH] sync codes for tizen_tct_2.2.1 --- VERSION | 4 ++-- commodule/Makefile.am | 4 ---- commodule/autoexec.py | 5 ----- commodule/connector.py | 4 ---- commodule/httprequest.py | 5 ----- commodule/impl/Makefile.am | 4 ---- commodule/impl/androidmobile.py | 12 ++++-------- commodule/impl/localhost.py | 5 ----- commodule/impl/tizenmobile.py | 11 +++-------- commodule/impl/tizenpc.py | 5 ----- commodule/killall.py | 5 ----- commodule/log.py | 5 ----- commodule/str2.py | 5 ----- debian/changelog | 2 +- debian/rules | 0 doc/Makefile.am | 4 ---- packaging/testkit-lite.spec | 2 +- setup.py | 20 ++++++++++++++++++-- testkit-lite | 5 ----- testkitlite/Makefile.am | 4 ---- testkitlite/common/Makefile.am | 4 ---- testkitlite/common/process_killall.py | 5 ----- testkitlite/engines/Makefile.am | 4 ---- testkitlite/engines/default/Makefile.am | 4 ---- testkitlite/engines/default/runner.py | 7 ------- testkitlite/engines/default/worker.py | 20 ++++++++++---------- web/Makefile.am | 4 ---- web/index.html | 4 ---- web/manual_harness.html | 4 ---- web/manualharness.html | 4 ---- xsd/Makefile.am | 4 ---- 31 files changed, 39 insertions(+), 136 deletions(-) mode change 100755 => 100644 debian/rules diff --git a/VERSION b/VERSION index 5c878c6..9567ec8 100644 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ [public_version] -version=2.3.20 +version=2.3.22 [internal_version] -version=2.3.20 +version=2.3.22 diff --git a/commodule/Makefile.am b/commodule/Makefile.am index 205211e..b341307 100644 --- a/commodule/Makefile.am +++ b/commodule/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Yuanyuan,Zou diff --git a/commodule/autoexec.py b/commodule/autoexec.py index 25991a5..6bb3752 100644 --- a/commodule/autoexec.py +++ b/commodule/autoexec.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# # Authors: # Liu,chengtao """ The shell command executor module""" diff --git a/commodule/connector.py b/commodule/connector.py index a552164..dc6ce65 100644 --- a/commodule/connector.py +++ b/commodule/connector.py @@ -12,10 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301,USA. -# # Authors: # Liu,chengtao """Test connector for test instance and target instance""" diff --git a/commodule/httprequest.py b/commodule/httprequest.py index 97ad3f3..b1a2574 100644 --- a/commodule/httprequest.py +++ b/commodule/httprequest.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# # Authors: # Liu,chengtao """ The http request process module""" diff --git a/commodule/impl/Makefile.am b/commodule/impl/Makefile.am index 2d91657..6ea9162 100644 --- a/commodule/impl/Makefile.am +++ b/commodule/impl/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Yuanyuan,Zou diff --git a/commodule/impl/androidmobile.py b/commodule/impl/androidmobile.py index 907a396..3a281ae 100644 --- a/commodule/impl/androidmobile.py +++ b/commodule/impl/androidmobile.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Chengtao,Liu @@ -98,14 +93,15 @@ class AndroidMobile: def launch_stub(self, stub_app, stub_port="8000", debug_opt=""): wgt_name = "testkit.stub/.TestkitStub" - blauched = True pkg_name = wgt_name.split('/')[0] cmdline = APP_STOP % (self.deviceid, pkg_name) exit_code, ret = shell_command(cmdline) cmdline = APP_START % (self.deviceid, wgt_name) - exit_code, ret = shell_command(cmdline) + debug_ext = " -e debug on" if debug_opt != "" else " -e debug off" + port_ext = " -e port " + stub_port + exit_code, ret = shell_command(cmdline + port_ext + debug_ext) time.sleep(2) - return blauched + return True def shell_cmd_ext(self, cmd="", diff --git a/commodule/impl/localhost.py b/commodule/impl/localhost.py index 72ccd32..8c1cb0b 100644 --- a/commodule/impl/localhost.py +++ b/commodule/impl/localhost.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# # Authors: # Liu,chengtao diff --git a/commodule/impl/tizenmobile.py b/commodule/impl/tizenmobile.py index 12584ad..b58ac79 100644 --- a/commodule/impl/tizenmobile.py +++ b/commodule/impl/tizenmobile.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Chengtao,Liu @@ -41,7 +36,7 @@ RPM_LIST = "sdb -s %s shell \"rpm -qa|grep tct\"" APP_QUERY_STR = "sdb -s %s shell \"ps aux|grep '%s'|grep -v grep\"|awk '{print $2}'" APP_KILL_STR = "sdb -s %s shell kill -9 %s" WRT_QUERY_STR = "sdb -s %s shell wrt-launcher -l | grep '%s'|awk '{print $2\":\"$NF}'" -WRT_START_STR = "sdb -s %s shell wrt-launcher -s %s" +WRT_START_STR = "sdb -s %s shell 'wrt-launcher -s %s; echo returncode=$?'" WRT_STOP_STR = "sdb -s %s shell wrt-launcher -k %s" WRT_INSTALL_STR = "sdb -s %s shell wrt-installer -i %s" WRT_UNINSTL_STR = "sdb -s %s shell wrt-installer -un %s" @@ -330,8 +325,8 @@ class TizenMobile: exit_code, ret = shell_command(cmdline) cmdline = WRT_START_STR % (self.deviceid, wgt_name) while timecnt < 3: - exit_code, ret = shell_command(cmdline) - if len(ret) > 0 and ret[0].find('launched') != -1: + exit_code, ret_out, ret_err = shell_command_ext(cmdline, 30) + if exit_code == "0": blauched = True break timecnt += 1 diff --git a/commodule/impl/tizenpc.py b/commodule/impl/tizenpc.py index 9f65ea9..1586dce 100644 --- a/commodule/impl/tizenpc.py +++ b/commodule/impl/tizenpc.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Chengtao,Liu diff --git a/commodule/killall.py b/commodule/killall.py index 28f6070..2458887 100644 --- a/commodule/killall.py +++ b/commodule/killall.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110 - 1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/commodule/log.py b/commodule/log.py index 8c4fee6..450c8b7 100644 --- a/commodule/log.py +++ b/commodule/log.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# # Authors: # Liu,chengtao """General Implementation""" diff --git a/commodule/str2.py b/commodule/str2.py index 96ecdc7..6971df4 100644 --- a/commodule/str2.py +++ b/commodule/str2.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/debian/changelog b/debian/changelog index 471250f..521ebde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -testkit-lite (2.3.20) unstable; urgency=low +testkit-lite (2.3.22) unstable; urgency=low * TCT2.2.1 Release. diff --git a/debian/rules b/debian/rules old mode 100755 new mode 100644 diff --git a/doc/Makefile.am b/doc/Makefile.am index 80c2a27..b70840b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/packaging/testkit-lite.spec b/packaging/testkit-lite.spec index 0d21550..c024128 100644 --- a/packaging/testkit-lite.spec +++ b/packaging/testkit-lite.spec @@ -1,6 +1,6 @@ Summary: TCT-Lite Name: testkit-lite -Version: 2.3.20 +Version: 2.3.22 Release: 1 License: GPLv2 Group: Applications/System diff --git a/setup.py b/setup.py index be80897..9f8ac1d 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,20 @@ #!/usr/bin/python +# +# Copyright (C) 2012 Intel Corporation +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# Authors: +# Jing,Wang +# Yuanyuan,Zou from setuptools import setup, find_packages @@ -8,10 +24,10 @@ setup( url = "https://github.com/testkit/testkit-lite", author = "Cathy Shen", author_email = "cathy.shen@intel.com", - version = "2.3.20", + version = "2.3.22", include_package_data = True, data_files = [('/opt/testkit/lite/', - ('VERSION', 'doc/testkit-lite_user_guide_for_tct.pdf'))], + ('VERSION', 'doc/testkit-lite_user_guide_for_tct.pdf'))], scripts = ('testkit-lite',), packages = find_packages(), ) diff --git a/testkit-lite b/testkit-lite index 65d5b24..48536aa 100755 --- a/testkit-lite +++ b/testkit-lite @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, -# USA. -# # Authors: # Jing,Wang # Yuanyuan,Zou diff --git a/testkitlite/Makefile.am b/testkitlite/Makefile.am index e619983..5a462d8 100644 --- a/testkitlite/Makefile.am +++ b/testkitlite/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/common/Makefile.am b/testkitlite/common/Makefile.am index 0cafaad..7fbb07f 100644 --- a/testkitlite/common/Makefile.am +++ b/testkitlite/common/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/common/process_killall.py b/testkitlite/common/process_killall.py index f15427a..cd923a4 100755 --- a/testkitlite/common/process_killall.py +++ b/testkitlite/common/process_killall.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/engines/Makefile.am b/testkitlite/engines/Makefile.am index b360a3f..7d0d213 100644 --- a/testkitlite/engines/Makefile.am +++ b/testkitlite/engines/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/engines/default/Makefile.am b/testkitlite/engines/default/Makefile.am index 0591520..3babd1f 100644 --- a/testkitlite/engines/default/Makefile.am +++ b/testkitlite/engines/default/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/engines/default/runner.py b/testkitlite/engines/default/runner.py index c88a679..4f3fc0b 100644 --- a/testkitlite/engines/default/runner.py +++ b/testkitlite/engines/default/runner.py @@ -12,13 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., -# 51 Franklin Street, -# Fifth Floor, -# Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/testkitlite/engines/default/worker.py b/testkitlite/engines/default/worker.py index b116125..b8d00eb 100644 --- a/testkitlite/engines/default/worker.py +++ b/testkitlite/engines/default/worker.py @@ -12,11 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -# MA 02110-1301, USA. -# # Authors: # Chengtao,Liu """ The implementation test worker""" @@ -35,7 +30,8 @@ from commodule.httprequest import get_url, http_request CNT_RETRY = 10 DATE_FORMAT_STR = "%Y-%m-%d %H:%M:%S" -UIFW_MAX_TIME = 600 +UIFW_MAX_TIME = 300 +UIFW_MAX_WRITE_TIME = 10 UIFW_RESULT = "/opt/usr/media/Documents/tcresult" UIFW_SET_NUM = 0 LAUNCH_ERROR = 1 @@ -304,6 +300,7 @@ def _webuifw_test_exec(conn, test_web_app, test_session, test_set_name, exetype, result_obj.set_status(0) result_obj.set_result({"resultfile": ""}) ls_cmd = "ls -l %s" % set_UIFW_RESULT + sz_cmd = "du -hk %s " % set_UIFW_RESULT time_out = UIFW_MAX_TIME rm_cmd = "rm /opt/usr/media/Documents/tcresult*.xml" @@ -322,10 +319,13 @@ def _webuifw_test_exec(conn, test_web_app, test_session, test_set_name, exetype, while time_out > 0: LOGGER.info('[webuifw] waiting for test completed...') exit_code, ret = conn.shell_cmd(ls_cmd) - if 'No such file or directory' in ret[0]: - continue - else: - break + if not 'No such file or directory' in ret[0]: + exit_code, ret = conn.shell_cmd(sz_cmd) + f_size = int(ret[0].split("\t")[0]) + if f_size > 0: + break + if time_out > UIFW_MAX_WRITE_TIME: + time_out = UIFW_MAX_WRITE_TIME time.sleep(2) time_out -= 2 diff --git a/web/Makefile.am b/web/Makefile.am index 7c6dc85..ed22ef2 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/web/index.html b/web/index.html index ffe4019..2d1f327 100644 --- a/web/index.html +++ b/web/index.html @@ -12,10 +12,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Wang, Jing # Tang, Shaofeng diff --git a/web/manual_harness.html b/web/manual_harness.html index 63a4c61..cc6aac4 100644 --- a/web/manual_harness.html +++ b/web/manual_harness.html @@ -11,10 +11,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/web/manualharness.html b/web/manualharness.html index 6ca25b5..1339fdf 100644 --- a/web/manualharness.html +++ b/web/manualharness.html @@ -11,10 +11,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui diff --git a/xsd/Makefile.am b/xsd/Makefile.am index 90f5086..9b44e0e 100644 --- a/xsd/Makefile.am +++ b/xsd/Makefile.am @@ -10,10 +10,6 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# # Authors: # Zhang, Huihui # Wendong,Sui -- 2.7.4