Skip to content

Commit 43a194f

Browse files
committed
[Test] Added regression test for replication when AUTH is on.
1 parent 9ee99ed commit 43a194f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Diff for: tests/windows/regression.tcl

+34
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
proc log_file_matches {log pattern} {
2+
set fp [open $log r]
3+
set content [read $fp]
4+
close $fp
5+
string match $pattern $content
6+
}
7+
8+
start_server {tags {"regression"}} {
9+
set slave [srv 0 client]
10+
set slave_host [srv 0 host]
11+
set slave_port [srv 0 port]
12+
set slave_log [srv 0 stdout]
13+
start_server {} {
14+
set master [srv 0 client]
15+
set master_host [srv 0 host]
16+
set master_port [srv 0 port]
17+
18+
# Set the AUTH password
19+
$master config set requirepass mypwd
20+
$slave config set masterauth mypwd
21+
22+
# Start the replication process...
23+
$slave slaveof $master_host $master_port
24+
25+
test {Slave is able to sync with master when AUTH is on} {
26+
wait_for_condition 50 100 {
27+
[log_file_matches $slave_log "*Finished with success*"]
28+
} else {
29+
fail "Slave is not able to sync with master when AUTH is on"
30+
}
31+
}
32+
}
33+
}
34+
135
start_server {tags {"regression"}} {
236
set A [srv 0 client]
337
set A_host [srv 0 host]

0 commit comments

Comments
 (0)