-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·42 lines (34 loc) · 811 Bytes
/
run.sh
File metadata and controls
executable file
·42 lines (34 loc) · 811 Bytes
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
#!/usr/bin/env bash
if [ -d test/keyval ]; then
rm -rf test/keyval;
fi
mkdir -p test/keyval
n_proc=${1}
echo "Running $(( ${n_proc} + 1 )) processes with ${2} and ${3}..."
make clean
make cache=${2} dbg=${3}
dd if=/dev/zero of=disk.img bs=1M count=2048
./objfs mnt1 -o use_ino
rand_put parv > test/keyval/keyparv
for i in `seq 0 ${n_proc}`; do
rand_put ${i} > test/keyval/key${i} &
pids1[${i}]=$!
done
for pid in ${pids1[*]}; do
wait ${pid}
done
for i in `seq 0 ${n_proc}`; do
rand_get ${i} > test/keyval/val${i} &
pids2[${i}]=$!
done
for pid in ${pids2[*]}; do
wait ${pid}
done
for i in `seq 0 ${n_proc}`; do
diff test/keyval/key${i} test/keyval/val${i} 1>/dev/null
if [ ! $? -eq 0 ]; then
echo "Failed on ${i}"
exit 1
fi
done
fusermount -u mnt1