25 Commits

Author SHA1 Message Date
Markus Mäkelä
4420730f31
Start all tests with read_only disabled
Explicitly checking and setting read_only allows all tests to have a
consistent backend state.
2018-02-07 16:07:16 +02:00
Markus Mäkelä
0d037b2c24 Add configuration reset command
Resetting the settings makes it possible to start a test from a known good
configuration.
2018-02-02 12:28:07 +02:00
Timofey Turenko
8dfc1a141d fix typo in read_env() and set_env.sh 2018-01-15 17:17:44 +02:00
Johan Wikman
3c5963cf3b Reset default master node state as well
Now that mariadbmon supports failover and switchover, a test may
may change the master to some other node than node 0.

Consequently, as part of fixing the replication, gtid_slave_pos
of node 0 must be reset as well.
2018-01-05 12:47:57 +02:00
Timofey Turenko
ef79db4362 add killing mysqld process after snapshot revert 2017-12-29 12:12:20 +02:00
Timofey Turenko
5c7845c381 Galera startup crash fix, temporal removal of revert snapshot (Galera does not survive revert)
and add cores saving from tests themselves.
2017-12-21 17:20:41 +02:00
Markus Mäkelä
071ab8302b Remove old stashed configurations
When new configuration files are stashed, remove the old ones first.
2017-12-21 10:48:08 +02:00
Markus Mäkelä
c9aa504f50 Make start_node parameters const
The second parameter can be `const char*` as it is not modified. This
fixes a compiler warning.
2017-12-21 10:48:07 +02:00
Markus Mäkelä
2e68ba8c6e Automatically detect the need for GTID replication
Verifying that the requested replication type matches the one that is
currently in use allows the resetting of the nodes to automatically set up
the correct replication type. This means that a test that invokes
`Mariadb_nodes::require_gtid(true)` before initializing the
TestConnections class is given a replication setup that uses GTID
coordinates instead of file and position.
2017-12-19 16:44:46 +02:00
Markus Mäkelä
a10b93515e Simplify initialization of replication
The users are now created on both the slaves as well as the master. This
allows static binlog coordinates to be used on the slaves and the
replication initialization boils down to a set of SQL queries.
2017-12-19 16:44:46 +02:00
Markus Mäkelä
4451355e47 Don't force verbose output
The tests shouldn't force verbose output.
2017-12-19 15:00:39 +02:00
Timofey Turenko
1006ec506a
2.2 fix restore (#152)
* refactor test backend fixing

* return comatibility with 5.5 for backend restore

* remove backend configuration scripts

* adopt test backed restore function for 2.2 test fw
2017-12-18 23:47:07 +02:00
Johan Wikman
2c46e2a7ec Ensure slave not running when reseting
With this change it is ensured that you do not see

  ERROR 1198 (HY000) at line 28: This operation cannot be performed
  as you have a running slave ''; run STOP SLAVE '' first

when the slave is reset.
2017-12-18 10:58:09 +02:00
Markus Mäkelä
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
Markus Mäkelä
6803ca2efc Fix crash in mxs361
The test crashed as it used the wrong result set field.
2017-12-11 12:31:40 +02:00
Timofey Turenko
3c88bf1ec6
refactored tests (#147) 2017-12-08 12:23:04 +02:00
Markus Mäkelä
016b0f69f7 MXS-1509: Initial implementation of test case
Added some code to detect server states in a consistent manner and created
the test. The multi-source replication appeared to cause problems for the
test system which needs to be resolved.

Added --force flags to most direct `mysql` calls to prevent errors from
stopping the processing of remaining commands.
2017-11-30 12:39:00 +02:00
Esa Korhonen
ced93acc20 MXS-1514: Add failover test
The test is composed of a few parts.
1: Test that failover happens on master failure.
2: Test that a server with slave sql thread stopped is not promoted.
3: Test that a server with log_slave_updates=1 is promoted before others.
2017-11-14 10:01:37 +02:00
Markus Mäkelä
555aa6d2c8 Fix test crash in sync_slaves
The crash happens if the slave is not configured for replication or the
connection is broken when results are read. Adding missing return value
checks will fix it.
2017-10-24 11:06:14 +03:00
Markus Mäkelä
75316712e7 Fix error messages in sync_slaves
Fixed missing newlines in the error output printf calls of
sync_slaves. Changed the order of commands pers_02 executes to a more
correct way.
2017-10-08 23:26:22 +03:00
Markus Mäkelä
d391db6c2a Fix sync_slaves
The function did not check whether the file name was valid.
2017-10-05 08:23:01 +03:00
Markus Mäkelä
af08647fa2 Add variadic ssh function to mariadb_nodes
The ssh_node function now supports printf style arguments. This is used to
simplify command execution on the nodes.

Curreltny, in addition to its old usage, it is used to drop extra
databases when replication is started.
2017-10-01 10:49:11 +03:00
Markus Mäkelä
ed44c45be1 MXS-1323: Fix crash on attempted retry of read
When a backend is waiting for a response but no statement is stored for
the session, the buffer where the stored statement is copied is not
modified. This means that it needs to be initialized to a NULL value.

Added a test that checks that the behavior works as expected even with
persistent connections. A second test reproduces the crash by executing
parallel SET commands while slaves are blocked.

There is still a behavioral problem in readwritesplit. If a session
command is being executed and it fails on a slave, an error is sent to the
client. In this case it would not be necessary to close the session if the
master is still alive.
2017-07-25 11:25:43 +03:00
Markus Mäkelä
e21bec2e14 Add test for ALTER TABLE with avrorouter
The test does a set of ALTER TABLE operations and checks that MaxScale
outputs the correct data.
2017-06-05 15:33:14 +03:00
Markus Mäkelä
d7d4ec29bb Add tests from develop
Added tests from develop. The test results need to be modified for 2.0.
2017-05-26 15:40:40 +03:00