Commit Graph

349 Commits

Author SHA1 Message Date
e4efc29297 MXS-1702: Process comments when canonicalizing
The canonicalization process now strips non-executable comments from the
SQL and replaces all constants in executable comments.

Enabled the comment test and updated expected output of the select and
alter tests.
2018-03-20 13:53:55 +02:00
9fe25c8003 MXS-1702: Update tests
Updated tests with new expected output. Also took new function into use
and removed the old one.

Since the comment removal isn't added yet, one of the tests is expected to
fail and it is temporarily disabled.
2018-03-20 13:53:55 +02:00
a03e8d46f0 MXS-1702: Rename tests
The test naming now follows the common convention.
2018-03-20 13:53:55 +02:00
e90c29cce2 MXS-1702: Clean up and convert test to C++
Cleaned up and updated the test; the code was written with a pre-C99
standard in mind.

Added a get() method into mxs::Buffer to make it easier to use with
non-C++ functions.
2018-03-20 13:53:54 +02:00
cb170eb88e MXS-1702: Move canonicalization test into core
Moved the test into the core where it belongs.
2018-03-20 13:53:54 +02:00
69383c0943 Merge branch '2.2' into develop 2018-03-12 14:38:37 +02:00
aea9c36498 Merge branch '2.1' into 2.2 2018-03-12 14:38:13 +02:00
c5345d34ca MXS-1714 Use local_address also with MaxScale connections
If local address has been specified, then all connections created
using mxs_mysql_real_connect() will use that same local address as
well.

A system test has not been created as our VMs do not have more than
one usable IP-address. Locally it has been verified to work as
expected.
2018-03-12 11:35:46 +02:00
dfbecc41e2 Format protocol modules
Formatted the MariaDB protocol modules with Astyle.
2018-01-24 11:20:11 +02:00
fe73458d65 Merge remote-tracking branch 'ybbct/MXS-1603' into develop 2018-01-24 11:15:14 +02:00
73e5fd52fa misc fix and remove all tail spaces 2018-01-22 22:02:22 +08:00
73f1005e7a Fix memory leak in test_users
Users were allocated but not freed. Same with the JSON objects.
2018-01-22 15:29:21 +02:00
ef53ded057 Fix test_atomic
As the function documentation states, the expected value must be read
again after a call to atomic_cas_ptr. This is due to the fact that if the
values are not the same, the __atomic builtin version will store the
current value into the expected value.

The new value given to the atomic_cas_ptr function was the address of the
new value, not the new value itself. The behavior of the atomic_cas_ptr is
what caused the test to pass on systeems that implement the __atomic
builtins. On older systems that do not implement it, the expected value
was never modified which caused the test to hang.
2018-01-22 15:29:21 +02:00
ccebf38bc0 Update test configuration files
Updated the REST API and MaxCtrl configuration files with new object
names. Updated tests with new object names.
2018-01-22 15:29:21 +02:00
81f303512e check protocol state to determine real ok packet 2018-01-22 14:52:12 +08:00
8ce7683a0a fix parse session track info out of packet boundary 2018-01-21 18:27:00 +08:00
0afe10ffb9 Merge branch '2.1' into 2.2 2018-01-16 09:47:49 +02:00
0416d66bcb Set query classifier with an absolute path in tests
Setting the query classifier with an absolute path makes it easier to
manage test setup without having to manually resolve the relative path to
the query classifier from the test source directory.
2018-01-08 09:41:24 +02:00
579dca0750 Log to stdout in unit tests
The log manager will log to stdout to work around directory and file
permissions.
2018-01-05 16:12:54 +02:00
e5b5303137 Initialize the query classifier in tests
The test initialization function now loads the query classifier.
2018-01-05 12:57:09 +02:00
bed0b850b1 Merge branch '2.1' into 2.2 2018-01-05 09:58:10 +02:00
e9fceff8ce Fix log manager race condition
The log manager could send two messages if a log message was posted soon
before the log manager was stopped. This caused a debug assertion which
then manifested as a deadlock inside the log manager.
2018-01-04 10:27:56 +02:00
8b2aa52384 Merge branch '2.1' into 2.2 2017-12-29 08:42:49 +02:00
6f3a580168 Fix test due to mysqlmon -> mariadbmon change
Test that a command can be invoked both using the actual module name
and the deprecated one.
2017-12-29 08:34:46 +02:00
33b1c552e0 Load qc from build directory
The query classifier library will now be loaded from the build
directory and not from the installation directory.
2017-12-27 16:09:54 +02:00
26b2a4b15d Fix executable names for core tests
The core test executable names were not in the new format.
2017-12-27 11:49:33 +02:00
396b81f336 Fix in-source builds
The internal header directory conflicted with in-source builds causing a
build failure. This is fixed by renaming the internal header directory to
something other than maxscale.

The renaming pointed out a few problems in a couple of source files that
appeared to include internal headers when the headers were in fact public
headers.

Fixed maxctrl in-source builds by making the copying of the sources
optional.
2017-11-22 18:40:18 +02:00
b2b72474d9 Initialize thread as well in test_trxtracking 2017-11-10 14:45:54 +02:00
6cc8bc36c1 Initialize in test_dcb
Make necessary initializations in test_dcb.
2017-11-10 14:45:54 +02:00
f2b9525032 Initialize thread as well in test_trxcompare 2017-11-10 14:45:54 +02:00
f152c118cb Name core tests consistently
Now, given a concept xyz,
* the main test file is called test_xyz.cc
* the executable is called test_xyz, and
* the ctest test is called text_xyz.
2017-11-10 14:45:54 +02:00
3a35d49ffe Merge branch '2.2' into 2.2-mrm 2017-11-08 10:44:35 +02:00
42d9064b04 Remoeve queuemanager.[h|cc] 2017-11-08 10:44:14 +02:00
d7b8e95234 MXS-1489 Create mechanism for running concurrent tasks
This commit introduces maxscale::future, maxscale::packaged_task
and maxscale::thread that are modeled after C++11 std::future,
std::packaged_task and std::thread as described here:
http://en.cppreference.com/w/cpp/thread

The standard classes rely upon rvalue references (and move
constructors) introduced by C++11. As the C++ compilers we must use
are pre-C++11 that feature is obviously not present. The absence of
rvalue references is circumvented by implementing regular copy
constructors and assignment operators as if the arguments were rvalue
references.

In practice the above means that when one of these objects are copied,
the state is _moved_ rendering the copied object in default initialized
state. Some care is needed to ensure that unintended copying does not
occur.
2017-11-07 12:03:09 +02:00
3a78b716b8 Merge branch '2.2' into 2.2-mrm 2017-10-30 11:06:34 +02:00
cd9a84d762 Add tests for direct relationship updating
The tests check that direct updates to the relationships endpoints work.
2017-10-23 19:37:24 +03:00
7111724851 Fix REST API monitor relationship test
The test did not properly move the relationships from the old monitor to
the new one. The test to passed as the relationship modification was not
really tested.
2017-10-23 19:37:24 +03:00
b7b50959ac Update REST API tests
Extended the relationship checks in the REST API tests to actually verify
that the returned objects represent what is expected.
2017-10-23 19:37:24 +03:00
d371ecb30f Only remove explicitly deleted relationships
Only when a relationship is defined as a null JSON value, it should be
deleted. If it is missing, it should be ignored.
2017-10-23 19:37:24 +03:00
5a585b1c8a Fix buffer overflow in test program 2017-10-12 12:29:43 +03:00
c6ed779dcf Fix buffer overflow in test program 2017-10-05 15:15:55 +03:00
e41f60fd2e Add mxs_json_error_append
Using this function, more error object can be added to the error
array of an json error object.
2017-10-02 16:08:12 +03:00
895d950da0 Format all source files with Astyle
Formatted all source files Astyle.
2017-09-28 07:04:21 +03:00
2633ad2fe4 Merge branch '2.1' into 2.2 2017-09-26 14:29:14 +03:00
4220e3ca6a MXS-1450 Add more string trimming functions
- trim_leading
- trim_trailing

Implemented trim in terms of trim_leading and trim_trailing
2017-09-26 13:36:10 +03:00
bb95074e88 MXS-1450 Add test case for trim 2017-09-26 13:19:09 +03:00
c542010e67 Fix internal test failures
The adminusers test did not properly initialize all subsystems in
MaxScale. The polling and DCB tests weren't updated with the changes to
the DCB closing.
2017-09-06 13:20:28 +03:00
9c25e6d995 MXS-1376 All zombie related code removed
As dcbs are now closed when dcb_close() is called and there is
no zombie queue, the zombie state can also be removed.
2017-08-25 14:48:16 +03:00
9f81f0775f MXS-1354: Rename user account type enum
Renamed the enum and its values.
2017-08-18 10:28:21 +03:00
6ee7ed6a38 MXS-1354: Add creation of basic/admin users to maxctrl
The type of the created user can now be specified with the --type option.

Expanded tests that cover the user creation. Also added a test case that
checks that basic users are only allowed to read through the REST API.
2017-08-18 10:28:21 +03:00