Commit Graph

584 Commits

Author SHA1 Message Date
Pedro Algarvio
40c5512bfb Properly deprecate check_dns.
Instead of having to leave `**kwargs` "forever" in `salt.config.minion_config` and `salt.config.apply_minion_config` in order to support API access to those which still passes `check_dns`. Support the argument but show a deprecation warning once. Leave the deprecation warning for 2 major releases. Then, finally, and properly, remove `check_dns` for good.
2013-07-20 01:39:23 +01:00
Pedro Algarvio
b03a5fcee3 Stop using the deprecated check_dns in salt.config.minion_config. 2013-07-20 01:38:09 +01:00
Xavier Barbosa
11ef87bd5d finished cleanup 2013-07-19 16:53:51 +02:00
Xavier Barbosa
abd031963f removed anchored yaml, does not work with CDumper... 2013-07-19 16:50:59 +02:00
Xavier Barbosa
f381590256 try to fix travis exception 2013-07-19 16:24:32 +02:00
Xavier Barbosa
f8bf53b682 added doc for yaml / json tags 2013-07-19 16:02:29 +02:00
Xavier Barbosa
9288281c63 added to jinja load* filters and tags 2013-07-19 16:02:28 +02:00
Xavier Barbosa
117f76def4 added AnchoredDumper 2013-07-19 16:02:28 +02:00
Pedro Algarvio
7aed6aeb30 Actually, the Syndic config test case can be a simple unit test. 2013-07-17 16:43:18 +01:00
Pedro Algarvio
db6553a019 Skip unit.templates.jinja_test.TestGetTemplate.test_strftime test if timelib is not installed. 2013-07-17 11:23:42 +01:00
Xavier Barbosa
22e1da9148 changed dateutil by timelib saltstack/salt#6088 2013-07-15 11:12:23 +02:00
Xavier Barbosa
00e373b63b added unittests for strftime filter saltstack/salt#6088 2013-07-15 11:12:21 +02:00
Pedro Algarvio
d6b1e60fb1 Added a mocked test case for pip.list with prefix matching. 2013-07-14 20:53:36 +01:00
Pedro Algarvio
01f489c79d Added a mocked test case for pip.list. 2013-07-14 19:30:08 +01:00
Pedro Algarvio
c83e767e06 Added a mocked test case for pip freeze. 2013-07-14 19:25:44 +01:00
Pedro Algarvio
e17599a820 Added a mocked test case for --timeout passing to pip uninstall. 2013-07-14 19:02:41 +01:00
Pedro Algarvio
71c278384b Added a mocked test case for --log passing to pip uninstall. 2013-07-14 19:01:27 +01:00
Pedro Algarvio
3e97e36e78 Added a mocked test case for --proxy passing to pip uninstall. 2013-07-14 18:59:23 +01:00
Pedro Algarvio
95ee5a9f36 Added a mocked test case for --proxy passing to pip install. 2013-07-14 18:59:22 +01:00
Pedro Algarvio
315c1f911d Added a mocked test case for multiple --requirements passing to pip uninstall. 2013-07-14 18:59:22 +01:00
Pedro Algarvio
5435dc69e1 Added a mocked test case for multiple --requirements passing to pip install. 2013-07-14 18:59:22 +01:00
Pedro Algarvio
411c926146 Prefix tests with install since they're testing the install command. 2013-07-14 18:59:22 +01:00
Pedro Algarvio
02034c4d86 Added a mocked test case for --no-install passing to pip install. 2013-07-14 18:59:18 +01:00
Pedro Algarvio
716f760e80 Added a mocked test case for --no-deps passing to pip install. 2013-07-14 18:59:13 +01:00
Pedro Algarvio
89fa6cecf4 Added a mocked test case for --ignore-installed passing to pip install. 2013-07-14 18:59:08 +01:00
Pedro Algarvio
892646bdee Added a mocked test case for --force-reinstall passing to pip install. 2013-07-14 18:59:01 +01:00
Pedro Algarvio
03c88dac2c Added a mocked test case for --upgrade passing to pip install. 2013-07-14 18:58:56 +01:00
Pedro Algarvio
27959701dc Added support and a mocked test case for --global-options passing to pip install. 2013-07-14 18:58:49 +01:00
Pedro Algarvio
fd200c96b0 Added a mocked test case for --install-options passing to pip install.
* Replaced all occurrences of `basestring` with the `string_types` from salt's `_compat` module.
* Properly split install options on commas.
* Install options need to be quoted.
2013-07-14 18:58:44 +01:00
Pedro Algarvio
12d05e4b9a Added a mocked test case for --exists-action passing to pip install.
* `exists_action` now only accepts it's valid settings, one of `s`, `i`, `w`, `b`, else, `CommandExecutionError`.
2013-07-14 18:58:37 +01:00
Pedro Algarvio
fb16313804 Added a mocked test case for --source passing to pip install. 2013-07-14 18:58:33 +01:00
Pedro Algarvio
85b0d7964d Added a mocked test case for --no-download passing to pip install. 2013-07-14 18:58:28 +01:00
Pedro Algarvio
60ef910bad Added a mocked test case for --download-cache passing to pip install. 2013-07-14 18:58:24 +01:00
Pedro Algarvio
bfcd91d700 Added a mocked test case for --download passing to pip install. 2013-07-14 18:58:12 +01:00
Pedro Algarvio
6fbbd5fb31 Added a mocked test case for --target passing to pip install. 2013-07-14 18:58:06 +01:00
Pedro Algarvio
aa8dda75c7 Added a mocked test case for --build passing to pip install. 2013-07-14 18:57:58 +01:00
Pedro Algarvio
6e0e8fddf9 Added a mocked test case for --no-index passing to pip install. 2013-07-14 18:57:52 +01:00
Pedro Algarvio
467d7de4e5 Added a mocked test case for --extra-index-url passing to pip install. 2013-07-14 18:57:47 +01:00
Pedro Algarvio
900682ac51 Added a mocked test case for --index-url passing to pip install. 2013-07-14 18:57:43 +01:00
Pedro Algarvio
d3c1c43781 Add tests for proper protocols to find_links. 2013-07-14 18:57:42 +01:00
Pedro Algarvio
72600f67e6 Test string argument on pkgs, editable, find_links and mirrors. 2013-07-14 18:57:42 +01:00
Pedro Algarvio
3372034c07 Added a mocked test case for --timeout passing to pip install. 2013-07-14 18:57:37 +01:00
Pedro Algarvio
c582d721d9 Added a mocked test case for --log passing to pip install. 2013-07-14 18:57:29 +01:00
Pedro Algarvio
21698d187d Update mocked test case to have the package name as last argument to the pip install call. 2013-07-14 18:57:20 +01:00
Pedro Algarvio
5e58d4c4f3 Added mock test case for clear, upgrade and symlinks for the virtualenv_mod. 2013-07-14 13:23:18 +01:00
Pedro Algarvio
45c258e00b Added test case for the prompt argument to virtualenv_mod. 2013-07-14 13:04:11 +01:00
Pedro Algarvio
d8536c9f87 Add a mocked test case for salt.modules.virtualenv_mod python argument.
* Updated the `virtualenv_mod` mock test case to patch `salt.utils.which` and `sys.modules` at class level as opposed to every function.
2013-07-14 12:53:23 +01:00
Pedro Algarvio
c65b1348fe Fix Travis-CI for unit.modules.virtualenv_test.VirtualenvTestCase.test_no_site_packages_deprecation
Also mock the `virtualenv` module.
2013-07-13 23:23:30 +01:00
Pedro Algarvio
b6471e4099 Mock the virtualenv module in unit.modules.virtualenv_test.VirtualenvTestCase.test_issue_6031_multiple_extra_search_dirs. Is Travis-CI still going to complain? 2013-07-13 23:14:12 +01:00
Pedro Algarvio
2b1cf0ac14 Patch _install_script() since the virtualenv module will try to install some scripts. 2013-07-13 19:55:51 +01:00
Pedro Algarvio
05f2a23733 Make use of salttesting.helpers.ForceImportErrorOn. 2013-07-13 19:55:50 +01:00
Pedro Algarvio
04133b07b4 Added mock test case to test getting the virtualenv version from shell and not from the module. 2013-07-13 19:55:50 +01:00
Pedro Algarvio
606c6d5ffb Add test case which tests if non proper arguments raise an exception. 2013-07-13 19:55:50 +01:00
Pedro Algarvio
de572cb193 Fix the virtualenv unittests which rely on it's version changing. 2013-07-13 19:55:49 +01:00
Pedro Algarvio
606413c063 Show a deprecation warning if no_site_packages is used. Fixes #6027.
If both `no_site_packages` and `system_site_packages` are used, throw an error.
Added the appropriate tests.
2013-07-13 19:55:49 +01:00
Pedro Algarvio
cde1c628ac Added a test case to check for multiple extra search dirs support. Refs #6031. 2013-07-13 19:55:49 +01:00
Pedro Algarvio
2fd8dc299a Add test case to check for proper handling of --never-download. Refs #6030.
Also added assertions to check for proper deprecation logging messages output.
2013-07-13 19:55:49 +01:00
Pedro Algarvio
6126aa47be Small code and print's cleanup. 2013-07-13 19:55:48 +01:00
Pedro Algarvio
8858d1183f Add test case which tests for proper deprecated output based on virtualenv version. 2013-07-13 19:55:48 +01:00
Pedro Algarvio
64c9463a8b Merge pull request #6143 from s0undt3ch/issues/6129-unexpected-__env__-keyword
Fix Issue #6129 unexpected `__env__`  keyword
2013-07-13 11:53:19 -07:00
Pedro Algarvio
5bee1ca7f3 Re-implement 06ac67c84a the right way since the state __env__ was being confused by the shell environment. Fixes #6129. 2013-07-13 18:45:30 +01:00
Pedro Algarvio
269175145f Update mocked rvm unit test since we now call cmd.run_all instead of cmd.retcode. 2013-07-13 17:46:46 +01:00
Xavier Barbosa
3f49000ba2 unittesting for file.serialize and yaml & json filters 2013-07-08 16:19:19 +02:00
Pedro Algarvio
66d86ca2d5 Added 2 test cases which prove that #5970 is invalid. Closes #5970. 2013-07-06 12:48:13 +01:00
Pedro Algarvio
66d51a036f Switch assertRaisesWithMessage with assertRaises. The first was not working as supposed. 2013-07-05 01:21:00 +01:00
Pedro Algarvio
3c3933d25e Test for the proper exception, remove stray character left behind. 2013-07-05 00:57:47 +01:00
Pedro Algarvio
edf66fd3fe pip allows multiple --find-links to be passed. Added mocked tests too. 2013-07-05 00:54:11 +01:00
Pedro Algarvio
e6aa92901d Add multiple editable's and pkgs+editable's test cases. 2013-07-04 17:24:24 +01:00
Pedro Algarvio
6158edee2d Add a mocked unit testcase to test for multiple mirrors support. Refs #5940. 2013-07-04 15:01:05 +01:00
Pedro Algarvio
f8216aa584 Fix unit tests to expect the new, single quotes and less wasted white-space, output. 2013-07-04 14:50:07 +01:00
Joost Cassee
7fd85c2963 Allow listing a single module in a top match
This makes the following valid syntax for the top.sls file:

base:
  tommy.example.com:   webserver
  jerry.example.com:   dbserver
  alberon.example.com: mailserver

develop:
  saturn.example.com:  webserver
2013-07-04 00:20:08 +02:00
Pedro Algarvio
d6049a92b5 Use an unicode aware context in the jinja render call. Refs #3436 2013-07-02 14:28:20 +01:00
Pedro Algarvio
a977a4f4fa Don't ignore environment variables pointing to valid configuration files. Fixes saltstack/salt-cloud#661
`salt.config.load_config()` cannot be hard-coded to use only the master configuration file as the default configuration file path to know if the user has passed any configuration file in the CLI tool or not.
To fix this, `default_path` was added. This way, the minion config or client config or even the salt cloud config can say which is the expected default path of the configuration file and properly load config from environment variables.
2013-06-28 20:39:37 +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
4a875f5b35 Updated unit.templates.jinja_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:04 +01:00
Pedro Algarvio
c04cc4a945 Updated unit.states.rvm_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
b13340e5ea Updated unit.states.gem_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
0631e31cb1 Updated unit.modules.win_status_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
86564ba1ce Updated unit.modules.rvm_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
7a5872b498 Updated unit.modules.postgres_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
9df34a39d7 Updated unit.modules.pip_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
99d828a650 Updated unit.modules.gem_test test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:03 +01:00
Pedro Algarvio
2097684c0a Minor formating changes. 2013-06-28 00:12:59 +01:00
Pedro Algarvio
cb0922faf7 Updated some of the test cases to use a much more readable approach using salttesting.helpers.ensure_in_syspath(). 2013-06-28 00:12:59 +01:00
Pedro Algarvio
6dfe563ce1 Added support for __main__ execution. 2013-06-28 00:12:57 +01:00
Pedro Algarvio
d245b17412 Added support for __main__ execution and formatting fixes. 2013-06-28 00:12:57 +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
Thomas S Hatch
90c5cc8c4d list_, not _list 2013-05-28 23:54:38 -06:00
Thomas S Hatch
95780ff219 Fix ref no non func alias in rvm test 2013-05-28 14:53:40 -06:00
Thomas S Hatch
8d018e0b8c make gem test ref non func alias 2013-05-28 14:35:26 -06:00
Matt George
ecdff63b6e added ability to activate a virtualenv before
running pip install
2013-05-17 13:56:09 -05:00
Sylvain Fankhauser
101b9d2f2e Rename build_whitepace_splited_regex to build_whitespace_split_regex 2013-05-15 12:48:08 +02:00
Thomas S Hatch
f1697aea5b Fix test where the absence of mock breaks things 2013-05-07 22:42:08 -06:00
Thomas S Hatch
367927b3d3 Fix #4912
Clint, this fixes it for me and still logicaly verifies the test
let me know if this works on your end
2013-05-07 22:36:34 -06:00
Daniel Watkins
7e7bf244c7 Move caching of requirements to helper function and add unit tests. 2013-05-07 10:20:56 +01: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
Chris Rebert
26209c1fc1 rm unused imports reported by pyflakes 2013-04-30 14:48:04 -07:00
Thomas S Hatch
ab5f540430 Merge pull request #4232 from tohojo/ipv6-support
IPv6 support for master-minion communication
2013-04-28 18:34:28 -07:00
Pedro Algarvio
5f58f0d28b We need OrderedDict support. So, as a last resort, provide our own.
* We try to import `OrderedDict` from the standard library, which is only available on python >= 2.7, if `ImportError` is raised we try to import it from `ordereddict`, a package available in PyPi. As a last resort, we provide our own implementation based on http://code.activestate.com/recipes/576669/.
* Update all code requiring `OrderDict` to use our compatible import module.
2013-04-23 12:56:23 +01:00
Pedro Algarvio
0d5c3b5f0c Add cmd.run_all to __salt__. Required for the unit test. 2013-04-22 22:26:05 +01:00
Denis Generalov
1b1a5bd743 fix unit tests 2013-04-05 18:21:33 +04:00
G.Tjebbes
60af610e3f Ref #4361 : add some unit tests on pip's args 2013-04-03 23:41:17 +02: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
Colton Myers
e277154c18 Fix patch.multiple (wrong order on function defs) 2013-03-21 17:26:12 -06:00
Colton Myers
99d0a34dc2 Define patch.multiple 2013-03-21 17:21:26 -06:00
Colton Myers
d42e9d8b63 Wrap extra Mock() references 2013-03-21 17:09:16 -06:00
Colton Myers
7d6c2ffcd3 Add skipIf decorator 2013-03-21 17:00:53 -06:00
Colton Myers
46f6145310 Remove trailing whitespace and fix PEP8 issues 2013-03-21 16:49:41 -06:00
Colton Myers
d3314e231b Wrap mock import to avoid ImportErrors 2013-03-21 16:48:18 -06:00
Roberto Aguilar
f3b46d7460 Fixed tabs 2013-03-12 11:20:54 -07:00
Roberto Aguilar
18ba416554 Added default runas for postgres functions.
On BSD the default runas user is pgsql, on other systems it's postgres.
2013-03-12 18:10:46 +00:00
Jack Kuan
deee61c51a Fix a regression in the stateconf renderer and updated docs. 2013-03-01 09:35:45 -05:00
Pedro Algarvio
1795fbe591 Commented out test case which is failing since 209c566010. @vlaci could you have a look please? 2013-02-17 12:05:11 +00:00
Roberto Aguilar
c0c67a7509 Added test for limit in file.sed. 2013-02-13 14:36:34 -08:00
Jack Kuan
ede7d9a762 Added doc for render time state execution and also fixed a bug with the feature. 2013-02-10 00:37:31 -05:00
Jack Kuan
fa7e327baf Fix the merge conflicts in tests/unit/pydsl_test.py 2013-02-09 21:28:35 -05:00
Thomas S Hatch
f65626db0b Update pydsl tests, still failing though 2013-02-09 15:07:59 -07:00
Thomas S Hatch
e63a01f853 Add docstring 2013-02-09 14:41:16 -07:00
Thomas S Hatch
ace2aade9f Fix binary file issue from merge 2013-02-09 14:40:31 -07:00
Thomas S Hatch
858e86d597 Merge branch 'pydsl_compile_time_state_execution' of git://github.com/kjkuan/salt into kjkuan-pydsl_compile_time_state_execution
Conflicts:
	tests/unit/pydsl_test.py
2013-02-09 14:31:36 -07:00
Jack Kuan
106cc0aa0e Move the pydsl module into salt/utils/. 2013-02-08 17:49:21 -05:00
Thomas S Hatch
42024cab39 Clean out unused code 2013-02-08 10:57:20 -07:00
Thomas S Hatch
b86a8d6da8 Pylint cleanup for salt log tests 2013-02-07 15:50:43 -07:00
Thomas S Hatch
59c4fdaf39 Merge pull request #3610 from s0undt3ch/develop
Fix test case and skip message.
2013-02-06 08:45:42 -08:00
Pedro Algarvio
df2ac900c3 Fix pydsl unittest skip message + PEP8. 2013-02-06 05:10:47 +00:00
Pedro Algarvio
f43b21516a Fix salt version unittest. 2013-02-06 04:59:26 +00:00
Jack Kuan
9bf7f72a43 Now calling a state(id declaration) at compile/render time executes it using salt['state.high']().
Also fixed a bug: Now we prevent the use of extend() after ordered execution was turned on once.
2013-02-05 14:50:40 -05:00
Jack Kuan
b7571dd891 Add support for #3483([pydsl] Import Python definitons from included files). 2013-02-01 12:32:19 -05:00
Jack Kuan
0976f42410 Fix test case skipping logic: if < py2.7 then no OrderedDict, so skip.
For ordered execution, PyDSL requires py2.7 or above. Although, it's
possible to make it work with a third-party OrderedDict implementation
like the yaml renderer does..., this is not bothered here.
2013-01-24 12:21:54 -05:00
Jack Kuan
5ad5cd9b6e Fix a bug in the pydsl test case. 2013-01-21 10:27:06 -05:00
Thomas S Hatch
99172816ea Merge pull request #3329 from mjarco/fix-config-options-defaults
Default options were never returned if omit_pillar flag was set to false (or unset)
2013-01-20 20:17:39 -08:00
Jack Kuan
897f877bed Added docs for pydsl and fixed a syntax inconsistency. 2013-01-20 01:21:05 -05:00
Pedro Algarvio
3629fe88c0 Fix tests.unit.pydsl_test and tests.unit.stateconf_test.
No more errors are shown because the configuration files are not readable, and in fact, the minion configuration can be use, unlike what was said in the comment.
2013-01-20 04:09:07 +00:00
Michał Jarco
77f898b0cb Simplistic tests (still better than none) 2013-01-19 15:02:06 +01:00
Pedro Algarvio
09bba5b054 git describe sha signatures have a length of 8 chars. 2013-01-19 05:07:41 +00:00
Pedro Algarvio
7694829219 Also include the number of commits after the found tag. 2013-01-19 04:38:36 +00:00
Pedro Algarvio
d3391f4db0 Harden git describe parsing so it does not fail on awkward situations.
This issue came up because a user is using custom tags and git describe for him is something like `debian/0.11.1+ds-1-3-ga0afcb`.
Added unittests for this.
2013-01-19 02:31:00 +00:00
Jack Kuan
a678901c48 Fix test cases for py2.6. 2013-01-18 14:14:42 -05:00
Jack Kuan
9c35844c56 Make pydsl work with stateconf.
- Added implicit ordering to pydsl.(turned on via __pydsl__.set(ordered=True))

- Fixed a KeyError bug in stateconf renderer that happens during id renaming.

- The stateconf renderer now generates a no-op start state as the
  "first" state in a sls file.(enabled via -s)

- Made the stateconf renderer take high state input via the new -p
  option, so we can pipe pydsl output into it.

- Added more and fixed some test cases for stateconf and pydsl.
2013-01-18 12:34:56 -05:00
Thomas S Hatch
a1de80e5c6 Merge pull request #3257 from mjarco/fix-local-jinja-template-resolution
Fix jinja template includes lookup with salt-call --local mode
2013-01-15 11:03:54 -08:00
Jack Kuan
791ca1cb44 Add test cases and fixed some corner cases. 2013-01-14 23:29:35 -05:00
Jack Kuan
a8b8a6eb18 Add a test module for pydsl and some bug fixes. 2013-01-14 23:29:35 -05:00
Michał Jarco
7f782afb14 Fixed jinja_tests.
File roots contains lists of paths for each env.
2013-01-14 08:58:27 +01:00
Thomas S Hatch
ad63c17227 overcome value error in win status test 2013-01-13 00:09:28 -07:00
Pedro Algarvio
c20cb1da51 Fix logging unit tests. Thanks @shadowfax-chc. 2013-01-08 03:41:59 +00:00
Pedro Algarvio
f8073a08eb Warn about low mock version instead of mock not available. 2013-01-04 17:45:06 +00:00
László Vaskó
7ff2ab7d58 win_status_test: added pid explicitly 2012-12-31 11:45:54 +01:00
László Vaskó
d6d9e9ce47 win_status: finalize COM library properly 2012-12-31 11:45:54 +01:00
László Vaskó
51150f1427 win_status: handle if CommandLine is None 2012-12-31 11:45:54 +01:00
Thomas S Hatch
a601af6955 Merge pull request #3071 from s0undt3ch/hotfix/pylint/C0103
Fixes for pylint's C0103 msgid
2012-12-30 20:22:42 -08:00
Thomas S Hatch
66ae9bcc67 Merge pull request #3080 from vlaci/master
'status.procs' function implementation and tests for windows
2012-12-30 20:03:07 -08:00
László Vaskó
ecef344c61 Added 'status.procs' function for windows 2012-12-31 01:34:38 +01:00
Pedro Algarvio
d8d9d14d5a Fix the stateconf unit test. Refs #1775 2012-12-29 22:19:17 +00:00
Ryan Schneider
8f8cc74b34 Some minor cleanup of unit and integration tests. 2012-12-18 17:39:16 -08:00
Thomas S Hatch
9d427c868d Merge pull request #2861 from s0undt3ch/hotfix/headers
Header updates. More copyright to the SaltSatck team. Code author to me(where applicable).
2012-12-11 04:50:37 -08:00
Pedro Algarvio
64a0d631e1 Fix rvm unit tests. 2012-12-11 11:27:21 +00: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
8d092afddc Don't assume digits in logging format strings. Refs #2859, fixes #2853.
Sorry @ryanschneider for stepping in on your fix.

Nothing is assumed now, and several checks are made. If any of the checks fail, nothing else is done in `salt.log.Logging.__new__()`.
Added a test case which will take care of possible regressions on this bug fix.
2012-12-11 10:10:03 +00:00
Henrik Holmboe
5bcce96761 Update import in unit test.
https://travis-ci.org/holmboe/salt/jobs/3563157
2012-12-08 10:37:26 +01:00
Henrik Holmboe
a607016198 Update import in unit test.
https://travis-ci.org/holmboe/salt/jobs/3563086
2012-12-08 09:44:51 +01:00
Jeroen Dekkers
c123d8f824 Preserve the final newline in Jinja templates 2012-12-02 19:45:09 +01:00
Jack Kuan
190f4bd828 Fix a case when a single shorthand state is declared without arguments.
Also, now automatically adds the name argument, if one is not provided,
for states declared under a dot-prefixed state id.
2012-11-18 22:02:24 -05:00
Pedro Algarvio
c5fe83272f Even more open() to salt.utils.fopen(). 2012-11-18 18:57:10 +00:00
Pedro Algarvio
bed55506c3 Proper OrderedDict check. 2012-11-17 01:19:37 +00:00
Pedro Algarvio
89fd313766 Fix stateconf test failing in 2.6 because OrderedDict was not available. 2012-11-16 22:45:12 +00:00
John Debs
4a062f1e69 Logic and test fixes for version, ri, rdoc support in gem state 2012-11-15 18:05:06 -05:00
Thomas S Hatch
326904e020 An easy fix on opening files 2012-11-13 20:55:40 -07:00
Jack Kuan
7f3ac3fe89 Add some docs on render pipe.
Also, added a stateconf state so that its stateconf.set function
can be used by the stateconf renderer.
2012-11-13 02:01:34 -05:00
Jack Kuan
a76331e0e1 Merge branch 'develop' of github.com:saltstack/salt into develop 2012-11-13 00:58:04 -05:00
Thomas S Hatch
6fce0a2353 Minor fixes for stateconf tests and sting updates 2012-11-12 22:20:37 -07:00
Jack Kuan
db451d5ed3 Update jinja template unit tests and remove obsolete salt.utils.jinja.get_template(). 2012-11-12 17:08:14 -05:00
Jack Kuan
7ad98acfb4 Fix stateconf unit test and the problem with sls_dir==''. 2012-11-12 00:50:46 -05:00
Jack Kuan
8cb70d0a6e Update stateconf renderer module doc and revert names declaration support. 2012-11-12 00:16:03 -05:00
Jack Kuan
f1c49d6efd Minor update to a test case. 2012-11-08 02:00:54 -05:00
Jack Kuan
f921e91377 Add unit tests for the stateconf renderer.
Also fixed a few bugs in the stateconf renderer.
2012-11-08 01:46:03 -05: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
Morgan Fainberg
7800157e37 Fix the test for jinja, local (non salt:// files) now can support {% include %} 2012-09-27 14:55:55 -07: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
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
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
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
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
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
Jeroen Dekkers
92ffbaba6e Be compatible with mock 0.7 2012-06-19 02:19:03 +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
L.C. Rees
140e8781df - py3k updates 2012-05-31 23:31:27 -06:00
Dan Colish
f5c8e242e4 Refactor runtests to allow dotted path module discovery.
In addition to traditional file system path test discovery it is
useful to run a test by stating it's dotted python path. For example,
this will only run the cmdmod integration tests from the
module suite::

        $ runtests.py -n tests.integration.modules.cmdmod
2012-05-29 19:56:47 -07:00
Baiju Muthukadan
24bb4ea4e0 Fix PEP8 warnings for test cases 2012-05-29 22:10:20 +05:30
Jeff Schroeder
6f836afafa Remove a few instances of hardcoded /tmp in code
tempfile.gettempdir() is way better. The gem and rvm states are
still failing, but only because they require the "mock" python
module for running their tests.
2012-05-09 21:29:05 -07:00
Anselm Helbig
d02f0beaee added proper unit tests for gem and rvm modules and states; fixed bugs in the rvm module's install function and in the rvm state's handling of ruby versions 2012-05-03 11:33:16 +02:00
Anselm Helbig
5bc9ea7d67 added preliminary unit tests for rvm module 2012-05-02 09:42:01 +02:00
Eivind Uggedal
ab7ace6aa5 Split out integration tests from pure unit tests.
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.
2012-02-20 13:18:13 +01:00