~ubuntu-branches/ubuntu/quantal/mdadm/quantal-proposed

« back to all changes in this revision

Viewing changes to test

  • Committer: Package Import Robot
  • Author(s): Scott James Remnant
  • Date: 2007-07-11 10:31:39 UTC
  • mfrom: (1.1.6)
  • mto: (1.4.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20070711103139-ih7oxwxsal9ndbej
Tags: upstream-2.6.2
ImportĀ upstreamĀ versionĀ 2.6.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
# assume md0, md1, md2 exist in /dev
23
23
md0=/dev/md0 md1=/dev/md1 md2=/dev/md2
 
24
mdp0=/dev/md_d0
 
25
mdp1=/dev/md_d1
24
26
 
25
27
# We test mdadm on loop-back block devices.
26
28
# dir for storing files should be settable by command line maybe
27
29
targetdir=/var/tmp
28
30
size=20000
 
31
# super0, round down to multiple of 64 and substract 64
29
32
mdsize0=19904
 
33
# super1.0 round down to multiple of 2, subtract 8
30
34
mdsize1=19992
31
 
mdsize11=19996
32
 
mdsize12=19992
 
35
# subtract another 4 for bitmaps
 
36
mdsize1b=19988
 
37
mdsize11=19992
 
38
mdsize12=19988
33
39
 
34
40
cleanup() {
35
41
        $mdadm -Ss
65
71
 
66
72
# mdadm always adds --quiet, and we want to see any unexpected messages
67
73
mdadm() {
 
74
    rm -f $targetdir/stderr
68
75
    case $* in
69
 
       *-C* ) $mdadm --quiet "$@" --auto=yes;;
70
 
        * )   $mdadm --quiet "$@"
 
76
       *-C* ) $mdadm 2> $targetdir/stderr --quiet "$@" --auto=yes;;
 
77
        * )   $mdadm 2> $targetdir/stderr --quiet "$@"
71
78
    esac
 
79
    cat >&2 $targetdir/stderr
72
80
}
73
81
 
74
82
# check various things
126
134
   esac
127
135
}
128
136
 
 
137
no_errors() {
 
138
  if [ -s $targetdir/stderr ]
 
139
  then echo Bad errors from mdadm: ; cat $targetdir/stderr; exit 2;
 
140
  fi
 
141
}
129
142
# basic device test
130
143
 
131
144
testdev() {
155
168
do
156
169
  if [ -f "$script" ]
157
170
  then
 
171
   rm -f $targetdir/stderr
158
172
   # source script in a subshell, so it has access to our
159
173
   # namespace, but cannot change it.
160
174
   if ( set -ex ; . $script )  2> $targetdir/log
161
175
   then echo "$script succeeded" 
162
 
   else cat $targetdir/log
 
176
   else cat $targetdir/log ; cat $targetdir/stderr
163
177
        echo "$script failed"
164
178
       exit 1
165
179
   fi