Sha256: 5e60a104e815dcadb8a7adac37e21f68b1be315097e7cce1488e5a422b29cc92

Contents?: true

Size: 958 Bytes

Versions: 4

Compression:

Stored size: 958 Bytes

Contents

require_relative "../integration_helper"

class ThereAndBackAgain < Minitest::Test
  def test_there_and_back
    $mysql_master.connection.query("set GLOBAL READ_ONLY=0")
    $mysql_slave.connection.query("set GLOBAL READ_ONLY=1")

    puts "testing first cutover..."

    system "#{master_cut_script} 127.0.0.1:#{$mysql_master.port} 127.0.0.1:#{$mysql_slave.port} root -p '' -r -s"
    assert_ro($mysql_master.connection, 'original master', true)
    assert_ro($mysql_slave.connection, 'original slave', false)

    assert "Yes" == $mysql_master.connection.query("show slave status").first['Slave_IO_Running']

    system "#{master_cut_script} 127.0.0.1:#{$mysql_slave.port} 127.0.0.1:#{$mysql_master.port} root -p '' -r"
    assert_ro($mysql_master.connection, 'original master', false)
    assert_ro($mysql_slave.connection, 'original slave', true)

    assert "No" == $mysql_slave.connection.query("show slave status").first['Slave_IO_Running']
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ar_mysql_flexmaster-1.0.1 test/integration/there_and_back_again_test.rb
ar_mysql_flexmaster-1.0.0 test/integration/there_and_back_again_test.rb
ar_mysql_flexmaster-0.6.0 test/integration/there_and_back_again_test.rb
ar_mysql_flexmaster-0.5.0 test/integration/there_and_back_again_test.rb