Commit Graph

630 Commits

Author SHA1 Message Date
Scott Walton
9a0fe34e9a Some clean-up, and tests for #962 2012-10-19 16:07:31 +01:00
Scott Walton
0bd81e5ae6 Added support for managing virtual hosts #962 2012-10-19 15:05:35 +01:00
Scott Walton
b7ed775a07 Grammar 2012-10-19 11:42:32 +01:00
Scott Walton
340616a379 Added test framework for rabbitmq user #962 2012-10-19 11:42:01 +01:00
Thomas S Hatch
8c3fadf15e Fix python 2.6 compat issue in tests 2012-10-18 22:37:02 -06:00
Daniel Miller
1957700161 Add "file.patch" state function 2012-10-18 12:23:47 -04:00
Daniel Miller
3a68a85a9b Add "file.patch" module function 2012-10-18 12:20:39 -04:00
Thomas S Hatch
c1fc9d6726 fix sock_dir change for eventlisten script 2012-10-15 22:50:31 -06:00
Seth House
2e9ecdbaa4 Remove bash-ism from pip state test
This one is pretty silly; hopefully the regex match is still specific
enough to be a good test.

% bash -c '/tmp/someenv/bin/pip install something'
bash: /tmp/someenv/bin/pip: No such file or directory

% zsh -c '/tmp/someenv/bin/pip install something'
zsh:1: no such file or directory: /tmp/someenv/bin/pip
2012-10-15 15:31:47 -06:00
Pedro Algarvio
6533c48014 Just some renames. Refs #2227. 2012-10-12 11:53:40 +01:00
Pedro Algarvio
ae7e476bfc Handle some quoting issues while building the whitespace regex for file.append. Fixes #2227. 2012-10-12 11:45:27 +01:00
Pedro Algarvio
d6d8e22b68 Merge branch 'develop' of github.com:saltstack/salt into develop 2012-10-12 10:57:37 +01:00
Seth House
6c103bc4df Changed lookup_jid runner to return empty dict instead of an exception 2012-10-09 13:55:54 -06:00
Seth House
8c18c29323 Fixed bungled default logic for minionswarm root_dir 2012-10-09 12:20:46 -06:00
Seth House
17627fea89 Added flag to set the root_dir for a minionswarm 2012-10-08 14:16:53 -06:00
Thomas S Hatch
a556a44707 fix jobs runner test for new exception return 2012-10-07 10:20:03 -06:00
Thomas S Hatch
bd041c31f6 sp 2012-10-06 23:39:25 -06:00
Thomas S Hatch
af03feecee Update jobs runner to check for valid exception type 2012-10-06 23:30:11 -06:00
Thomas S Hatch
fa2c84317d update to new bad jid return data 2012-10-06 23:01:34 -06:00
Thomas S Hatch
7a5cead786 this is 5 now... 2012-10-06 22:59:42 -06:00
Thomas S Hatch
5aa1e847b6 update tests for changes in directory perms 2012-10-06 22:53:04 -06:00
Pedro Algarvio
cec1cbd477 Fix test if there the host has multiple subnets. 2012-10-07 03:05:00 +01:00
Pedro Algarvio
7e816c291f Add shell ipcadr match test. 2012-10-06 01:29:24 +01:00
Thomas S Hatch
3d9375038c Merge pull request #2183 from s0undt3ch/issues/2167
Fix #2167. Testcases included.
2012-10-05 17:21:24 -07:00
Pedro Algarvio
b0bf4919a3 Add exsel shell match test.
Although this commit does not exactly reference the problem see on #2167, it was added while working for that issue.
2012-10-06 01:11:03 +01:00
Pedro Algarvio
174ee8aab8 Fix #2167. Testcases included. 2012-10-06 01:05:04 +01:00
Pedro Algarvio
496906e413 Add exsel shell match test.
Although this commit does not exactly reference the problem see on #2167, it was added while working for that issue.
2012-10-05 07:56:23 +01:00
Pedro Algarvio
eb22aa5f49 Allow some more time to get the tests events notifications. 2012-10-05 07:15:00 +01:00
Pedro Algarvio
ac1fe9810a Point hosts.file and aliases.file to the new tests temporary dir. 2012-10-05 07:10:53 +01:00
Pedro Algarvio
85c6664538 Fix running tests using python setup.py tests. I was deleting it too soon and not re-creating it. Increase tests verbosity on travis-ci. 2012-10-05 02:45:35 +01:00
Pedro Algarvio
b6cb78364f Switch integration tmp to the system's temporary directory.
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.
2012-10-05 00:52:00 +01:00
Thomas S Hatch
858d086995 Args got flipped in eventlisten 2012-10-02 13:26:23 -06:00
Pedro Algarvio
4c456864db Improve our tests runner.
* Show an error when the user tries to use `--xml` and `xmlrunner` is not installed.
* Add support to generate HTML reports of the tests coverage.
2012-10-02 13:04:22 +01:00
Pedro Algarvio
624fb03d9c Smaller requirements.txt also works for testing. 2012-10-01 10:21:40 +01:00
Pedro Algarvio
e87a408dcd Correct license. 2012-10-01 10:16:21 +01:00
Pedro Algarvio
8d1411115d Merge branch 'develop' of github.com:saltstack/salt into issues/1959 2012-09-30 19:21:41 +01:00
Pedro Algarvio
0872852602 Add missing imports. 2012-09-30 18:41:44 +01:00
Pedro Algarvio
27bf64fbf3 Only root can run these tests. 2012-09-30 18:26:39 +01:00
Pedro Algarvio
73a679e070 Include primary group into user.info groups. Fixes #2137. 2012-09-30 18:01:47 +01:00
Pedro Algarvio
064b3a60c2 Add test case for #1959. 2012-09-30 12:20:38 +01:00
Pedro Algarvio
325902c169 Test to make sure we're outputting kwargs on the user.delete documentation. 2012-09-30 10:59:07 +01:00
Pedro Algarvio
905fb835cd Improve runtests.py logging and report output.
* 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.
2012-09-30 10:40:06 +01:00
Pedro Algarvio
420bfe830b Mark destructive tests with the destructiveTest decorator. 2012-09-29 23:16:08 +01:00
Thomas S Hatch
47221a4f98 Merge pull request #2135 from s0undt3ch/features/overall-tests-resume
Provide an overall tests report.
2012-09-29 13:52:21 -07:00
Pedro Algarvio
e8766b7b8d Allow certain tests to marked as destructive.
* 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'
```
2012-09-29 15:42:43 +01:00
Pedro Algarvio
ced9e7d91e Remove the tests added to explicitly fail. 2012-09-29 12:51:39 +01:00
Pedro Algarvio
6896fd0ab8 Allow disabling the tests report. 2012-09-29 12:48:50 +01:00
Pedro Algarvio
b8917071f6 Provide an overall tests report.
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.
2012-09-29 12:10:06 +01:00
Thomas S Hatch
f1dca86fd4 Fix some quotes 2012-09-28 17:40:30 -06:00
Thomas S Hatch
59e775ed8d remove unused skipif 2012-09-28 17:35:59 -06:00
Pedro Algarvio
7f7b196f1e Include an invalid items test for state.template* functions. Refs #2068. 2012-09-28 17:56:13 +01:00
Pedro Algarvio
b28a80fab0 Minor whitespace formatting 'prettyfication'. 2012-09-28 17:44:35 +01:00
Pedro Algarvio
2211afa63a Properly render the high state loaded from templates. Fixes #2068.
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.
2012-09-28 17:34:55 +01:00
Pedro Algarvio
677a08fe7d Update the test cases which better expose #2068. 2012-09-28 16:04:38 +01:00
Pedro Algarvio
cc10ed1906 Add include and exclude test cases. Refs #2068. 2012-09-28 01:17:37 +01:00
Pedro Algarvio
c80ea695b1 Let's narrow any possible errors by reusing the same template contents. Refs #2068. 2012-09-28 00:22:24 +01:00
Pedro Algarvio
60fe1695a3 Merge branch 'develop' of github.com:saltstack/salt into issues/2068 2012-09-27 23:43:29 +01:00
Morgan Fainberg
7800157e37 Fix the test for jinja, local (non salt:// files) now can support {% include %} 2012-09-27 14:55:55 -07:00
Scott Walton
ce4237e2bd Fixed test failures #2026 2012-09-27 20:04:18 +01:00
Scott Walton
768487995d Merge remote-tracking branch 'upstream/develop' into develop 2012-09-27 19:35:13 +01:00
Pedro Algarvio
fb2b87a675 Merge branch 'develop' of github.com:saltstack/salt into issues/2068 2012-09-27 19:08:13 +01:00
Pedro Algarvio
6e2ba6885e Fix test case assertion. 2012-09-27 18:43:15 +01:00
Pedro Algarvio
eec932799a The pip module now uses cmd.run_all. Fixes #2113.
* 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.
2012-09-27 18:33:50 +01:00
Pedro Algarvio
af9709dde5 Properly handle missing pip binary. Fixes #2087. 2012-09-27 12:06:09 +01:00
Pedro Algarvio
33aa55f905 Use a PyPI mirror for installing packages. Fixes #2098.
For now we're using `http://testpypi.python.org/pypi` as the mirror.
2012-09-27 11:55:00 +01:00
Pedro Algarvio
b0017f0e5a Make sure the tests logging handler catches all messages when active. 2012-09-27 11:39:26 +01:00
Pedro Algarvio
582011a8be Allow passing multiple test names(-n) to runtests.py. 2012-09-26 16:17:27 +01:00
Pedro Algarvio
ec2486c9d8 Only test supervisor if conditions are proper. Refs #2026.
* Only the root user can run the supervisor state tests.
* Install supervisor on the travis-ci machine to run the tests.
2012-09-25 22:32:42 +01:00
Pedro Algarvio
6e5fd9e62c Regular users cannot run the supervisor tests. 2012-09-25 22:19:28 +01:00
Thomas S Hatch
43382b6d1c Merge pull request #2085 from s0undt3ch/issues/2028
Address `pip.installed` regarding weird packages setup. Fixes #2028.
2012-09-25 10:20:47 -07:00
Pedro Algarvio
41f0f4449e Address pip.installed regarding weird packages setup. Fixes #2028.
Some packages, carbon and graphite-web for example, install their packages to a specific root, using a `virtualenv` or not. `pip freeze` won't show those packages as installed.
2012-09-25 12:24:54 +01:00
Scott Walton
438ea792a7 Added state and test for stopping services #2026 2012-09-24 09:45:31 +01:00
Thomas S Hatch
50857861c5 remove unused import 2012-09-24 01:03:24 -06:00
Thomas S Hatch
282c8f4e3c clean out unused imports 2012-09-24 00:55:01 -06:00
Thomas S Hatch
cf1e87e185 Merge pull request #2031 from scott-w/develop
Add Supervisor Support
2012-09-23 22:56:45 -07:00
Scott Walton
48c0d56841 Merge remote-tracking branch 'upstream/develop' into develop 2012-09-23 21:16:09 +01:00
Pedro Algarvio
36fb821596 Add the module.state.template_str() failing test. 2012-09-23 18:42:26 +01:00
Pedro Algarvio
03c006debb Removed a test that was using state.template_str. Re-adding later.
The test was removed in order to have a clean pull request. A new issue will be opened because of that failing test.
2012-09-23 18:32:04 +01:00
Pedro Algarvio
c315e95b95 Move the state pip.installed tests to the proper place.
* Moved the state `pip.installed` tests to it's own module, the correct one.
* Added a test which checks for the presence of errors while running `pip.installed` introduced while fixing #2028
2012-09-23 18:16:11 +01:00
Pedro Algarvio
5b9c6f92ce Issue #2028 fixes and improvements.
* `salt.states.pip.installed()` now keeps a reference to the output of the `__salt__['pip.install']()` call. The reason for this is that we need to know and pass along any information about an eventual error when running that call. This is now done in addition to the old behaviour.
* Add some tests which triggered the issue.
2012-09-23 17:25:21 +01:00
Pedro Algarvio
0a9b0b3e08 Merge branch 'develop' of github.com:saltstack/salt into issues/2028 2012-09-20 19:33:00 +01:00
Pedro Algarvio
6640e9581d Merge branch 'develop' of github.com:saltstack/salt into develop 2012-09-20 19:29:49 +01:00
Pedro Algarvio
39af3fb5d6 Fix the test-cases custom logging handler.
* Even when the tests logging handler stream is directed to `/dev/null` we still need a low logging level so that our custom logging handler, used to see if certain log messages are emitted or not, catches messages.
2012-09-20 19:27:32 +01:00
Pedro Algarvio
62446308ff Fix the test-cases custom logging handler.
* Even when the tests logging handler stream is directed to `/dev/null` we still need a low logging level so that our custom logging handler, used to see if certain log messages are emitted or not, catches messages.
2012-09-20 19:16:20 +01:00
Thomas S Hatch
543f7c6bc9 Fix error cause by django module renaming 2012-09-19 14:52:36 -06:00
Thomas S Hatch
2dc5ebb80e Fix event test with the change in master events returning a dict 2012-09-19 14:42:48 -06:00
Thomas S Hatch
6de9939768 Fix another test for new hased minion ids 2012-09-19 14:39:01 -06:00
Thomas S Hatch
a3e7a3a7af fix test based on new minion event socket names 2012-09-19 14:21:56 -06:00
Pedro Algarvio
8ab5e6e9c2 Include some test cases to expose saltstack/salt#2028 2012-09-18 01:53:05 +01:00
Scott Walton
b7f259adc7 Merge remote-tracking branch 'upstream/develop' into develop 2012-09-17 20:36:50 +01:00
Scott Walton
c581e7bab5 Added tests, and modified state/modules to pass #2026 2012-09-17 20:34:50 +01:00
Pedro Algarvio
243edfb9ad Also test for not triggering log messages. Refs #1986. 2012-09-16 16:27:17 +01:00
Pedro Algarvio
969dc01ce1 Skip test on travis-ci environment. Refs #1986. 2012-09-16 16:12:17 +01:00
Pedro Algarvio
b445674d98 Skip test if max open files exception is triggered. 2012-09-16 16:00:36 +01:00
Scott Walton
9e35b77038 Added stop and status 2012-09-15 19:02:00 +01:00
Scott Walton
88c04486e4 Added test and code for start #2026 2012-09-15 18:41:01 +01:00
Pedro Algarvio
0fd61050c9 Inform the users about the current max open files situation.
We defined that the amount of accepted keys should be lower than 1/4 of the system's max open file setting. Inform the user about the current situation, the logging level is "attached" to the gravity of the current status.
2012-09-15 15:32:07 +01:00
Pedro Algarvio
7339cd6950 Allow clearing the stored log messages. 2012-09-15 15:28:09 +01:00
Pedro Algarvio
b20b05cb41 Add a tests logging handler. Refs #1986.
This is just a simple logging handler which will keep all emitted log messages in a list. This can be used to test if a certain log messages is emitted in a certain scenario. Usage example:

```python
with TestsLoggingHandler() as handler:
    # (...)               Do what ever you wish here
    handler.messages    # here are the emitted log messages
```
2012-09-15 15:27:47 +01:00
Pedro Algarvio
348cd9e51e Improve the tests minion swarm.
The `pki` and all minion's configuration directories are now all created under the same temporary directory.
The minion's ID's are now something more meaningful and less random to ease the interpretation of what's going on while running.
Minor pep-8 corrections.
2012-09-08 20:31:25 +01:00
Pedro Algarvio
ce0c8832a8 Minor PEP-8 changes. 2012-09-07 22:14:38 +01:00
Pedro Algarvio
71327e4ff7 Also allow skipping the tests on the syndic. Refs #1935. 2012-09-07 20:24:35 +01:00
Pedro Algarvio
5b4d462413 Also skip a run_function test-case in case the minion does not reply. Refs #1935. 2012-09-07 20:03:44 +01:00
Pedro Algarvio
8c6b96db59 Support -d on the salt binary. Fixes #1992. 2012-09-07 19:21:07 +01:00
Pedro Algarvio
4f9e62eaf4 Include a test case. Fixes #1989. 2012-09-07 18:04:14 +01:00
Pedro Algarvio
0c830784f3 Merge pull request #1974 from s0undt3ch/issues/1964
Reduce requirements to generate keys.
2012-09-05 14:38:03 -07:00
Pedro Algarvio
6e9b2810ee Reduce requirements to generate keys.
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.
2012-09-05 22:31:12 +01:00
Pedro Algarvio
a8e62f1a15 Merge pull request #1968 from s0undt3ch/develop
Fix `ValueError` on Py2.6 zero length field names are not supported
2012-09-05 04:13:33 -07:00
Pedro Algarvio
75f262c447 Fix ValueError on Py2.6 zero length field names are not supported 2012-09-05 12:11:16 +01:00
Pedro Algarvio
fc3070c3bb Keep minionswarm temporary files/dirs. Refs #1964.
* Provide an option to the parer which allows not to delete temporary files/directories created for the minionswarm.
2012-09-05 12:01:48 +01:00
Pedro Algarvio
145197b48b Fix test/minionswarm.py. Refs #1964.
* Allow the `minionswarm` to run under user space
* Provide some additional configuration to the minions to use the temporary directories created for the swarm.
* Try to properly shutdown the running minions.
* As a last resort, `kill -KILL` all minions still running.
2012-09-05 11:54:17 +01:00
Pedro Algarvio
81ccd7c9a7 Remove un-used import. 2012-09-03 23:26:59 +01:00
Pedro Algarvio
e7a10cce98 Fix saltstack/salt#1948
* `SaltCPOptionParser` was not reading any configuration file. It should!
* Fixed the `salt-cp` test which was not testing anything, until now.
2012-09-03 23:24:08 +01:00
Pedro Algarvio
6110a72231 Fix syntax error from last commit. 2012-09-03 19:10:38 +01:00
Pedro Algarvio
e2d0ffa992 Automatically try to raise max open files setting if too low when running tests. 2012-09-03 17:42:36 +01:00
Pedro Algarvio
68cbd08070 Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-09-03 16:41:25 +01:00
Pedro Algarvio
5ec829a46e Fix state tests. 2012-09-03 16:40:52 +01:00
Thomas S Hatch
94a57bd806 repair minionswarm for updated configdir changes 2012-09-02 22:42:49 -06:00
Pedro Algarvio
a45c0bdce8 Fix saltstack/salt#1896
* Added `source` support to `salt.states.file.append()`
 * Added tests for the above.
2012-09-01 07:49:34 +01:00
Pedro Algarvio
accb15d6ee Add tests for saltstack/salt#1900
* 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`
2012-09-01 07:29:06 +01:00
Pedro Algarvio
71c842a896 Allow skipping random failing tests saltstack/salt#1935 2012-09-01 05:20:53 +01:00
Pedro Algarvio
174f3d6d19 Fix the tests related to saltstack/salt#1900 2012-09-01 05:06:44 +01:00
Pedro Algarvio
ed7878e7c8 Fix saltstack/salt#1900
* Minor typo.
* Fix MinionEvent getting 'id' from kwargs and not getting the proper default value.
* And some unittest about this issue.
2012-08-31 01:20:32 +01:00
Thomas S Hatch
34829cd046 Clean up unused imports and variables 2012-08-30 14:14:02 -06:00
Thomas S Hatch
511eb57fdd remove unused import 2012-08-30 13:26:35 -06:00
Thomas S Hatch
f68816ed47 Remove unused import 2012-08-30 13:25:17 -06:00
Thomas S Hatch
47bd829764 Merge pull request #1895 from s0undt3ch/issues/1864
Fix #1864 - Support `makedirs` to `salt.states.file.append()`
2012-08-28 12:40:39 -07:00
Pedro Algarvio
b3a03e391f Fix #1864 - Support makedirs to salt.states.file.append() 2012-08-28 12:05:50 +01:00
Pedro Algarvio
8b645b339b Fix #1879. Searching/matching is now done on multiple lines.
* `salt.modules.file.contains()`, `salt.modules.file.contains_regex()`, `salt.modules.file.contains_glob()` and `salt.utils.find` now do the searching/matching against chunks of data; using defaults, 32KB chunks of data in files; instead of searching/matching line by line.
* Based on the above changes `salt.states.file.append()`, when checking if the text to append is already present, now uses `salt.modules.file.contains_regex()` in order to match spanning multiple lines ignoring the addition/deletion of white-space or new lines, except inside commas.
* The regex used on the above item is built at runtime using `salt.utils.build_whitepace_splited_regex()`, just feed the text to it and you'll get back the proper regex to the matching/searching on, for example `salt.modules.file.contains_regex()`.
* Added tests for all this code.
2012-08-28 10:03:11 +01:00
Pedro Algarvio
797defc320 Add the failing test for saltstack/salt#1879 2012-08-26 00:38:39 +01:00
Pedro Algarvio
22d69e43c7 Properly catch some more state SLS syntax errors.
Sort keys before checking for same key in rule. Fixes #1876.
2012-08-25 14:44:07 +01:00
Pedro Algarvio
d21e8c7b27 Another mkdir that should be included in previous commit. 2012-08-25 14:36:30 +01:00
Pedro Algarvio
6b2e12d9bf Don't fail on tests because we're trying to create a directory and it exists(and that's not the actual test). 2012-08-25 14:21:38 +01:00
Pedro Algarvio
c06541bdf0 Allow some logging output when running tests. 2012-08-25 14:21:19 +01:00
Pedro Algarvio
5da4fcb109 Fix integration.runners.manage tests.
These tests started to fail after 54cf9ca and specially 5626332.
2012-08-25 14:21:08 +01:00
Thomas S Hatch
f25167802a fix test that broke because of output changes 2012-08-18 01:48:40 -06:00
Ulrich Dangel
7176ec5d4a Add test to test if os_family grain is provided.
Corey Quinn reported a issue where __grains__['os_family'] returned a
KeyError. This commits adds a check to the grains module test to ensure
os_family is present.
2012-08-15 02:59:03 +02:00
Pedro Algarvio
e32faa4a28 Fix salt-call bug with default outputter.
* `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.
2012-08-13 07:10:42 +01:00
Pedro Algarvio
c5f1236984 There's no logging NullHandler in 2.6. Fix it. 2012-08-11 21:03:49 +01:00
Pedro Algarvio
9dfce0f7d2 Final fix for saltstack/salt#1756
Don't try to import `salt.log` during tests. Adapt `check_user` test accordingly.
2012-08-11 01:28:49 +01:00
Pedro Algarvio
80804c67b4 Some more fixes regarding saltstack/salt#1756
Setup and disable logging during the tests.
2012-08-11 00:44:16 +01:00
Pedro Algarvio
1cae292c68 Fix tests/unit/utils/verify_test.py since verify_user no longer accepts the log argument. 2012-08-11 00:30:13 +01:00
Pedro Algarvio
639471d110 Multi-platform path joiner(appender)
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.
2012-08-08 14:43:34 +01:00
Pedro Algarvio
2faada54d3 Fix the too many open file descriptor issues on 2.6 while running tests. 2012-08-08 09:04:52 +01:00
Pedro Algarvio
2bf0187ae5 Don't close stderr if it's not being used. 2012-08-08 08:18:45 +01:00
Pedro Algarvio
bbfa0b939b One more try travis. 2012-08-08 01:35:36 +01:00
Pedro Algarvio
12007c23a3 Let's see if travis stops failing on 2.6 with "filedescriptor out of range in select()" 2012-08-08 01:21:16 +01:00
Pedro Algarvio
759d67ffc0 Reverted back the --key-logfile deprecation.
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.
2012-08-08 01:08:38 +01:00
Pedro Algarvio
0b73795310 Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-08-06 23:05:37 +01:00
Pedro Algarvio
2a7e9500d7 Set the master's logfile to avoid travis failing. 2012-08-06 17:58:30 +01:00
Thomas S Hatch
2355dc3dd4 Merge pull request #1770 from s0undt3ch/master
Make file.touch work on directories and fix some tests when using `--no-clean`
2012-08-06 01:03:49 -07:00
Pedro Algarvio
c89928ec33 Typo. 2012-08-05 19:31:13 +01:00
Pedro Algarvio
a4b96eacfc Corrected last commit line placement. 2012-08-05 19:29:56 +01:00
Pedro Algarvio
dcc0efcd70 Re-add wrongly removed line. 2012-08-05 19:27:28 +01:00
Pedro Algarvio
d01b8da9aa Fix some tests when using --no-clean
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.
2012-08-05 19:23:12 +01:00
Pedro Algarvio
ac1ee79fa6 Cleanup the salt-run(salt.cli.SaltRun) binary parser.
Reused the timeout mix-in. All cli tools parsers also reuse the config mixin.
This commit finishes cleaning up the cli tool parsers.
2012-08-04 23:25:37 +01:00
Pedro Algarvio
261450e90f Cleanup the salt-call(salt.cli.SaltCall) binary parser.
Reused the logging and output mix-ins.
2012-08-04 23:07:39 +01:00
Pedro Algarvio
060f33a15a Cleanup the salt-key(salt.cli.SaltKey) binary parser.
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.
2012-08-04 22:55:15 +01:00
Pedro Algarvio
f5aad4f8e2 Cleanup the salt-cp(salt.cli.SaltCP) binary parser.
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.
2012-08-04 22:28:51 +01:00
Pedro Algarvio
b582e40ff1 Cleanup the salt(salt.cli.SaltCMD) binary parser.
* 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.
2012-08-04 22:08:06 +01:00
Pedro Algarvio
d776705e49 Parsers(master, minion, syndic) cleanup code.
Moved the minion, master and syndic parsers to use mixins to clean up, reuse, and automate some of the required procedures.
2012-08-04 19:58:32 +01:00
Pedro Algarvio
6d3028f3da Removed the pip module integration tests since it's also being tested in the virtualenv's integration tests. 2012-08-01 23:11:48 +01:00
Pedro Algarvio
e57f505a2d Fix pip.freeze tests which require an active virtualenv. 2012-08-01 22:40:15 +01:00
Pedro Algarvio
97a4c1dde2 Fix integration/modules/file.py
Since the tests are comparing results, switch to `assertEqual`'s.
2012-08-01 19:36:49 +01:00
Pedro Algarvio
842036b136 Minor cosmetic change while running tests.
Make the salt's printed `~~` lines match the length of the `--` printed lines from unittest.
2012-08-01 19:07:56 +01:00
Pedro Algarvio
7148735b12 Fix virtualenv integration tests.
The virtualenv module needs to have a default for `venv_bin`.
2012-08-01 18:57:31 +01:00
cheater
d07d6b8a7b Adding the gid_from_name parameter to the user.present state 2012-07-30 21:15:35 +02:00
Roman Imankulov
aa5896681d Fix the escaping issue in cmd.run
Lack of escaping in cmd.run with "runas" option could lead to incorrect
execution of commands containing quotes in their bodies.
2012-07-26 22:21:07 +06:00
Roman Imankulov
bc1650a085 Add "mockbin" directory and a fake "su" wrapper for tests
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.
2012-07-26 22:14:00 +06:00
Thomas S Hatch
366a4935c1 single quotes 2012-07-23 13:29:55 -06:00
Thomas S Hatch
e61ddfdcfc fix many a test 2012-07-23 13:00:54 -06:00
Intchanter
768e17b9d5 We return tuples, not lists 2012-07-20 08:31:36 -06:00
Roman Imankulov
bb0ed1a3a7 Tests cleanup
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
2012-07-20 12:25:08 +06:00
Roman Imankulov
4cac03c42d Add options --clean and --no-clean in runtest.py
--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
2012-07-20 12:16:14 +06:00
Intchanter
df4a83ac61 Made data.getvals work with CLI, updated test 2012-07-19 21:35:23 -06:00
Thomas S Hatch
8965400ee7 Add consist test to make sure swarm returns are all the same
This is a tool to help hunt down #1386
2012-07-18 13:24:16 -06:00
Jeroen Dekkers
a28272e2fb Fix "undefined name" errors spotted by pyflakes 2012-07-15 03:01:35 +02:00
Intchanter
f663dd2c46 Merge branch 'develop' of https://github.com/saltstack/salt into develop
Conflicts:
	salt/states/network.py
	setup.py
	tests/integration/__init__.py
2012-07-08 22:50:12 -06:00
Thomas S Hatch
e446a306c7 Add sock_dir verification to tests 2012-07-07 22:11:36 -06:00
Thomas S Hatch
7f034cf6ba See if pushing the timeout to insane levels makes travis stop failing 2012-07-05 20:17:04 -06:00
Intchanter
3c05a3ee78 Merge branch 'develop' of https://github.com/saltstack/salt into develop
Conflicts:
	tests/integration/modules/grains.py
	tests/integration/states/host.py
	tests/unit/utils/find_test.py
2012-07-04 18:29:13 -06:00
Intchanter
49b2465cf0 Cleaned up syntax error 2012-07-04 17:42:53 -06:00
Alec Koumjian
a22773bdde Instruct authors of state modules to check for the test parameter 2012-07-03 14:17:52 -07:00
Alec Koumjian
bdb4055ce2 Updating Virtualenv module test with cross-platform file.remove 2012-07-03 08:39:11 -07:00
Dan Colish
b43c256ea7 Adds file.remove to file module, #1545. Drive by spelling correction 2012-07-03 07:50:02 -07:00
Dan Colish
aacd9cc5bd Use getpass.getuser since os.getlogin requires a tty and tests do not
always run with one.
2012-06-30 23:31:01 -07:00
Dan Colish
abf50324d2 Fix integration.module.file tests on linux 2012-06-30 22:47:02 -07:00
Thomas S Hatch
6ac1e176e5 Merge pull request #1548 from laprice/6a63f7c71c39fe442780c192b566e5bcd7f94f42
user creation tests work properly for issue #1482
2012-06-30 17:45:31 -07:00
Dan Colish
71e97d6921 Fix file.chown to report unknown users and groups. Add tests to prove it. 2012-06-30 17:33:34 -07:00
Larry Price
6a63f7c71c Destructive tests now fail properly. 2012-06-30 17:28:48 -07:00
Larry Price
0d1d01fba2 Adding the user creation tests.
These tests will create users on the test machine if you run them as root.
2012-06-30 17:00:27 -07:00
Dan Colish
087f8be69a Merge branch 'develop' of git://github.com/saltstack/salt into develop 2012-06-30 16:56:31 -07:00
Dan Colish
f91d947806 Simplify file.chgrp. Add file module test suite 2012-06-30 16:56:02 -07:00
Larry Price
6408f286b2 added two tests that will only be run if you are root. 2012-06-30 16:51:11 -07:00
Jeff Schroeder
4b13aebe0b Merge pull request #1542 from akoumjian/develop
Initial module tests for virtualenv
2012-06-30 16:46:44 -07:00
Alec Koumjian
378606c97f Initial module tests for virtualenv 2012-06-30 16:43:32 -07:00
Dan Colish
e767d25a5e Use tempdir to ensure there will always be a directory which can be accessed. 2012-06-30 15:48:28 -07:00
Thomas S Hatch
0a83e68e1a Merge pull request #1537 from dcolish/develop
Fix state.file tests and unit.utils.find_tests.
2012-06-30 15:28:31 -07:00
Thomas S Hatch
756d358e95 Merge pull request #1536 from laprice/develop
fixing the salt/tests/integration/states/cmd.py test
2012-06-30 15:28:01 -07:00
Dan Colish
040c249866 Fix find_test on OSX 2012-06-30 15:23:50 -07:00
Thomas S Hatch
3aa93ba14b Merge pull request #1535 from jhutchins/tests
Tests
2012-06-30 15:15:01 -07:00
Jeff Hutchins
b380991316 Merge git://github.com/saltstack/salt into tests
Conflicts:
	tests/unit/utils/find_test.py
2012-06-30 15:58:17 -06:00
Jeff Schroeder
5e85497760 Gracefully skip the django module tests w/o mock 2012-06-30 14:53:55 -07:00
Jeff Schroeder
94ec7d4816 Make an error go to stderr and remove net 1 LOC 2012-06-30 14:53:32 -07:00
Thomas S Hatch
8ba1d51a75 Merge pull request #1533 from mattrobenolt/django-module-tests
Added tests for Django module
2012-06-30 14:33:16 -07:00
Thomas S Hatch
ede600a734 Merge pull request #1532 from akoumjian/develop
Fix for minion KeyError 1523
2012-06-30 14:27:40 -07:00
Alec Koumjian
40781ea0ae Fix for minion KeyError 1523 2012-06-30 14:25:14 -07:00
Matt Robenolt
d327e6bdf4 Adding tests for Django module commands 2012-06-30 14:24:22 -07:00
Dan Colish
1b1431ba66 Skip verify_env test on windows. 2012-06-30 14:11:37 -07:00
Dan Colish
c5cdb366dc Fix test.integration.states.host. Make master_config and minion_config a property to keep semantics consistent 2012-06-30 13:54:23 -07:00
Jeff Hutchins
ff54029c98 Make tests on utils.find run with nose. 2012-06-30 14:48:40 -06:00
Thomas S Hatch
d15899ce20 Merge pull request #1528 from dcolish/develop
Add unittests for salt.utils.verify
2012-06-30 13:30:36 -07:00
Dan Colish
01b74fc04c Add unittests for salt.utils.verify 2012-06-30 13:28:15 -07:00
Intchanter
a1433ef5ec PEP8 fixes for tests 2012-06-30 14:10:34 -06:00
Dan Colish
edfb3d2560 Merge branch 'develop' of git://github.com/saltstack/salt into develop
Conflicts:
	tests/unit/utils/find_test.py
2012-06-30 12:46:04 -07:00
Jeff Schroeder
7e16fd680a Merge branch 'develop' of github.com:saltstack/salt into develop 2012-06-30 12:34:41 -07:00
Jeff Schroeder
07b4c8b4ed Skip the rvm and gem module/state tests when mock is missing
The mock python module is required for the gem and rvm tests.
If it is not available, the tests should be gracefully skipped.

From python runtests.py -u:

test__check_and_install_ruby (unit.states.rvm_test.TestRvmState) ... skipped 'mock python module is unavailable'
test__check_ruby (unit.states.rvm_test.TestRvmState) ... skipped 'mock python module is unavailable'
test__check_rvm (unit.states.rvm_test.TestRvmState) ... skipped 'mock python module is unavailable'
test_gemset_present (unit.states.rvm_test.TestRvmState) ... skipped 'mock python module is unavailable'
test_installed (unit.states.rvm_test.TestRvmState) ... skipped 'mock python module is unavailable'
test_installed (unit.states.gem_test.TestGemState) ... skipped 'mock python module is unavailable'
test_removed (unit.states.gem_test.TestGemState) ... skipped 'mock python module is unavailable'
test__rvm (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test__rvm_do (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test_gemset_list (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test_gemset_list_all (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test_install (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test_list (unit.modules.rvm_test.TestRvmModule) ... skipped 'mock python module is unavailable'
test__gem (unit.modules.gem_test.TestGemModule) ... skipped 'mock python module is unavailable'
test_list (unit.modules.gem_test.TestGemModule) ... skipped 'mock python module is unavailable'
test_sources_list (unit.modules.gem_test.TestGemModule) ... skipped 'mock python module is unavailable'
2012-06-30 12:29:48 -07:00
Dan Colish
78d16a28f0 Move tmp hosts file management to test case which requires it. Fix
test.unit.utils.find_test on OSX
2012-06-30 12:20:53 -07:00
Thomas S Hatch
65d8cb4e59 Merge pull request #1521 from dcolish/develop
Fix host file setup and fix tests.integration.states.host
2012-06-30 12:00:05 -07:00
Dan Colish
f79b6e5ea0 Fix host file setup and fix tests.integration.states.host 2012-06-30 11:47:48 -07:00
Matt Robenolt
57ff2bfe3e Hardcode /tmp/subsalttest dir in ssh module integration tests
I don't really like doing this, but `/tmp/subsalttest dir` is already
hardcoded in other places for running tests.

Without this, when running tests under a mounted Vagrant drive,
`ssh-keygen` doesn't have permission to create the symlink for
known_hosts to known_hosts.old, causing a test to fail.

```
======================================================================
FAIL: test_rm_known_host (integration.modules.ssh.SSHModuleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/vagrant/tests/integration/modules/ssh.py", line 143, in
test_rm_known_host
    self.assertEqual(ret, 'add')
AssertionError: 'exists' != 'add'
```

`link /vagrant/tests/integration/tmp/known_hosts to
/vagrant/tests/integration/tmp/known_hosts.old: Operation not permitted`
2012-06-30 11:46:31 -07:00
Larry Price
77f54af75e Merge branch 'develop' of https://github.com/saltstack/salt into develop 2012-06-30 11:43:49 -07:00
Larry Price
994d62431e found the issue, set cwd. 2012-06-30 11:43:32 -07:00
Larry Price
aa95c9d26b initial test case for user. 2012-06-30 09:43:44 -07:00
Larry Price
c2f89a849d adding state tests to the full run :-/ 2012-06-30 09:40:00 -07:00
David Boucha
7e7d831103 Disable find unit tests on Windows
There are problems with pwd, grp and /dev/null
as they don't exist on Windows. So we are disabling
tests that use those for now.
2012-06-24 19:43:43 -06:00
David Boucha
bb72a4dfba Fix jinja_test on Windows 2012-06-24 18:16:22 -06:00
Baiju Muthukadan
f9e9e32eaf The pwd & grp modules are only available for unix 2012-06-23 11:47:53 +02:00
Thomas S Hatch
7477583c97 Add test for recuse error 2012-06-19 10:29:14 -06:00
Jeroen Dekkers
ac2344f2cb Skip pip test if pip is not installed 2012-06-19 03:11:54 +02:00
Jeroen Dekkers
92ffbaba6e Be compatible with mock 0.7 2012-06-19 02:19:03 +02:00
Jeroen Dekkers
9dd57c057e Use cat instead of echo for cmd.which test, as echo can be a built-in 2012-06-19 02:17:55 +02:00
Baiju Muthukadan
8cc8fe7305 use sys.maxint for platform compatibility
Also comment out a failing test case.  This works in CentOS 6.2 32bit
but not working unde Ubuntu 12.04 32bit.
2012-06-18 12:06:54 +05:30
Baiju Muthukadan
ea4c519e25 tests for find utility 2012-06-18 00:54:48 +05:30
Thomas S Hatch
baa9cf88eb Add sls for non recurse test 2012-06-15 22:41:59 -06:00
Thomas S Hatch
b13f723ed6 Add non recurse test 2012-06-15 22:41:36 -06:00
Thomas S Hatch
c29d1d6076 Only generate one pair of minion keys for the swarm 2012-06-13 13:37:28 -06:00
Thomas S Hatch
bb9558b316 Fix exception in minionswarm 2012-06-11 14:43:42 -06:00
Thomas S Hatch
e6e92fb3af Add eventlisten script to watch events on the master and minion 2012-06-07 18:41:18 -06:00
Thomas S Hatch
b4f9c22883 Doh! thats the wrong cachedir config! 2012-06-06 11:18:17 -06:00
Thomas S Hatch
8de4dbc13d disable failing aliases tests 2012-06-05 18:11:15 -06:00
Thomas S Hatch
ef6b027e90 Fix salt key tests for new no_color option 2012-06-05 18:10:59 -06:00
Thomas S Hatch
5b05d77405 Add sock_dir setting for the integration test syndic 2012-06-05 17:51:52 -06:00
Thomas S Hatch
f3c7b5be5f Fix path loading for shell tests 2012-06-05 17:04:28 -06:00
Thomas S Hatch
7ad6b3c6e4 Add abaility to disable minion modules in the swarm 2012-06-05 11:44:01 -06:00
Thomas S Hatch
5c6b8aea28 docstring cleanups for ssh tests 2012-06-04 17:22:43 -06:00
L.C. Rees
cc8a921311 - more py3k fixes 2012-06-04 16:40:34 -06:00
Thomas S Hatch
400a429502 Add user to integration verify_env 2012-06-02 23:17:52 -06:00
L.C. Rees
cdb5e89631 - exploit how 'iterkeys' is default iterator for dict
- use values()

- pep8
2012-06-01 13:06:43 -06:00
L.C. Rees
140e8781df - py3k updates 2012-05-31 23:31:27 -06:00