From 2f6d3c916a43df86279c0e10d02cf3bf893588a8 Mon Sep 17 00:00:00 2001 From: liudanning Date: Mon, 16 May 2022 14:52:25 +0800 Subject: [PATCH] kernel_linux_build: modify some sched_rtg and cpuisolation testcases Signed-off-by: liudanning --- .../cpuisolation_t/testcases/bin/cpuisolation05.sh | 2 +- .../bin/sched_rtg_t/testcases/bin/sched_rtg02.sh | 12 +++++------- .../bin/sched_rtg_t/testcases/bin/sched_rtg03.sh | 6 ++---- .../bin/sched_rtg_t/testcases/bin/sched_rtg04.sh | 4 ++-- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh index 6193c39..4a73b1f 100644 --- a/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh +++ b/test/moduletest/runtest/bin/cpuisolation_t/testcases/bin/cpuisolation05.sh @@ -45,7 +45,7 @@ do_test() tst_res TINFO "Start CPU trace catching test ..." bytrace -t 10 -b 32000 --overwrite sched ace app disk ohos graphic sync \ - workq ability >/data/mynewtrace.ftrace & + workq ability > cputrace.ftrace & sleep 5 for i in $(seq 1 8);do sh create_process.sh 40 diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh index 5b33c31..8ab1532 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh @@ -33,7 +33,7 @@ do_setup() { aa start -b ohos.samples.ecg -a ohos.samples.ecg.default sleep 1 - PID=`ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}'` + PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } do_test() @@ -43,10 +43,8 @@ do_test() tst_res TINFO "Start process $PID sched RTG interface test ..." cur_rtgid=$(cat $sched_group_id) - if [ cur_rtgid -eq 2 ]; then - tst_res TINFO "process $PID already in rtgid 2, remove it firstly..." - echo 0 > $sched_group_id - fi + tst_res TINFO "process $PID already in rtgid $sched_group_id, remove it firstly..." + echo 0 > $sched_group_id set_check_rtgid -1 $PID 1 0 @@ -83,9 +81,9 @@ set_check_rtgid() local _cur_rtgid=$(cat $_sched_group_id) if [ $_cur_rtgid -eq $_expect_rtgid ]; then - tst_res TPASS "process $_pid rtgid equal to expected value." + tst_res TPASS "process $_pid rtgid $_cur_rtgid equal to expected value." else - tst_res TFAIL "process $_pid rtgid not equal to expected value!" + tst_res TFAIL "process $_pid rtgid $_cur_rtgid unexpected value $_expect_rtgid!" fi } diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh index fc7a8bc..1fef3be 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh @@ -41,10 +41,8 @@ do_test() tst_res TINFO "Start sched RTG /proc/sched_rtg_debug interface test ..." cur_rtgid=$(cat $sched_group_id) - if [ cur_rtgid -eq 2 ]; then - tst_res TINFO "process $PID already in rtgid 2, remove it firstly..." - echo 0 > $sched_group_id - fi + tst_res TINFO "process $PID already in rtgid $sched_group_id, remove it firstly..." + echo 0 > $sched_group_id set_check_rtgid_debug 2 $PID 0 2 diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh index 6cce5ec..3d3b60f 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh @@ -49,10 +49,10 @@ do_test() local sched_group_id=/proc/$PID/sched_group_id tst_res TINFO "Start sched RTG trace catching test ..." - bytrace -t 10 -b 32000 --overwrite sched ace app disk ohos graphic sync workq ability >/data/mynewtrace.ftrace & + bytrace -t 10 -b 32000 --overwrite sched ace app disk ohos graphic sync workq ability > rtgtrace.ftrace & tst_res TINFO "Checking sched RTG trace ..." sleep 3 - for i in $(seq 1 20);do + for i in $(seq 1 50);do echo 0 > $sched_group_id echo 2 > $sched_group_id done -- Gitee