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.
* All logging messages are now logged on a log file. If verbose is enabled, the log messages are also logged to the console.
* The tests report now also let's us know if there were no glitches.
* Some tests might be considered destructive, such as adding or removing users from the system. This change allows those tests to be skipped unless stated otherwise.
```python
from saltunittest import destructiveTest
class ATestCase(TestCase):
@destructiveTest
def test_some_destructive_code(self):
"""Some destructive code."""
```
On the console we get something like:
```
test_destructive (unit.config_test.ConfigTestCase) ... skipped 'Destructive tests are disabled'
```
Previously we have to go through the scroll history to see which tests failed, which were skipped, etc. Now, besides test failures, errors and skips being reported like they always were, we also provide a nice overall report and the end.
Previously using `state.template` or `state.template_str` would not be checked/rendered into proper formatting resulting in some templates not being correctly executed. For example, the following template worked:
```
/tmp/issue-2068-template-str:
virtualenv:
- managed
- no_site_packages: True
- distribute: True
pep8-pip:
pip:
- installed
- name: pep8
- bin_env: /tmp/issue-2068-template-str
- mirrors: http://testpypi.python.org/pypi
- require:
- virtualenv: /tmp/issue-2068-template-str
```
as opposed to the following which did not work:
```
/tmp/issue-2068-template-str:
virtualenv.managed:
- no_site_packages: True
- distribute: True
pep8-pip:
pip.installed:
- name: pep8
- bin_env: /tmp/issue-2068-template-str
- mirrors: http://testpypi.python.org/pypi
- require:
- virtualenv: /tmp/issue-2068-template-str
```
The dotted names should be converted into lists for example, which was the problems with the two examples above.
* In order to check if something went wrong while running the various pip commands using the command module, we need to know, at least, the return code, this way we can report the failure.
* `salt.modules.pip.uninstall()` now returns the `cmd.run_all` `dict` instead of a list of strings. **This breaks previous behaviour**.
* Added a test case for `salt.modules.pip.uninstall()` changes.