3
# Requires MySQL 5.6 - 5.7+
5
my $TEST_VERSION = $ENV{TEST_VERSION};
6
my ($version, $name_version) = get_bare_version($TEST_VERSION);
7
my $replication_dir = "rsandbox_$name_version";
10
command => "make_replication_sandbox $TEST_VERSION ",
11
expected => 'replication directory installed',
12
msg => 'replication directory installed',
15
ok( (-f "$sandbox_home/$replication_dir/enable_gtid" ), "file enable_gtid found ");
17
my $result = qx( $sandbox_home/$replication_dir/enable_gtid );
19
ok( $? == 0 , 'enable_gtid ran without errors');
21
ok( $result && ($result =~ /# option 'gtid_mode=ON' added to \w+ configuration file/), "enable_gtid added options successfully");
24
path => "$sandbox_home/$replication_dir/master",
25
query => 'select @@global.gtid_mode',
27
msg => 'Master GTID is enabled',
31
path => "$sandbox_home/$replication_dir/node1",
32
query => 'select @@global.gtid_mode',
34
msg => 'Slave1 GTID is enabled',
38
path => "$sandbox_home/$replication_dir/master",
39
query => "create table test.t1 (id int not null primary key); show tables from test",
41
msg => 'Master created a table',
45
path => "$sandbox_home/$replication_dir/master",
46
query => "insert into test.t1 values(12345); select * from test.t1",
48
msg => 'Master inserted a row',
54
path => "$sandbox_home/$replication_dir/node1",
55
query => "show tables from test",
57
msg => 'slave replicated the table',
61
path => "$sandbox_home/$replication_dir/node1",
62
query => "select * from test.t1",
64
msg => 'Slave retrieved a row',
68
path => "$sandbox_home/$replication_dir/master",
69
query => 'select @@global.gtid_executed',
71
msg => 'Master has produced a GTID',
75
path => "$sandbox_home/$replication_dir/node1",
76
query => 'select @@global.gtid_executed',
78
msg => 'Slave has retrieved a GTID',
82
command => "sbtool -o delete -s $sandbox_home/$replication_dir ",
83
expected => 'has been removed',
84
msg => "$replication_dir removed"