@@ -89,7 +89,7 @@ EndTest () {
89
89
I=0
90
90
while test $I -le $SyncTestRepos; do
91
91
WithCCND $I ccndsmoketest kill
92
- I=`expr $ I + 1`
92
+ I=$(( I + 1))
93
93
done
94
94
sleep 1
95
95
}
@@ -104,13 +104,12 @@ AwkMax () {
104
104
}
105
105
ZeroPoint () {
106
106
# create a non-participating slice to set the initial point
107
- local I
108
107
I=1
109
108
while test $I -le $SyncTestRepos; do
110
109
WithCCND $I SyncTest -scope 1 -mark -slice $SyncTestTopo /zero/point >/dev/null
111
110
WithCCND $I SyncTest $SyncPutFlags -put $SyncTestDir/small.data ccnx:/zero/point/data >$SyncTestDir/tfr0.$I.txt
112
111
WithCCND $I GetStats $ZeroPointHash $SyncTestDir/zero.$I.txt
113
- I=`expr $ I + 1`
112
+ I=$(( I + 1))
114
113
done
115
114
}
116
115
GetCPU () {
@@ -136,7 +135,6 @@ IfInitDataAfter () {
136
135
fi
137
136
}
138
137
AppendSummary () {
139
- local I
140
138
etLine="Elapsed"
141
139
etMax=0.0
142
140
packetSum=0
@@ -158,7 +156,7 @@ AppendSummary () {
158
156
packetSum=$(($packetSum + $packets))
159
157
intLine="$intLine, P$I = $packets"
160
158
echo Repo $I dCPU = $dCPU, maxrss = $maxrss, depth = $treeDepth, treeBytes = $treeBytes, nodesCreated = $nodesCreated, lastHashChange = $lastHashChange >>$SyncTestDir/res.txt
161
- I=`expr $ I + 1`
159
+ I=$(( I + 1))
162
160
done
163
161
etLine="$etLine, max = $etMax"
164
162
echo $etLine >>$SyncTestDir/res.txt
@@ -172,23 +170,20 @@ InitData () {
172
170
WithCCND 1 SyncTest $SyncPutFlags -put $SyncTestDir/test.data ccnx:/root/beer/floatZ >>$SyncTestDir/tfr2.txt
173
171
}
174
172
WaitLim () {
175
- local I
176
173
I=1
177
174
while test $I -le $SyncTestRepos; do
178
175
WaitRepoLeaves $I $LIM
179
- I=`expr $ I + 1`
176
+ I=$(( I + 1))
180
177
done
181
178
}
182
179
SetSlices () {
183
- local I
184
180
I=1
185
181
while test $I -le $SyncTestRepos; do {
186
182
WithCCND $I DoSlice $I >$SyncTestDir/slice.$I.txt
187
- I=`expr $ I + 1`
183
+ I=$(( I + 1))
188
184
}; done
189
185
}
190
186
DoTest () {
191
- local I
192
187
testOrder="after"
193
188
if [ ${SyncTestInitBefore:=0} -gt 0 ]; then testOrder="before"; fi
194
189
testLine="-- Testing, repos $SyncTestRepos, config $repoConfig, init $testOrder, $SyncTestExtra, names $SyncTestNames, `MyDate`"
@@ -198,29 +193,29 @@ DoTest () {
198
193
while test $I -le $SyncTestRepos; do
199
194
WithCCND $I ccnd 2>$SyncTestDir/ccnd.$I.$SyncTestNames.txt &
200
195
sleep 0.2
201
- I=`expr $ I + 1`
196
+ I=$(( I + 1))
202
197
done
203
198
sleep 1
204
199
if [ ${SyncTestUseStar:=0} -eq 1 ] ; then
205
200
I=2
206
201
while test $I -le $SyncTestRepos; do {
207
202
Linkup 1 $I
208
203
Linkup $I 1
209
- I=`expr $ I + 1`
204
+ I=$(( I + 1))
210
205
}; done
211
206
else
212
207
I=1
213
208
while test $I -lt $SyncTestRepos; do {
214
- II=`expr $ I + 1`
209
+ II=$(( I + 1))
215
210
Linkup $I $II
216
211
Linkup $II $I
217
- I=`expr $ I + 1`
212
+ I=$(( I + 1))
218
213
}; done
219
214
fi
220
215
I=1
221
216
while test $I -le $SyncTestRepos; do {
222
217
WithCCND $I StartEmptyRepo $I &
223
- I=`expr $ I + 1`
218
+ I=$(( I + 1))
224
219
}; done
225
220
sleep $(( $SyncTestRepos / 4 ))
226
221
@@ -247,10 +242,10 @@ DoTest () {
247
242
I=1
248
243
while test $I -le $SyncTestRepos; do
249
244
WithCCND $I GetStats $RootBeerHash $SyncTestDir/prev.$I.txt
250
- I=`expr $ I + 1`
245
+ I=$(( I + 1))
251
246
done
252
247
WithCCND 1 SyncTest $SyncPutFlags -put $SyncTestDir/small.data ccnx:/root/beer/floatY >$SyncTestDir/tfr3.txt
253
- LIM=`expr $ LIM + $ stp`
248
+ LIM=$(( LIM + stp))
254
249
ncLine="Added $stp name"
255
250
ncMax=0
256
251
etLine="Update time"
@@ -285,7 +280,7 @@ DoTest () {
285
280
packets=`awk -f scan-sumint.awk $SyncTestDir/stats.$I.txt`
286
281
packetSum=$(($packetSum + $packets))
287
282
intLine="$intLine, P$I = $packets"
288
- I=`expr $ I + 1`
283
+ I=$(( I + 1))
289
284
done
290
285
echo ----
291
286
tail -1 $SyncTestDir/tfr3.txt >>$SyncTestDir/res.txt
@@ -310,7 +305,7 @@ DoTest () {
310
305
StatsPause
311
306
stuff=`jobs -p`
312
307
if [ ! "$stuff" ] ; then break; fi ;
313
- x=`expr $ x + 1`
308
+ x=$(( x + 1))
314
309
} ; done
315
310
}
316
311
CheckDir () {
@@ -330,12 +325,12 @@ StartTest () {
330
325
while test $I -le $SyncTestRepos; do
331
326
WithCCND $I ccnd 2>$SyncTestDir/ccnd.$I.$SyncTestNames.txt &
332
327
sleep 0.2
333
- I=`expr $ I + 1`
328
+ I=$(( I + 1))
334
329
done
335
330
I=1
336
331
while test $I -le $SyncTestRepos; do
337
332
WithCCND $I StartEmptyRepo $I &
338
- I=`expr $ I + 1`
333
+ I=$(( I + 1))
339
334
done
340
335
I=0
341
336
while test $I -le $SyncTestRepos; do
@@ -345,9 +340,9 @@ StartTest () {
345
340
echo Linkup $I $J
346
341
Linkup $I $J
347
342
fi
348
- J=`expr $ J + 1`
343
+ J=$(( J + 1))
349
344
done
350
- I=`expr $ I + 1`
345
+ I=$(( I + 1))
351
346
done
352
347
SetSlices
353
348
}
0 commit comments