MaxCtrl seems to have relied on an implicit dependency which, for whatever
reason, broke only recently. Since we require() it, we should declare it
as a dependency.
Instead of using the correct version in in-source builds, a dummy file is
copied in place. This removes the need to explicitly include the
VERSION.cmake file.
When the -p parameter is given without an argument, the password is read
from the command line. This allows passwords to be given to MaxCtrl in a
safer manner.
The `cluster diff` command is now tested by doing add/alter/remove
operations on servers. As the same methods are used for all objects, they
should detect all sorts of modifications between two Maxscales.
Making the core a module proved to bring more problems than it solved. For
the sake of simplicity in installation and code coverage reporting, the
core is now completely contained in the `lib/` directory.
Also added preliminary coverage reporting with nyc.
The request-promise-native package adds support for request with native
promises. This is a convenient way to synchronize multiple HTTP requests.
The functions are changed to use promises to make testing easier. With
promises, the testing code can use the chai-as-promised library.
There are a few cases where doRequest is called with a callback that again
calls doAsyncRequest. With multiple hosts, this causes each command to be
propagated to all servers. This is a design flaw of the current multi-host
mode and needs to be changed.
Changed maxctrl.js to wait on the promises to silence some warnings if the
promise rejections are ignored.