Commit Graph

998 Commits

Author SHA1 Message Date
778623bdfd Make mysqlmon_failover_manual2 tests faster
Removed the sleeps and used wait_for_monitor instead. Also dropped the
table at the end of the test.
2018-11-19 20:03:22 +02:00
fd3a42ceb6 Remove unnecessary sleeps from tests
Removed unnecessary sleeps and replaced sleeps with wait_for_monitor in
some older tests. Also removed the odd arrangement of arrays in
server_weight.
2018-11-19 20:02:13 +02:00
47092ed18a Prevent connection double counts in tests
The function would count a connection twice if hostname resolution was not
enabled and both the host and the IP matched.
2018-11-19 20:02:13 +02:00
601c2d6633 Drop databases in connect_to_nonexisting_db
The test left undropped databases after itself which caused unnecessary
work with repeated runs. Also removed the somewhat superficial wait at the
start of the test.
2018-11-19 20:02:12 +02:00
9c19a481fc Rewrite readconnrouter_master test
Using server_id values is more reliable and significantly faster. Changed
code to use newer functions and constructs.
2018-11-19 20:02:12 +02:00
355f34669d Sanitize log_matches input
Given that the pattern is given as an argument quoted with single quotes,
embedded single quotes are a problem. Given that most cases that they are
used for is as parts of natural words like can't or won't. By replacing
the single quotes with wildcard characters, we make sure the input is
formatted correctly while still matching with relatively high accuracy.
2018-11-19 20:02:12 +02:00
4b6aab1417 Replace check_log_err with log_includes/log_excludes
The latter are more explicit and easier to understand at the call site.

Also removed the redundant crash checks via the log files.
2018-11-19 20:02:11 +02:00
bc8db6d52c Improve false_monitor_state_change
The test uses wait_for_monitor and no longer does the redundant debug
assert check that is covered by the core dump detection.
2018-11-19 20:02:11 +02:00
d60e97dfa5 Make node startup more robust
The connection attempts to all nodes are done over a period of time to
cope with slowly starting servers.
2018-11-19 20:02:11 +02:00
1f8180b8ee Use explicit file in mxs722
Using an explicit file also checks whether the correct file is used when a
specific file is given as an argument.
2018-11-19 20:02:11 +02:00
29b3dd0930 Fix prepared_statement
The test relied on the master's @@server_id being a specific value.
2018-11-19 20:02:11 +02:00
14fb142afb Rewrite maxscale_process_user
Changed output format to be more robust and used stack allocated objects
instead of heap allocated ones.
2018-11-19 20:02:10 +02:00
74ec1e7400 Skip tests that cannot be run
If a test requires Galera but it is not available, it is now skipped. All
tests that explicitly use the `test.galera` member as well as all tests
that use a Galera configuration now require that Galera is present.
2018-11-19 20:02:10 +02:00
eac9b86647 MXS-2167: Change expected test outcome
The test should now pass as the functionality is implemented. Also added a
temporary workaround to firewall problems.
2018-11-15 14:24:41 +02:00
598edea203 MXS-2167: Add test case
Added a test case that reproduces the problem.
2018-11-15 14:24:41 +02:00
396da06eb8 Move sync_with_stdio into TestConnections constructor
This way all tests run with the same configuration.
2018-11-15 14:24:41 +02:00
29d96662eb Add missing error message to check_replication
The version extraction could fail silently.
2018-11-15 14:24:41 +02:00
4bd8630107 MXS-1598 Add replication lag test cases to mysqlmon_multimaster
The delay is added simply with the 'MASTER_DELAY'-option of
the 'CHANGE MASTER TO'-command.
2018-11-15 13:26:38 +02:00
52b9cc59d5 MXS-1775 Test automatic switchover
Tests low disk space detection and automatic switchover.
2018-11-14 18:17:40 +02:00
3092a744ed Enable verbose output on Galera startup failure
If a Galera node fails to start, enabling the verbose mode prints the
output of each SSH command. This fixes the visibility of the log file
printing.
2018-11-14 16:23:47 +02:00
54370618bc Stop keepalived after the tests
Once the tests are done keepalived must be stopped. This is done to
prevent it from affecting other tests.
2018-11-14 16:23:47 +02:00
07231747bf Print server logs on failure to start
When the MariaDB server exits with an error, the logs help explain why
that happened.
2018-11-14 16:23:47 +02:00
77f8a3b71b MXS-2057 System test 2018-11-14 16:20:42 +02:00
e371964f8b MXS-2057 Add log output for system test, and two random code fixes 2018-11-14 16:20:42 +02:00
2650a9174e Fix addition of galera config options
The options weren't properly set as the galera nodes used different file
names.
2018-11-14 13:08:27 +02:00
896ce87332 Allow loading any plugin for tests
Required for 'disks'-plugin.
2018-11-14 11:05:23 +02:00
0355398425 Fix typo in unblock_node
The command is called ip6tables.
2018-11-13 16:48:03 +02:00
ad52834c9b Merge branch '2.2' into 2.3 2018-11-12 14:51:49 +02:00
f7db955101 Add proxy protocol test
The test creates a user with only the client ip as allowed host and
then uses that client to log in.
2018-11-12 14:33:59 +02:00
f2688784cf Reconnect before sync in mxs1743_rconn_bitmask
The blocking of the nodes that happens before it could cause the
connections to break. This also removes the need for the fixing of the
replication which takes time.
2018-11-12 10:13:59 +02:00
2a6df0e724 Merge branch '2.2' into 2.3 2018-11-09 14:22:28 +02:00
00eb7cb4ee Automatically stop secondary MaxScale
If the test uses two MaxScales, they are automatically stopped after the
test. This prevents the second MaxScale from interfering with subsequent
tests.
2018-11-09 12:13:22 +02:00
514b5f7856 Fix mxs359_read_only
Due to the changes in the monitor, an explicit failcount=1 and extra waits
are required to make sure the master actually changes.
2018-11-09 12:13:22 +02:00
226fe4871d Log mysql error message in mxs1776_ps_exec_hang
If the test fails, log the error message. This should help understand why
the test failed.
2018-11-09 12:13:21 +02:00
00d0ec5f8e Move wait_for_maxscale functionality inside MaxScale
By exposing a (currently undocumented) debug endpoint that lets one
monitor interval pass, we make the reuse of the monitor waiting
functionality a lot easier. With it, when MaxScale is started by the test
framework it knows that at least one monitor interval will have passed for
all monitors and that the system is ready to accept queries.
2018-11-09 09:13:27 +02:00
a53dbeec57 Always use service restart for startup
By starting MaxScale with `service restart maxscale`, the start() function
is idempotent: MaxScale is started from a stopped state.
2018-11-09 09:13:27 +02:00
eb1bc0b768 Add more error logging to Galera checks
The reason for the failure is now logged.
2018-11-09 09:13:27 +02:00
f085abf720 Use one ssh connection for block/unblock operations
As the ssh_node_f function supports full shell syntax, all of the work can
be done with a single ssh connection. This removes the overhead that each
extra ssh connection adds.
2018-11-09 09:13:27 +02:00
4f3ae823a9 Speed up log copying
The collection of the various artifacts generated by a test case and the
core dump detection is now done in the same SSH command. This removes the
extra overhead that it added.
2018-11-09 09:13:27 +02:00
ff9b26b7fa Remove unnecessary SSHing to MaxScale at test startup
There were a total of five SSH connections opened at the start of each
test. Only two of these are currently required: the SSL certificate
directory check and the actual command that restarts MaxScale. Two of the
three remaining commands, stopping of MaxScale and copying of the
configuration, can be made conditional or combined into other
commands.

The stopping of MaxScale is done to prevent it from interfering with the
cluster setup process. As MaxScale does nothing if nothing is wrong, it is
safe to make the restart conditional so that it is done only when a
problem in the cluster setup is detected.

The final SSH command, the MaxScale health check via maxadmin, can be
removed as it is redundant: the daemonization already covers this by
exiting only after MaxScale is ready.
2018-11-09 09:13:26 +02:00
4e3d1a29b6 Clean up Galera_nodes::check_galera
The code can be simplified as only one of the nodes needs to be checked to
see how many nodes are in the cluster.
2018-11-09 09:13:26 +02:00
69bf3a90d3 Fix and improve Galera startup
A certain templated parameter was only substituted when the VMs were
provisioned. This needs to be handled by the test framework to allow
changes into Galera clusters configuration.

Also made the startup of the "lesser" nodes parallel so minimize the
startup time.
2018-11-09 09:13:26 +02:00
2ac1656fc7 Fix galera initialization
The galera configurations need pre-processing before they can be
used. Switched to std::endl to automatically flush the output at the end
of each line. This makes it easier to see what is happening when the tests
are ran by buildbot. Also removed the extra startup of the servers that
was done right after installing the database.
2018-11-09 09:13:26 +02:00
4e87d7da4c Remove unused files
The files weren't used or were built but not used.
2018-11-09 09:13:26 +02:00
6479656445 Remove commented out tests
The tests weren't enabled in 2.1 so they are unlikely to be up to date.
2018-11-09 09:13:26 +02:00
d7e809f525 Group blr and avrorouter tests
Grouped all binlogrouter and avrorouter tests so that they are executed as
the last tests. This helps prevent some side effects that result from the
"aggressive" replication modifications the tests do. Also removed some
commented out test cases.
2018-11-09 09:13:25 +02:00
8f542d05ba Organize tests by backend server type
Grouping the tests helps detect Galera specific problems.
2018-11-09 09:13:25 +02:00
70dfb447a2 Use normal config for bug681
The test doesn't require Galera backends.
2018-11-09 09:13:25 +02:00
df003a3e7c Use normal config for server_weight
The backends used for the test don't have to be Galera servers as the
functionality is generic.
2018-11-09 09:13:25 +02:00
8c9ecf2756 Remove redundant tests
The tests tested generic functionality and the backend type should not
affect the test results.
2018-11-09 09:13:25 +02:00