From ab8cfa00b1d7092fab0bffab3e67854b6232a439 Mon Sep 17 00:00:00 2001 From: clay <578345022@qq.com> Date: Tue, 30 Jul 2024 02:07:42 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20smoke-xdiagnose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testcases/smoke-test/smoke-xdiagnose/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 testcases/smoke-test/smoke-xdiagnose/.keep diff --git a/testcases/smoke-test/smoke-xdiagnose/.keep b/testcases/smoke-test/smoke-xdiagnose/.keep new file mode 100644 index 000000000..e69de29bb -- Gitee From 0e0a1041854fea2331d610d5e1c09df362e2be89 Mon Sep 17 00:00:00 2001 From: clay <578345022@qq.com> Date: Tue, 30 Jul 2024 02:10:57 +0000 Subject: [PATCH 2/5] add testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh. Signed-off-by: clay <578345022@qq.com> --- .../oe_test_xdiagnose_basic.sh | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh diff --git a/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh b/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh new file mode 100644 index 000000000..e8d6073d7 --- /dev/null +++ b/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh @@ -0,0 +1,56 @@ +#!/usr/bin/bash + +# Copyright (c) 2023. Huawei Technologies Co.,Ltd.ALL rights reserved. +# This program is licensed under Mulan PSL v2. +# You can use it according to the terms and conditions of the Mulan PSL v2. +# http://license.coscl.org.cn/MulanPSL2 +# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, +# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, +# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. +# See the Mulan PSL v2 for more detaitest -f. + +# ############################################# +# @Author : clay +# @Contact : clay4016@126.com +# @Date : 2023/10/15 +# @License : Mulan PSL v2 +# @Desc : Test xdiagnose +# ############################################# + +source "${OET_PATH}"/libs/locallibs/common_lib.sh + +function pre_test() { + LOG_INFO "Start environmental preparation." + DNF_INSTALL "xdiagnose" + SLEEP_WAIT 5 + LOG_INFO "End environmental preparation." +} + +function run_test() { + LOG_INFO "Start testing..." + stdbuf -oL xd_arpstormcheck -f 1 -i 1 -c 2 2>&1 | grep "SIP.*TIP.*Freq" + CHECK_RESULT $? 0 0 "xd_arpstormcheck result err" + + stdbuf -oL xd_scsiiocount -d sda -i 1 -t 5 2>&1 | grep -c DEVICE | grep -w 5 + CHECK_RESULT $? 0 0 "xd_scsiiocount result err" + + local_ip=$(ip route | head -1 | awk '{print $3}') + stdbuf -oL xd_tcpskinfo -a "${local_ip}" -p 22 2>&1 | grep skmem + CHECK_RESULT $? 0 0 "xd_tcpskinfo result err" + + stdbuf -oL xd_scsiiotrace -d 0:0:0:0 -e start >checklog 2>&1 & + SLEEP_WAIT 3 + pkill xd_scsiiotrace + grep Tracing checklog + CHECK_RESULT $? 0 0 "xd_scsiiotrace result err" + LOG_INFO "Finish test!" +} + +function post_test() { + LOG_INFO "start environment cleanup." + DNF_REMOVE "$@" + rm -rf checklog + LOG_INFO "Finish environment cleanup!" +} + +main "$@" \ No newline at end of file -- Gitee From dd48927bb8236a0eb08ec0b4d59be6b1c39999c3 Mon Sep 17 00:00:00 2001 From: clay <578345022@qq.com> Date: Tue, 30 Jul 2024 02:12:05 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20test?= =?UTF-8?q?cases/smoke-test/smoke-xdiagnose/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testcases/smoke-test/smoke-xdiagnose/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 testcases/smoke-test/smoke-xdiagnose/.keep diff --git a/testcases/smoke-test/smoke-xdiagnose/.keep b/testcases/smoke-test/smoke-xdiagnose/.keep deleted file mode 100644 index e69de29bb..000000000 -- Gitee From 44d8656b07458ac8ae7fb3b25531304a48be8b06 Mon Sep 17 00:00:00 2001 From: clay <578345022@qq.com> Date: Tue, 22 Oct 2024 03:20:22 +0000 Subject: [PATCH 4/5] update testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh. Signed-off-by: clay <578345022@qq.com> --- .../smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh b/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh index e8d6073d7..9d6f69684 100644 --- a/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh +++ b/testcases/smoke-test/smoke-xdiagnose/oe_test_xdiagnose_basic.sh @@ -34,11 +34,10 @@ function run_test() { stdbuf -oL xd_scsiiocount -d sda -i 1 -t 5 2>&1 | grep -c DEVICE | grep -w 5 CHECK_RESULT $? 0 0 "xd_scsiiocount result err" - local_ip=$(ip route | head -1 | awk '{print $3}') - stdbuf -oL xd_tcpskinfo -a "${local_ip}" -p 22 2>&1 | grep skmem + stdbuf -oL xd_tcpskinfo -a "${NODE1_IPV4}" -p 22 2>&1 | grep skmem CHECK_RESULT $? 0 0 "xd_tcpskinfo result err" - stdbuf -oL xd_scsiiotrace -d 0:0:0:0 -e start >checklog 2>&1 & + stdbuf -oL xd_scsiiotrace -d 0:0:0:0 >checklog 2>&1 & SLEEP_WAIT 3 pkill xd_scsiiotrace grep Tracing checklog -- Gitee From 8a8afafd38fadbb08fe60c1b3c4b9edca68e2ee9 Mon Sep 17 00:00:00 2001 From: clay <578345022@qq.com> Date: Tue, 22 Oct 2024 03:23:12 +0000 Subject: [PATCH 5/5] fix Signed-off-by: clay <578345022@qq.com> --- suite2cases/xdiagnose.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suite2cases/xdiagnose.json b/suite2cases/xdiagnose.json index 90b64ffef..da004cf75 100644 --- a/suite2cases/xdiagnose.json +++ b/suite2cases/xdiagnose.json @@ -1,5 +1,5 @@ { - "path": "$OET_PATH/testcases/cli-test/xdiagnose", + "path": "$OET_PATH/testcases/smoke-test/xdiagnose", "cases": [ { "name": "oe_test_xdiagnose_basic" -- Gitee