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
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
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
Max Arnold
3d4fcbe3aa
Add test for issue #48145
2018-06-15 23:48:14 +07: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
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
Ch3LL
48b5d2e9d3
Add timeout argument to run_salt for ShellCase
2018-06-14 16:19:33 -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
Erik Johnson
54f9a2ab54
Remove unused import
2018-06-13 21:11:14 -05:00
Erik Johnson
767cc7e87f
fix tabs
2018-06-13 21:10:30 -05:00
Erik Johnson
db19636f56
Get rid of additional newline append
...
This looks like it was just incorrectly done before. writelines()
expects you to take care of newlines yourself, so each element should
end in a newline. But we were doing two separate writes, one with the
key=value pair and one with a newline
2018-06-13 15:17:56 -05:00
Erik Johnson
7427e192ba
Fix more crappy mocking
2018-06-13 15:01:12 -05:00
Erik Johnson
4eaa5789ce
Fix crappy mocking
...
This mocking was poorly done, which was revealed when I made an EAFP
modification to _generate_minion_id().
2018-06-13 14:11:44 -05:00
twangboy
1ec3f436ee
Fix test_error_logged_if_process_get_owner_fails
2018-06-13 12:46:20 -06:00
twangboy
d26fc56f13
Use os.sep for paths
2018-06-13 12:04:37 -06:00
Gareth J. Greenaway
7c472fed51
Fixing failing test_set_hwclock_aix test.
2018-06-13 10:15:28 -07:00
Gareth J. Greenaway
ccb0acc958
Porting #47049 to 2017.7.
2018-06-13 10:15:28 -07:00
Erik Johnson
6fe711ad76
Reverse monkeypatching after test_symlink_list finishes
...
On Windows, in test_symlink_list we monkeypatch the file_roots. However,
we don't ever reverse that monkeypatching.
This would not have affected other test classes, because the opts we are
monkeypatching are ones created specifically for that test class. And
due to the lexicographic order in which the tests are run,
test_symlink_list is run last. However, if we were to ever add a test to
that test class which would run after test_symlink_list, it would be
affected by the monkeypatching.
2018-06-13 09:58:29 -05:00
Nicole Thomas
b10b7355a0
Merge pull request #48054 from rallytime/merge-2018.3
...
[2018.3] Merge forward from 2017.7 to 2018.3
2018-06-13 08:58:45 -04:00
Erik Johnson
248467edac
Add regression test for _generate_minion_id()
2018-06-13 01:13:43 -05:00
Erik Johnson
e6a4744f85
Use errno instead of hard-coding error 2
2018-06-13 01:11:55 -05:00
Erik Johnson
ff63f36932
Fixes / enhancements for mock_open
...
This makes the following changes:
1. Now works properly when read_data is a bytestring
2. Now works properly when mocked filehandle is iterated (e.g. `for line in fh:`)
3. Adds ability to make mocked filehandle raise an IOError when the path
being opened doesn't match a pattern (or one of a list of patterns).
2018-06-13 01:05:44 -05:00
twangboy
0e99dd741c
Fix logic for non-root
2018-06-12 17:45:19 -06:00
twangboy
2d2534a688
Fix parsers for Windows, fix tests
2018-06-12 17:26:40 -06:00
Daniel Wallace
d8c035e5e5
mark test as expensive
...
This tests takes a large amount of cpu to run, and is causing tests to
hang.
Mark it as an expensive test so it only runs with the cloud tests.
2018-06-11 16:08:10 -05:00
rallytime
508d70fabf
Update old utils paths to use new paths
2018-06-11 11:49:10 -04:00
rallytime
3d2ea16c3a
Merge branch '2017.7' into '2018.3'
...
Conflicts:
- requirements/base.txt
- salt/states/archive.py
- salt/states/file.py
- tests/integration/runners/test_state.py
- tests/unit/daemons/test_masterapi.py
2018-06-11 11:45:37 -04:00
Erik Johnson
b33a0b5eaa
Switch to trace level logging for further test failure troubleshooting
2018-06-08 17:06:49 -05:00
Nicole Thomas
871a910fcb
Merge pull request #48009 from dwoz/winswarmfix
...
minionswarm runs on windows
2018-06-08 09:52:35 -04:00
Mike Place
ea85f882bc
Merge pull request #47915 from garethgreenaway/state_runner_pause_resume_kill
...
[2018.3] state runner pause resume kill
2018-06-07 10:08:29 -06:00
Gareth J. Greenaway
f457f9cb84
Adding a test to ensure archive.list returns the right results when a tar file contains a file with unicode in it's name.
2018-06-06 21:23:28 -07:00
Nicole Thomas
0dcaead36d
Merge pull request #47968 from gtmanfred/2017.7
...
Clean up tox + pytest
2018-06-06 17:23:51 -04:00
Daniel A Wozniak
5027c7bb84
minionswarm runs on windows
2018-06-06 14:19:16 -07:00
Gareth J. Greenaway
4377e0cc08
Some fixes to the set_pause and rm_pause function in the state runner, renaming to in line with the functions in the state module. Including aliases to previous names for back-ward compatibility. Including a soft_kill function to kill running orchestration states. A new test to test soft_kill functionality.
2018-06-06 13:52:45 -07:00
Daniel Wozniak
1ce7d6c38a
Merge pull request #47989 from dwoz/awscloud
...
Properly decode password from aws using m2crypto
2018-06-06 13:44:28 -07:00
Nicole Thomas
76068c83f5
Merge pull request #47976 from terminalmage/salt-jenkins-1000
...
Capture and log output of processes that timed out and were killed
2018-06-06 15:17:08 -04:00
Nicole Thomas
42dd6b83eb
Merge pull request #47978 from twangboy/fix_test_pkg
...
Add try/finally, fix typo in 7zip def file
2018-06-06 15:06:03 -04:00
Nicole Thomas
a67b21ef3d
Merge pull request #47959 from twangboy/fix_test_service
...
Fix failing test when service doesn't exist
2018-06-06 15:05:42 -04:00
Daniel Wallace
8d15b93d00
remove tox virtualenvs from doc tests
2018-06-06 12:22:22 -05:00
Daniel A. Wozniak
23ab2727be
Fix linter errors
2018-06-06 09:43:04 -07:00
Gareth J. Greenaway
7b7fb1f5d5
Adding missing test sls file.
2018-06-06 09:00:42 -07:00
Gareth J. Greenaway
54e51bc627
Backporting #47843 to 2017.7, updating test for 2017.7.
2018-06-06 09:00:42 -07:00