From 486044db9bbd72097e20d0f36797f2de73d7187f Mon Sep 17 00:00:00 2001 From: wangshi Date: Fri, 9 Sep 2022 16:02:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1,=E5=A2=9E=E5=8A=A0=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E6=96=87=E4=BB=B6;2,=E4=BF=AE=E6=94=B9=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=BF=87=E6=BB=A4,=E4=B8=8D=E8=AE=B0?= =?UTF-8?q?=E5=BD=95retry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangshi --- install.sh | 28 ++++++++++++++++++++++++++++ ohtest | 32 ++++++++++++++++++++++++++++++++ src/core/command/display.py | 12 ++++++------ src/core/command/run.py | 3 ++- 4 files changed, 68 insertions(+), 7 deletions(-) create mode 100755 install.sh create mode 100755 ohtest diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..490d515 --- /dev/null +++ b/install.sh @@ -0,0 +1,28 @@ +#! /bin/bash +# +# Copyright (c) 2020 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +sudo cp ohtest /usr/bin/ + +if cat ~/.bashrc | grep "DEVTESTDIR" > /dev/null +then + echo "DEVTESTDIR exist" +fi + +sed -i "/DEVTESTDIR/d" ~/.bashrc + +testdir=$(cd $(dirname $0);pwd) +testparam="export DEVTESTDIR="$testdir +echo $testparam >> ~/.bashrc \ No newline at end of file diff --git a/ohtest b/ohtest new file mode 100755 index 0000000..a1b32fc --- /dev/null +++ b/ohtest @@ -0,0 +1,32 @@ +#!/usr/bin/python +# +# Copyright (c) 2020 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os +import sys + +print(os.getcwd()) + +if "DEVTESTDIR" in os.environ: + homedir = os.environ["DEVTESTDIR"] + os.chdir(homedir) + print(os.getcwd()) + cmd = "./start.sh" + for index in range (1, len(sys.argv)): + cmd += " " + sys.argv[index] + print(cmd) + os.system(cmd) +else: + print("no DEVTESTDIR!!") \ No newline at end of file diff --git a/src/core/command/display.py b/src/core/command/display.py index 6fbc832..5760a8d 100755 --- a/src/core/command/display.py +++ b/src/core/command/display.py @@ -104,8 +104,8 @@ usage: run [-p PRODUCTFORM] [-tc TESTCASE] [-tl TESTLEVEL] [-repeat NUMBER] - [-thl] - [-thr HISCOMMAND-INDEX] + [-hl] + [-rh HISCOMMAND-INDEX] [-retry] optional arguments: @@ -122,10 +122,10 @@ optional arguments: -tc TESTCASE, --testcase TESTCASE Specify test case -tl TESTLEVEL, --testlevel TESTLEVEL - -repeat NUMBER, --repeat NUMBER + --repeat NUMBER -hl, --hisotrylist -rh INDEX, --runhistory INDEX - -retry + --retry Examples: run -t UT @@ -137,14 +137,14 @@ Examples: AAFwkBaseTest.* run -t UT -ss aafwk -tm base_test -ts base_test -tc \ AAFwkBaseTest.object_test_001 - run -t UT -ss aafwk -tm base_test -repeat 3 + run -t UT -ss aafwk -tm base_test --repeat 3 run -t MST ... run -t ALL ... run -hl run -rh 1 - run -retry + run --retry run -t ACTS -ss arkui,ability -ts ActsAceEtsTest;ActsAceEtsStTest;ActsApiTest """ diff --git a/src/core/command/run.py b/src/core/command/run.py index 392281e..bd793ab 100755 --- a/src/core/command/run.py +++ b/src/core/command/run.py @@ -100,7 +100,8 @@ class Run(object): "command": command, "options": options } - if not ("-thl" in options.current_raw_cmd or "-thr" in options.current_raw_cmd): + if not ("-hl" in options.current_raw_cmd or "-rh" in options.current_raw_cmd \ + or "--retry" in options.current_raw_cmd): need_record_history = True #打印历史记录 -- Gitee From d3beadd494a2e9553fa322f0690c82887a822fe3 Mon Sep 17 00:00:00 2001 From: wangshi Date: Tue, 13 Sep 2022 17:59:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9copyright=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E4=B8=BA2022?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangshi --- install.sh | 2 +- ohtest | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 490d515..86c05c7 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #! /bin/bash # -# Copyright (c) 2020 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/ohtest b/ohtest index a1b32fc..ff86949 100755 --- a/ohtest +++ b/ohtest @@ -1,6 +1,6 @@ #!/usr/bin/python # -# Copyright (c) 2020 Huawei Device Co., Ltd. +# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -- Gitee