test: fix compile specification warnings for enhanced_f2fs_t

Signed-off-by: Ma Feng <mafeng.ma@huawei.com>
This commit is contained in:
Ma Feng
2022-05-24 12:30:57 +08:00
parent e28ee4e8c0
commit 22ce6c4739
12 changed files with 61 additions and 53 deletions
@@ -81,7 +81,7 @@ do_test()
do_clean()
{
rm -rf log01.txt
rm log01.txt
losetup -d /dev/block/loop1
umount /mnt/f2fs_mount
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -71,10 +71,10 @@ do_test()
confirm_value()
{
local result_out1=$(cat /sys/fs/f2fs/loop1/$1)
if [ $result_out1 == '5242880' ]; then
tst_res TPASS "$1 Value is 5242880 successfully."
if [ "$result_out1" == "5242880" ]; then
tst_res TPASS "$1 is 5242880 expected."
else
tst_res TFAIL "$1 Value is 5242880 failed."
tst_res TFAIL "$1 is not 5242880 unexpected!"
ret=$(( $ret + 1 ))
fi
}
@@ -82,10 +82,10 @@ confirm_value()
confirm_change_value()
{
local result_out2=$(cat /sys/fs/f2fs/loop1/$1)
if [ $result_out2 == '6000000' ]; then
tst_res TPASS "$1 Value is 6000000 successfully."
if [ "$result_out2" == "6000000" ]; then
tst_res TPASS "$1 is 6000000 expected."
else
tst_res TFAIL "$1 Value is 6000000 failed."
tst_res TFAIL "$1 is not 6000000 unexpected!"
ret=$(( $ret + 1 ))
fi
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -46,21 +46,25 @@ do_test()
init_value3=$(cat $_ssr_path/hc_hot_node_waterline)
init_value4=$(cat $_ssr_path/hc_warm_node_waterline)
confirm_value hc_hot_data_waterline
confirm_value hc_warm_data_waterline
confirm_value hc_hot_node_waterline
confirm_value hc_hot_data_waterline &&
confirm_value hc_warm_data_waterline &&
confirm_value hc_hot_node_waterline &&
confirm_value hc_warm_node_waterline
[ $? -ne 0 ] && ret=$(( $ret + 1 ))
echo 85 > $_ssr_path/hc_hot_data_waterline
echo 85 > $_ssr_path/hc_warm_data_waterline
echo 85 > $_ssr_path/hc_hot_node_waterline
echo 85 > $_ssr_path/hc_warm_node_waterline
confirm_change_value hc_hot_data_waterline
confirm_change_value hc_warm_data_waterline
confirm_change_value hc_hot_data_waterline
confirm_change_value hc_hot_data_waterline &&
confirm_change_value hc_warm_data_waterline &&
confirm_change_value hc_hot_data_waterline &&
confirm_change_value hc_warm_node_waterline
[ $? -ne 0 ] && ret=$(( $ret + 1 ))
if [ $ret -eq 0 ];then
tst_res TPASS "Hierarchical SSR waterline configuration interface pass."
else
@@ -72,9 +76,10 @@ confirm_value()
{
if [ $(cat $_ssr_path/$1) == '80' ];then
tst_res TPASS "$1 Value is 80 successfully."
return 0
else
tst_res TFAIL "$1 Value not is 80 failed."
ret=$(( $ret + 1 ))
return 1
fi
}
@@ -82,9 +87,10 @@ confirm_change_value()
{
if [ $(cat $_ssr_path/$1) == '85' ];then
tst_res TPASS "$1 Value is 85 successfully."
return 0
else
tst_res TFAIL "$1 Value not is 85 failed."
ret=$(( $ret + 1 ))
return 1
fi
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -29,8 +29,8 @@ source tst_oh.sh
do_setup()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -29,8 +29,8 @@ source tst_oh.sh
state_init()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -50,14 +50,14 @@ equilibrium_init()
done
local b=$(cat $segs_path | grep "valid blocks" | awk -F ' ' '{print$3}' | tr -cd "[0-9]")
local result_left=`echo | awk "{peint $a*512*0.2}"`
local result_might=`echo | awk "{print $a*512-$b}"`
local result_right=`echo | awk "{print $a*512*0.1}"`
local result1=`echo "$result_left $result_might" \
| awk '{if ($result_left -gt $result_might) print 1; else print 0}'`
local result2=`echo "$result_might $result_right" \
| awk '{if ($result_might -gt $result_right) print 1; else print 0}'`
if [ $result1 ] && [ $result2 ];then
local result_left=$(echo | awk "{peint $a*512*0.2}")
local result_might=$(echo | awk "{print $a*512-$b}")
local result_right=$(echo | awk "{print $a*512*0.1}")
local result1=$(echo "$result_left $result_might" \
| awk '{if ($result_left -gt $result_might) print 1; else print 0}')
local result2=$(echo "$result_might $result_right" \
| awk '{if ($result_might -gt $result_right) print 1; else print 0}')
if [ $result1 -gt 0 ] && [ $result2 -gt 0 ]; then
tst_res TPASS "Inequality holds."
else
tst_res TFAIL "Inequality does not hold."
@@ -29,8 +29,8 @@ source tst_oh.sh
state_init()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -44,11 +44,11 @@ life_init()
local a=$(cat $_segs_path | grep segs | awk -F ' ' '{print$3}')
local b=$(cat $_segs_path| grep "valid blocks" | awk -F ' ' '{print$3}' | tr -cd "[0-9]")
local result_left=`echo | awk "{print $a*512-$b}"`
local result_right=`echo | awk "{print $a*512*0.2}"`
local result=`echo "$result_left $result_right" \
| awk '{if ($result_left -gt $result_right) print 1; else print 0}'`
if [ $result ];then
local result_left=$(echo | awk "{print $a*512-$b}")
local result_right=$(echo | awk "{print $a*512*0.2}")
local result=$(echo "$result_left $result_right" \
| awk '{if ($result_left -gt $result_right) print 1; else print 0}')
if [ $result -gt 0 ]; then
tst_res TPASS "Inequality holds."
else
tst_res TFAIL "Inequality does not hold."
@@ -29,8 +29,8 @@ source tst_oh.sh
state_init()
{
mkfs.f2fs -d1 -t1 -O quota /data/image_f2fs
losetup /dev/block/loop1 /data/image_f2fs
mkfs.f2fs -d1 -t1 -O quota $IMG_FILE
losetup /dev/block/loop1 $IMG_FILE
mount -t f2fs /dev/block/loop1 /mnt/f2fs_mount/
}
@@ -50,11 +50,11 @@ performance_init()
done
echo "end Embedded file system $(date +%Y%m%d%H%M%S)...." >> log06.txt
local b=$(cat $segs_path | grep "valid blocks" | awk -F ' ' '{print$3}' | tr -cd "[0-9]")
local result_left=`echo | awk "{print $a*512-$b}"`
local result_right=`echo | awk "{print $a*512*0.1}"`
local result=`echo "$result_left $result_right" \
| awk '{if ($result_left -lt $result_right) print 1; else print 0}'`
if [ $result ];then
local result_left=$(echo | awk "{print $a*512-$b}")
local result_right=$(echo | awk "{print $a*512*0.1}")
local result=$(echo "$result_left $result_right" \
| awk '{if ($result_left -lt $result_right) print 1; else print 0}')
if [ $result -gt 0 ];then
tst_res TPASS "Inequality holds."
else
tst_res TFAIL "Inequality does not hold."
@@ -24,6 +24,7 @@
# History: April 8 2022 - init scripts
#
################################################################################
export IMG_FILE=/data/image_f2fs
create_catalogue()
{
@@ -32,7 +33,7 @@ create_catalogue()
enable_init()
{
dd if=/dev/zero of=/data/image_f2fs bs=1M count=20480
dd if=/dev/zero of=$IMG_FILE bs=1M count=20480
}
echo "***************************ENHANCED INIT START***************************"
@@ -27,7 +27,8 @@
delete_catalogue()
{
rm -rf /mnt/f2fs_mount/
rm /mnt/f2fs_mount/*
rmdir /mnt/f2fs_mount
}
echo "***************************enhanced UNINIT START**************************"