Daniel A Wozniak
fc760685ee
Fix multiple git module tests
2018-06-27 18:28:58 -07:00
Nicole Thomas
34b24bb7fa
Merge branch '2018.3' into issue47937
2018-06-27 13:41:34 -04:00
Erik Johnson
c636b18cf0
Add unit test for tojson filter
2018-06-27 12:23:29 -05:00
Nicole Thomas
21ed5b97ce
Merge pull request #48295 from rallytime/bp-48193
...
Back-port #48193 to 2017.7
2018-06-26 19:42:17 -04:00
Nicole Thomas
caf630487c
Merge pull request #48207 from rallytime/bp-48189
...
Back-port #48189 to 2017.7
2018-06-25 15:26:55 -04:00
rallytime
1c8bd35f28
Update old utils paths to use new utils paths
2018-06-25 10:45:24 -04:00
rallytime
c7bb8a50b0
Merge branch '2017.7' into '2018.3'
...
Conflicts:
- salt/modules/x509.py
- salt/runners/cloud.py
- tests/unit/modules/test_state.py
2018-06-25 10:41:06 -04:00
Thomas Jackson
c0180ff33d
Properly configure syndic in test case
...
Without this option we aren't really a syndic and it won't wait
2018-06-25 10:26:30 -04:00
rallytime
e9d09e0375
Use old is_windows utils path on 2017.7
2018-06-25 10:06:37 -04:00
Nicole Thomas
3327181507
Merge pull request #48234 from dwoz/thin_dir
...
Fix py2 thin dir issues
2018-06-25 09:33:01 -04:00
Nicole Thomas
27a0e95174
Merge pull request #48279 from terminalmage/mock_open-docs
...
Add documentation/further enhancements to rewritten mock_open
2018-06-25 09:12:29 -04:00
Gareth J. Greenaway
aea4f7ae14
Fixing test_local_batch
2018-06-24 16:03:47 -07:00
Erik Johnson
830a624ce8
Ignore IOError when tearing down filehandles not opened for reading
2018-06-23 21:28:34 -05:00
Erik Johnson
3b6356f4b0
Raise TypeError when trying to read from filehandles not opened for reading
2018-06-23 21:27:58 -05:00
Erik Johnson
a13d1fe1a0
Update mock_open usage to reflect read_data type enforcement
2018-06-23 15:04:47 -05:00
Erik Johnson
374a8ce31f
Add more mock_open tests
2018-06-23 15:04:24 -05:00
Erik Johnson
0f06adb008
Improve code-reuse in mock_open tests
2018-06-23 15:04:06 -05:00
Erik Johnson
0e8c83bac6
2 MockFH enhancements:
...
1. Raise appropriate TypeErrors when wrong type is written
2. Don't raise exception about read_data unless we actually try to read
from the filehandle. This makes it a bit more permissive when testing
code where the file is only being written to.
2018-06-23 15:00:26 -05:00
Gareth J. Greenaway
ce3e1eaf2c
Removing sort.
2018-06-23 11:25:46 -07:00
Gareth J. Greenaway
83accf3b20
Fixing test_local_batch
2018-06-22 12:19:41 -07:00
Gareth J. Greenaway
85cef126e0
Adding note about why salt.utils.versions is being re-imported. Adding a test for local_batch.
2018-06-22 12:19:40 -07:00
Nicole Thomas
09b036c26e
Merge pull request #48228 from garethgreenaway/48204_mysql_user_password_exception
...
[2018.3] Fixes to mysql module
2018-06-22 11:43:59 -04:00
Nicole Thomas
731ec0a11a
Merge pull request #48037 from terminalmage/fix-custom-types-sync-docs
...
Add "sync_mods" argument to state.apply/state.sls
2018-06-21 15:57:02 -04:00
rallytime
84ec655c24
Merge branch '2017.7' into '2018.3'
...
Conflicts:
- doc/ref/configuration/minion.rst
- salt/minion.py
- salt/modules/dockermod.py
- salt/modules/lxc.py
- salt/utils/__init__.py
- tests/unit/modules/test_mount.py
2018-06-21 14:22:15 -04:00
Nicole Thomas
51928ff050
Merge pull request #48166 from terminalmage/salt-jenkins-1000
...
Add trace logging and optimize file handling in grains.core.os_data
2018-06-21 14:02:32 -04:00
Erik Johnson
8b1bd0eda2
Update test to reflect changed argument name
2018-06-21 11:39:12 -05:00
Daniel A. Wozniak
70c603451b
Fix py2 thin dir issues
2018-06-20 17:16:30 -07:00
Gareth J. Greenaway
1b2ffcef1d
Updating the mysql module to not use the PASSWORD when MySQL is version 8.0.11 or higher, where the PASSWORD function has been removed.
2018-06-20 11:41:14 -07:00
Ch3LL
236773e3e9
Skip new sha256 files on repo.saltstack.com/windows
2018-06-20 14:28:31 -04:00
Nicole Thomas
6072d1ef9c
Merge pull request #48216 from Ch3LL/grains_unicode
...
Fix UnicodeDecodeError when reading file to determine virtual grain
2018-06-20 12:53:40 -04:00
Nicole Thomas
de614d31f5
Merge pull request #48209 from rallytime/bp-47986
...
Back-port #47986 to 2018.3
2018-06-20 09:44:16 -04:00
Ch3LL
c4334f3f14
Fix UnicodeDecodeError when reading file to determine virtual grain
2018-06-19 16:38:28 -04:00
rallytime
dae65da256
Merge branch '2018.3.1' into '2018.3'
2018-06-19 14:56:06 -04:00
J. Eduardo
f4b3bd5d2c
Changed salt.utils.fopen to salt.utils.files.fopen
2018-06-19 14:30:54 -04:00
J. Eduardo
8686872909
Fixed typos, removed repeated unit tests, and applied code fixes suggested by linter.
2018-06-19 14:30:48 -04:00
J. Eduardo
5aa99d14c4
Added unit tests for CRL creation and certificate revocation with CRL
2018-06-19 14:30:38 -04:00
Daniel Wallace
b965d6c9b3
If pip binary is passed to bin_env, use that pip binary
...
We don't need to do a lookup for python to then run `python -m pip`
because we already know where pip is.
Fixes using /bin/pip3
Fixes #48122
2018-06-19 14:09:11 -04:00
Nicole Thomas
96f79b0674
Merge pull request #48189 from gtmanfred/pip
...
If pip binary is passed to bin_env, use that pip binary
2018-06-19 14:08:12 -04:00
Nicole Thomas
71e385501b
Merge pull request #48165 from terminalmage/issue48144
...
Fix regression with top_file_merging_strategy=same
2018-06-19 14:03:06 -04:00
Erik Johnson
b73df0ab00
Change call_args to call.args to reflect changes to MockFH
2018-06-18 16:57:51 -05:00
Erik Johnson
0c2cc07704
remove unused import
2018-06-18 16:55:19 -05:00
Nicole Thomas
e079fce38d
Merge pull request #48190 from terminalmage/fix-vfstab-test
...
Fix mount.vfstab unit test
2018-06-18 17:47:54 -04:00
Erik Johnson
b8c0a55cf3
Add test for tell()
2018-06-18 16:24:44 -05:00
Erik Johnson
1cbe89feee
Implement tell() for filehandle iteration
2018-06-18 16:23:35 -05:00
Daniel Wallace
96c59f3d93
If pip binary is passed to bin_env, use that pip binary
...
We don't need to do a lookup for python to then run `python -m pip`
because we already know where pip is.
Fixes using /bin/pip3
Fixes #48122
2018-06-18 16:21:58 -05:00
Erik Johnson
efb8f49d42
Add tests for read_data being a list, and containing unicode or bytestrings
2018-06-18 14:48:53 -05:00
Erik Johnson
38df912fa6
Operate on a copy of the read_data
...
This keeps us from mangling it if it contains lists, which we would be
popping items off of. We don't want to pop items from the list that was
passed in.
2018-06-18 14:45:40 -05:00
Erik Johnson
71eeae1240
Update mount module unit tests to reflect changes in mock_open
2018-06-18 13:39:52 -05:00
Erik Johnson
8d70d14362
Fix mount.vfstab unit test
...
This test was calling mount.fstab() instead of mount.vfstab()
2018-06-18 13:21:40 -05:00
Erik Johnson
16c414e120
Update nfs3 module tests to reflect changes in mock_open
2018-06-18 12:28:38 -05:00
Erik Johnson
b7eab25d6c
Update grub_legacy module tests to reflect changes in mock_open
2018-06-18 12:21:33 -05:00
Erik Johnson
cc002b8fd7
Update new network unit test to reflect changes in mock_open
2018-06-18 12:13:49 -05:00
Erik Johnson
a8f11594f1
Update new core grains tests to reflect changes in mock_open
2018-06-18 11:53:59 -05:00
Erik Johnson
84ce18d956
Update crypt unit tests to reflect changes in mock_open
2018-06-18 10:38:53 -05:00
Erik Johnson
67c036dc2d
Add MockCall to tests.support.mock to track calls
2018-06-18 10:34:33 -05:00
Alexey Aksenov
9ed2d2ec55
Fix integration.shell.test_key and integration.shell.test_runner
2018-06-18 17:39:35 +03:00
Alexey Aksenov
26a6f79730
Fix integration tests test_list_acc_wrong_eauth, test_salt_run_with_wrong_eauth
2018-06-18 17:39:23 +03:00
Erik Johnson
2556a1e13d
Remove unused import
2018-06-18 07:23:52 -05:00
Erik Johnson
fd9d700157
Add additional docs to MockOpen class
2018-06-18 00:28:06 -05:00
Erik Johnson
6acb4c83ec
Update newly added test to reflect renaming of handles attribute
2018-06-18 00:22:43 -05:00
Erik Johnson
77e5288d42
Update fibre_channel grains tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
ed40371a06
Update timezone module tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
fc0aa9934f
Track call_count in MockOpen
2018-06-18 00:21:26 -05:00
Erik Johnson
2598d2453a
Update snapper module tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
51b3faa7b4
Add support for passing multiple strings for a given match in read_data
2018-06-18 00:21:26 -05:00
Erik Johnson
55487c175c
Fix mock_open call to use new multifile syntax
2018-06-18 00:21:26 -05:00
Erik Johnson
7f516ef73a
Update puppet module tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
33a97c4ecc
Update btmp beacon tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
bc027cfa94
Update wtmp beacon tests to reflect changes in mock_open
2018-06-18 00:21:26 -05:00
Erik Johnson
f5823252bb
Track call args/kwargs in MockFH
...
This allows for them to be verified in tests
2018-06-18 00:21:25 -05:00
Erik Johnson
335591ca90
Mock the seek function in MockFH
2018-06-18 00:21:25 -05:00
Erik Johnson
7eb4b1ae1c
Update cp.push test to reflect changes to mock_open
2018-06-18 00:21:25 -05:00
Erik Johnson
2be19cfa89
Report correct location when reading using explicit size and EOF reached
2018-06-18 00:21:25 -05:00
Erik Johnson
5ec95ba5ca
On second thought, actually implement tell()
2018-06-18 00:21:25 -05:00
Erik Johnson
19022eb9e5
Add tell mock to MockFH
2018-06-18 00:21:25 -05:00
Erik Johnson
4b5a393445
Update junos tests to reflect changes to mock_open
2018-06-18 00:21:25 -05:00
Erik Johnson
278a222b09
Update dnsutil tests to reflect changes to mock_open
2018-06-18 00:21:25 -05:00
Erik Johnson
4e67955572
Replace the rest of mock_open with a class
2018-06-18 00:21:25 -05:00
Erik Johnson
75307a47c5
Update linux_sysctl tests to reflect changes to mock_open
2018-06-18 00:21:25 -05:00
Erik Johnson
05c68fd5d9
Use explicit config file and fix remaining mac_sysctl tests
...
This updates test_persist_success to work with the new mocked filehandle
support. Additionally, it fixes incorrect invocation of
`mac_sysctl.persist()`; the `config` argument is supposed to be a file
path, not a string config text.
2018-06-18 00:21:25 -05:00
Erik Johnson
836fde9a30
Allow Python 2 to accept an exception as read_data
2018-06-18 00:21:25 -05:00
Erik Johnson
543385fd02
Add writelines_calls property
2018-06-18 00:21:25 -05:00
Erik Johnson
42fa842456
Make read funcs mocks so their calls can be tracked
...
Also add a property func as a shorthand to return all the write calls
for a given filehandle.
2018-06-18 00:21:25 -05:00
Erik Johnson
675f03c58f
Update mac_sysctl tests to reflect new mock_open behavior
2018-06-18 00:21:24 -05:00
Erik Johnson
3d2c41d395
Update file module tests to reflect new mock_open behavior
2018-06-18 00:21:24 -05:00
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
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
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
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
Erik Johnson
9af09e0127
Mock config.get due to changes in _refresh_mine_cache
2018-06-18 00:05:25 -05:00
Erik Johnson
d403ae58d7
Add unit test for docker.update_mine
2018-06-17 21:42:28 -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