Whamcloud - gitweb
b=19944 promise every cpu has at least 2MB debug memory.
[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,iopen_nopriv,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 DEBUG_SIZE=${DEBUG_SIZE:-10}
48 if [ `grep processor /proc/cpuinfo | wc -l` -gt 5 ]; then
49     DEBUG_SIZE=$((`grep processor /proc/cpuinfo | wc -l` * 2))   # promise 2MB for every cpu
50 fi
51 SUBSYSTEM=${SUBSYSTEM:- 0xffb7e3ff}
52
53 ENABLE_QUOTA=${ENABLE_QUOTA:-""}
54 QUOTA_TYPE="ug3"
55 QUOTA_USERS=${QUOTA_USERS:-"quota_usr quota_2usr sanityusr sanityusr1"}
56
57 MKFSOPT=""
58 [ "x$MDSJOURNALSIZE" != "x" ] &&
59     MKFSOPT=$MKFSOPT" -J size=$MDSJOURNALSIZE"
60 [ "x$MDSISIZE" != "x" ] &&
61     MKFSOPT=$MKFSOPT" -i $MDSISIZE"
62 [ "x$MKFSOPT" != "x" ] &&
63     MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
64 [ "x$SECLEVEL" != "x" ] &&
65     MKFSOPT=$MKFSOPT" --param mdt.sec_level=$SECLEVEL"
66 [ "x$MDSCAPA" != "x" ] &&
67     MKFSOPT=$MKFSOPT" --param mdt.capa=$MDSCAPA"
68 [ "x$mdsfailover_HOST" != "x" ] &&
69     MDSOPT=$MDSOPT" --failnode=`h2$NETTYPE $mdsfailover_HOST`"
70 [ "x$STRIPE_BYTES" != "x" ] &&
71     MDSOPT=$MDSOPT" --param lov.stripesize=$STRIPE_BYTES"
72 [ "x$STRIPES_PER_OBJ" != "x" ] &&
73     MDSOPT=$MDSOPT" --param lov.stripecount=$STRIPES_PER_OBJ"
74 [ "x$L_GETIDENTITY" != "x" ] &&
75     MDSOPT=$MDSOPT" --param mdt.identity_upcall=$L_GETIDENTITY"
76
77 MDSn_MKFS_OPTS=$MDS_MKFS_OPTS
78 MDS_MKFS_OPTS="--mdt --fsname=$FSNAME --device-size=$MDSSIZE --param sys.timeout=$TIMEOUT $MKFSOPT $MDSOPT $MDS_MKFS_OPTS"
79 if [[ $mds1_HOST == $mgs_HOST ]] && [[ $MDSDEV1 == $MGSDEV ]]; then
80     MDS_MKFS_OPTS="--mgs $MDS_MKFS_OPTS"
81 else
82     MDS_MKFS_OPTS="--mgsnode=$MGSNID $MDS_MKFS_OPTS"
83     mgs_MKFS_OPTS="--mgs "
84 fi
85 MDSn_MKFS_OPTS="--mgsnode=$MGSNID --mdt --fsname=$FSNAME --device-size=$MDSSIZE --param sys.timeout=$TIMEOUT $MKFSOPT $MDSOPT $MDSn_MKFS_OPTS"
86
87 MKFSOPT=""
88 [ "x$OSTJOURNALSIZE" != "x" ] &&
89     MKFSOPT=$MKFSOPT" -J size=$OSTJOURNALSIZE"
90 [ "x$MKFSOPT" != "x" ] &&
91     MKFSOPT="--mkfsoptions=\\\"$MKFSOPT\\\""
92 [ "x$SECLEVEL" != "x" ] &&
93     MKFSOPT=$MKFSOPT" --param ost.sec_level=$SECLEVEL"
94 [ "x$OSSCAPA" != "x" ] &&
95     MKFSOPT=$MKFSOPT" --param ost.capa=$OSSCAPA"
96 [ "x$ostfailover_HOST" != "x" ] &&
97     OSTOPT=$OSTOPT" --failnode=`h2$NETTYPE $ostfailover_HOST`"
98 OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$TIMEOUT $MKFSOPT $OSTOPT $OST_MKFS_OPTS"
99
100 MDS_MOUNT_OPTS=${MDS_MOUNT_OPTS:-"-o loop,user_xattr,acl"}
101 OST_MOUNT_OPTS=${OST_MOUNT_OPTS:-"-o loop"}
102
103 #client
104 MOUNT=${MOUNT:-/mnt/${FSNAME}}
105 MOUNT1=${MOUNT1:-$MOUNT}
106 MOUNT2=${MOUNT2:-${MOUNT}2}
107 MOUNTOPT=${MOUNTOPT:-"user_xattr,acl,flock"}
108 DIR=${DIR:-$MOUNT}
109 DIR1=${DIR:-$MOUNT1}
110 DIR2=${DIR2:-$MOUNT2}
111
112 if [ $UID -ne 0 ]; then
113         log "running as non-root uid $UID"
114         RUNAS_ID="$UID"
115         RUNAS=""
116 else
117         RUNAS_ID=${RUNAS_ID:-500}
118         RUNAS=${RUNAS:-"runas -u $RUNAS_ID"}
119 fi
120
121 PDSH=${PDSH:-no_dsh}
122 FAILURE_MODE=${FAILURE_MODE:-SOFT} # or HARD
123 POWER_DOWN=${POWER_DOWN:-"powerman --off"}
124 POWER_UP=${POWER_UP:-"powerman --on"}
125 SLOW=${SLOW:-no}
126 FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
127
128 MPIRUN=$(which mpirun 2>/dev/null) || true
129 MPI_USER=${MPI_USER:-mpiuser}
130 SHARED_DIR_LOGS=${SHARED_DIR_LOGS:-""}
131