* As Xiaoguang Wnag <wangxg.f...@cn.fujitsu.com> said:
"Now I think 'grep -q CONF' is not enough, if fallocate[1-3] prints TBROK..."
Change these like:
-               TMPDIR=mnt_point; fallocate0${i} | grep -q "CONF"
+               TMPDIR=mnt_point; fallocate0${i} > /dev/null 2>&1
+               ret=$?
                TMPDIR=$temp_tmpdir

-               if [ $? -ne $ret ]; then
+               if [ $ret -ne 0 ]; then

* Copyright cleanup

Signed-off-by: Xiaoguang Wang <wangxg.f...@cn.fujitsu.com>
Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com>
---
 .../ext4-persist-prealloc/ext4_persist_prealloc_test.sh       | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git 
a/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh
 
b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh
index a6e3a2a..985df41 100755
--- 
a/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh
+++ 
b/testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh
@@ -15,8 +15,8 @@
 ## for more details.                                                          
##
 ##                                                                            
##
 ## You should have received a copy of the GNU General Public License          
##
-## along with this program;  if not, write to the Free Software               
##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA    ##
+## along with this program;  if not, write to the Free Software Foundation,   
##
+## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           
##
 ##                                                                            
##
 ## Author: Li Zefan <l...@cn.fujitsu.com>                                     
##
 ##         Miao Xie <mi...@cn.fujitsu.com>                                    
##
@@ -44,8 +44,6 @@ ext4_test_persist_prealloc()
                return
        fi
 
-       ret=1
-
        for ((i = 1; i <= 3; i++))
        {
                if ! command -v fallocate0${i} > /dev/null 2>&1; then
@@ -57,10 +55,11 @@ ext4_test_persist_prealloc()
                fi
 
                temp_tmpdir=$TMPDIR
-               TMPDIR=mnt_point; fallocate0${i} | grep -q "CONF"
+               TMPDIR=mnt_point; fallocate0${i} > /dev/null 2>&1
+               ret=$?
                TMPDIR=$temp_tmpdir
 
-               if [ $? -ne $ret ]; then
+               if [ $ret -ne 0 ]; then
                        tst_resm TFAIL "fallocate's return value is not 
expected"
                        umount mnt_point
                        return
-- 
1.9.3




------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to