This commit kind of reverts the previous "no more os.sep.join ..." commit by solving the issue which led to switching that code to `os.path.join`. Tested both on linux and windows.
On the parsers cleanup branch, I though about making the available options as equal as possible. Since the log_file setting for the master and the minion could be separately set, I made the logfile option for the key also log_file. Yet, since there's no key specific config file, it shares master, one could only specify the log_file settings from the cli, it could not be hardcoded on the config file, unless, we made a separate config file just for key.
So, in order to reduce required changes, and keep it all as backwards compatible as possible, the key log file options is now, once again, `--key-logfile` which will allow us to hardcode it in the masters config file as `key_logfile`.
This will also, hopefully make travis behave better too.
When using `--no-clean` while running tests, some files/dirs still need to be removed, if not, test will fail. This commit tries to addresses those issues.
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