-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·145 lines (127 loc) · 3.05 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·145 lines (127 loc) · 3.05 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#!/usr/bin/env bash
set -eu
. ./tests/helper.sh
function unit() {
if [[ "${USE_VALGRIND:-1}" != "1" ]] || [[ "$OSTYPE" == "darwin"* ]]; then
./build/unit
else
valgrind --leak-check=full --error-exitcode=1 ./build/unit
fi
echo "All unit tests passed"
}
function integration_1() {
stop_redis
rm dump.rdb 2>/dev/null || true
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind
else
start_redis
fi
./tests/integration_1.sh
stop_redis
echo "All integration (1) tests passed"
}
function integration_2() {
stop_redis
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind --aof
else
start_redis --aof
fi
./tests/integration_1.sh
stop_redis
# Test RDB load
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind
else
start_redis
fi
./tests/integration_2.sh
stop_redis
rm dump.rdb 2>/dev/null || true
# Test AOF load
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind --aof
else
start_redis --aof
fi
./tests/integration_2.sh
stop_redis
rm appendonly.aof 2>/dev/null || true
echo "All integration tests passed"
}
function integration_3() {
stop_redis
rm dump.rdb 2>/dev/null || true
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind
else
start_redis
fi
./tests/integration_3.sh
stop_redis
echo "All integration (3) tests passed"
}
function integration_4() {
stop_redis
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind --cluster
else
start_redis --cluster
fi
./tests/integration_4.sh
stop_redis
echo "All integration (4) tests passed"
}
function integration_5() {
stop_redis
rm dump.rdb 2>/dev/null || true
# appendonlydir is Redis 7+; appendonly.aof is the 6.2 layout.
rm -rf ./appendonlydir 2>/dev/null || true
rm -f appendonly.aof 2>/dev/null || true
# Seed, rewrite the AOF, then reload it from a restarted server. The rewrite
# runs without an RDB preamble so the module's aof_rewrite callbacks are used.
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind --aof --no-rdb-preamble
else
start_redis --aof --no-rdb-preamble
fi
./tests/integration_5.sh seed
stop_redis
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind --aof --no-rdb-preamble
else
start_redis --aof --no-rdb-preamble
fi
./tests/integration_5.sh verify
stop_redis
rm -rf ./appendonlydir 2>/dev/null || true
rm -f appendonly.aof 2>/dev/null || true
echo "All integration (5) tests passed"
}
function integration_6() {
stop_redis
rm dump.rdb 2>/dev/null || true
if [[ "${USE_VALGRIND:-1}" == "1" ]]; then
start_redis --valgrind
else
start_redis
fi
REDIS_PORT="$REDIS_PORT" python3 ./tests/integration_6.py
stop_redis
rm dump.rdb 2>/dev/null || true
echo "All integration (6) tests passed"
}
setup
unit
integration_1
integration_2
integration_3
integration_4
integration_5
integration_6
echo ""
echo "************************"
echo "*** ALL TESTS PASSED ***"
echo "************************"
echo ""