Whamcloud - gitweb
LU-958 tests: debug_mb set incorrectly for smp or vm
[fs/lustre-release.git] / lustre / tests / cfg / local.sh
1 FSNAME=${FSNAME:-lustre}
2
3 # facet hosts
4 mds_HOST=${mds_HOST:-`hostname`}
5 mdsfailover_HOST=${mdsfailover_HOST}
6 mds1_HOST=${mds1_HOST:-$mds_HOST}
7 mds1failover_HOST=${mds1failover_HOST:-$mdsfailover_HOST}
8 mgs_HOST=${mgs_HOST:-$mds1_HOST}
9 ost_HOST=${ost_HOST:-`hostname`}
10 ostfailover_HOST=${ostfailover_HOST}
11 CLIENTS=""
12
13 TMP=${TMP:-/tmp}
14
15 DAEMONSIZE=${DAEMONSIZE:-500}
16 MDSCOUNT=${MDSCOUNT:-1}
17 [ $MDSCOUNT -gt 4 ] && MDSCOUNT=4
18 [ $MDSCOUNT -gt 1 ] && IAMDIR=yes
19 for num in $(seq $MDSCOUNT); do
20     eval mds${num}_HOST=\$\{mds${num}_HOST:-$mds_HOST\}
21     eval mds${num}failover_HOST=\$\{mds${num}failover_HOST:-$mdsfailover_HOST\}
22 done
23 MDSDEVBASE=${MDSDEVBASE:-$TMP/${FSNAME}-mdt}
24 MDSSIZE=${MDSSIZE:-200000}
25 MDSOPT=${MDSOPT:-"--mountfsoptions=errors=remount-ro,user_xattr,acl"}
26
27 MGSDEV=${MGSDEV:-$MDSDEV1}
28 MGSSIZE=${MGSSIZE:-$MDSSIZE}
29
30 OSTCOUNT=${OSTCOUNT:-2}
31 OSTDEVBASE=${OSTDEVBASE:-$TMP/${FSNAME}-ost}
32 OSTSIZE=${OSTSIZE:-200000}
33 OSTOPT=""
34 # Can specify individual ost devs with
35 # OSTDEV1="/dev/sda"
36 # on specific hosts with
37 # ost1_HOST="uml2"
38
39 NETTYPE=${NETTYPE:-tcp}
40 MGSNID=${MGSNID:-`h2$NETTYPE $mgs_HOST`}
41 FSTYPE=${FSTYPE:-ldiskfs}
42 STRIPE_BYTES=${STRIPE_BYTES:-1048576}
43 STRIPES_PER_OBJ=${STRIPES_PER_OBJ:-0}
44 SINGLEMDS=${SINGLEMDS:-"mds1"}
45 TIMEOUT=${TIMEOUT:-20}
46 PTLDEBUG=${PTLDEBUG:-0x33f0404}
47
48 # promise 2MB for every cpu
49 _debug_mb=$((($(cut -d "-" -f 2 /sys/devices/system/cpu/possible)+1)*2))
50
51 # but not less then 10Mb, and limited by 512Mb in libcfs
52 if (( _debug_mb < 10 )); then
53         _debug_mb=10
54 elif ((_debug_mb > 512 )); then
55         _debug_mb=512
56 fi
57
58 DEBUG_SIZE=${DEBUG_SIZE:-$_debug_mb}
59
60 SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
61
62 ENABLE_QUOTA=${ENABLE_QUOTA:-""}
63 QUOTA_TYPE="ug3"
64 QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"}
65 LQUOTAOPTS=${LQUOTAOPTS:-"hash_lqs_cur_bits=3"}
66
67 MKFSOPT=""
68 [ "x$MDSJOURNALSIZE" != "x" ] &&
69     MKFSOPT=$MKFSOPT" -J size=$MDSJOURNALSIZE"
70 [ "x$MDSISIZE" != "x" ] &&
71     MKFSOPT=$MKFSOPT" -i $MDSISIZE"
72 [ "x$MKFSOPT" != "x" ] &&
73     MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
74 [ "x$SECLEVEL" != "x" ] &&
75     MKFSOPT=$MKFSOPT" --param mdt.sec_level=$SECLEVEL"
76 [ "x$MDSCAPA" != "x" ] &&
77     MKFSOPT=$MKFSOPT" --param mdt.capa=$MDSCAPA"
78 [ "x$mdsfailover_HOST" != "x" ] &&
79     MDSOPT=$MDSOPT" --failnode=`h2$NETTYPE $mdsfailover_HOST`"
80 [ "x$STRIPE_BYTES" != "x" ] &&
81     MDSOPT=$MDSOPT" --param lov.stripesize=$STRIPE_BYTES"
82 [ "x$STRIPES_PER_OBJ" != "x" ] &&
83     MDSOPT=$MDSOPT" --param lov.stripecount=$STRIPES_PER_OBJ"
84 [ "x$L_GETIDENTITY" != "x" ] &&
85     MDSOPT=$MDSOPT" --param mdt.identity_upcall=$L_GETIDENTITY"
86
87 MDS_MKFS_OPTS="--mdt --fsname=$FSNAME --device-size=$MDSSIZE --param sys.timeout=$TIMEOUT $MKFSOPT $MDSOPT $MDS_MKFS_OPTS"
88 if [[ $mds1_HOST == $mgs_HOST ]] && [[ $MDSDEV1 == $MGSDEV ]]; then
89     MDS_MKFS_OPTS="--mgs $MDS_MKFS_OPTS"
90 else
91     MDS_MKFS_OPTS="--mgsnode=$MGSNID $MDS_MKFS_OPTS"
92     MGS_MKFS_OPTS="--mgs --device-size=$MGSSIZE"
93 fi
94
95 MKFSOPT=""
96 [ "x$OSTJOURNALSIZE" != "x" ] &&
97     MKFSOPT=$MKFSOPT" -J size=$OSTJOURNALSIZE"
98 [ "x$MKFSOPT" != "x" ] &&
99     MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
100 [ "x$SECLEVEL" != "x" ] &&
101     MKFSOPT=$MKFSOPT" --param ost.sec_level=$SECLEVEL"
102 [ "x$OSSCAPA" != "x" ] &&
103     MKFSOPT=$MKFSOPT" --param ost.capa=$OSSCAPA"
104 [ "x$ostfailover_HOST" != "x" ] &&
105     OSTOPT=$OSTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
106 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$TIMEOUT $MKFSOPT $OSTOPT $OST_MKFS_OPTS"
107
108 MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS:-"-o loop,user_xattr,acl"}
109 OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-"-o loop"}
110 MGS_MOUNT_OPTS=${MGS_MOUNT_OPTS:-$MDS_MOUNT_OPTS}
111
112 #client
113 MOUNT=${MOUNT:-/mnt/${FSNAME}}
114 MOUNT1=${MOUNT1:-$MOUNT}
115 MOUNT2=${MOUNT2:-${MOUNT}2}
116 MOUNTOPT=${MOUNTOPT:-"-o user_xattr,acl,flock"}
117 DIR=${DIR:-$MOUNT}
118 DIR1=${DIR:-$MOUNT1}
119 DIR2=${DIR2:-$MOUNT2}
120
121 if [ $UID -ne 0 ]; then
122         log "running as non-root uid $UID"
123         RUNAS_ID="$UID"
124         RUNAS_GID=`id -g $USER`
125         RUNAS=""
126 else
127         RUNAS_ID=${RUNAS_ID:-500}
128         RUNAS_GID=${RUNAS_GID:-$RUNAS_ID}
129         RUNAS=${RUNAS:-"runas -u $RUNAS_ID -g $RUNAS_GID"}
130 fi
131
132 PDSH=${PDSH:-no_dsh}
133 FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
134 POWER_DOWN=${POWER_DOWN:-"powerman --off"}
135 POWER_UP=${POWER_UP:-"powerman --on"}
136 SLOW=${SLOW:-no}
137 FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
138
139 MPIRUN=$(which mpirun 2>/dev/null) || true
140 MPI_USER=${MPI_USER:-mpiuser}
141 SHARED_DIR_LOGS=${SHARED_DIR_LOGS:-""}
142
143 # This is used by a small number of tests to share state between the client
144 # running the tests, or in some cases between the servers (e.g. lfsck.sh).
145 # It needs to be a non-lustre filesystem that is available on all the nodes.
146 SHARED_DIRECTORY=${SHARED_DIRECTORY:-""}        # bug 17839 comment 65