add tuna 0.19
This commit is contained in:
@@ -2,13 +2,28 @@
|
||||
"path": "$OET_PATH/testcases/cli-test/tuna",
|
||||
"cases": [
|
||||
{
|
||||
"name": "oe_test_tuna_01"
|
||||
"name": "oe_test_tuna_apply"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_02"
|
||||
"name": "oe_test_tuna_include"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_03"
|
||||
"name": "oe_test_tuna_run"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_show_irqs"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_show_threads_01"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_show_threads_02"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_spread"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
14
suite2cases/tuna_0.14.json
Normal file
14
suite2cases/tuna_0.14.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"path": "$OET_PATH/testcases/cli-test/tuna",
|
||||
"cases": [
|
||||
{
|
||||
"name": "oe_test_tuna_01"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_02"
|
||||
},
|
||||
{
|
||||
"name": "oe_test_tuna_03"
|
||||
}
|
||||
]
|
||||
}
|
||||
58
testcases/cli-test/tuna/oe_test_tuna.sh
Normal file
58
testcases/cli-test/tuna/oe_test_tuna.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna -h | grep "usage: tuna"
|
||||
CHECK_RESULT $? 0 0 "tuna -h No Pass"
|
||||
tuna --help | grep "usage: tuna"
|
||||
CHECK_RESULT $? 0 0 "tuna --help No Pass"
|
||||
tuna -v | grep "$(rpm -qa tuna | awk -F- '{print $2}')"
|
||||
CHECK_RESULT $? 0 0 "tuna -v No Pass"
|
||||
tuna --version | grep "$(rpm -qa tuna | awk -F- '{print $2}')"
|
||||
CHECK_RESULT $? 0 0 "tuna --version No Pass"
|
||||
tuna -D 2>&1 | grep -i "debug"
|
||||
CHECK_RESULT $? 0 0 "tuna -D No Pass"
|
||||
tuna -D -L 1 2>&1 | grep "log level"
|
||||
CHECK_RESULT $? 0 0 "tuna -L No Pass"
|
||||
tuna --debug 2>&1 | grep -i "debug"
|
||||
CHECK_RESULT $? 0 0 "tuna --debug No Pass"
|
||||
tuna -D --logging 1 2>&1 | grep "log level"
|
||||
CHECK_RESULT $? 0 0 "tuna --logging No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
rm -rf ./tuna-*
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
62
testcases/cli-test/tuna/oe_test_tuna_apply.sh
Normal file
62
testcases/cli-test/tuna/oe_test_tuna_apply.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
systemctl restart sshd.service
|
||||
cp /etc/tuna/example.conf ./
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna apply -h | grep "usage: tuna apply"
|
||||
CHECK_RESULT $? 0 0 "tuna apply -h No Pass"
|
||||
tuna apply --help | grep "usage: tuna apply"
|
||||
CHECK_RESULT $? 0 0 "tuna apply --help No Pass"
|
||||
tuna what_is -h | grep "usage: tuna what_is"
|
||||
CHECK_RESULT $? 0 0 "tuna what_is -h No Pass"
|
||||
tuna what_is --help | grep "usage: tuna what_is"
|
||||
CHECK_RESULT $? 0 0 "tuna what_is --help No Pass"
|
||||
tuna what_is sshd | grep "sshd:"
|
||||
CHECK_RESULT $? 0 0 "tuna what_is No Pass"
|
||||
tuna gui -h | grep "usage: tuna gui"
|
||||
CHECK_RESULT $? 0 0 "tuna gui -h No Pass"
|
||||
tuna gui --help | grep "usage: tuna gui"
|
||||
CHECK_RESULT $? 0 0 "tuna gui --help No Pass"
|
||||
tuna isolate -h | grep "tuna isolate"
|
||||
CHECK_RESULT $? 0 0 "tuna isolate -h No Pass"
|
||||
tuna isolate --help | grep "tuna isolate"
|
||||
CHECK_RESULT $? 0 0 "tuna isolate --help No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
rm -rf example.conf
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
75
testcases/cli-test/tuna/oe_test_tuna_include.sh
Normal file
75
testcases/cli-test/tuna/oe_test_tuna_include.sh
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
systemctl restart sshd.service
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna include -h | grep "usage: tuna include"
|
||||
CHECK_RESULT $? 0 0 "tuna include -h No Pass"
|
||||
tuna include --help | grep "usage: tuna include"
|
||||
CHECK_RESULT $? 0 0 "tuna include --help No Pass"
|
||||
tuna include -c 0
|
||||
CHECK_RESULT $? 0 0 "tuna include -c No Pass"
|
||||
tuna include --cpus 0
|
||||
CHECK_RESULT $? 0 0 "tuna include --cpus No Pass"
|
||||
tuna include -S 0
|
||||
CHECK_RESULT $? 0 0 "tuna include -S No Pass"
|
||||
tuna include --sockets 0
|
||||
CHECK_RESULT $? 0 0 "tuna include --sockets No Pass"
|
||||
tuna move -h | grep "usage: tuna move"
|
||||
CHECK_RESULT $? 0 0 "tuna move -h No Pass"
|
||||
tuna move --help | grep "usage: tuna move"
|
||||
CHECK_RESULT $? 0 0 "tuna move --help No Pass"
|
||||
irqs_id=$(tuna show_irqs | awk '{print$1}' | tail -n 1)
|
||||
tuna move -c 0 -q "${irqs_id}"
|
||||
CHECK_RESULT $? 0 0 "tuna move -c -q No Pass"
|
||||
tuna show_irqs -q "${irqs_id}" | grep "${irqs_id}" | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -q No Pass"
|
||||
tuna move -S 0 --irqs "${irqs_id}"
|
||||
CHECK_RESULT $? 0 0 "tuna move -S --irqs No Pass"
|
||||
tuna show_irqs -q "${irqs_id}" | grep "${irqs_id}" | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -q No Pass"
|
||||
tuna move --cpus 0 -t sshd
|
||||
CHECK_RESULT $? 0 0 "tuna move --cpus -t No Pass"
|
||||
tuna show_threads -t sshd | grep sshd | awk '{print $4}' | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t No Pass"
|
||||
tuna move --sockets 0 --threads sshd
|
||||
CHECK_RESULT $? 0 0 "tuna move --sockets --threads No Pass"
|
||||
tuna show_threads -t sshd | grep sshd | awk '{print $4}' | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
66
testcases/cli-test/tuna/oe_test_tuna_run.sh
Normal file
66
testcases/cli-test/tuna/oe_test_tuna_run.sh
Normal file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna run -h | grep "usage: tuna run"
|
||||
CHECK_RESULT $? 0 0 "tuna run -h No Pass"
|
||||
tuna run --help | grep "usage: tuna run"
|
||||
CHECK_RESULT $? 0 0 "tuna run --help No Pass"
|
||||
tuna run -c 0 -p OTHER:0 uname | grep "$(uname)"
|
||||
CHECK_RESULT $? 0 0 "tuna run -c -p No Pass"
|
||||
tuna run -S 0 -b uname | grep "$(uname)"
|
||||
CHECK_RESULT $? 0 0 "tuna run -S -b No Pass"
|
||||
tuna run --cpus 0 --priority OTHER:0 uname | grep "$(uname)"
|
||||
CHECK_RESULT $? 0 0 "tuna run --cpus --priority No Pass"
|
||||
tuna run --sockets 0 --background uname | grep "$(uname)"
|
||||
CHECK_RESULT $? 0 0 "tuna run --sockets --background No Pass"
|
||||
tuna save -h | grep "usage: tuna save"
|
||||
CHECK_RESULT $? 0 0 "tuna save -h No Pass"
|
||||
tuna save --help | grep "usage: tuna save"
|
||||
CHECK_RESULT $? 0 0 "tuna save --help No Pass"
|
||||
tuna save -c 0 -t sshd savefile && grep "Generated by tuna" savefile
|
||||
CHECK_RESULT $? 0 0 "tuna save -c -t No Pass"
|
||||
tuna save -S 0 -t sshd savefile && grep "Generated by tuna" savefile
|
||||
CHECK_RESULT $? 0 0 "tuna save -S -t No Pass"
|
||||
tuna save --cpus 0 -t sshd savefile && grep "Generated by tuna" savefile
|
||||
CHECK_RESULT $? 0 0 "tuna save --cpus -t No Pass"
|
||||
tuna save --sockets 0 --threads sshd savefile && grep "Generated by tuna" savefile
|
||||
CHECK_RESULT $? 0 0 "tuna save -sockets --threads No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
rm -rf savefile
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
63
testcases/cli-test/tuna/oe_test_tuna_show_irqs.sh
Normal file
63
testcases/cli-test/tuna/oe_test_tuna_show_irqs.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna show_irqs -h | grep "usage: tuna show_irqs"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -h No Pass"
|
||||
tuna show_irqs --help | grep "usage: tuna show_irqs"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs --help No Pass"
|
||||
tuna show_irqs -c 0 | grep "0"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -c No Pass"
|
||||
tuna show_irqs --cpus 0 | grep "0"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs --cpus No Pass"
|
||||
tuna show_irqs -S 0 | grep "[0-9]"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -S No Pass"
|
||||
tuna show_irqs --sockets 0 | grep "[0-9]"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs --sockets No Pass"
|
||||
tuna show_irqs -q pciehp | grep -E "pciehp|virtio"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -q No Pass"
|
||||
tuna show_irqs --irqs pciehp | grep -E "pciehp|virtio"
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs --irqs No Pass"
|
||||
tuna show_configs | grep "config"
|
||||
CHECK_RESULT $? 0 0 "tuna show_configs No Pass"
|
||||
tuna show_configs -h | grep "usage: tuna show_configs"
|
||||
CHECK_RESULT $? 0 0 "tuna show_configs -h No Pass"
|
||||
tuna show_configs --help | grep "usage: tuna show_configs"
|
||||
CHECK_RESULT $? 0 0 "tuna show_configs --help No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
62
testcases/cli-test/tuna/oe_test_tuna_show_threads_01.sh
Normal file
62
testcases/cli-test/tuna/oe_test_tuna_show_threads_01.sh
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
systemctl restart sshd.service
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna show_threads -h | grep "usage: tuna show_threads"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -h No Pass"
|
||||
tuna show_threads --help | grep "usage: tuna show_threads"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --help No Pass"
|
||||
tuna show_threads -c 0 2>&1 | grep "cpu.*0"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -c No Pass"
|
||||
tuna show_threads --cpus 0 2>&1 | grep "cpu.*0"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --cpus No Pass"
|
||||
tuna show_threads -S 0 | grep "[0-9]"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -S No Pass"
|
||||
tuna show_threads --sockets 0 | grep "[0-9]"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --sockets No Pass"
|
||||
tuna show_threads -t sshd | grep sshd
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t No Pass"
|
||||
tuna show_threads --threads sshd | grep sshd
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --threads No Pass"
|
||||
tuna show_threads -q pciehp | grep -E "pciehp|sshd"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -q No Pass"
|
||||
tuna show_threads --irqs pciehp | grep -E "pciehp|sshd"
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --irqs No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
61
testcases/cli-test/tuna/oe_test_tuna_show_threads_02.sh
Normal file
61
testcases/cli-test/tuna/oe_test_tuna_show_threads_02.sh
Normal file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna show_threads | grep systemd
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads No Pass"
|
||||
tuna show_threads -U | grep systemd
|
||||
CHECK_RESULT $? 0 1 "tuna show_threads -U No Pass"
|
||||
tuna show_threads --no_uthreads | grep systemd
|
||||
CHECK_RESULT $? 0 1 "tuna show_threads --no_uthreads No Pass"
|
||||
tuna show_threads | grep cpu
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads No Pass"
|
||||
tuna show_threads -K | grep cpu
|
||||
CHECK_RESULT $? 0 1 "tuna show_threads -K No Pass"
|
||||
tuna show_threads --no_kthreads | grep cpu
|
||||
CHECK_RESULT $? 0 1 "tuna show_threads --no_kthreads No Pass"
|
||||
tuna show_threads -G | grep "name="
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -G No Pass"
|
||||
tuna show_threads --cgroups | grep "name="
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --cgroups No Pass"
|
||||
tuna show_threads -z | grep systemd
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -z No Pass"
|
||||
tuna show_threads --spaced | grep systemd
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads --spaced No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
75
testcases/cli-test/tuna/oe_test_tuna_spread.sh
Normal file
75
testcases/cli-test/tuna/oe_test_tuna_spread.sh
Normal file
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# Copyright (c) 2025. 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 details.
|
||||
|
||||
# ##################################
|
||||
# @Author : liujingjing
|
||||
# @Contact : liujingjing25812@163.com
|
||||
# @Date : 2025/01/02
|
||||
# @License : Mulan PSL v2
|
||||
# @Desc : Test "tuna" command
|
||||
# ##################################
|
||||
|
||||
source "${OET_PATH}"/libs/locallibs/common_lib.sh
|
||||
|
||||
function pre_test() {
|
||||
LOG_INFO "Start to prepare the test environment"
|
||||
OLD_LANG=$LANG
|
||||
export LANG=en_US.UTF-8
|
||||
DNF_INSTALL "tuna"
|
||||
systemctl restart sshd.service
|
||||
LOG_INFO "End to prepare the test environment"
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
LOG_INFO "Start to run test."
|
||||
tuna spread -h | grep "usage: tuna spread"
|
||||
CHECK_RESULT $? 0 0 "tuna spread -h No Pass"
|
||||
tuna spread --help | grep "usage: tuna spread"
|
||||
CHECK_RESULT $? 0 0 "tuna spread --help No Pass"
|
||||
irqs_id=$(tuna show_irqs | awk '{print$1}' | tail -n 1)
|
||||
tuna spread -c 0 -q "$irqs_id"
|
||||
CHECK_RESULT $? 0 0 "tuna spread -c -q No Pass"
|
||||
tuna show_irqs -q "$irqs_id" | grep "$irqs_id" | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -q No Pass"
|
||||
tuna spread -S 0 --irqs "$irqs_id"
|
||||
CHECK_RESULT $? 0 0 "tuna spread -S --irqs No Pass"
|
||||
tuna show_irqs -q "$irqs_id" | grep "$irqs_id" | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_irqs -q No Pass"
|
||||
tuna spread --cpus 0 -t sshd
|
||||
CHECK_RESULT $? 0 0 "tuna spread -cpus -t No Pass"
|
||||
tuna show_threads -t sshd | grep sshd | awk '{print $4}' | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t No Pass"
|
||||
tuna spread --sockets 0 --threads sshd
|
||||
CHECK_RESULT $? 0 0 "tuna spread --sockets --threads No Pass"
|
||||
tuna show_threads -t sshd | grep sshd | awk '{print $4}' | grep -w 0
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t No Pass"
|
||||
tuna priority -h | grep "usage: tuna priority"
|
||||
CHECK_RESULT $? 0 0 "tuna priority -h No Pass"
|
||||
tuna priority --help | grep "usage: tuna priority"
|
||||
CHECK_RESULT $? 0 0 "tuna priority --help No Pass"
|
||||
tuna priority -t sshd -C OTHER:0
|
||||
CHECK_RESULT $? 0 0 "tuna priority -t -C No Pass"
|
||||
tuna show_threads -t sshd | grep OTHER
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t sshd No Pass"
|
||||
tuna priority --threads sshd --affect_children OTHER:0
|
||||
CHECK_RESULT $? 0 0 "tuna priority -t -C No Pass"
|
||||
tuna show_threads -t sshd | grep OTHER
|
||||
CHECK_RESULT $? 0 0 "tuna show_threads -t sshd No Pass"
|
||||
LOG_INFO "End to run test."
|
||||
}
|
||||
function post_test() {
|
||||
LOG_INFO "Start to restore the test environment."
|
||||
DNF_REMOVE "$@"
|
||||
export LANG=${OLD_LANG}
|
||||
LOG_INFO "End to restore the test environment."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user