]>
Commit | Line | Data |
---|---|---|
85ecc65e PN |
1 | start_server default.conf {} { |
2 | r set mykey foo | |
3 | ||
4 | start_server default.conf {} { | |
5 | test {Second server should have role master at first} { | |
6 | s role | |
7 | } {master} | |
8 | ||
9 | test {SLAVEOF should start with link status "down"} { | |
10 | r slaveof [srv -1 host] [srv -1 port] | |
11 | s master_link_status | |
12 | } {down} | |
13 | ||
14 | test {The role should immediately be changed to "slave"} { | |
15 | s role | |
16 | } {slave} | |
17 | ||
18 | wait_for_sync r | |
19 | test {Sync should have transferred keys from master} { | |
20 | r get mykey | |
21 | } {foo} | |
22 | ||
23 | test {The link status should be up} { | |
24 | s master_link_status | |
25 | } {up} | |
26 | ||
27 | test {SET on the master should immediately propagate} { | |
28 | r -1 set mykey bar | |
29 | r 0 get mykey | |
30 | } {bar} | |
31 | } | |
32 | } |