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 a8f7adc2fb39a430d8388f7675d370beb750b50a..1f764755454efa168647c0214e94f2e1b185ce38 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 0afcdd85e005bdee3e2499ffe06880a42f5a6ce4..cc7ffc70d5960bc328eb0de046e7d9c9cf396434 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 4b1f50f9487d4cd825b735bb10be712257ec4a02..e9d2195bc78801049e20b61a9629282e8715853e 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 3a5f78862b1c814dac38decf002b90c6802a849c..21353df8247f5745b50fc1d6266e9b2141a4c5c6 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 a749a3f0e8bf7b3081c70d20e5d4998d3c3f68cb..e244b014e2ec73b86b006f7edb3fae6a78e22cee 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 77a2946e3c97a777fa559767fb331f602ab19adc..f6be2a18b0eb04de6ccf6804e08061065887c185 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 87007314d3c86e9f578024cf902bb52475fd8b35..a5df47531b88b348fb7e787660f8a1c06fc5058e 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 ebafc0f3410096bf208d567fcbd20d9020877c5c..b3cdb2dd87234ce9a960de3edaabe106da4066ee 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 b1bc0b9842511ba046a1aa3e623abd513eabfbb2..d2cc70b49b3ce6ede82eb9cd19b0ea1cabfffa8b 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 aaca37e176f0288b66ffaef824b47e3e1fedfed7..72543bda0e774fb1741a062f758ac0e94c895cd5 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 0ce081adad53be1e9910b5da4519963ce7756a9a..72124374e2dd933cf1ec2f63690480f0ca0d759b 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 1e407bda3680e16ea7116c602f2b94160c3b8fdf..199b5848ba23826fe593f1535d4243e7e5e728ee 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 b38e723787ce356045de419f8439891513c15ee9..bdb75df3602598206b9f47b68f3229b57be315b5 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 38b7e6c252d5ee73f39e710be2c2dca086910372..ae1ad1621340ebcc7563581b9edd9d75b3821b44 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 5a6f483233bd5088c1c49012162e9d655b9766c4..118df9818693973a03b3cafc8dea13cd5b670c60 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 fda31b5a1bb901d7457fa7a0e4abf2016264b5d8..6477d602ad45eb1d31a959f83d34c208ff88fe48 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**************************"