mirror of
https://github.com/openharmony/kernel_linux_build.git
synced 2026-07-18 15:54:30 -04:00
linuxkerneltest: fix some shell format and update cpusetdecouple_cpuhotplug_t
1. fix 6 shell format issues 2. delete print_error info when config file not exists 3. change some print info to be clearer Signed-off-by: Ma Feng <mafeng.ma@huawei.com>
This commit is contained in:
+5
-6
@@ -24,9 +24,6 @@
|
||||
# History: Mar 15 2022 - init scripts
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ret=0
|
||||
|
||||
source tst_oh.sh
|
||||
|
||||
do_setup()
|
||||
@@ -45,6 +42,8 @@ do_setup()
|
||||
|
||||
do_test()
|
||||
{
|
||||
local ret=0
|
||||
|
||||
tst_res TINFO "Start test cupsetdecouple_cpuhotplug01"
|
||||
mkdir /dev/cpuset/hotplug01
|
||||
echo "0-3" > /dev/cpuset/hotplug01/cpuset.cpus
|
||||
@@ -58,7 +57,7 @@ do_test()
|
||||
echo 0 > /sys/devices/system/cpu/cpu$i/online
|
||||
cat /dev/cpuset/hotplug01/cpuset.cpus
|
||||
cpu_set=$(cat /dev/cpuset/hotplug01/cpuset.cpus)
|
||||
if [ $cpu_set == '0-3' ]; then
|
||||
if [ "$cpu_set" == '0-3' ]; then
|
||||
tst_res TINFO "hotplug01 cpu$i offline cpuset decouple success"
|
||||
else
|
||||
tst_res TINFO "hotplug01 cpu$i offline cpuset decouple fail"
|
||||
@@ -68,9 +67,9 @@ do_test()
|
||||
done
|
||||
|
||||
if [ $ret -eq 0 ];then
|
||||
tst_res TPASS "cpusetdecouple_cpuhotplug01 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TPASS "CPU hot-plug and CPUSET decoupling are implemented pass."
|
||||
else
|
||||
tst_res TFAIL "cpusetdecouple_cpuhotplug01 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TFAIL "CPU hot-plug and CPUSET decoupling are implemented failed!"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -24,9 +24,6 @@
|
||||
# History: Mar 15 2022 - init scripts
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ret=0
|
||||
|
||||
source tst_oh.sh
|
||||
|
||||
do_setup()
|
||||
@@ -45,6 +42,8 @@ do_setup()
|
||||
|
||||
do_test()
|
||||
{
|
||||
local ret=0
|
||||
|
||||
tst_res TINFO "Start test cupset_decouple_cpuhotplug02"
|
||||
mkdir /dev/cpuset/hotplug02
|
||||
echo "1" > /dev/cpuset/hotplug02/cpuset.cpus
|
||||
@@ -59,7 +58,7 @@ do_test()
|
||||
cat /dev/cpuset/hotplug02/cpuset.cpus
|
||||
cpu_set=$(cat /dev/cpuset/hotplug02/cpuset.cpus)
|
||||
|
||||
if [ $cpu_set == '1' ]; then
|
||||
if [ "$cpu_set" == '1' ]; then
|
||||
tst_res TINFO "hotplug02 cpu1 offline cpuset decouple success"
|
||||
else
|
||||
tst_res TINFO "hotplug02 cpu1 offline cpuset decouple fail"
|
||||
@@ -67,12 +66,12 @@ do_test()
|
||||
fi
|
||||
|
||||
if [ $ret -eq 0 ];then
|
||||
tst_res TPASS "cpusetdecouple_cpuhotplug02 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TPASS "process are migrated when the CPU is offline pass."
|
||||
else
|
||||
tst_res TFAIL "cpusetdecouple_cpuhotplug02 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TFAIL "process are migrated when the CPU is offline failed!"
|
||||
fi
|
||||
|
||||
echo 1 > /sys/devices/system/cpu/cpu1/online #offline cpu$i
|
||||
echo 1 > /sys/devices/system/cpu/cpu1/online
|
||||
|
||||
}
|
||||
|
||||
|
||||
+7
-8
@@ -24,9 +24,6 @@
|
||||
# History: Mar 15 2022 - init scripts
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ret=0
|
||||
|
||||
source tst_oh.sh
|
||||
|
||||
do_setup()
|
||||
@@ -45,15 +42,17 @@ do_setup()
|
||||
|
||||
do_test()
|
||||
{
|
||||
local ret=0
|
||||
|
||||
tst_res TINFO "Start test cupset_decouple_cpuhotplug03"
|
||||
mkdir /dev/cpuset/hotplug03
|
||||
echo 0 > /sys/devices/system/cpu/cpu2/online #offline cpu2
|
||||
echo 0 > /sys/devices/system/cpu/cpu3/online #offline cpu3
|
||||
echo 0 > /sys/devices/system/cpu/cpu2/online
|
||||
echo 0 > /sys/devices/system/cpu/cpu3/online
|
||||
|
||||
echo "0-3" > /dev/cpuset/hotplug03/cpuset.cpus
|
||||
cat /dev/cpuset/hotplug03/cpuset.cpus
|
||||
cpu_set=$(cat /dev/cpuset/hotplug03/cpuset.cpus)
|
||||
if [ $cpu_set == '0-3' ]; then
|
||||
if [ "$cpu_set" == '0-3' ]; then
|
||||
tst_res TINFO "hotplug03 cpu2 cpu3 offline cpuset decouple success"
|
||||
else
|
||||
tst_res TINFO "hotplug03 cpu2 cpu3 offline cpuset decouple fail"
|
||||
@@ -61,9 +60,9 @@ do_test()
|
||||
fi
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
tst_res TPASS "cpusetdecouple_cpuhotplug03 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TPASS "processes will be migrated to new online CPU pass."
|
||||
else
|
||||
tst_res TFAIL "cpusetdecouple_cpuhotplug03 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TFAIL "processes will be migrated to new online CPU failed!"
|
||||
fi
|
||||
|
||||
for i in $(seq 1 100); do
|
||||
|
||||
+7
-8
@@ -24,9 +24,6 @@
|
||||
# History: Mar 15 2022 - init scripts
|
||||
#
|
||||
#################################################################################
|
||||
|
||||
ret=0
|
||||
|
||||
source tst_oh.sh
|
||||
|
||||
do_setup()
|
||||
@@ -45,6 +42,8 @@ do_setup()
|
||||
|
||||
do_test()
|
||||
{
|
||||
local ret=0
|
||||
|
||||
tst_res TINFO "Start test cupset_decouple_cpuhotplug04"
|
||||
mkdir /dev/cpuset/hotplug04
|
||||
echo "0-3" > /dev/cpuset/hotplug04/cpuset.cpus
|
||||
@@ -55,10 +54,10 @@ do_test()
|
||||
|
||||
for i in $(seq 0 $cpu_total); do
|
||||
echo $i
|
||||
echo 0 > /sys/devices/system/cpu/cpu$i/online #offline cpu$i
|
||||
echo 0 > /sys/devices/system/cpu/cpu$i/online
|
||||
cat /dev/cpuset/hotplug04/cpuset.cpus
|
||||
cpu_set=$(cat /dev/cpuset/hotplug04/cpuset.cpus)
|
||||
if [ $cpu_set == '0-3' ]; then
|
||||
if [ "$cpu_set" == '0-3' ]; then
|
||||
tst_res TINFO "hotplug04 cpu$i offline cpuset decouple success"
|
||||
else
|
||||
tst_res TINFO "hotplug04 cpu$i offline cpuset decouple fail"
|
||||
@@ -67,13 +66,13 @@ do_test()
|
||||
done
|
||||
|
||||
if [ $ret -eq 0 ]; then
|
||||
tst_res TPASS "cpusetdecouple_cpuhotplug04 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TPASS "CPU online and offline function pass."
|
||||
else
|
||||
tst_res TFAIL "cpusetdecouple_cpuhotplug04 CPU hot-plug and CPUSET decoupling are implemented."
|
||||
tst_res TFAIL "CPU online and offline function failed!"
|
||||
fi
|
||||
|
||||
for i in $(seq 0 $cpu_total); do
|
||||
echo 1 > /sys/devices/system/cpu/cpu$i/online #offline cpu$i
|
||||
echo 1 > /sys/devices/system/cpu/cpu$i/online
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
@@ -346,7 +346,6 @@ do_test_by_conf()
|
||||
curtest_timeout=0
|
||||
|
||||
if [ ! -f ${TEST_ROOT}/tests/${testsuite} ]; then
|
||||
print_error "${testsuite} file not found in ${TEST_ROOT}/tests!"
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -401,7 +400,7 @@ do_test_by_conf()
|
||||
source ./${testsuite}_uninit.sh &> ${RESULT_LOG_DIR}/${testsuite}/uninit.log
|
||||
fi
|
||||
|
||||
testsuite_total=$((${testsuite_totaol} + 1))
|
||||
testsuite_total=$((${testsuite_total} + 1))
|
||||
echo "Test total: ${curtest_total}" >> ${RESULT_LOG_DIR}/${testsuite}/summary.log
|
||||
echo "Test failed: ${curtest_fail}" >> ${RESULT_LOG_DIR}/${testsuite}/summary.log
|
||||
echo "Test timeout: ${curtest_timeout}" >> ${RESULT_LOG_DIR}/${testsuite}/summary.log
|
||||
@@ -508,6 +507,7 @@ main()
|
||||
*) print_usage;;
|
||||
esac
|
||||
done
|
||||
echo "start sh runtest test -t $test_scenario -n $no_need_run_testlist -l $testcase_timelimit"
|
||||
do_test_by_conf
|
||||
else
|
||||
print_usage
|
||||
|
||||
Reference in New Issue
Block a user