HBASE-20801 Fix broken TestReplicationShell

This commit is contained in:
zhangduo 2018-06-28 10:27:11 +08:00
parent 0789e15b5e
commit 6198e1fc7d
1 changed files with 18 additions and 4 deletions

View File

@ -103,7 +103,10 @@ module Hbase
define_test "add_peer: remote wal dir" do define_test "add_peer: remote wal dir" do
cluster_key = "server1.cie.com:2181:/hbase" cluster_key = "server1.cie.com:2181:/hbase"
remote_wal_dir = "hdfs://srv1:9999/hbase" remote_wal_dir = "hdfs://srv1:9999/hbase"
args = { CLUSTER_KEY => cluster_key, REMOTE_WAL_DIR => remote_wal_dir } table_cfs = { "ns3:table1" => [], "ns3:table2" => [],
"ns3:table3" => [] }
args = { CLUSTER_KEY => cluster_key, REMOTE_WAL_DIR => remote_wal_dir,
TABLE_CFS => table_cfs}
command(:add_peer, @peer_id, args) command(:add_peer, @peer_id, args)
assert_equal(1, command(:list_peers).length) assert_equal(1, command(:list_peers).length)
@ -111,6 +114,7 @@ module Hbase
assert_equal(@peer_id, peer.getPeerId) assert_equal(@peer_id, peer.getPeerId)
assert_equal(cluster_key, peer.getPeerConfig.getClusterKey) assert_equal(cluster_key, peer.getPeerConfig.getClusterKey)
assert_equal(remote_wal_dir, peer.getPeerConfig.getRemoteWALDir) assert_equal(remote_wal_dir, peer.getPeerConfig.getRemoteWALDir)
assert_tablecfs_equal(table_cfs, peer.getPeerConfig.getTableCFsMap())
# cleanup for future tests # cleanup for future tests
command(:remove_peer, @peer_id) command(:remove_peer, @peer_id)
@ -519,7 +523,10 @@ module Hbase
define_test "transit_peer_sync_replication_state: test" do define_test "transit_peer_sync_replication_state: test" do
cluster_key = "server1.cie.com:2181:/hbase" cluster_key = "server1.cie.com:2181:/hbase"
remote_wal_dir = "hdfs://srv1:9999/hbase" remote_wal_dir = "hdfs://srv1:9999/hbase"
args = { CLUSTER_KEY => cluster_key, REMOTE_WAL_DIR => remote_wal_dir } table_cfs = { "ns3:table1" => [], "ns3:table2" => [],
"ns3:table3" => [] }
args = { CLUSTER_KEY => cluster_key, REMOTE_WAL_DIR => remote_wal_dir,
TABLE_CFS => table_cfs}
command(:add_peer, @peer_id, args) command(:add_peer, @peer_id, args)
assert_equal(1, command(:list_peers).length) assert_equal(1, command(:list_peers).length)
@ -527,11 +534,18 @@ module Hbase
assert_equal(@peer_id, peer.getPeerId) assert_equal(@peer_id, peer.getPeerId)
assert_equal(SyncReplicationState::DOWNGRADE_ACTIVE, peer.getSyncReplicationState) assert_equal(SyncReplicationState::DOWNGRADE_ACTIVE, peer.getSyncReplicationState)
command(:transit_peer_sync_replication_state, @peer_id, 'ACTIVE') command(:transit_peer_sync_replication_state, @peer_id, 'STANDBY')
assert_equal(1, command(:list_peers).length) assert_equal(1, command(:list_peers).length)
peer = command(:list_peers).get(0) peer = command(:list_peers).get(0)
assert_equal(@peer_id, peer.getPeerId) assert_equal(@peer_id, peer.getPeerId)
assert_equal(SyncReplicationState::ACTIVE, peer.getSyncReplicationState) assert_equal(SyncReplicationState::STANDBY, peer.getSyncReplicationState)
# need to transit back otherwise we can not remove the peer
command(:transit_peer_sync_replication_state, @peer_id, 'DOWNGRADE_ACTIVE')
assert_equal(1, command(:list_peers).length)
peer = command(:list_peers).get(0)
assert_equal(@peer_id, peer.getPeerId)
assert_equal(SyncReplicationState::DOWNGRADE_ACTIVE, peer.getSyncReplicationState)
# cleanup for future tests # cleanup for future tests
command(:remove_peer, @peer_id) command(:remove_peer, @peer_id)