4 # reservation test with heavy cp workload
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2011-2012 Fujitsu, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
25 owner=wu.bo@cn.fujitsu.com
28 echo "QA output created by $seq"
32 status=0 # success is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
50 _cpu_num=`cat /proc/cpuinfo | grep "processor" | wc -l`
51 threads=$(($_cpu_num * 50))
52 if [ $threads -gt 200 ]
62 if ! mkdir $SCRATCH_MNT/origin
64 echo "mkdir origin err"
69 cd $SCRATCH_MNT/origin
71 _disksize=`df --block-size=1 $SCRATCH_DEV | awk -v sd=$SCRATCH_DEV 'BEGIN{c=0}{for(i=1;i<=NF;++i){a[c]=$i;++c}}END{for(entry in a){if(a[entry] ~ sd){print a[entry + 3]; break}}}'`
72 _disksize=$(($_disksize / 3))
73 _num=$(($_disksize / $count / $threads / 4096))
75 while [ $_i -lt $_num ]
77 dd if=/dev/zero of=file_$_i bs=4096 count=$_count >/dev/null 2>&1
88 if ! mkdir $SCRATCH_MNT/sub_$_suffix
90 echo "mkdir sub_xxx err"
95 cp -r $SCRATCH_MNT/origin $SCRATCH_MNT/sub_$_suffix >$seq.full 2>&1
98 echo "_porter $_suffix not complete"
114 while [ $_pid -lt $_threads ]
124 # real QA test starts here
125 _supported_fs generic
126 _supported_os IRIX Linux
129 echo "------------------------------"
130 echo "start the workload"
131 echo "------------------------------"
135 _scratch_unmount 2>/dev/null
136 _scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seq.full 2>&1