Commit Graph

92957 Commits

Author SHA1 Message Date
Erik Johnson
b9200dbc3e
add a dict containing the handles to the mock_open return object
This allows tests to access the MockFH objects opened during the
execution of the unit test.
2018-06-18 00:16:03 -05:00
Erik Johnson
852ba4b982
Add mocked close() function to MockFH 2018-06-18 00:16:02 -05:00
Erik Johnson
f6b46bc608
Remove unused import 2018-06-18 00:16:02 -05:00
Erik Johnson
20f60a769b
Add blank lines to appease linter 2018-06-18 00:16:02 -05:00
Erik Johnson
48d7cfa6d3
Add multifile tests for mock_open 2018-06-18 00:16:02 -05:00
Erik Johnson
1861e9b944
mock_open: rewrite multi-file support
The initial approach tied all opened files to the same mocked
filehandle. This new approach moves all the read functions into a class,
and then uses a separate instance of that class for each opened file.
2018-06-18 00:16:02 -05:00
Erik Johnson
5e6b539770
Use function for empty string
Missed this when making changes for multi-file support
2018-06-18 00:16:02 -05:00
Erik Johnson
cb2620ad2b
Update core grains tests to reflect EAFP changes 2018-06-18 00:16:02 -05:00
Erik Johnson
5d09b178d7
Separate mocked file contents per filename, not glob
This allows for multiple opens of a file matching the same glob.
Otherwise, subsequent opens would already be at EOF.
2018-06-18 00:16:02 -05:00
Erik Johnson
875102f538
Modify mock_open to support multiple file paths 2018-06-18 00:16:02 -05:00
Erik Johnson
096ace74df
Move lsb_release parsing into its own function
This makes mocking easier in the unit tests, and follows the convention
used for parsing the os-release file.
2018-06-18 00:16:02 -05:00
Erik Johnson
6a0828beed
Add unit tests for mock_open 2018-06-18 00:16:02 -05:00
Erik Johnson
8ba6cadac7
More mock_open bugfixes
This makes readline() a regular function and not an iterator. It also
makes the different side_effect functions all operate on the same
generator representing the file contents, and adds support for reading
an explicit amount of bytes from the file. The side effect functions can
now be run one after another and the mocked filehandle will work
properly.
2018-06-18 00:16:02 -05:00
Erik Johnson
329dea218e
Add a bunch of logging for linux os_data core grains
Also removed a couple isfile checks and replaced them with try/except
clauses. EAFP.
2018-06-18 00:16:02 -05:00
Erik Johnson
2c64b270df
Add timestamp to the minion's log_fmt_console
This makes salt-call show timestamps in stdout/stderr when run from
integration tests (e.g. in ShellCase.run_script).
2018-06-18 00:16:02 -05:00
Nicole Thomas
85ebcbd3f2
Merge pull request #48156 from garethgreenaway/48113_ensure_writing_strings_with_file_dot_line
[2018.3] Unicode fixes for file.line
2018-06-17 15:34:07 -04:00
Nicole Thomas
33400e72db
Merge pull request #48161 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-06-17 15:33:28 -04:00
rallytime
0733fa1b02
Update utils path for which function to new path 2018-06-15 16:54:16 -04:00
rallytime
398cc78224
Merge branch '2017.7' into '2018.3'
Conflicts:
  - .kitchen.yml
  - doc/topics/releases/2017.7.6.rst
  - salt/modules/timezone.py
  - tests/support/case.py
  - tests/unit/modules/test_timezone.py
2018-06-15 16:51:45 -04:00
Nicole Thomas
9aa9a83b10
Merge pull request #48155 from max-arnold/2018.3
Do not fail on empty saltclass classes (fix for #48145)
2018-06-15 16:21:27 -04:00
Gareth J. Greenaway
5a9ef0d1ae
Unless we're using py2 and Windows, ensure we're writing out a string when using file.line. 2018-06-15 11:38:31 -07:00
Nicole Thomas
df2a156338
Merge pull request #48061 from garethgreenaway/port_47049_2017_7
[2017.7] Porting #47049 to 2017.7.
2018-06-15 13:15:49 -04:00
Nicole Thomas
152c09cc0c
Merge pull request #48104 from twangboy/fix_test_win_status
Fix `unit.modules.test_win_status`
2018-06-15 13:05:33 -04:00
Nicole Thomas
5ec3cf2dd4
Merge pull request #48143 from Ch3LL/fix_long_job
Add timeout argument to run_salt for ShellCase
2018-06-15 13:04:56 -04:00
Nicole Thomas
8cf03110d4
Merge pull request #48147 from brejoc/2018.3-multi-version-fix
Fix for sorting of multi-version packages
2018-06-15 13:03:17 -04:00
Max Arnold
63ab02c648 Do not fail on empty saltclass classes declaration #48145 2018-06-15 23:49:13 +07:00
Max Arnold
3d4fcbe3aa Add test for issue #48145 2018-06-15 23:48:14 +07:00
Nicole Thomas
2edc5f5442
Merge pull request #47956 from dmurphy18/aix_mount_support
Improved support for mount on AIX
2018-06-15 09:40:00 -04:00
Nicole Thomas
c05c176782
Merge pull request #48081 from terminalmage/issue48012
Fix UnicodeDecodeError when parsing hosts file with non-ascii
2018-06-15 08:41:12 -04:00
Jochen Breuer
90ed25447d
Swtiching to salt.utils.versions like linter suggested 2018-06-15 13:06:16 +02:00
Jochen Breuer
ed09574073
Fix for sorting of multi-version packages (bsc#1097174 and bsc#1097413) 2018-06-15 11:26:00 +02:00
Nicole Thomas
e1e566d1f8
Merge pull request #48135 from rallytime/release-notes-2017.7
Update the 2017.7.7 and 2017.7.8 release notes
2018-06-14 17:22:06 -04:00
Nicole Thomas
5d92e2763a
Merge pull request #48133 from rallytime/release-notes-2018.3
Updates the 2018.3.2 and 2018.3.3 release notes files
2018-06-14 17:21:14 -04:00
Erik Johnson
8d2fb0bf25
Fix cp.push test
mock_open now properly handles bytestrings, so the expected data needed
to be updated.
2018-06-14 15:23:54 -05:00
Erik Johnson
e230a7223f
Fix definition of test data for wtmp/btmp beacon tests
There is no need to do things differently on PY2 and PY3
2018-06-14 15:23:40 -05:00
Erik Johnson
82874a8c10
Import six like we do everywhere else 2018-06-14 15:20:56 -05:00
Ch3LL
48b5d2e9d3
Add timeout argument to run_salt for ShellCase 2018-06-14 16:19:33 -04:00
Nicole Thomas
ac9dabbfaa
Merge pull request #48105 from rallytime/merge-2017.7
[2017.7] Merge forward from 2017.7.6 to 2017.7
2018-06-14 13:00:08 -04:00
Nicole Thomas
0e3f846836
Merge pull request #48103 from terminalmage/gitfs-base-pinned-to-commit
Fix for gitfs base env being pinned to commit ID
2018-06-14 12:29:24 -04:00
Mike Place
4b6f1c7f75
Merge pull request #48077 from twangboy/fix_parsers
Fix issue with `salt.utils.parsers` on Windows
2018-06-14 18:22:56 +02:00
rallytime
7a97f157b3
Add missing v for tag reference 2018-06-14 12:10:18 -04:00
rallytime
2f2b69ed37
Add "in progress" notation to 2017.7.7 release notes 2018-06-14 12:08:47 -04:00
rallytime
06a1151a63
Add release notes file for 2017.7.7 2018-06-14 12:06:04 -04:00
rallytime
885b2862ce
Move 2017.7.7 release notes to 2017.7.8 2018-06-14 12:05:37 -04:00
rallytime
afe1e91972
Add "in progress" notation to 2018.3.2 release notes 2018-06-14 10:55:44 -04:00
rallytime
3e4272ac09
Add release notes for 2018.3.2 2018-06-14 10:53:40 -04:00
rallytime
88c584cb0d
Move 2018.3.2 release notes to 2018.3.3 2018-06-14 10:53:07 -04:00
Nicole Thomas
80332b32a7
Merge pull request #48096 from twangboy/fix_test_which
Fix `unit.utils.test_which` on Windows
2018-06-14 09:15:13 -04:00
Nicole Thomas
66b2200913
Merge pull request #48102 from rallytime/update-doc-refs-2018.3
[2018.3] Update 2018.3.2 references to 2018.3.3
2018-06-14 09:14:25 -04:00
Nicole Thomas
2da56a69d9
Merge pull request #48101 from rallytime/update-doc-refs-2017.7
[2017.7] Update 2017.7.7 reference to 2017.7.8
2018-06-14 09:14:08 -04:00