67 Commits

Author SHA1 Message Date
Markus Mäkelä
ba0e3bd6b7
Speed up avrorouter testing
Cut test time from about 300 seconds to 200 seconds.
2018-06-08 12:18:14 +03:00
Markus Mäkelä
74cc74ed66
Remove MySQL 5.1 support from tests
Removed the configuration parameter template and the code that uses it.
2018-06-04 19:26:36 +03:00
Niclas Antti
5d02d8c0ba Merge branch '2.2' into develop 2018-06-01 09:33:04 +03:00
Johan Wikman
8917458505 MXS-1890 Make it easier to run tests using local MaxScale
Now, if a test is invoked with '-l', then MaxScale is assumed to
be running locally using a configuration file suitable for the
test that is invoked. Further, at the end of the test, the log
files of MaxScale are not downloaded (obviously).

As a side-effect, an environment variable no_maxscale_log_copy,
similar to the existing no_backend_log_copy, has been introduced
using which the downloading of maxscale log files unconditionally
can be prevented.
2018-05-30 21:05:10 +03:00
Niclas Antti
f62d155036 MXS-173 Test for throttling filter
The test may fail if the client/maxscale/mariadb combo is too slow.
TODO, maybe: today I saw mysql_query() hang (in a poll) when maxscale
disconnected. Is there something that can be done about that?
I added a source directory, base, for stuff that should become part of a common
utility library in the future.
2018-05-25 14:51:36 +03:00
Markus Mäkelä
cd303df35c
Revert "Trunate logs instead of removing"
This reverts commit 14dc215a787e64fb6457889b647c861f634d68a5.
2018-05-25 12:12:35 +03:00
Markus Mäkelä
14dc215a78
Trunate logs instead of removing
By truncating the files, tests can be run while the log is being
tailed. If they are removed, the files need to be reopened each time a
test is started.
2018-05-22 15:44:55 +03:00
Markus Mäkelä
bf933ecc22
Open all ports by default
The test now flushes the INPUT chain of iptables at the start of the
test. This should open all ports even if the OS by default defines some
rules that block ports.
2018-05-17 10:04:00 +03:00
Markus Mäkelä
ed2d0f4a5b
Allow out-of-source test runs
The test can now be run outside of the test source directory. Since the
`test_dir` global variable contains the absolute path to the test source,
all copying of configurations and execution of scripts can be done with
minimal changes.
2018-05-15 10:14:38 +03:00
Markus Mäkelä
421e64ceeb
Take -Wall into use for tests
Take almost all warnings into use except `format-overflow` and
`unused-function`. format-overflow needs to be handled in a separate
commit.
2018-04-23 14:02:54 +03:00
Markus Mäkelä
0f0913fc99
Fix test build failures with GCC 8
GCC 8 enables -Werror=return-type by default which combined with -Werror
causes the build to fail.
2018-04-23 14:02:53 +03:00
Markus Mäkelä
01b04094a6
Only check for cores at root level
The previous core check would pick up any file in /tmp/ that would start
with the `core` prefix. This included some npm generated files which are
created if MaxCtrl is built on the MaxScale machine.
2018-03-29 14:25:19 +03:00
Markus Mäkelä
eca77fb4c9
Improve core dump detection
The core dump detection now properly distinguishes core dumps and ssh
failures.
2018-03-28 16:50:27 +03:00
Timofey Turenko
e921298af9 add Maxscale stop into test init procedure 2018-03-27 12:58:05 +03:00
Markus Mäkelä
8b943e249b
MXS-1731: Treat empty parameters as errors
If a parameter is defined without a value, it is now treated as an error.
2018-03-21 14:14:13 +02:00
Markus Mäkelä
94f29a11c5
MXS-1724: Reimplement core dump detection
Reimplemented the core dump detection for 2.2.
2018-03-20 13:06:20 +02:00
Timofey Turenko
022c226d4b
Mxs 1665 keepalived masterdown test (#171)
* add keepalived_masterdown test

* add missing cnfs
2018-03-16 15:14:14 +02:00
Markus Mäkelä
5941f9d3b3
Silence debugging commands
If verbose mode is not enabled, the exact commands don't need to be
printed.
2018-02-14 14:47:03 +02:00
Timofey Turenko
f7857518f3
Mxs 1140 keepalived (#166)
add keepalived test
2018-02-12 15:49:07 +02:00
Markus Mäkelä
6a1aba70e7
Add test case for ignore_external_masters + failover
The test checks that failover works even when the master of the monitored
cluster is a slave to an external masters. The test also verifies that the
servers do not get unexpected status labels.
2018-02-07 16:07:16 +02:00
Markus Mäkelä
6132ebd24f
MXS-1643: Add test case
Added test case that checks that the correct state changes are made and no
extra events are triggered.

Also cleaned up the log checking function.
2018-02-06 14:51:07 +02:00
Markus Mäkelä
9f7189a9a4
Sync slaves and writer thread in binlog_change_master
The test uses a separate writer thread to insert data into the
master. This thread must be halted before the blocking of the master
happens as the slaves must catch up. Once slaves have caught up and the
master is blocked, the writer thread can continue doing inserts.

At the end of the test slaves must also be synchronized before the
inserted data is validated. This prevents test failures due to slave lag.
2018-02-05 10:24:51 +02:00
Johan Wikman
bed0b850b1 Merge branch '2.1' into 2.2 2018-01-05 09:58:10 +02:00
Timofey Turenko
1bd20cd2eb temopary disable snapshot revert due to Galera failures 2018-01-05 09:40:41 +02:00
Markus Mäkelä
3b7275ec41 Use default value for "smoke"
The values should only be updated if the environment variable is defined.
2017-12-27 17:21:42 +02:00
Markus Mäkelä
58373b3495 Fix template generation
The templates weren't generated for Galera nodes.
2017-12-27 09:42:21 +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ä
70088be16d Use default value for "smoke"
The values should only be updated if the environment variable is defined.
2017-12-19 16:44:46 +02:00
Esa Korhonen
c3fe8a6b55 MXS-1565: Invalid rejoin test
- 1 master, 3 slaves
- stop maxscale so it does not autorejoin later on
- stop & reset slave on servers 3 & 4
- add data to server 4
- restart maxscale, check that server 3 is rejoined but not server 4
- manually set server 1 to replicate from server 4, creating a relay master
- check that servers 2 & 3 are redirected, making server 1 just a slave
- switchover master to server 1, check that it's the master

Also, moved some common functions into their own files. These functions
are used by multiple tests.
2017-12-19 15:59:01 +02:00
Markus Mäkelä
628203213e Fix template generation
The templates weren't generated for Galera nodes.
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
Timofey Turenko
1a63e5ec7e
2.1 fix restore (#151)
* refactor test backend fixing

* return comatibility with 5.5 for backend restore

* remove backend configuration scripts
2017-12-18 23:47:02 +02:00
Timofey Turenko
6d3e165bb0 fix log copying in Testconnections 2017-12-12 18:34:06 +02:00
Markus Mäkelä
dde85af83b Clean up mariadb_func.h
Combined functions into one which only used different default
values. Removed unused functions. Used std::string where possible to make
their usage easier. Hid code that isn't used externally.
2017-12-12 16:36:51 +02:00
Markus Mäkelä
79afaa447e Merge branch '2.1' into 2.2 2017-12-12 13:23:02 +02:00
Timofey Turenko
3c88bf1ec6
refactored tests (#147) 2017-12-08 12:23:04 +02:00
Markus Mäkelä
277ece53d0 Add assertion function to TestConnections
The TestConnections::assert behaves much like the normal assert function
by simply inverting the check for add_result.
2017-12-04 14:49:13 +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
Markus Mäkelä
fca11f992a Fix verify_master_failure
The test expected the wrong error message to be in the log. To better cope
with changes in the text, the test now uses a regular expression to do the
matching.
2017-11-14 16:53:09 +02:00
Markus Mäkelä
47b1004134 Add proper cluster testing scripts
The scripts start MaxScale processes on two different servers. The support
framework for the tests is in place but the tests themselves still need to
be modified to allow the use of non-localhost addresses.
2017-10-12 13:16:12 +03:00
Markus Mäkelä
9617b55905 Run MaxCtrl test suite in the regression test suite
The MaxCtrl test suite is now a part of the regression test suite. The
cluster tests are expected to fail as that is yet to be implemented.

Also fixed the return value of TestConnections::ssh_maxscale.
2017-10-12 13:16:12 +03:00
Markus Mäkelä
bbd5fe8288 Fix GTID setup in tests
The GTID setup in tests executed code that was not supposed to be executed
when GTID is in use.
2017-10-05 11:09:09 +03:00
Markus Mäkelä
0cb72937cd Disable multi-MaxScale initialization by default
Only tests that require multiple MaxScale instances should enable the
multi-MaxScale mode.
2017-10-05 08:09:58 +03:00
Markus Mäkelä
a4271cb94e Order member variable initialization in TestConnections
The variables are now initialized in order and always in the constructor.
2017-10-05 08:06:10 +03:00
Markus Mäkelä
503e768d80 Add methods for changing the active MaxScale instance
The new function allows two MaxScale instances to be controlled via the
same TestConnections object. This will allow testing of Maxscale clusters.
2017-10-04 10:57:12 +03:00
Markus Mäkelä
9f74878794 Run smoke tests by default
The tests are now run as the shorter version by default.
2017-10-04 10:34:06 +03:00
Markus Mäkelä
9f66278ac2 Fix typo in IP testing database
The test had a typo in the SQL that created the database so the later
queries that referred to it always failed.
2017-10-03 22:32:56 +03:00
Markus Mäkelä
54a7051a3f Fix tests broken by the merge
The merge caused compilation failures in two of the files.
2017-10-03 15:14:06 +03:00
Markus Mäkelä
bd39284f9c Merge branch '2.1' into 2.2 2017-10-03 14:30:06 +03:00
Markus Mäkelä
6a33e55b6f Backport no_vm_revert option
The VM revert on test failure was added to 2.1 but it was only disabled in
2.2.
2017-10-02 10:55:00 +03:00