Commit Graph

67 Commits

Author SHA1 Message Date
Pedro Algarvio
d02a2bc224 Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
Pedro Algarvio
f0bf78cdc0 Correct the state test case and respective expected output. 2013-11-24 12:15:20 +00:00
Pedro Algarvio
a752421b87 Expose a copy of the state dictionary to state functions.
Fixes #8343 since `__sls__` is now available in `__state__` and not on `kwargs`.
Closes #8709 since it's not the right approach.
Fixes #8710 and closes #8711 since I've cherry-picked the fix for #8710 in from #8711.
2013-11-24 11:08:33 +00:00
Pedro Algarvio
54fc502de0 Some more saltenv related tests. 2013-11-12 06:29:55 +00:00
Mike Place
2e6bf21635 Integration testing for file.managed dir_mode argument.
Added documentation for dir_mode to file.managed.
2013-11-07 10:19:16 -07:00
Pedro Algarvio
c170d1e572 Updated test cases to include environment selection in states using __env__. 2013-11-06 20:04:54 +00:00
Henrik Holmboe
77fd1acb7f Change assertEquals to assertEqual
According to
http://docs.python.org/2/library/unittest.html#deprecated-aliases
assertEquals is a deprecated alias of assertEqual.
2013-10-24 11:39:04 +02:00
Seth House
ea657eed48 Added unit and integration tests for the file.replace functions 2013-09-20 17:01:57 -06:00
Pedro Algarvio
ae5d9f5038 Switched arguments in SaltReturnAssertsMixIn.assertNotInSaltComment() 2013-08-22 19:02:17 +01:00
Pedro Algarvio
b880af89e1 Switched arguments in SaltReturnAssertsMixIn.assertInSaltComment() 2013-08-22 19:02:17 +01:00
Pedro Algarvio
a75c24dd5f Updated integration.states.file test suite to use salttesting.helpers.ensure_in_syspath() 2013-06-28 00:13:02 +01:00
Pedro Algarvio
be54a503d9 Adapted code fix sys.path in case called from __main__. Adapted to salt-testing. 2013-06-28 00:12:56 +01:00
Christian Franke
e46276db16 Improve file.directory for clean=True
Handle exclude_pat when running with test=True and add
some tests to verify correct behavior.
2013-06-11 02:28:51 +02:00
Pedro Algarvio
55b166f38c Fix issues around salt.modules.file, salt.states.files and respective tests.
* Updated `salt.modules.file.makedirs` to properly work. Any path passed to this function should be a directory, ie, if `/tmp/foo/bar` is passed, `/tmp/foo/bar` should be a directory, not `/tmp/foo`.
* Since `salt.modules.file.makedirs` was updated, `salt.states.file.append` needed to be updated to pass the proper directory to create.
* Minor formatting change
2013-04-25 16:36:19 +01:00
Thomas S Hatch
a85d1d4da1 Add extra not to file path, another test is laying it down
which was breaking this one
2013-03-23 14:41:27 -06:00
Roberto Aguilar
9631a63cb6 Added show_diff kwarg to file.managed.
This can be set on a per-file basis so that potentially-sensitive
content can be omitted from logs.
2013-03-13 11:07:56 +00:00
Thomas S Hatch
a4ca7a5f6f Change to a symlink that does not exist 2013-03-11 23:44:31 -06:00
Pedro Algarvio
0bf51ba5b0 Allow a test to specify it's own run_function timeout. Increase timeout for some tests. 2013-01-14 14:07:58 +00:00
Pedro Algarvio
b210d59eb8 Migrated test.integration.states.file to use SaltReturnAssertsMixIn. 2012-12-07 16:25:26 +00:00
Pedro Algarvio
d4005bee3d We now warn the users about misusing mode in file.recurse. Fixes #2726.
* Extended `SaltReturnAssertsMixIn` by adding `assertNotInSaltComment`.
* Fixed minor `tab` instead of spaces in `salt.states.file` code.
2012-11-28 17:57:44 +00:00
Pedro Algarvio
c782eae106 Extended SaltReturnAssertsMixIn and included a test case which triggers #2726.
* Extended `SaltReturnAssertsMixIn`, `assertInSaltComment`, which allows to see if a string is in a salt's returned comment.
2012-11-28 17:35:25 +00:00
Pedro Algarvio
c5fe83272f Even more open() to salt.utils.fopen(). 2012-11-18 18:57:10 +00:00
Jack Kuan
0931455721 Merge branch 'develop', remote-tracking branch 'origin' into sls_render_pipe 2012-11-10 23:06:14 -05:00
Pedro Algarvio
b7c763dec1 Improve salt.utils.build_whitepace_splited_regex(). Fixes #2379.
* Although we're building a regex which should ignore white space and new lines, the built regex should always match start and end of string.
2012-11-08 19:33:51 +00:00
Jack Kuan
6c13f876b2 Merge branch 'develop', remote-tracking branch 'origin' into sls_render_pipe 2012-11-08 10:31:23 -05:00
Pedro Algarvio
b50e4cb9c5 Improve salt.utils.contains_regex(). Fixes #2401.
* When `re.search`'ing, do a `re.MULTILINE` search. Not all matches happen on first line, specially using the `BufferedReader`.
* PEP-8 fixes.
* Removed `rowname` from `salt.utils.mysql_to_dict()` since it was not being used.
2012-11-08 12:47:19 +00:00
Pedro Algarvio
e04c872c66 Convert the remaining tests hard-coding temporary paths. 2012-11-06 12:44:53 +00:00
Jack Kuan
f2d8c5cef3 Add yaml/json parsing to values of kwargs for state.single.
Also fixed an incorrect use sls_encoder in compile_template_str().
2012-11-06 01:26:08 -05:00
Antti Andreimann
7085edf590 Use file.managed as a backend of file.recurse. Fixes #1583
Rewrite file.recurse state module to leverage existing file.managed and file.directory
modules to do the heavy lifting. This removes code duplication and will make
templates available for file.recurse.

These improvements will be visible to the end-user:
- All files in directory can now be templatized
- destination directory is no longer created in test mode
- When clean mode is enabled, the module is capable of replacing
  existing files with directories and vice versa
2012-10-24 17:15:29 -07: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
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
8ab5e6e9c2 Include some test cases to expose saltstack/salt#2028 2012-09-18 01:53:05 +01:00
Pedro Algarvio
b3a03e391f Fix #1864 - Support makedirs to salt.states.file.append() 2012-08-28 12:05:50 +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
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
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
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
L.C. Rees
cc8a921311 - more py3k fixes 2012-06-04 16:40:34 -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
Baiju Muthukadan
24bb4ea4e0 Fix PEP8 warnings for test cases 2012-05-29 22:10:20 +05:30
Roman Imankulov
28ca4cb776 Fix file.comment/file.uncomment states
Function "file.contains_regex" used to search values from the beginning
of the line and thus couldn't find pattern "hello world" in a "#hello
world" string.
2012-05-25 12:38:57 +06:00
Baiju Muthukadan
fa3b39f071 remove trailing whitespaces 2012-05-13 19:48:05 +05:30
Thomas S Hatch
6897542aa2 test the test interface for file.touch state 2012-05-13 02:07:54 -06:00
Thomas S Hatch
e363cf0105 test for file.touch 2012-05-13 02:06:46 -06:00