While running the tests within a VirtualBox(vagrant) machine, if the salt source is mounted using shared folders, any tests involving hard links WILL fail. Any tests involving symlinks, can be made to work by setting some properties on the VirtualBox shared folder. By moving the tests `tmp` directory to `tempfile.gettempdir()` we avoid this false test case errors.
The generation of keys does not involve all the checks required to accept/deny/list keys. This code change allows:
* regular users to generate keys
* `/etc/salt` and `/var/log/salt` not to exist or not to be readable by the current user
It also does not check for a running master. We have now lowered the requirements to run this script just for generating keys.
* Test both master and minion events firing
* Allow targeting the minions in `tests.integration.ModuleCase.run_function()`
* The above item allows to also test events firing using `tcp` as `ipc_mode` which is being used by the tests `sub_minion`
* `salt-call` default outputter returned from `salt.output.get_printout()` was `None` and `None` isn't callable neither outputs anything useful. In this case, the fault Outputter should be used.
* `get_printout()` also tested for `txt_out` which now is, in the cleaned up parsers, `text_out`. Fixed.
Reused the output options and logging setup mix-ins.
Fixed a bug introduced in previous commit on `salt.utils.parsers.SaltCPOptionParser._mixin_after_parsed()`, function does not accept any arguments.
For this, the timeout mix-in and both the target and output parser group mix-ins were re-used. Way less code and logic to keep track of.
Added a simple test for this binary too.
* Created 2 mix-ins as option groups, the output options and the target options. This will allow adding some explanatory text besides separating these options from the parser's main options.
* All options on the parser, including the grouped options are now merged to the loaded configuration which will latter get passed on.
* Also created the timeout mix-in which will be used in other binaries.
While performing integration tests, the "mockbin" directory is
inserted in the beginning of the $PATH environment variable.
This effectively means that every file placed in this directory will be
executed instead of real one from the system, which opens up the
opportunity to write more complex integration tests.
At the time the only wrapper for "su" command (used in "cmdmod") is
placed there.
Defined "integration.run_tests()" function which can be used to execute
a particular integration test case. Existing bolerplate code in modules
and states tests is replaced with following lines:
if __name__ == '__main__':
from integration import run_tests
run_tests(TestCaseName)
Typical usecase could look like this:
python integration/modules/pip.py --no-clean -vv
--no-clean option speeds up repeating test execution by skipping the cleanup
process before and after testing.
Typical use case command could look like
./runtests.py -vv --no-clean --name integration.modules.ssh
Integration tests requiring a salt master and daemon were seperated
from pure unit tests. For now both are run with runtest.py. In
the future it could take arguments for which type of tests to run.