Commit Graph

29 Commits

Author SHA1 Message Date
1572e088bf Run REST API and MaxCtrl unit tests
Install Docker when building on CentOS 7. This allows the REST API and
MaxCtrl unit tests to be run.
2018-08-13 10:54:25 +03:00
064ad8fa4f Improve MaxScale startup and shutdown in NPM tests
The tests are now less violent in how they stop MaxScale. Also the logs
are now removed before a new test run is executed.
2018-08-13 10:28:03 +03:00
a399c58df3 Make NPM tests runnable by root
The tests can now be run as root. This is most likely required in some
cases and it should not break things if they are run as root (e.g. inside
a VM with no other users).

NPM prevents the use of the root user (due to modules getting root access)
and uses an unprivileged user to install the modules. As maxctrl has to
generate the version information at install time, running `npm install` as
root will fail due to missing privileges to the current working
directory. To work around this, an explicit step was added.

Also changed the maxadmin checks to maxctrl to remove the dependency on
the socket file location being writable by non-root users
(/var/run/maxscale/ might not be accessible to all users).
2018-08-13 10:28:00 +03:00
7438a0f186 Remove unnecessary MaxScale parts for NPM tests
Some of the CMake arguments were redundant, unnecessary or just a
hindrance to testing.
2018-08-13 10:28:00 +03:00
a05b8c3ab4 Fix run_npm_test.sh
`docker exec` must be invoked without the -t flag as no terminal is
present.
2018-08-09 12:56:53 +03:00
1447ac2eb9 Fix MaxCtrl cluster tests
The configuration used an invalid parameter name which caused the two
MaxScales to use the same directory for persisted configurations.

The test also tried to sync with the wrong server causing the same
listener to be created twice on the same port but on different MaxScales.

Cleaned up the startup and shutdown scripts to always start from a clean
state.
2018-08-09 12:56:51 +03:00
b69fc4d32c Fix startup of MaxScales in NPM tests
The output was overwritten for each new test.
2018-08-09 12:56:50 +03:00
207a8609dc Use docker directly in NPM test runner
The checking of the container status should use docker directly.
2018-08-09 12:56:49 +03:00
37d9c09c5f Make NPM tests faster
The test now builds with multiple jobs.
2018-08-09 12:56:49 +03:00
bb1efd1b34 Merge branch '2.2' into develop 2018-08-07 22:20:27 +03:00
055043b5b8 Fail faster in NPM tests
The test script now stops if the configuration or build steps fail.
2018-08-07 22:14:33 +03:00
446116a8bb MXS-1999: Fix removal of undefined relationships
If a relationship isn't defined, it should not be removed. Only if a
relationship is change to a null relationship, should it be removed.

Also fixed the maxctrl test suite to verify that both it and the REST API
tests pass.
2018-08-07 22:14:33 +03:00
382595a2b8 Add missing filter to secondary test config
The test configs weren't similar.
2018-07-31 09:41:11 +03:00
e80a145b2c Remove passwd from bundled configurations
The configurations still used the old parameter name.
2018-07-17 11:52:17 +03:00
283a6d564e Update MaxCtrl dependencies
Updated various npm dependencies of MaxCtrl. Also updated the testing
docker-compose image to use 10.2.
2018-06-11 09:17:02 +03: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
d64cb9fa80 MXS-1300: Test calling of module commands via MaxCtrl
The calling of module commands is tested by using the qlafilter log
command.
2017-08-09 11:39:25 +03:00
527ada770c MXS-1300: Fix double maxscale startup script and configuration
The configuration wrongly spelled `secondary` as `secodary` causing a
failure to start the secondary MaxScale. The startup script didn't create
the log directory and removed the wrong maxadmin socket file.
2017-08-09 11:39:24 +03:00
2f7251a769 Reuse same MariaDB cluster for testing
The test created a cluster for each test. Reusing the same servers allows
faster testing by reusing the already running servers.
2017-08-09 11:39:24 +03:00
8f7be8a4f3 MXS-1300: Fix MaxCtrl cluster tests
Fixed tests to use correct functions, extended tests of problematic
cases. Added a secondary directory for the second MaxScale instance.
2017-08-09 11:39:24 +03:00
161776d576 MXS-1300: Add more MaxCtrl cluster tests
Added scripts that start two MaxScale on the same machine. This allows the
cluster synchronization commands to be tested locally.
2017-08-09 11:39:24 +03:00
64c5d6d610 Control npm testing with environment variables
The NPM based tests can now skip the stopping of the docker-compose
cluster by defining the SKIP_SHUTDOWN environment variable.
2017-07-18 11:37:18 +03:00
738dc48df7 MXS-1300: Add basic maxctrl tests
Added basic tests for maxctrl. They simply test that the diagnostic
commands work.
2017-07-18 11:37:18 +03:00
67b2654f50 Move REST API test scripts into a common directory
Moved and renamed the starting and stopping scripts from the REST API
tests to a common directory. This way the MaxCtrl tests can use the same
scripts to start and stop MaxScale.

Also moved the test configuration file into the `test/` directory and
changed some of the default directory locations.
2017-07-18 11:37:18 +03:00
173a97ae70 Refactor REST API test script into a npm test framework
The script can now be used to run an arbitrary set of Node.js tests as
long as they define the `test` npm target. Refactored REST API tests to
fit into this framework.
2017-07-18 11:37:18 +03:00
06c2d201e0 remove makefiles and other garbage 2015-01-14 19:08:24 +02:00
7b40c1ee70 Changed how MaxScale unit test works.
All tests are run by executing 'make testall' in root directory. As a result all directories which contain tests will be entered and tests executed.
After tests, each directory have a test log including the last run's logs only.
Created a global test log, which is specified in test.inc. Test logs from subdirectories are concatenated to this file.
2014-04-10 19:08:28 +03:00
ce5dc19ecc Added read/write split router tests to a part of makefile structure. 2014-04-01 14:11:48 -07:00
e8ce2268e0 Test system for MaxScale.
Every test/makefile have the following targets:
 cleantests 	- clean local and subdirectories' tests
 buildtests	- build all local and subdirectories' tests
 runtests	- run all local tests
 testall	- clean, build and run local and subdirectories' tests

Tests for directory random_dir are always in its subdirectory, in this case in random_dir/test . If random_dir has subdirectories with tests, random_dir/child_dir, for example, tests of child_dir can be started from random_dir/test/makefile where make -C child_dir/test <test target> is called.

See MAXSCALE_HOME/test/README for further information.
2014-02-07 11:06:37 +02:00