From 513f153704c6ce129d3efb523f53cb4e6a4bcd12 Mon Sep 17 00:00:00 2001 From: liudanning Date: Sun, 9 Oct 2022 10:52:28 +0800 Subject: [PATCH] kernel_linux_build:fix enhancedf2fs_t testcases Signed-off-by: liudanning --- .../testcases/bin/enhancedf2fs01.sh | 21 ++++++------- .../testcases/bin/enhancedf2fs02.sh | 21 ++++++------- .../testcases/bin/enhancedf2fs03.sh | 21 ++++++------- .../testcases/bin/enhancedf2fs05.sh | 21 ++++++------- .../testcases/bin/enhancedf2fs07.sh | 20 ++++++------ .../testcases/bin/enhancedf2fs08.sh | 20 ++++++------ .../testcases/bin/enhancedf2fs09.sh | 16 +++++----- .../testcases/bin/enhancedf2fs10.sh | 31 +++++++++---------- .../testcases/bin/enhancedf2fs11.sh | 31 +++++++++---------- .../testcases/bin/enhancedf2fs12.sh | 27 +++++++--------- .../testcases/bin/equilibrium_init.sh | 15 +++++---- .../enhancedf2fs_t/testcases/bin/life_init.sh | 13 ++++---- .../testcases/bin/performance_init.sh | 15 +++++---- .../enhancedf2fs_t/testcases/bin/run_fio.sh | 15 ++++----- .../runtest/bin/enhancedf2fs_t_init.sh | 12 +++---- .../runtest/bin/enhancedf2fs_t_uninit.sh | 11 ++++--- 16 files changed, 145 insertions(+), 165 deletions(-) diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh index a8f7adc..1f76475 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs01.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -39,7 +40,7 @@ do_test() tst_res TINFO "Start test discard size >= 512 blocks in life mode." cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log01.txt & - mkdir /mnt/f2fs_mount/test1 + mkdir /data/f2fs_test/test1 if [ $? -eq 0 ]; then tst_res TPASS "Created test1 dir successfully." else @@ -49,10 +50,10 @@ do_test() local i=0 while [ $i -lt 30 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test1/image$i bs=8M count=1 + dd if=/dev/zero of=/data/f2fs_test/test1/image$i bs=8M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test1/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test1/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -65,9 +66,9 @@ do_test() local blklen=$(cat log01.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 512 ]; then - tst_res TPASS "blklen >= 512 successfully." + tst_res TPASS "blklen = $blklen >= 512 successfully." else - tst_res TFAIL "blklen >= 512 failed." + tst_res TFAIL "blklen = $blklen >= 512 failed." ret=$(( $ret + 1 )) fi @@ -80,9 +81,7 @@ do_test() do_clean() { - rm log01.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh index 0afcdd8..cc7ffc7 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs02.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -44,7 +45,7 @@ do_test() cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log02.txt & sh run_fio.sh > run_fio.txt & sleep 60 - mkdir /mnt/f2fs_mount/test2 + mkdir /data/f2fs_test/test2 if [ $? -eq 0 ]; then tst_res TPASS "Created test2 dir successfully." else @@ -55,10 +56,10 @@ do_test() local i=0 while [ $i -lt 30 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test2/image$i bs=8M count=1 + dd if=/dev/zero of=/data/f2fs_test/test2/image$i bs=8M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test2/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test2/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -81,9 +82,9 @@ do_test() local blklen=$(cat log02.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 512 ]; then - tst_res TPASS "blklen >= 512 successfully." + tst_res TPASS "blklen = $blklen >= 512 successfully." else - tst_res TFAIL "blklen >= 512 failed." + tst_res TFAIL "blklen = $blklen >= 512 failed." ret=$(( $ret + 1 )) fi @@ -105,9 +106,7 @@ do_test() do_clean() { - rm -rf log02.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh index 4b1f50f..e9d2195 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs03.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -41,7 +42,7 @@ do_test() cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log03.txt & sleep 60 - mkdir /mnt/f2fs_mount/test3 + mkdir /data/f2fs_test/test3 if [ $? -eq 0 ]; then tst_res TPASS "Creation test3 dir successfully." else @@ -52,10 +53,10 @@ do_test() local i=0 while [ $i -lt 50 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test3/image$i bs=512K count=1 + dd if=/dev/zero of=/data/f2fs_test/test3/image$i bs=512K count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test3/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test3/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Deleted successfully." else @@ -68,9 +69,9 @@ do_test() local blklen=$(cat log03.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 16 ];then - tst_res TPASS "blklen >= 16 successfully." + tst_res TPASS "blklen = $blklen >= 16 successfully." else - tst_res TFAIL "Log printing fail." + tst_res TFAIL "blklen = $blklen >= 16 fail." ret=$(( $ret + 1 )) fi @@ -85,9 +86,7 @@ do_test() do_clean() { - rm -rf log03.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh index 3a5f788..21353df 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs05.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -40,7 +41,7 @@ do_test() tst_res TINFO "Start test discard size >= 1 block in performance mode." cat /sys/kernel/debug/tracing/trace_pipe | grep issue_discard >> log05.txt & - mkdir /mnt/f2fs_mount/test5 + mkdir /data/f2fs_test/test5 if [ $? -eq 0 ]; then tst_res TPASS "Creation test5 dir successfully." else @@ -50,10 +51,10 @@ do_test() local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test5/image$i bs=4k count=1 + dd if=/dev/zero of=/data/f2fs_test/test5/image$i bs=4k count=1 i=$((i+1)) done - rm -rf /mnt/f2fs_mount/test5/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test5/image*[1,3,5,7,9] if [ $? -eq 0 ]; then tst_res TPASS "Delete successfully." else @@ -65,9 +66,9 @@ do_test() kill %1 local blklen=$(cat log05.txt | awk 'NR == 1' | awk -F '0x' '{print$3}') if [ $((16#$blklen)) -ge 1 ];then - tst_res TPASS "Log printing successfully." + tst_res TPASS "blklen = $blklen >= 1 successfully." else - tst_res TFAIL "Log printing failed." + tst_res TFAIL "blklen = $blklen >= 1 failed." ret=$(( $ret + 1 )) fi @@ -82,9 +83,7 @@ do_test() do_clean() { - rm -rf log05.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh index a749a3f..e244b01 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs07.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,22 +29,20 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() { local ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/mmcblk0p11 tst_res TINFO "Start test hierarchical SSR control interface." if [ $(cat $_ssr_path/hc_enable) == '0' ]; then - tst_res TPASS "default is 0 successfully." + tst_res TPASS "$_ssr_path default is 0 successfully." else - tst_res TFAIL "default not is 0 failed." + tst_res TFAIL "$_ssr_path default not is 0 failed." ret=$(( $ret + 1 )) fi @@ -59,8 +58,7 @@ do_test() do_clean() { echo $temp > $_ssr_path/hc_enable - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh index 77a2946..f6be2a1 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs08.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,15 +29,13 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() { ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/mmcblk0p11 tst_res TINFO "Start test hierarchical SSR threshold configuration interface." @@ -73,7 +72,7 @@ do_test() confirm_value() { - local result_out1=$(cat /sys/fs/f2fs/loop1/$1) + local result_out1=$(cat /sys/fs/f2fs/mmcblk0p11/$1) if [ "$result_out1" == "5242880" ]; then tst_res TPASS "$1 is 5242880 expected." return 0 @@ -85,7 +84,7 @@ confirm_value() confirm_change_value() { - local result_out2=$(cat /sys/fs/f2fs/loop1/$1) + local result_out2=$(cat /sys/fs/f2fs/mmcblk0p11/$1) if [ "$result_out2" == "6000000" ]; then tst_res TPASS "$1 is 6000000 expected." else @@ -100,8 +99,7 @@ do_clean() echo $init_value2 > $_ssr_path/hc_warm_data_lower_limit echo $init_value3 > $_ssr_path/hc_hot_node_lower_limit echo $init_value4 > $_ssr_path/hc_warm_node_lower_limit - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh index 8700731..a5df475 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs09.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,15 +29,13 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() { ret=0 - _ssr_path=/sys/fs/f2fs/loop1 + _ssr_path=/sys/fs/f2fs/mmcblk0p11 tst_res TINFO "Start test hierarchical SSR waterline configuration interface." @@ -99,8 +98,7 @@ do_clean() echo $init_value2 > $_ssr_path/hc_warm_data_waterline echo $init_value3 > $_ssr_path/hc_hot_node_waterline echo $init_value4 > $_ssr_path/hc_warm_node_waterline - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh index ebafc0f..b3cdb2d 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs10.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,9 +29,7 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() @@ -43,32 +42,32 @@ do_test() local i=0 while [ $i -lt 32 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=/data/f2fs_test/image$i bs=512M count=1 i=$(( $i + 1 )) done - mkdir /mnt/f2fs_mount/test10 + mkdir /data/f2fs_test/test10 local i=0 while [ $i -lt 5120 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test10/image$i bs=512k count=1 + dd if=/dev/zero of=/data/f2fs_test/test10/image$i bs=512k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test10/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test10/image*[1,3,5,7,9] - echo 1 > /sys/fs/f2fs/loop1/hc_enable + echo 1 > /sys/fs/f2fs/mmcblk0p11/hc_enable echo 1 > $_sys_path/tracing_on echo 1 > $_sys_path/events/f2fs/f2fs_grading_ssr_allocate/enable cat $_sys_path/trace_pipe | grep ssr >> log10.txt & - mkdir /mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate + mkdir /data/f2fs_test/test10/f2fs_grading_ssr_allocate local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate/image$i bs=4k count=1 + dd if=/dev/zero of=/data/f2fs_test/test10/f2fs_grading_ssr_allocate/image$i bs=4k count=1 i=$(($i + 1)) done - rm -rf /mnt/f2fs_mount/test10/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test10/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] sleep 180 kill %1 @@ -89,9 +88,7 @@ do_test() do_clean() { - rm -rf log10.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh index b1bc0b9..d2cc70b 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs11.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,9 +29,7 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() @@ -42,32 +41,32 @@ do_test() local i=0 while [ $i -lt 32 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=/data/f2fs_test/image$i bs=512M count=1 i=$(( $i+ 1 )) done - mkdir /mnt/f2fs_mount/test11 + mkdir /data/f2fs_test/test11 local i=0 while [ $i -lt 5120 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test11/image$i bs=512k count=1 + dd if=/dev/zero of=/data/f2fs_test/test11/image$i bs=512k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test11/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test11/image*[1,3,5,7,9] - echo 0 > /sys/fs/f2fs/loop1/hc_enable + echo 0 > /sys/fs/f2fs/mmcblk0p11/hc_enable echo 1 > $_sys_path/tracing_on echo 1 > $_sys_path/events/f2fs/f2fs_grading_ssr_allocate/enable cat $_sys_path/trace_pipe | grep ssr >> log11.txt & - mkdir /mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate + mkdir /data/f2fs_test/test11/f2fs_grading_ssr_allocate local i=0 while [ $i -lt 200 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate/image$i bs=4k count=1 + dd if=/dev/zero of=/data/f2fs_test/test11/f2fs_grading_ssr_allocate/image$i bs=4k count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/test11/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/test11/f2fs_grading_ssr_allocate/image*[1,3,5,7,9] sleep 180 kill %1 @@ -88,9 +87,7 @@ do_test() do_clean() { - rm -rf log11.txt - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh index aaca37e..72543bd 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/enhancedf2fs12.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,16 +29,14 @@ source tst_oh.sh do_setup() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } do_test() { local ret=0 local _sys_path=/sys/kernel/debug/tracing - temp=$(cat /sys/fs/f2fs/loop1/gc_urgent) + temp=$(cat /sys/fs/f2fs/mmcblk0p11/gc_urgent) tst_res TINFO "Start test GC function." @@ -48,12 +47,12 @@ do_test() local i=0 while [ $i -lt 512 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=1M count=1 + dd if=/dev/zero of=/data/f2fs_test/image$i bs=1M count=1 i=$(( $i + 1 )) done - rm -rf /mnt/f2fs_mount/image*[1,3,5,7,9] + rm -rf /data/f2fs_test/image*[1,3,5,7,9] - echo 1 > /sys/fs/f2fs/loop1/gc_urgent + echo 1 > /sys/fs/f2fs/mmcblk0p11/gc_urgent sleep 60 kill %1 @@ -72,11 +71,9 @@ do_test() } do_clean() -{ - rm -rf log12.txt - echo $temp > /sys/fs/f2fs/loop1/gc_urgent - losetup -d /dev/block/loop1 - umount /mnt/f2fs_mount +{ + echo $temp > /sys/fs/f2fs/mmcblk0p11/gc_urgent + rm -rf /data/f2fs_test/ } do_setup diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh index 0ce081a..7212437 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/equilibrium_init.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,9 +29,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } equilibrium_init() @@ -44,7 +43,7 @@ equilibrium_init() local i=0 while [ $i -lt 32 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=/data/f2fs_test/image$i bs=512M count=1 i=$(( $i + 1 )) done @@ -64,7 +63,7 @@ equilibrium_init() fi sleep 60 - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '1' ];then + if [ $(cat /sys/fs/f2fs/mmcblk0p11/discard_type) == '1' ];then tst_res TPASS "equilibrium model successfully." else tst_res TFAIL "equilibrium model failed." diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh index 1e407bd..199b584 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/life_init.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,9 +29,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } life_init() @@ -54,7 +53,7 @@ life_init() ret=$(( $ret + 1 )) fi - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '0' ];then + if [ $(cat /sys/fs/f2fs/mmcblk0p11/discard_type) == '0' ];then tst_res TPASS "life model successfully." else tst_res TFAIL "life model failed." diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh index b38e723..bdb75df 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/performance_init.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -28,9 +29,7 @@ source tst_oh.sh state_init() { - mkfs.f2fs -d1 -t1 -O quota $IMG_FILE - losetup /dev/block/loop1 $IMG_FILE - mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/ + mkdir /data/f2fs_test/ } performance_init() @@ -44,7 +43,7 @@ performance_init() local i=0 while [ $i -lt 37 ] do - dd if=/dev/zero of=/mnt/f2fs_mount/image$i bs=512M count=1 + dd if=/dev/zero of=/data/f2fs_test/image$i bs=512M count=1 i=$(( $i + 1 )) done echo "end Embedded file system $(date +%Y%m%d%H%M%S)...." >> log06.txt @@ -61,7 +60,7 @@ performance_init() fi sleep 60 - if [ $(cat /sys/fs/f2fs/loop1/discard_type) == '2' ];then + if [ $(cat /sys/fs/f2fs/mmcblk0p11/discard_type) == '2' ];then tst_res TPASS "performance model successfully." else tst_res TFAIL "performance model failed." diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh index 38b7e6c..ae1ad16 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t/testcases/bin/run_fio.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -25,10 +26,10 @@ ################################################################################ run_fio() -{ - ./fio --name=rw_bg --numjobs=1 --filename=/mnt/f2fs_mount/fio-test.file \ - --bs=32768K --rw=read --ioengine=psync --refill_buffers --group_reporting \ - --runtime=360 --time_based --filesize=128M +{ + ./fio --name=rw_bg --numjobs=1 --filename=/data/f2fs_test/fio-test.file \ + --bs=32768K --rw=read --ioengine=sync --refill_buffers --group_reporting \ + --runtime=360 --time_based --filesize=128M } run_fio \ No newline at end of file diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh b/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh index 5a6f483..118df98 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t_init.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -23,16 +24,15 @@ # History: April 8 2022 - init scripts # ################################################################################ -export IMG_FILE=/data/image_f2fs create_catalogue() { - mkdir /mnt/f2fs_mount/ + } enable_init() { - dd if=/dev/zero of=$IMG_FILE bs=1M count=20480 + } echo "***************************ENHANCED INIT START***************************" diff --git a/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh b/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh index fda31b5..6477d60 100644 --- a/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh +++ b/test/moduletest/runtest/bin/enhancedf2fs_t_uninit.sh @@ -2,10 +2,11 @@ ################################################################################ # # Copyright (C) 2022 Huawei Device Co., Ltd. -# SPDX-License-Identifier: GPL-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. -# Do not use in new code. +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -26,8 +27,8 @@ delete_catalogue() { - rm /mnt/f2fs_mount/* - rmdir /mnt/f2fs_mount + rm -rf /data/f2fs_test/* + rmdir /data/f2fs_test } echo "***************************enhanced UNINIT START**************************" -- Gitee