[Test] Added regression test for replication when AUTH is on.

This commit is contained in:
Enrico Giordani
2015-12-02 18:40:59 +01:00
parent 9ee99ed194
commit 43a194f3da
+34
View File
@@ -1,3 +1,37 @@
proc log_file_matches {log pattern} {
set fp [open $log r]
set content [read $fp]
close $fp
string match $pattern $content
}
start_server {tags {"regression"}} {
set slave [srv 0 client]
set slave_host [srv 0 host]
set slave_port [srv 0 port]
set slave_log [srv 0 stdout]
start_server {} {
set master [srv 0 client]
set master_host [srv 0 host]
set master_port [srv 0 port]
# Set the AUTH password
$master config set requirepass mypwd
$slave config set masterauth mypwd
# Start the replication process...
$slave slaveof $master_host $master_port
test {Slave is able to sync with master when AUTH is on} {
wait_for_condition 50 100 {
[log_file_matches $slave_log "*Finished with success*"]
} else {
fail "Slave is not able to sync with master when AUTH is on"
}
}
}
}
start_server {tags {"regression"}} {
set A [srv 0 client]
set A_host [srv 0 host]