[LTP] [PATCH] ltp/testcases/kernel/fs/doio/rwtest: fix rwtest

Lei, Shaoting leist.fnst@cn.fujitsu.com
Wed Oct 18 10:47:03 CEST 2017


    fix the following issue:   rwtest01-rwtest04.fail
    -----------
    iogen(rwtest02): get_file_info():  Could not stat() /lkp/benchmarks/ltp/testcases/bin/rw-buffered-12736:  No such file or directory
    iogen(rwtest02) warning:  Error getting file info for rw-buffered-12736
    iogen(rwtest02):  Could not create, or gather info for any test files
    rwtest(rwtest02) : iogen reported errors (r=2)
    -----------
    When the size of test file is 0, we should use the default size. But the code of LTP missed to deal with this situation.

Signed-off-by: Shaoting Lei <leist.fnst@cn.fujitsu.com>
---
 testcases/kernel/fs/doio/rwtest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/fs/doio/rwtest b/testcases/kernel/fs/doio/rwtest index 90b1658..d22b1ff 100644
--- a/testcases/kernel/fs/doio/rwtest
+++ b/testcases/kernel/fs/doio/rwtest
@@ -344,7 +344,7 @@ do
 
 			# check if blks is a number, else set a default value for blks
 			default_sz=1000000
-			if [ $blks -eq $blks 2> /dev/null ]
+			if [ $blks -eq $blks 2> /dev/null && $blks -ne 0 ]
 			then
 
 				case $(uname) in
--
2.7.4







More information about the ltp mailing list