salt/tests/support
Erik Johnson f9f187e915
Improve reliability/idempotence of file.blockreplace state
This makes the following changes:

- The `append_newline` argument to the `file.blockreplace`
  remote-execution function has been modified so that if its value is
  `None`, it only appends a newline when the content block does not end
  in one.
- A couple of fixes were made to newline handling. The existing code
  normalized the newlines in the content block, replacing them with
  os.linesep. However, when the file contains newlines that don't match
  the OS (i.e. POSIX newlines in a file on a Windows box, or Windows
  newlines on a Linux/Mac/BSD/etc. box), then we would still end up with
  mixed newlines. The line separator is now detected when we read in the
  original file, and the detected line separator is used when writing
  the content block. Additionally, the same newline mismatch was
  possible when appending/prepending the content block. This has been
  fixed by using a common function for appending, prepending, and
  replacing the content block.
- Support for the `append_newline` argument has been added to the
  `file.blockreplace` state. The default value for the state is `None`.
  A `versionchanged` has been added to the remote execution function to
  let users know that the Fluorine release will change the default value
  of that variable.
- 20 new integration tests have been written to test the
  `file.blockreplace` state.
2018-03-07 22:29:39 -06:00
..
ext Move whatever we need from salttesting to salt. 2017-02-28 22:52:49 +00:00
parser Fix unnecessary/incorrect usage of six.binary_type 2018-01-22 11:17:06 -06:00
__init__.py Moved some test supporting modules to tests/support 2017-02-28 22:52:48 +00:00
case.py Add spm -y and -f arg integration tests 2017-12-04 16:06:14 -05:00
cherrypy_testclasses.py Use setUpClass instead of __init__ 2017-04-28 13:33:37 +01:00
copyartifacts.py fix pylint 2017-12-21 10:40:54 -07:00
cptestcase.py Properly handle bytes 2017-03-08 18:34:33 +00:00
gitfs.py Pass the fingerprint_hash_type through for gitfs sshd tests 2017-05-11 12:29:51 -06:00
helpers.py Improve reliability/idempotence of file.blockreplace state 2018-03-07 22:29:39 -06:00
mixins.py Pass root_dirs to the win_verify_env function 2017-11-13 13:05:23 -07:00
mock.py handle bytes strings in mock_open 2017-06-15 22:43:40 -06:00
paths.py add saltutil.refresh_pillar test 2017-10-25 15:56:49 -04:00
processes.py Merge pull request #41617 from cro/n_proxy_tests 2017-06-15 12:07:29 -05:00
runtests.py add saltutil.refresh_pillar test 2017-10-25 15:56:49 -04:00
unit.py Fix usage of assert_called_once in Python 3 < 3.6 2017-07-03 09:30:12 -05:00
xmlunit.py Make sure runtests_engine is ASCII text 2017-06-05 17:30:28 -06:00