Commit Graph

731 Commits

Author SHA1 Message Date
Erik Johnson
93ee5ee2b0
Fix all Sphinx warnings
Well, all but one, which we expect to see
2018-05-31 15:28:25 -05:00
Daniel A. Wozniak
94a70e847a
Ignore gitfs tests when symlinks not enabled 2018-04-26 23:51:28 -07:00
Benjamin Drung
a3c54b50f6 Fix various spelling mistakes
lintian found various spelling mistakes.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-03-08 15:25:42 +01:00
Erik Johnson
85ac6a9893
yamlify_arg: don't treat leading dashes as lists
We had a similar check to ensure "foo: bar" isn't loaded as a dict, this
adds a check to ensure that we only load lists when there is a leading
bracket.
2018-03-03 15:02:12 -06:00
Nicole Thomas
edcb64de76
Merge pull request #45763 from twangboy/win_fix_path_rehash
Fix rehash function in win_path.py
2018-02-15 15:05:15 -05:00
Erik Johnson
89cbd72a0d
Don't try to sort ports when translating docker input
This sorting was done mainly for the benefit of the test suite, but
Python 3 will raise an error when you try to sort a mixture of int and
tuple types, so sorting breaks down when there are UDP ports.

Instead, this just leaves them as an unsorted list when passed to the
API, and the test suite does the sorting before the assertEqual.
2018-02-09 11:33:10 -06:00
Erik Johnson
9cd47b39dd
Fix incorrect translation of docker port_bindings -> ports
The logic which ensures that we expose ports which are being bound,
even when not explicitly configured, was done incorrectly. UDP ports
were being passed to the API as '1234/udp' instead of (1234, 'udp').
This results in the port not being exposed properly.

The logic has been corrected. Additionally both the "ports" input
translation function, as well as the post-processing code (where the
port numbers configured in port_bindings were being added) both
contained code to "fix" any ports which were configured using
'portnum/tcp', as these must be passed to the API simply as integers. To
reduce code duplication, this normalization is now only performed at the
very end of the post-processing function, after ports have been
translated, and any missing ports from the port_bindings have been
added.

The unit test for the port_bindings input translation code, which was
written based upon the same incorrect reading of the API docs that
resulted in the incorrect behavior, have been updated to confirm the
(now) correct behavior. The unit test for the ports input translation
code has been updated to reflect the new normalization behavior.

Finally, an integration test has been added to ensure that we properly
expose UDP ports which are added as part of the post-processing
function.
2018-02-08 23:23:43 -06:00
twangboy
29912adc15
Move the test_rehash test to test_win_functions 2018-02-08 17:44:30 -07:00
William Villeneuve
217791079b some code cleanup (lint errors and escape_argument as _cmd_quote) 2018-01-28 12:42:33 -05:00
William Villeneuve
1c29bc5a3d fixed quoting of script path in cmd.script 2018-01-26 09:05:18 -05:00
Daniel Wallace
0cd95d1cc6
fix test boto imports
Test boto imports are failing for some reason
2018-01-13 15:01:14 -05:00
rallytime
8025b14584
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/unit/utils/test_parsers.py
2018-01-04 17:37:48 -05:00
rallytime
68f971b38f
Apply test fixes from #45034 to parsers_test.py 2018-01-03 15:10:04 -05:00
twangboy
40665d7b08
Skip test_log_created on Windows 2017-12-13 14:12:07 -07:00
Ch3LL
3bb58fb577
skip salt-key log creation test 2017-12-11 10:59:10 -05:00
Ch3LL
6a379195bc
Add test to ensure log files are created 2017-12-07 17:31:26 -05:00
twangboy
a5737e8fc3
Fix lint errors 2017-12-01 16:45:18 -07:00
twangboy
be96de09cc
Fix pickling error by decorating 2017-12-01 16:45:18 -07:00
Denys Havrysh
d1f247e49e
Add basic unit tests for schedule util eval func 2017-11-30 12:43:52 +02:00
twangboy
47114fdb30
Pass root_dirs to the win_verify_env function
Remove while loop that was hanging when `salt` wasn't in the path
Add salt.util.path.safe_path function to check for unsafe paths
Pass root_dir to all calls to `verify_env`
2017-11-13 13:05:23 -07:00
twangboy
2f30ad93b1
Skips mode check in Windows 2017-11-10 14:29:10 -07:00
Nicole Thomas
9fe94d7843 Merge pull request #44098 from twangboy/win_mock_test_parsers
Return multiprocessing queue in LogSetupMock class
2017-10-16 14:14:29 -04:00
twangboy
caf086c05a
Skip Master, Minion, and Syndic parser tests 2017-10-13 16:02:01 -06:00
twangboy
cc43ca27af
Return multiprocessing queue in LogSetupMock class 2017-10-13 15:47:19 -06:00
Erik Johnson
92e05cf1c0
Don't allow path separators in minion ID 2017-10-10 11:03:29 -04:00
Erik Johnson
19481423dd
Don't allow path separators in minion ID 2017-10-10 10:58:42 -04:00
twangboy
254dac7723
Fix unit.utils.test_utils for Windows
Use os agnostic path seps
Mock sys.platform to not return win
2017-10-05 16:47:32 -06:00
rallytime
cbae45bec4
Lint: Remove extra line at end of file 2017-09-22 10:33:10 -04:00
rallytime
fca4e5563a
Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/win_pkg.py
  - tests/unit/utils/test_parsers.py
2017-09-22 09:40:03 -04:00
Mike Place
e6dc4d64df Merge pull request #43314 from twangboy/win_fix_unit.utils.test_verify
Fix `unit.utils.test_verify` for Windows
2017-09-21 16:26:12 -06:00
Jochen Breuer
96f39a420b Fixed linting
Fix for "String format call with un-indexed curly braces".
2017-09-20 16:35:01 +02:00
Jochen Breuer
08fba98735 Fixed several issues with the test
* Removed redundant import.
* No longer inheriting from LogSettingsParserTests.
* Replaced test class description with somethin meaninful.
* Fixed identation.

I've also moved the class to the bottom, since all the classes inheriting
from LogSettingsParserTests are in the block above.
2017-09-20 15:37:24 +02:00
Jochen Breuer
3a089e450f Added tests for pid-file deletion in DaemonMixIn
This is a follow up on this PR:
https://github.com/saltstack/salt/pull/43366

Since we can get an OSError durin PIDfile deletion with non-root users, it
would make sense to also test for this. So here are the two test cases.
One with an OSError and the other one without.
2017-09-20 14:34:30 +02:00
Erik Johnson
4243a2211d Rewrite the reactor unit tests
These have been skipped for a while now because they didn't work
correctly. The old tests have been scrapped in favor of new ones that
test both the old and new config schema.
2017-09-13 10:35:23 -05:00
twangboy
c0dc3f73ef Use sys.platform instead of salt.utils to detect Windows 2017-09-11 12:22:06 -06:00
twangboy
e496d28cbf Fix unit.utils.test_verify for Windows
Use Windows api to get and set the maxstdio
Change messages to work with Windows
2017-09-11 12:22:06 -06:00
Erik Johnson
53bd3a3e23 Improve inheritance in salt.utils.gitfs
This makes the following changes:

1. Renames the valid_providers param in GitBase to git_providers,
   allowing for a dictionary mapping provider names to their associated
   classes. This allows for alternate providers to be used with a
   GitBase subclass.
2. Renames the get_provider function to verify_provider to reduce
   confusion with git_providers.
3. Uses super() to run a parent class' dunder init instead of invoking
   the parent class directly.
2017-08-28 21:49:42 -05:00
Mike Place
03f652159f Merge pull request #43123 from twangboy/win_fix_test_which
Fix `unit.utils.test_which` for Windows
2017-08-23 10:01:38 -06:00
Nicole Thomas
0467a0e3bf Merge pull request #43038 from twangboy/win_unit_utils_test_url
Fix `unit.utils.test_url` for Windows
2017-08-23 09:35:24 -04:00
twangboy
ed97cff5f6 Fix unit.utils.test_which for Windows
This test wasn't really written with Windows in mind. Uses PATHEXT that
actually resembles a Windows environment. The test value has the correct
path seperator for Windows.
2017-08-22 16:59:22 -06:00
Mike Place
19fc644c9b Merge pull request #43024 from twangboy/win_unit_utils_test_find
Fix `unit.utils.test_find` for Windows
2017-08-21 16:38:09 -06:00
rallytime
84829a6f8c Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/jenkins.py
  - salt/states/jenkins.py
2017-08-18 09:13:54 -04:00
twangboy
fbe54c9a33 Remove unused import six (lint) 2017-08-17 15:54:38 -06:00
twangboy
7f5ee55f57 Fix unit.utils.test_url for Windows
Detect escaped urls in Windows
Unescape urls in Windows
Fix tests to deal with sanitized Windows paths
2017-08-17 14:20:25 -06:00
twangboy
b04d1a2f18 Fix unit.utils.test_find for Windows
Fix skipIf statements
Use sys.maxsize instead of sys.maxint
2017-08-17 11:55:00 -06:00
Erik Johnson
4089b7b1bc Use socket.AF_INET6 to get the correct value instead of doing an OS check
This builds on #43014 with a more future-proof solution.
2017-08-17 12:12:27 -05:00
Ch3LL
b8eee4401e Change AF_INET6 family for mac in test_host_to_ips 2017-08-17 10:55:53 -04:00
Nicole Thomas
47ff9d5627 Merge pull request #42812 from terminalmage/yaml-loader-tests
Update custom YAML loader tests to properly test unicode literals
2017-08-15 13:50:22 -04:00
Erik Johnson
9d8486a894 Add test for custom YAML loader with unicode literal strings 2017-08-15 11:06:20 -05:00
Erik Johnson
a0118bcece Remove bytestrings and use textwrap.dedent for readability
PyYAML works with and without bytestrings on PY3, and Python 3 can read
all of the test data as regular strings, so bytestrings are unnecessary
here.

This also adds use of textwrap.dedent to make the YAML easier to read,
so it can be indented away from the far left side of the line.
2017-08-15 11:05:48 -05:00