1 #!/bin/sh 2 3 ################################################################################ 4 ## ## 5 ## Copyright (c) 2009 FUJITSU LIMITED ## 6 ## ## 7 ## This program is free software; you can redistribute it and#or modify ## 8 ## it under the terms of the GNU General Public License as published by ## 9 ## the Free Software Foundation; either version 2 of the License, or ## 10 ## (at your option) any later version. ## 11 ## ## 12 ## This program is distributed in the hope that it will be useful, but ## 13 ## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## 14 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## 15 ## for more details. ## 16 ## ## 17 ## You should have received a copy of the GNU General Public License ## 18 ## along with this program; if not, write to the Free Software ## 19 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## 20 ## ## 21 ## Author: Li Zefan <lizf (at] cn.fujitsu.com> ## 22 ## Miao Xie <miaox (at] cn.fujitsu.com> ## 23 ## ## 24 ################################################################################ 25 26 . test.sh 27 28 ext4_setup() 29 { 30 tst_kvercmp 2 6 31 31 if [ $? -eq 0 ]; then 32 tst_brkm TCONF "kernel is below 2.6.31" 33 fi 34 35 tst_require_root 36 37 EXT4_KERNEL_SUPPORT=`grep -w ext4 /proc/filesystems | cut -f2` 38 if [ "$EXT4_KERNEL_SUPPORT" != "ext4" ]; then 39 modprobe ext4 > /dev/null 2>&1 40 if [ $? -ne 0 ]; then 41 tst_brkm TCONF "Ext4 is not supported" 42 fi 43 fi 44 45 if [ -z "$LTP_BIG_DEV" ];then 46 tst_brkm TCONF "tests need a big block device(5G-10G)" 47 else 48 export EXT4_DEV=$LTP_BIG_DEV 49 fi 50 51 tst_tmpdir 52 TST_CLEANUP=ext4_cleanup 53 54 mkdir mnt_point 55 } 56 57 ext4_cleanup() 58 { 59 rm -rf mnt_point 60 tst_rmdir 61 } 62