This utility executes predefined tests to test the MySQL
Utilities. The tests are located under the
/mysql-test directory with the default tests
located in the
/t folder. The utility supports
dividing tests into suites, which are stored as folders with their
/t folder for the test files. Those tests
located in the base
/t folder are considered
the 'main' test suite.
You can select any number of tests to run, select one or more
suites to restrict the tests, exclude suites and tests, and
specify the location of the utilities and tests. The utility
attempts to locate the tests based on name in any of the suites in
/suites folder with the exception of a
special test suite named 'performance' where performance-related
tests are placed. This suite is not included by default and must
be specified with the
to execute the performance tests.
The utility requires the existence of at least one server to clone for testing purposes. You must specify at least one server, but you may specify multiple servers for tests designed to use additional servers.
mut accepts the following command-line options:
Display a help message and exit.
Execute all tests that begin with prefix.
Do not abort when a test fails.
Record the output of the specified test if successful. With this option, you must specify exactly one test to run.
Connection information for the server to use in the tests. Use this option multiple times to specify multiple servers.
To connect to a server, it is necessary to specify connection parameters such as the user name, host name, password, and either a port or socket. MySQL Utilities provides a number of ways to supply this information. All of the methods require specifying your choice via a command-line option such as --server, --master, --slave, etc. The methods include the following in order of most secure to least secure.
Use login-paths from your
.mylogin.cnffile (encrypted, not visible). Example :
Use a configuration file (unencrypted, not visible) Note: available in release-1.5.0. Example :
Specify the data on the command-line (unencrypted, visible). Example :
Exclude tests that require greater resources or take a long time to run.
Exclude the named test suite. Use this option multiple times to specify multiple suites.
Exclude the named test. Use this option multiple times to specify multiple tests.
Exclude all tests that begin with prefix.
Execute tests sorted by suite.name either ascending (asc) or descending (desc). Default is ascending (asc).
The first port to use for spawned servers. If you run the entire test suite, you may see up to 12 new instances created. The default is to use ports 3310 to 3321.
Start executing tests that begin with prefix.
Stop executing tests at the first test that begins with prefix.
Execute the named test suite. Use this option multiple times to specify multiple suites.
The path to the test directory. Note that the path is appended with a folder named 't' and result files are expected to reside in a folder named 'r', both are sub folders of the path specified for this option.
The location of the utilities.
Specify how much information to display. Use this option multiple times to increase the amount of information. For example,
-vv= more verbose,
-vvv= debug. To diagnose test execution problems, use
-vvvto display the actual results of test cases and ignore result processing.
Display version information and exit.
Specify the display width. The default is 75 characters.
The connection specifier must name a valid account for the server.
Any test named ???_template.py is skipped. This enables the developer to create a base class to import for a collection of tests based on a common code base.
The following example demonstrates how to invoke mut to execute a subset of the tests using an existing server which is cloned. The example displays the test name, status, and relative time:
shell> mut --server=root@localhost --do-tests=clone_user --width=70 MySQL Utilities Testing - MUT Parameters used: Display Width = 70 Sorted = True Force = False Test directory = './t' Utilities directory = '../scripts' Starting port = 3310 Test wildcard = 'clone_user%' Servers: Connecting to localhost as user root on port 3306: CONNECTED ---------------------------------------------------------------------- TEST NAME STATUS TIME ====================================================================== main.clone_user [pass] 54 main.clone_user_errors [pass] 27 main.clone_user_parameters [pass] 17 ---------------------------------------------------------------------- Testing completed: Friday 03 December 2010 09:50:06 All 3 tests passed.
There are no special permissions required to run mut however, you must have the necessary privileges to execute the desired utilities in the tests.