-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·77 lines (57 loc) · 1.09 KB
/
test.sh
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
set -x
cargo run -- --port 6481 --replicaof "localhost 6379" &
pid1=$!
cargo run -- --port 6482 --replicaof "localhost 6379" &
pid2=$!
cargo run -- --port 6483 --replicaof "localhost 6379" &
pid3=$!
cargo run -- --port 6484 --replicaof "localhost 6379" &
pid4=$!
function cleanup {
kill $pid1
kill $pid2
kill $pid3
kill $pid4
}
trap cleanup EXIT
sleep 1
for i in {1..100}
do
redis-cli -p 6379 set key$i value$i > /dev/null
done
sleep 2
echo "check 6481"
for i in {1..100}
do
value=$(redis-cli -p 6481 get key$i)
if [ "$value" != "value$i" ]; then
echo "value$i is not value$i"
fi
done
echo "check 6482"
for i in {1..100}
do
value=$(redis-cli -p 6482 get key$i)
if [ "$value" != "value$i" ]; then
echo "value$i is not value$i"
fi
done
echo "check 6483"
for i in {1..100}
do
value=$(redis-cli -p 6483 get key$i)
if [ "$value" != "value$i" ]; then
echo "value$i is not value$i"
fi
done
echo "check 6484"
for i in {1..100}
do
value=$(redis-cli -p 6484 get key$i)
if [ "$value" != "value$i" ]; then
echo "value$i is not value$i"
fi
done
echo "PASS"
# sleep 1000