-
Notifications
You must be signed in to change notification settings - Fork 7
/
runTest
executable file
·60 lines (51 loc) · 1.4 KB
/
runTest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
minDedup=85
function cleanUp {
rm -rf testDir test.index
}
function runVDOEstimator {
sync
./vdoestimator --index test.index ./testDir
}
cleanUp
mkdir testDir
dd if=/dev/zero ibs=4k count=22 > testDir/data 2>/dev/null
dedupPercent=`runVDOEstimator | grep 'Dedupe Percentage' | awk '{print $3}' | sed 's/%//'`
dedupPercent=${dedupPercent/\.*}
if [ $dedupPercent -lt $minDedup ]; then
echo Dedup too low: $dedupPercent
exit 1
else
echo succeed: $dedupPercent
fi
dedup1=$dedupPercent
cleanUp
mkdir testDir
dd if=/dev/zero ibs=4k count=22 2>/dev/null | tr "\000" "\377" > testDir/data
dedupPercent=`runVDOEstimator | grep 'Dedupe Percentage' | awk '{print $3}' | sed 's/%//'`
dedupPercent=${dedupPercent/\.*}
if [ $dedupPercent -lt $minDedup ]; then
echo Dedup too low: $dedupPercent
exit 1
else
echo succeed: $dedupPercent
fi
dedup2=$dedupPercent
if [ $dedup1 != $dedup2 ]; then
echo Dedup rate should be the same for the first two tests.
exit 1;
fi
cleanUp
mkdir testDir
dd if=/dev/zero ibs=4k count=11 > testDir/data 2>/dev/null
dd if=/dev/zero ibs=4k count=11 2>/dev/null | tr "\000" "\377" >> testDir/data 2>/dev/null
dedupPercent=`runVDOEstimator | grep 'Dedupe Percentage' | awk '{print $3}' | sed 's/%//'`
dedupPercent=${dedupPercent/\.*}
if [ $dedupPercent -lt $minDedup ]; then
echo Dedup too low: $dedupPercent
exit 1
else
echo succeed: $dedupPercent
fi
cleanUp
exit 0