Skip to content

Commit

Permalink
fix maintenance.feature tests (#89)
Browse files Browse the repository at this point in the history
* check regex test

* test regex

* fix maintenance.feature tests

* fix maintenance.feature tests

* fix maintenance.feature tests

* fix maintenance.feature tests

---------

Co-authored-by: suetin <[email protected]>
Co-authored-by: teem0n <[email protected]>
  • Loading branch information
3 people authored May 7, 2024
1 parent 2166ae0 commit 92c21e2
Showing 1 changed file with 72 additions and 36 deletions.
108 changes: 72 additions & 36 deletions tests/features/maintenance.feature
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,37 @@ Feature: maintenance mode
"""
When I run SQL on mysql host "mysql2"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"0",
"SlaveEnabled":"1"
}]
[
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"ON",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""
When I run SQL on mysql host "mysql1"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"1",
"SlaveEnabled":"0"
}]
[
{
"Value":"ON",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""
When I run command on host "mysql1"
"""
Expand All @@ -103,25 +115,37 @@ Feature: maintenance mode
And zookeeper node "/test/active_nodes" should not exist
When I run SQL on mysql host "mysql2"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"0",
"SlaveEnabled":"1"
}]
[
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"ON",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""
When I run SQL on mysql host "mysql1"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"0",
"SlaveEnabled":"0"
}]
[
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""
When I run command on host "mysql1"
"""
Expand All @@ -135,25 +159,37 @@ Feature: maintenance mode
"""
When I run SQL on mysql host "mysql2"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"0",
"SlaveEnabled":"1"
}]
[
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"ON",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""
When I run SQL on mysql host "mysql1"
"""
SELECT @@rpl_semi_sync_master_enabled AS MasterEnabled, @@rpl_semi_sync_slave_enabled AS SlaveEnabled;
SHOW GLOBAL VARIABLES LIKE 'rpl_semi_sync_%_enabled'
"""
Then SQL result should match regexp
Then SQL result should match json
"""
[{
"MasterEnabled":"1",
"SlaveEnabled":"0"
}]
[
{
"Value":"ON",
"Variable_name":"rpl_semi_sync_master_enabled"
},
{
"Value":"OFF",
"Variable_name":"rpl_semi_sync_slave_enabled"
}
]
"""

Scenario: master host in DCS updated correctly after manual master change
Expand Down

0 comments on commit 92c21e2

Please sign in to comment.