122 Commits

Author SHA1 Message Date
Markus Mäkelä
2cbfe4fb8a
Stop maxscale if it won't be restarted
This makes sure no MaxScales are running when the test is started.
2019-03-25 19:21:12 +02:00
Johan Wikman
2ba7e63e7e Merge branch '2.3' into develop 2019-03-21 09:26:06 +02:00
Markus Mäkelä
805e7975f5
Fix log truncation
Syslog wasn't truncated which caused massive disk space usage when the
full test set was run. Also removed the creation of empty log files if no
messages were logged during the run.
2019-03-18 13:58:04 +02:00
Markus Mäkelä
1c3a5bda83
Merge branch '2.3' into develop 2019-03-11 12:29:56 +02:00
Timofey Turenko
c83868936a fix start_maxscale for valgrind case 2019-03-08 11:47:11 +02:00
Markus Mäkelä
9572ff84ea
Merge branch '2.3' into develop 2019-03-05 10:37:56 +02:00
Markus Mäkelä
77ef3dd613
Merge branch '2.2' into 2.3 2019-03-05 04:54:40 +02:00
Markus Mäkelä
a6ab05b673
Fix format-overflow warnings in tests
The tests previously ignored these warnings but the change in compiler
flags caused them to fail.
2019-03-04 08:48:32 +02:00
Timofey Turenko
21fc015635 Fix compiler warnings in system tests 2019-02-27 23:15:36 +02:00
Timofey Turenko
2440b48ccc
Mxs 2236 own longtest (#189)
MXS-2236 Add own long test and possibility to run tests under Valgrind

Long test executes INSERT queries, transactions, prepared statements in parallel to create weird load on Maxscale to catch crashes and leaks

Test is not included into ctest scope. Test should be executed manually. For BuildBot (and also for run_test.sh) 'test_set' should be set 'NAME# ./long_test'

Time to run test is defined by 'long_test_time' variable (in seconds)

Possibility to run Maxscale under Valgrind is also added. To run Maxscale under Vaslgrind 'use_valgrind=yes' variable have to be defined
2019-02-22 16:12:57 +02:00
Johan Wikman
968743f61a Fix compiler errors related to unused results 2019-02-01 12:31:53 +02:00
Timofey Turenko
038f4d63e1
Mxs 2226 long test (#186)
* add possibility to run named test

* remove sysbench_dir

* remove unsupported in 1.0 sysbench options

* exculed ReadConnRouter sysbench test

* fix sysbench table name
2018-12-31 17:27:04 +02:00
Markus Mäkelä
da1772f8c9
MXS-2146: Add conditional columnstore usage
Tests can now declare that they require a columnstore setup. If one is not
present, the test is skipped.
2018-11-19 20:19:18 +02:00
Markus Mäkelä
92b4ed2867
Use explicit paths for bad config location
The test_bad_config used implicit locations which aren't very clear. Using
an explicit path, /tmp/, solves all of these problems.
2018-11-19 20:03:22 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Niclas Antti
e371964f8b MXS-2057 Add log output for system test, and two random code fixes 2018-11-14 16:20:42 +02:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
e5d6e5329a
Format source code
Formatted all of the source code that was not accordance with the coding
style. This was caused by merges from 2.2 into 2.3.
2018-11-01 14:05:15 +02:00
Markus Mäkelä
906d8cee5b
Format all files
Formatted all files with uncrustify.
2018-10-31 09:46:02 +02:00
Markus Mäkelä
a0d12191da
Create test database when processing config template
For an unknown reason, the mxs874_slave_recovery test times out unless the
test database is created when the config templates are being processed.
2018-10-08 09:53:30 +03:00
Markus Mäkelä
fed5037081
Make copying of SSL certs conditional
If the certs exist, they are not copied. This makes testing slightly
faster.
2018-10-05 11:25:50 +03:00
Markus Mäkelä
8029bdff4f
Process maxscale.cnf template with one sed command
Using a single sed command with multiple -e flags is faster than multiple
separate sed commands.
2018-10-05 11:25:49 +03:00
Markus Mäkelä
75ea1b6ea1
Fix formatting of new(std::nothrow)
The code previously formatted everything as `new( std::nothrow)`.
2018-10-04 21:50:44 +03:00
Johan Wikman
9ecd027ea0 Test: Provide additional control of local MaxScale
When running BLR locally, you need to be able to specify what
IP the BLR is visible at (127.0.0.1 does not work for VM nodes)
and also to perform cleanup etc. action when needed.
2018-10-04 12:57:54 +03:00
Esa Korhonen
dfc10b109d MXS-1937 Add failover/switchover with server events test
The test adds a scheduled server event, the does failover, rejoin and
switchover and checks that event is manipulated correctly. Also includes
a change to the monitor to fix an invalid ALTER EVENT query when the event
definer has wildcard host.
2018-09-24 10:43:17 +03:00
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
7ec2f77708
Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
Markus Mäkelä
f6840fbded
Remove implicit initialization of all maxscales
The extra maxscale instances are only started if the test explicitly
requests it.
2018-09-12 22:09:38 +03:00
Johan Wikman
d881630204 Allow programatic control of galera restarting
If a test program needs other than the default Galera config
(e.g. log_slave_updates enabled), then it should be able to
programmatically cause galera to be restarted as part of the
TestConnections construction.
2018-09-12 09:09:52 +03:00
Markus Mäkelä
d11c78ad80
Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
Johan Wikman
edd5ddcc88 Merge branch '2.2' into develop 2018-09-10 12:29:00 +03:00
Johan Wikman
6279ab350c Rename TestConnections::assert() to TestConnections::expect()
Allows the including of <assert.h>.
2018-09-10 10:24:46 +03:00
Niclas Antti
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
Markus Mäkelä
a13e95951b
Merge branch '2.2' into develop 2018-08-30 11:37:49 +03:00
Timofey Turenko
4fd6d075cb doc and astyle fixes 2018-08-29 12:00:52 +03:00
Markus Mäkelä
bb1efd1b34
Merge branch '2.2' into develop 2018-08-07 22:20:27 +03:00
Markus Mäkelä
7394f03cd9
Exit with failure if coredump is found in destructor
If the test would otherwise succeed but a coredump is found when the logs
are copied in the destructor, the test would pass. To prevent this, the
destructor should always exit with a non-zero status when it detects an
error.
2018-08-07 22:14:33 +03:00
Markus Mäkelä
37f32464f2
Rewrite mxs564_big_dump
Streamlined the test to perform as much testing as fast as possible. The
gradual ramp up did not provide any concrete benefits compared to testing
everything at once.

Replaced structures with C++11 alternatives where possible and removed
unused, redundant or dead code.
2018-07-24 09:51:47 +03:00
Markus Mäkelä
bfd3d2975d
Merge branch '2.2' into develop 2018-07-06 14:56:19 +03:00
Markus Mäkelä
cb05199bac
Stop MaxScale before fixing replication
Before the state of the backend servers is checked, MaxScale needs to be
stopped to prevent the automated failover from interfering in the start-up
process.
2018-07-05 21:03:57 +03:00
Markus Mäkelä
2e88ce4132
Merge branch '2.2' into develop 2018-07-04 22:01:01 +03:00
Markus Mäkelä
d98ffb5d0a
Always stop MaxScale before test
The test should stop MaxScale at the start unless the manual debug flag is
given on the command line. This fixes the connection failure of mxs1719
but reveals a problem with the filter itself.
2018-07-04 13:51:10 +03:00
Markus Mäkelä
b98c0841b4
Enable and fix -Wextra warnings
Fixed all warnings that were present with -Wextra.
2018-07-03 15:07:19 +03:00