Commit Graph

255 Commits

Author SHA1 Message Date
Erik Johnson
5e0d10f03c Update event tests to use truncated hash 2014-05-23 08:57:01 -05:00
David Boucha
9dc182a2f4 fix codeauthor misspellings 2014-05-21 18:59:02 -06:00
Erik Johnson
5c07011d65 Remove unnecessary test module 2014-05-07 13:00:33 -05:00
Pedro Algarvio
e31ca389ae Provide a custom keyring just for tests.
Properly skip tests.
2014-04-27 13:26:59 +01:00
Marek Skrobacki
524113fc4f fix pylint warnings 2014-04-26 10:21:26 +01:00
Marek Skrobacki
10ce848828 remove hard-dependency on keyring 2014-04-25 18:11:24 +01:00
Marek Skrobacki
7fbb5fcb78 add tests for keyring utils 2014-04-25 17:22:48 +01:00
Pedro Algarvio
f07e614a31 Adapt the tests to the new deprecation output. 2014-04-24 11:32:46 +01:00
Pedro Algarvio
500513375e Use salt's master clean_proc routine.
On Fedora 20, we hit an issue, at least, similar to #3618.
While debugging it, I've found that the runtests process keeps eating
memory.

Using `clean_proc` has at least, allowed the runtests to finish without
triggering #3618.
2014-04-18 07:52:40 +01:00
Yusuke Tsutsumi
f5b4ac2395 Adding introspection methods for yum and apt-get
* adding yumpkg:owner
* adding aptpkg:owner
* refactoring owner method to utils.pkg library
2014-04-14 14:05:43 -04:00
Thomas S Hatch
09769d6fa2 lint tests 2014-04-02 11:16:24 -06:00
Pedro Algarvio
7c782f6752 Adapt test case because we default to dropping unrelated events.
The previous default was not dropping unrelated event, however, this
could cause memory leaks, so, the current default is dropping those
events.

We now test for both behaviours.
2014-03-31 03:31:23 +01:00
Pedro Algarvio
ed12816806 Update tests to new event classes signatures. 2014-03-24 16:54:31 +00:00
Thomas S Hatch
4af873dcaf Merge pull request #11337 from techdragon/fix-hightstate-failure-retcode
Fix for broken salt cmd return codes - issue #7013
2014-03-22 00:31:19 -06:00
Thomas S Hatch
43de620730 Merge pull request #11413 from s0undt3ch/hotfix/immutable-lists-sum
Simpler immutable types
2014-03-21 11:40:09 -06:00
Pedro Algarvio
5fa42543e3 Fix reference and allow standalone test excution. 2014-03-21 12:51:42 +00:00
Pedro Algarvio
f38b18ce7d Fix reference. 2014-03-21 12:48:06 +00:00
Pedro Algarvio
1825dfe635 Also test slicing 2014-03-21 12:45:54 +00:00
Pedro Algarvio
49bdbefb66 No more proxied immutables. Add test for nested immutables. 2014-03-20 23:59:38 +00:00
techdragon
e2a04d2877 Fixes & Updates
- fixed pep8 issue
- added more logic to check_state_result logic to handle list results properly and return false.
- ordered the check_state_result unit tests more logically. All the data type tests are now before the content & logic handling checks
- discovered duplicate test in check_state_result unit tests and removed it, both tests were asserting using the same data {'host': []}
2014-03-20 15:08:34 +08:00
Pedro Algarvio
4c7d06a64a Test ImmutableList sum 2014-03-13 20:10:44 +00:00
Thomas S Hatch
8c6c608958 Merge branch 'serializers' of git://github.com/johnnoone/salt into johnnoone-serializers
Conflicts:
	doc/topics/yaml/index.rst
2014-03-07 14:53:03 -07:00
Thomas Jackson
96c76f7a73 Add some unit tests for cache object 2014-03-05 18:12:20 -08:00
George Marshall
8f66db2e0f Teach utils.option to fail so that it can succeed 2014-02-28 21:57:03 -08:00
Xavier Barbosa
a3b87d1981 a little bit of lint 2014-02-21 13:49:54 +01:00
Xavier Barbosa
9f39d4171b added reset tag 2014-02-21 09:52:31 +01:00
Xavier Barbosa
85a5c9e617 ensure that str are yaml friendly 2014-02-20 17:50:49 +01:00
Xavier Barbosa
ad9734e78f implement aggregation 2014-02-20 13:57:37 +01:00
Xavier Barbosa
9d32696939 implement serializers 2014-02-20 12:00:21 +01:00
Thomas S Hatch
17edf0b1a7 Merge pull request #10288 from s0undt3ch/hotfix/lint
Lint Fixes
2014-02-10 12:22:09 -07:00
Thayne Harbaugh
08ed0f0e1e Do not fail if the system does not support IPv6
Fixes: #10318
2014-02-10 11:01:34 -07:00
Pedro Algarvio
2d5aafa12b Remove unused imports 2014-02-08 08:09:13 +00:00
Pedro Algarvio
24fdc6f688 Ignore unused imports 2014-02-08 08:08:49 +00:00
Pedro Algarvio
baa3a4b8cf Remove hardcoded version, we're regex matching. 2014-01-03 00:40:45 +00:00
Pedro Algarvio
b03c779718 Don't assume mock and timelib are instaled. 2013-12-31 13:53:37 +00:00
Mike Place
17dea90f63 Fix RHEL5 zmq unit tests
* Import zmq, check its attr and skip test if necessary.
2013-12-30 14:37:17 -07:00
Mike Place
4b7148a0f5 Don't test deprecated function.
* utils.memoize has been moved to salt.utils.decorators. Don't test it here.
2013-12-27 13:28:42 -07:00
Mike Place
72b565af2c Optimize imports. 2013-12-23 20:55:43 -07:00
Mike Place
f8b772f970 More aggressive IPC fix. 2013-12-23 19:36:57 -07:00
Mike Place
8efa385291 More unit tests. Many, many more. 2013-12-23 17:16:05 -07:00
Mike Place
ae4fdc1066 Raise IPC check even higher to resolve failing tests in Jenkins. 2013-12-23 17:11:24 -07:00
Mike Place
d15bd31b9c Unit testing and utils refinements
* More unit tests against utils module
* Minor modifications to utils module for formatting.
* Remove case which could not be reached inside utils module.
2013-12-23 17:10:29 -07:00
Mike Place
83b08df07d Clarify len of line. 2013-12-23 17:06:22 -07:00
Thomas S Hatch
fb0ca047d1 Fix lint errors in tests 2013-12-23 09:25:16 -07:00
Mike Place
fab5535240 test is_true 2013-12-22 19:23:45 -07:00
Mike Place
647f954c7c More detailed testing against the state verifier utility. 2013-12-22 19:15:59 -07:00
Mike Place
451cd8d7ea Default var and typo. 2013-12-22 16:40:09 -07:00
Mike Place
0ef7c56e11 Doh. Typo. 2013-12-22 16:37:07 -07:00
Mike Place
dc5874fb1c Don't run event tests on systems that can't support them. 2013-12-22 16:33:07 -07:00
Thomas S Hatch
706665ff0d Merge pull request #9382 from cachedout/docker-unit-tests
Unit testing
2013-12-20 16:17:58 -08:00
Mike Place
b77fce5816 Many more unit tests for salt.utils
Small doc change.
2013-12-20 17:12:49 -07:00
Thomas S Hatch
b63c0449ac Stub out bad test 2013-12-20 13:55:37 -07:00
Mike Place
05b78e30bc More utils testing. 2013-12-20 13:47:01 -07:00
Mike Place
4176354820 Pylint fixes for regex errors. 2013-12-20 09:42:15 -07:00
Mike Place
40ecf088f2 Work on salt.utils unit testing. 2013-12-20 08:34:33 -07:00
Mike Place
3bb714282e Starting on unit tests for docker and salt.utils. 2013-12-19 09:14:59 -07:00
Pedro Algarvio
4bbd0c512d Too much white-space added. 2013-12-14 17:42:51 +00:00
Pedro Algarvio
82973662e9 Disable the VT test, the code ain't mature enough. 2013-12-14 17:37:06 +00:00
Pedro Algarvio
d8453a4b91 Make sure we can actually get the size of the terminal before trying. 2013-12-12 09:53:36 +00:00
Pedro Algarvio
b15b3237e9 Update self.args even if shell is not True 2013-12-11 14:23:11 +00:00
Pedro Algarvio
1341573532 Fix the SSH password regular expression. 2013-12-10 11:08:52 +00:00
Pedro Algarvio
e45cbf1dca Add unit test for the ssh password regex matching 2013-12-10 10:46:25 +00:00
Thomas S Hatch
41df5b16f3 pylint 2013-12-06 10:50:24 -07:00
Ollie Walsh
68e0e3a106 Add unit test for event timeouts 2013-12-03 22:44:52 +00:00
Pedro Algarvio
877bdb2a90 Lint white-space fixes. 2013-12-03 20:30:16 +00:00
Ollie Walsh
8bacb953c0 Fix typo 2013-12-03 01:45:18 +00:00
Ollie Walsh
d81aeb2c0e More tests 2013-12-03 01:22:51 +00:00
Ollie Walsh
f9aca16aee More unit tests and longer timeouts for travis-ci 2013-12-02 23:20:54 +00:00
Ollie Walsh
6fe85f1294 Add some basic unit tests for events 2013-12-02 22:26:13 +00:00
Pedro Algarvio
0ae1a15c61 PEP8 E302 and E303 blank lines fixes. 2013-11-27 12:11:45 +00:00
Pedro Algarvio
14b59ac073 Include the coding header. 2013-11-27 12:04:43 +00:00
Pedro Algarvio
08c5c8e83a Fix PyLint W1401, anomalous backslash. 2013-11-27 11:24:26 +00:00
Pedro Algarvio
d02a2bc224 Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
Pedro Algarvio
b5c9815e9a Arguments like pip==1.0 must not match yaml'ification as as keyword arguments. 2013-11-09 10:32:27 +00:00
Mike Place
00c7d36966 Exception handling for missing id
Refs #8259. We don't like tracebacks. Includes unit test.
2013-11-07 11:59:07 -07:00
Pedro Algarvio
798e1830d5 Provide a default PATHEXT environment variable.
Added test case which relies on the `PATHEXT` environment variable.
2013-10-28 16:05:19 +00:00
Pedro Algarvio
c8c6dab678 Add some comments to explain whats going on. 2013-10-27 16:53:39 +00:00
Pedro Algarvio
79391f107b Provide a mocked version the tests to reach windows specific code. 2013-10-27 16:53:39 +00:00
Erik Johnson
a9d1c12481 Add unit test for salt.utils.which
This is a Linux-only test, it will need some mock love to make it
suitable to test for windows paths.
2013-10-27 16:53:39 +00:00
Pedro Algarvio
f0b78cd916 Format version on deprecation messages.
Add a test case to check if a deprecation message get it's `version` format holder properly populated.
2013-10-04 09:53:51 +01:00
Pedro Algarvio
a9ceedb5eb warn_until and kwargs_warn_until are now aware of named versions.
Updated the warnings tests cases accordingly.
2013-10-04 09:53:50 +01:00
Pedro Algarvio
8c9fe2c5c1 Fix the kwargs_warn_until unit test case. 2013-10-04 09:53:50 +01:00
Pedro Algarvio
f028a004ad Fix the warnings unit test.
Since the `warn_until` function now parses and instantiates a `SaltStackVersion`, the `bugfix` part of the version info is always shown.
2013-10-04 09:53:50 +01:00
Pedro Algarvio
800c918729 Let SaltStackVersion be the original one, not a MagicMock'ed one 2013-10-04 09:53:50 +01:00
Pedro Algarvio
ec07e5ae49 Adapt test cases to fixed behaviour. 2013-09-28 00:00:59 +01:00
Pedro Algarvio
9b3d504e03 Fix unit tests regarding salt.utils.find._parse_interval 2013-09-28 00:00:59 +01:00
Pedro Algarvio
a9d5ac5a3e Add unit tests to salt.utils.format_call(). 2013-09-24 22:08:08 +01:00
Pedro Algarvio
05be7064d5 0.17.0 has been tagged. The 0.16.x requires_network is no longer necessary. 2013-09-19 11:16:37 +01:00
Pedro Algarvio
e18ba0758b Don't include authorship in generated documentation, the Sphinx way. 2013-09-16 17:24:00 +01:00
Chris Rebert
90f257df13 add salt.utils.kwargs_warn_until() 2013-09-10 17:12:25 -07:00
Pedro Algarvio
25a72358ab Skip this test until properly mocked. 2013-08-28 15:21:29 +00:00
Pedro Algarvio
57feb4a015 One more missing import 2013-08-28 15:21:29 +00:00
Pedro Algarvio
5ea856c104 Fix missing import 2013-08-28 15:21:29 +00:00
Pedro Algarvio
2b64d0482d Make sure every temp dir created on the unittests respects, integration.SYS_TMP_DIR 2013-08-27 15:31:58 +00:00
Pedro Algarvio
6e694791fb Allow tests to be properly skipped if mock is not installed. 2013-08-26 17:05:44 +00:00
Pedro Algarvio
2eab51a429 Adapted unit.utils.warnings_test to use salttesting.mock 2013-08-26 13:03:04 +00:00
Pedro Algarvio
0c0751e793 Adapt the test case to the changes introduced in 7e9e889 2013-08-16 20:26:48 +01:00
Pedro Algarvio
2f750ed06c Allow network related tests to be skipped if no network is available. Fixes #6710. 2013-08-16 02:02:37 +01:00
Thomas S Hatch
4808281594 freebsd uses wheel as well 2013-08-13 01:01:10 -06:00
Pedro Algarvio
83004fd8f8 Allow salt.utils.warn_until() to not issue the warning because we're only after the RuntimeError behaviour. 2013-07-20 16:26:47 +01:00
Pedro Algarvio
eaa0b16e53 Added a helper function to raise warnings until a specified salt version.
The helper raises a warning, by default, a ``DeprecationWarning``, until the provided ``version_info`` is matched, after which, a ``RuntimeError`` will be raised to remember the developers to remove the warning.
2013-07-20 15:32:50 +01:00
Pedro Algarvio
6e061b5d24 Updated unit.utils.verify_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
bdf808773d Updated unit.utils.safe_walk_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
0675fae89c Updated unit.utils.runtime_whitespace_regex_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
155987dc08 Updated unit.utils.path_join_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
6e1f36fb22 Updated unit.utils.find_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
f35367613e Updated unit.utils.filebuffer_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
2081aff707 Updated unit.utils.event_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
663f54ef9f Update copyright years of changed files. Added __main__ execution to tests/integration/states/pip.py. 2013-06-28 00:12:57 +01:00
Pedro Algarvio
222be7b446 Make sure every test module is runnable by __main__.
* Double to single quotes
2013-06-28 00:12:56 +01:00
Sylvain Fankhauser
101b9d2f2e Rename build_whitepace_splited_regex to build_whitespace_split_regex 2013-05-15 12:48:08 +02:00
Chris Rebert
c487d86fff tests: standardize to modern 'except FooError as err:' syntax 2013-05-03 19:55:50 -07:00
Thomas S Hatch
829b2ca993 sort directory data to ensure consistent data set 2013-05-02 23:23:22 -06:00
Thomas S Hatch
f65515d57c Fix safe_walk test 2013-05-02 23:07:06 -06:00
Daniel Miller
b5d130cc3a Fix symlink recursion in salt.utils.safe_walk 2013-05-02 13:32:21 -04:00
Chris Rebert
498d2999db more typo fixes 2013-05-01 16:52:52 -07:00
Toke Høiland-Jørgensen
5b6e17474b IPv6 address literals should be specified without brackets in config files. 2013-03-23 23:57:23 +01:00
Toke Høiland-Jørgensen
0f0a7cf560 Add a unit test for passing IPv6-formatted addresses to verify_socket. 2013-03-23 23:34:47 +01:00
Pedro Algarvio
7c5a5d0bd3 Header updates. More copyright to the SaltSatck team. Code author to me(where applicable). 2012-12-11 10:23:37 +00:00
Pedro Algarvio
c5fe83272f Even more open() to salt.utils.fopen(). 2012-11-18 18:57:10 +00: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
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
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
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
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
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
4f9e62eaf4 Include a test case. Fixes #1989. 2012-09-07 18:04:14 +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
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
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
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
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
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
040c249866 Fix find_test on OSX 2012-06-30 15:23:50 -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
Dan Colish
1b1431ba66 Skip verify_env test on windows. 2012-06-30 14:11:37 -07:00
Jeff Hutchins
ff54029c98 Make tests on utils.find run with nose. 2012-06-30 14:48:40 -06: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