mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-02 05:22:26 +03:00
Test case for init first succesfull SST.
This commit is contained in:
@ -79,6 +79,19 @@ namespace
|
|||||||
wsrep::view bootstrap_view;
|
wsrep::view bootstrap_view;
|
||||||
wsrep::view second_view;
|
wsrep::view second_view;
|
||||||
|
|
||||||
|
void connect_in_view(const wsrep::view& view)
|
||||||
|
{
|
||||||
|
BOOST_REQUIRE(ss.connect("cluster", "local", "0", false) == 0);
|
||||||
|
ss.on_connect(view);
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
|
||||||
|
}
|
||||||
|
|
||||||
|
void prepare_for_sst()
|
||||||
|
{
|
||||||
|
ss.prepare_for_sst();
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_joiner);
|
||||||
|
}
|
||||||
|
|
||||||
void final_view()
|
void final_view()
|
||||||
{
|
{
|
||||||
BOOST_REQUIRE(ss.state() != wsrep::server_state::s_disconnected);
|
BOOST_REQUIRE(ss.state() != wsrep::server_state::s_disconnected);
|
||||||
@ -121,19 +134,6 @@ namespace
|
|||||||
server_service.sst_before_init_ = true;
|
server_service.sst_before_init_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void connect_in_view(const wsrep::view& view)
|
|
||||||
{
|
|
||||||
BOOST_REQUIRE(ss.connect("cluster", "local", "0", false) == 0);
|
|
||||||
ss.on_connect(view);
|
|
||||||
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
|
|
||||||
}
|
|
||||||
|
|
||||||
void prepare_for_sst()
|
|
||||||
{
|
|
||||||
ss.prepare_for_sst();
|
|
||||||
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_joiner);
|
|
||||||
}
|
|
||||||
|
|
||||||
void sst_received_action()
|
void sst_received_action()
|
||||||
{
|
{
|
||||||
server_service.sync_point_enabled_ = "on_view_wait_initialized";
|
server_service.sync_point_enabled_ = "on_view_wait_initialized";
|
||||||
@ -428,6 +428,22 @@ BOOST_FIXTURE_TEST_CASE(server_state_init_first_boostrap,
|
|||||||
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_synced);
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_synced);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_FIXTURE_TEST_CASE(server_state_init_first_join_with_sst,
|
||||||
|
init_first_server_fixture)
|
||||||
|
{
|
||||||
|
ss.initialized();
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_initialized);
|
||||||
|
connect_in_view(second_view);
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_connected);
|
||||||
|
prepare_for_sst();
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_joiner);
|
||||||
|
server_service.logged_view(second_view);
|
||||||
|
ss.sst_received(cc, wsrep::gtid(cluster_id, wsrep::seqno(2)), 0);
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_joined);
|
||||||
|
ss.on_sync();
|
||||||
|
BOOST_REQUIRE(ss.state() == wsrep::server_state::s_synced);
|
||||||
|
}
|
||||||
|
|
||||||
// Cycle from synced state to disconnected and back to synced. Server
|
// Cycle from synced state to disconnected and back to synced. Server
|
||||||
// storage engines remain initialized.
|
// storage engines remain initialized.
|
||||||
BOOST_FIXTURE_TEST_CASE(
|
BOOST_FIXTURE_TEST_CASE(
|
||||||
|
Reference in New Issue
Block a user