Skip to contentSkip to conversation

ltp/testcases/kernel/fs/doio/rwtest: fix rwtest

PATCH New Lei 1 participant 1 message Oct 18, 2017 1 message not in the archive

lore
Share & tools
lore

Lei

#1 lore raw

PATCH 1/1 ltp/testcases/kernel/fs/doio/rwtest: fix rwtest

In reply to a message not in the archive

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.

---
 testcases/kernel/fs/doio/rwtest | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/kernel/fs/doio/rwtest +1 -1
@@ -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