From 7cdbb67dc5e9f2278035d19b78204865e7d6392f Mon Sep 17 00:00:00 2001 From: liudanning Date: Tue, 12 Jul 2022 09:45:17 +0800 Subject: [PATCH 1/2] kernel_linux_build:Modify testcases to adapt to app AbilityName changes Signed-off-by: liudanning --- test/moduletest/runtest/bin/enhancedswap_t_init.sh | 7 ++++++- .../runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh | 2 +- test/moduletest/runtest/bin/mem_debug_t_init.sh | 2 +- .../runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh | 6 +++--- .../runtest/bin/sched_rtg_t/testcases/bin/sched_rtg02.sh | 2 +- .../runtest/bin/sched_rtg_t/testcases/bin/sched_rtg03.sh | 2 +- .../runtest/bin/sched_rtg_t/testcases/bin/sched_rtg04.sh | 2 +- .../runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh | 6 +++--- 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/test/moduletest/runtest/bin/enhancedswap_t_init.sh b/test/moduletest/runtest/bin/enhancedswap_t_init.sh index 4dcadcf..a51937e 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_init.sh @@ -58,14 +58,19 @@ zram_enable() swapon /dev/block/zram0 aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default + aa start -b com.ohos.camera -a com.ohos.camera.MainAbility + aa start -b com.ohos.permissionmanager -a com.ohos.permissionmanager.MainAbility + aa start -b ohos.sample.shopping -a com.example.entry.MainAbility + aa start -b ohos.samples.distributedcalc -a ohos.samples.distributedcalc.MainAbility } echo "***************************ESWAP INIT START***************************" free -m +uninit_platform pre_condition hp_init hp_enable diff --git a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh index cdfcb09..fabc90e 100644 --- a/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh +++ b/test/moduletest/runtest/bin/mem_debug_t/testcases/bin/mem_debug04.sh @@ -56,7 +56,7 @@ do_test() sh ../../../mem_debug_t_init.sh aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default diff --git a/test/moduletest/runtest/bin/mem_debug_t_init.sh b/test/moduletest/runtest/bin/mem_debug_t_init.sh index 91474c8..1455628 100644 --- a/test/moduletest/runtest/bin/mem_debug_t_init.sh +++ b/test/moduletest/runtest/bin/mem_debug_t_init.sh @@ -58,7 +58,7 @@ zram_enable() swapon /dev/block/zram0 aa start -b com.ohos.settings -a com.ohos.settings.MainAbility aa start -b ohos.samples.airquality -a ohos.samples.airquality.default - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default aa start -b ohos.samples.clock -a ohos.samples.clock.default } diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh index 429b78b..6f273c1 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg01.sh @@ -29,7 +29,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } @@ -65,7 +65,7 @@ do_test() fi local rtgid3=$(cat $sched_group_id) if [ $rtgid3 -eq 3 ]; then - tst_res TFAIL "process $PID switch rtgid 2 to 3 success unexpected!" + tst_res TFAIL "process $PID switch rtgid 2 to 3 sucess unexpected!" res=$(($res + 1)) fi @@ -96,4 +96,4 @@ do_clean() do_setup do_test do_clean -tst_exit +tst_exit \ No newline at end of file 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 8ab1532..631283d 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 @@ -31,7 +31,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') } 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 6c53aeb..d9f1a6a 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 @@ -29,7 +29,7 @@ source tst_oh.sh do_setup() { - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $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 56996f4..0f77902 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 @@ -31,7 +31,7 @@ do_setup() { cpu_value=$(cat /sys/kernel/debug/tracing/events/rtg/find_rtg_cpu/enable) - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility sleep 1 PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') echo 1 > /sys/kernel/debug/tracing/events/rtg/find_rtg_cpu/enable diff --git a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh index e69d871..91a3014 100644 --- a/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh +++ b/test/moduletest/runtest/bin/sched_rtg_t/testcases/bin/sched_rtg06.sh @@ -65,8 +65,8 @@ stability_test() tst_res TINFO "kill 40 task processes...." ps -ef | grep "create_process" | grep -v "grep" | grep -v ${PPID} | cut -c 9-18 | xargs kill -9 sleep 5 - tst_res TINFO "kill process succeeded." - aa start -b ohos.samples.ecg -a ohos.samples.ecg.default && + tst_res TINFO "kill process successed." + aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility && sleep 1 && PID=$(ps -ef | grep ohos.samples.ecg | grep -v grep | awk '{print $2}') if [ $? -eq 0 ]; then @@ -147,4 +147,4 @@ do_clean() do_setup do_test do_clean -tst_exit +tst_exit \ No newline at end of file -- Gitee From 8fcea5edb0f61956b41df34048fb74d495a28f2c Mon Sep 17 00:00:00 2001 From: liudanning Date: Tue, 12 Jul 2022 09:47:28 +0800 Subject: [PATCH 2/2] kernel_linux_build:modify enhancedswap_t_init.sh to clean environment Signed-off-by: liudanning --- .../runtest/bin/enhancedswap_t_init.sh | 16 ++++++++++++++-- .../runtest/bin/enhancedswap_t_uninit.sh | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/test/moduletest/runtest/bin/enhancedswap_t_init.sh b/test/moduletest/runtest/bin/enhancedswap_t_init.sh index a51937e..404136d 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_init.sh @@ -30,12 +30,24 @@ pre_condition() } +uninit_platform() +{ + losetup -d /dev/block/loop7 + echo ${hyperhold_device} > /proc/sys/kernel/hyperhold/device + echo ${hyperhold_enable} > /proc/sys/kernel/hyperhold/enable + echo ${zram0_group} > /sys/block/zram0/group + echo ${zram0_disksize} > /sys/block/zram0/disksize + rm -rf hpdisk + swapoff /dev/block/zram0 + echo 1 > /sys/block/zram0/reset +} + hp_init() { dd if=/dev/random of=hpdisk bs=4096 count=131072 - losetup /dev/block/loop6 hpdisk + losetup /dev/block/loop7 hpdisk hyperhold_device=$(cat /proc/sys/kernel/hyperhold/device) - echo /dev/block/loop6 > /proc/sys/kernel/hyperhold/device + echo /dev/block/loop7 > /proc/sys/kernel/hyperhold/device } hp_enable() diff --git a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh index e7a5e60..6236024 100644 --- a/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh +++ b/test/moduletest/runtest/bin/enhancedswap_t_uninit.sh @@ -27,7 +27,7 @@ uninit_platform() { - losetup -d /dev/block/loop6 + losetup -d /dev/block/loop7 echo ${hyperhold_device} > /proc/sys/kernel/hyperhold/device echo ${hyperhold_enable} > /proc/sys/kernel/hyperhold/enable echo ${zram0_group} > /sys/block/zram0/group -- Gitee