Commit Graph

12632 Commits

Author SHA1 Message Date
Bo Maryniuk
f00cf88c7b Fix unit test for socket data 2018-02-26 15:04:49 +01:00
Benjamin Drung
0b445f2a37 tests: Add unit tests for _parse_os_release()
Add tests cases to fully cover _parse_os_release().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:38:23 +01:00
Benjamin Drung
f6069b77ed Fix osfinger grain on Debian
Rework _run_os_grains_tests() to check all os grains including osfinger.
Fix osfinger on Debian (e.g. use "Debian-9" instead of
"Debian GNU/Linux-9").

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
8dde55a761 tests: Add os_grains test cases for Debian
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
ff02ab9937 tests: Add Ubuntu 17.10 (artful) os_grains test case
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
77d5356aba Fix incorrect oscodename grain on Ubuntu
Use the full content of /etc/os-release for the Ubuntu 16.04 (artful)
os_grains test case. This reveals a bug that 'oscodename' is not
correctly calculated if /etc/os-release provides PRETTY_NAME:

FAIL: test_ubuntu_os_grains (tests.unit.grains.test_core.CoreGrainsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/grains/test_core.py", line 439, in test_ubuntu_os_grains
    self._run_ubuntu_os_grains_tests(_os_release_map)
  File "tests/unit/grains/test_core.py", line 446, in _run_ubuntu_os_grains_tests
    self._run_os_grains_tests(os_release_map)
  File "tests/unit/grains/test_core.py", line 262, in _run_os_grains_tests
    self.assertEqual(os_grains.get('oscodename'), os_release_map['oscodename'])
AssertionError: 'Ubuntu 16.04.3 LTS' != 'xenial'
- Ubuntu 16.04.3 LTS
+ xenial

fixes #34423 for Ubuntu
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
7e62dc9fd2 tests: Support reading os-release files from disk
Instead of storing pre-parsed os-release files, add support for reading
os-release files from disk.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
a92ec0db1b Make _parse_os_release() always callable
To simplify running unit tests against os_data(), make the
_parse_os_release() function always callable to avoid needing to mock
os.path.isfile().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
eee1fe5b38 tests: Dissolve _run_ubuntu_os_grains_tests
_run_ubuntu_os_grains_tests is only used once and does not provide any
useful abstraction since the introduction of _run_os_grains_tests.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
1d6ef731fe tests: Deduplicate _run_os_grains_tests()
_run_suse_os_grains_tests() and _run_ubuntu_os_grains_tests() share most
of their logic. Combine the common part in _run_os_grains_tests() and
let the remaining small parts live in their origin functions.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
rallytime
69ac94baca
Update utils paths 2018-02-24 06:55:09 -05:00
rallytime
cffbf52c10
Lint fix: remove extra line 2018-02-24 06:51:25 -05:00
Daniel Wallace
667b5b9f0c
fix unicode for mac autologin test 2018-02-23 17:00:56 -07:00
twangboy
661a0687ec
Fix git utf-8 issues for Windows
Adds the `output_encoding` option to all the functions
Defaults to `utf-8` for Windows
Fixes some utf-8 issues in the test
2018-02-23 14:49:13 -07:00
Nicole Thomas
705caa8cca
Merge pull request #46148 from rallytime/merge-2017.7
[2017.7] Merge forward from 2017.7.3 to 2017.7
2018-02-23 14:21:38 -05:00
rallytime
79bed6cff1
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/cmdmod.py
  - salt/modules/reg.py
  - salt/modules/win_lgpo.py
  - salt/modules/win_path.py
  - salt/modules/win_pkg.py
  - salt/pillar/file_tree.py
  - salt/states/boto3_route53.py
  - salt/states/reg.py
  - salt/utils/win_functions.py
  - tests/unit/modules/test_kubernetes.py
  - tests/unit/modules/test_win_path.py
2018-02-23 09:50:19 -05:00
rallytime
49e49ae51b
Mark 2 tests as flaky
- integration.spm.test_man_spm.SPMManTest.test_man_spm
- integration.ssh.test_state.SSHStateTest.test_state_running
2018-02-23 09:34:14 -05:00
Nicole Thomas
e6374bf68d
Merge pull request #46149 from rallytime/bp-46145
Back-port #46145 to oxygen.rc1
2018-02-22 16:57:51 -05:00
rallytime
29468f3dce
Lint fixes 2018-02-22 14:18:28 -05:00
Erik Johnson
2b887dd77d
Update tests to reflect changes to the SaltCacheLoader 2018-02-22 10:51:36 -05:00
rallytime
25deebf7a6
Merge branch '2017.7.3' into '2017.7'
Conflicts:
  - salt/modules/git.py
2018-02-22 10:22:22 -05:00
Nicole Thomas
6b5b56d302
Merge pull request #46146 from terminalmage/update-version-2018.3.0
Update refrences to Oxygen codename to 2018.3.0
2018-02-22 09:26:01 -05:00
Nicole Thomas
391f45b5cd
Merge pull request #46005 from gtmanfred/ssh
pass opts to SSHClient for enable_ssh_minions
2018-02-22 09:10:44 -05:00
Erik Johnson
e2c4702e0c
Update tests to reflect changes to the SaltCacheLoader 2018-02-21 23:20:02 -06:00
Erik Johnson
1668a489c4
Update refrences to Oxygen codename to 2018.3.0 2018-02-21 21:47:41 -06:00
Gareth J. Greenaway
0d4647c2dd
Removing unnecessary log. 2018-02-21 13:14:05 -08:00
Gareth J. Greenaway
2df1866cc1
Adding a internal reset function to scheduler. Calling reset between schedule tests to ensure schedule is empty and it is using defaults. 2018-02-21 13:00:19 -08:00
Daniel Wallace
53d969a152
mark orch test as flaky 2018-02-21 09:41:57 -07:00
Nicole Thomas
0e63decaac
Merge pull request #46117 from Ch3LL/mac_ssh_schema
Add stringutils.to_str in test_roster_config_validate test
2018-02-21 09:57:44 -05:00
Nicole Thomas
a50bb41849
Merge pull request #46110 from isbm/isbm-iscsii-master-nonroot
IQN check for iSCSII crash on non-root Master
2018-02-21 09:56:53 -05:00
Bo Maryniuk
1b75f98a91 Catch proper exception type 2018-02-21 13:11:44 +01:00
Bo Maryniuk
5149cdbbd9 Fix unit test for py3 2018-02-21 10:53:20 +01:00
Daniel Wallace
9ce14b2a12
pass opts to SSHClient for enable_ssh_minions
Also, use ckminions to get the minions from the roster, instead of doing it in
publish.
2018-02-20 16:06:00 -07:00
Nicole Thomas
b92346645b
Merge pull request #46107 from amendlik/yumpkg-assumeyes
Add --assumeyes on YUM/DNF commands
2018-02-20 17:52:05 -05:00
Nicole Thomas
772636f67a
Merge pull request #46084 from garethgreenaway/oxygen_swap_to_datetime_objects
[oxygen] swap scheduler to use datetime objects
2018-02-20 17:51:26 -05:00
Nicole Thomas
8f245ea62e
Merge pull request #46069 from rallytime/bp-46036
Back-port #46036 to oxygen.rc1
2018-02-20 17:50:17 -05:00
Nicole Thomas
551f7a6280
Merge pull request #46057 from terminalmage/unicode-normalization
Add unicode normalization support to data/stringutils helpers
2018-02-20 16:26:09 -05:00
Ch3LL
1fd0295cca
Add stringutils.to_str in test_roster_config_validate test 2018-02-20 16:22:15 -05:00
Nicole Thomas
0dc8d17540
Merge pull request #46104 from isbm/isbm-x509fixonfix
x509 fix update
2018-02-20 16:08:23 -05:00
Nicole Thomas
7088438930
Merge pull request #46002 from isbm/isbm-zeromq17-deprecationwarning
Pyzmq 17.0.0 proper handling
2018-02-20 16:07:06 -05:00
Gareth J. Greenaway
e8b0e64bf5
Removing debugging code 2018-02-20 11:11:24 -08:00
Gareth J. Greenaway
5a90e6db9e
merge conflict 2018-02-20 10:42:40 -08:00
Gareth J. Greenaway
1a636b1c71
Fixing typo. swapping out a format string for an additional with datetime.timedelta. 2018-02-20 10:34:57 -08:00
Gareth J. Greenaway
b5bde4e904
Fixing cron based schedule logic up. Removing debugging messages. 2018-02-20 10:34:56 -08:00
Gareth J. Greenaway
e9ebfc8226
swapping the scheduler to use datetime objects internally 2018-02-20 10:34:31 -08:00
Gareth J. Greenaway
29fea7c550
Updating skip_job and postpone_job to acceept date strings. Reverting skip_explicit and run_explicit to not be prefixed by an undercore. 2018-02-20 10:01:20 -08:00
Gareth J. Greenaway
5e15c28dfa
Swapping skip_job and postpone_job to send time in date string format instead of passing datetie objects across the event bus. Updating tests tto reflect changes. Updating others which fail when run with --scheduler option but run fine individually. 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
d37ac991a6
Fixing lint, unused imports 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
2559815eb5
Adding tests for after and until. Updating schedule unit tests. Adding skip_reason and friends for those two cases. Moving them to the end for evaluation. 2018-02-20 10:01:19 -08:00
Gareth J. Greenaway
f62f93c892
Fixing typo. swapping out a format string for an additional with datetime.timedelta. 2018-02-20 10:01:18 -08:00
Gareth J. Greenaway
ed898baf37
Fixing cron based schedule logic up. Removing debugging messages. 2018-02-20 10:01:18 -08:00
Gareth J. Greenaway
bc93552884
swapping the scheduler to use datetime objects internally 2018-02-20 10:01:18 -08:00
Bo Maryniuk
201ce62c45 Fix unit test on Python3 2018-02-20 18:50:10 +01:00
Bo Maryniuk
62d2472c01 Lintfix: unused import 2018-02-20 18:49:58 +01:00
Bo Maryniuk
b24a8c3653 Use salt.utils.platform for OS detection 2018-02-20 18:36:27 +01:00
Bo Maryniuk
98cb94ae73 Update unit test on ignoring logging while file do not exist 2018-02-20 16:47:05 +01:00
Bo Maryniuk
2e76606edf Update unit test for catching out permission error 2018-02-20 16:46:43 +01:00
Bo Maryniuk
e61315c956 Update unit test to handle OSError exception 2018-02-20 16:28:00 +01:00
Bo Maryniuk
8aa0e83be6 Refactor unit test for simplicity so it does not need to be splitted in two functions 2018-02-20 15:25:54 +01:00
Bo Maryniuk
8320939f5e Add pytest 2018-02-20 15:25:19 +01:00
Bo Maryniuk
3015ed6bcb Fix unit test for testing main functionality of linux_iqn 2018-02-20 15:18:21 +01:00
Bo Maryniuk
2aa4d02677 Add unit test for linux_iqn testing, if not iscsii available 2018-02-20 15:10:11 +01:00
Bo Maryniuk
a2ba9377f6 Add unit test for grains linux_iqn when running as non-root 2018-02-20 15:03:59 +01:00
Adam Mendlik
8d9a432fb2
Add --assumeyes to yum/dnf commands in yumpkg.refresh_db
Without --assumeyes, these commands can hang waiting for
user confirmation if there is an unaccepted repository key.
2018-02-19 17:51:11 -07:00
Justin Findlay
2eef3c65a6
tests.unit.modules.gentoo_service add retcode arg 2018-02-19 11:27:11 -08:00
Bo Maryniuk
43026b67da Add unit test for x509 module on function _parse_subject 2018-02-19 15:53:42 +01:00
Benjamin Drung
dd3f936557 Fix skipping Kubernetes tests if client is not installed
When the Kubernetes client is not installed, the import of
salt.modules.kubernetes will still succeed, but HAS_LIBS will be set to
False (since the library import will be covered by a try-except clause).

Therefore expect the salt.modules.kubernetes to always succeed and check
kubernetes.HAS_LIBS instead for the presence of the kubernetes library.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-19 12:32:14 +01:00
Ch3LL
edc6243d1c
Patch salt.utils call for test_parse_localectl test 2018-02-16 15:26:06 -05:00
rallytime
2d0f81fd1b
Merge branch 'oxygen.rc1' into 'oxygen'
No conflicts.
2018-02-16 12:36:13 -05:00
rallytime
144b29f68b
Update old utils paths to new paths for oxygen 2018-02-16 10:35:22 -05:00
Erik Johnson
149e9edf8c
Mock the ssh.key_is_encrypted utils func 2018-02-16 10:29:30 -05:00
Erik Johnson
3fac72431f
git.latest: Fix regression with identity file usage
Unit test included
2018-02-16 10:25:25 -05:00
Erik Johnson
2035bc8a44
Use unicode normalization to make test work on MacOS 2018-02-15 20:27:44 -06:00
Erik Johnson
e9ddce6e26
Update unit tests to test new unicode normalization support 2018-02-15 20:27:44 -06:00
Erik Johnson
e2140d9a84
Mock the ssh.key_is_encrypted utils func 2018-02-15 14:37:50 -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
Nicole Thomas
005539923f
Merge pull request #45811 from gtmanfred/oxygen.rc1
Fix ldap eauth
2018-02-15 14:04:47 -05:00
Erik Johnson
f2b69f703d
git.latest: Fix regression with identity file usage
Unit test included
2018-02-15 09:35:10 -06:00
Bo Maryniuk
48b40eede9 Use ZMQ switch utility in the integration tests 2018-02-15 14:04:45 +01:00
rallytime
e060a74fd8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/cloud/clouds/dimensiondata.py
  - salt/config/__init__.py
  - salt/modules/yumpkg.py
  - salt/pillar/ec2_pillar.py
  - salt/utils/docker/__init__.py
  - salt/utils/vault.py
  - tests/integration/states/test_docker_container.py
  - tests/unit/modules/test_yumpkg.py
  - tests/unit/templates/test_jinja.py
  - tests/unit/utils/test_docker.py
2018-02-14 16:31:31 -05:00
Erik Johnson
ee6bf2e634
yumpkg: Fix a couple issues with _get_extra_opts
`_get_extra_opts()` and `_get_branch_option()` were unnecessarily
quoting the value, causing it to be interpreted as a literal quote by
`subprocess.Popen()`.

Also, because there were separate helpers for repo options,
disableexcludes, branch options, and extra options, and specifically
because `_get_extra_opts()` parses *all* kwargs, any of the options from
the other helper funcs would end up being added to the command line
twice if `_get_extra_opts()` was used.

This commit consolidates all of the kwarg inspection and CLI opts
construction to a single helper function. It also adds unit tests to
make sure that we are formatting our commands properly.

Additionally, it makes a minor fix in `refresh_db()` which was not
accounted for when we changed the osmajorrelease grain to an integer in
2017.7.0.
2018-02-14 13:36:57 -06:00
Nicole Thomas
a1f4092811
Merge pull request #46015 from rallytime/bp-45785
Back-port #45785 to 2017.7
2018-02-14 13:16:08 -05:00
Nicole Thomas
1279924f5f
Merge pull request #45991 from terminalmage/fix-duplicate-extra-opts
yumpkg: Fix a couple issues with _get_extra_opts
2018-02-14 11:48:28 -05:00
Nicole Thomas
3e18604d75
Merge pull request #45979 from isbm/isbm-parsers-loggerfix-unicode-rc1
Unicode/logger fix + bugfix: salt/utils/parsers
2018-02-14 10:39:24 -05:00
Erik Johnson
916766f651
yumpkg: Fix a couple issues with _get_extra_opts
`_get_extra_opts()` and `_get_branch_option()` were unnecessarily
quoting the value, causing it to be interpreted as a literal quote by
`subprocess.Popen()`.

Also, because there were separate helpers for repo options,
disableexcludes, branch options, and extra options, and specifically
because `_get_extra_opts()` parses *all* kwargs, any of the options from
the other helper funcs would end up being added to the command line
twice if `_get_extra_opts()` was used.

This commit consolidates all of the kwarg inspection and CLI opts
construction to a single helper function. It also adds unit tests to
make sure that we are formatting our commands properly.

Additionally, it makes a minor fix in `refresh_db()` which was not
accounted for when we changed the osmajorrelease grain to an integer in
2017.7.0.
2018-02-13 22:46:27 -06:00
Nicole Thomas
e7999e260d
Merge pull request #44892 from terminalmage/yamlloader
Force Salt's YAML loader to load all strings as unicode types
2018-02-13 17:00:37 -05:00
Erik Johnson
9d004f6512 Use mock 2.0.0 instead of unittest.mock on Python 3 (#2)
This preserves the custom mock_open we backported from unittest.mock,
but otherwise ditches unittest.mock as it does not have
MagicMock.assert_called in Python releases before 3.6.

This allows us to maintain a uniform mock version across all platforms
and Python releases.
2018-02-13 20:16:03 +01:00
Ollie Armstrong
ef6ffb1492
Resolve linting errors 2018-02-13 13:27:38 -05:00
Ollie Armstrong
8047066c46
Remove unused import 2018-02-13 13:27:38 -05:00
Ollie Armstrong
8f7c45935a
Add tests for salt.modules.selinux.fcontext_get_policy 2018-02-13 13:27:38 -05:00
Nicole Thomas
b18087cee0
Merge pull request #45711 from bdrung/fix-unicode-tests
Fix Unicode tests when run with LC_ALL=POSIX
2018-02-13 12:42:06 -05:00
Nicole Thomas
cf367dbd04
Merge pull request #45942 from terminalmage/issue45679-2017.7
Fix incorrect translation of docker port_bindings -> ports (2017.7 branch)
2018-02-13 11:10:02 -05:00
rallytime
d6c2d0693a
Merge branch 'oxygen.rc1' into 'oxygen'
No conflicts.
2018-02-13 10:54:25 -05:00
Daniel Wallace
1c349d4d9d
fix pylint 2018-02-13 07:45:13 -07:00
gwiyeong
949aefc82b
Merge branch '2017.7' into 2017.7-local-client-hotfix 2018-02-13 11:09:06 +09:00
Nicole Thomas
007214f7bf
Merge pull request #45908 from DimensionDataResearch/fix/issue/45884
Fix for #45884 ("TypeError: can't serialize <NodeImage" when calling salt-cloud with the dimensiondata driver)
2018-02-12 17:05:28 -05:00
Daniel Wallace
472ed2ee9a
fix class for pylint 2018-02-12 14:31:33 -07:00
Daniel Wallace
f7aa2b9266
fix pylint 2018-02-12 14:25:17 -07:00
Daniel Wallace
4d4a2f4790
move Bind to outside of functions 2018-02-12 14:25:17 -07:00
Daniel Wallace
b0fb3d6786
add ldap tests 2018-02-12 14:25:17 -07:00
Bo Maryniuk
8b5af58066 Fix lints 2018-02-12 18:54:23 +01:00
Bo Maryniuk
07ef909ea9 Remove unused variables, rename mixin variable to more exact name 2018-02-12 18:54:23 +01:00
Bo Maryniuk
9fa6647bd0 Refactor a unit test for calling PID file removal without the exception 2018-02-12 18:54:23 +01:00
Bo Maryniuk
fe4502b0e4 Add debug logging call to the unit test check 2018-02-12 18:54:23 +01:00
Bo Maryniuk
d9941ce1f3 Throw away unnecessary variable handling 2018-02-12 18:54:23 +01:00
Bo Maryniuk
56818045b6 Add unit test for calling PID deletion as non-root user 2018-02-12 18:54:23 +01:00
Bo Maryniuk
2f5b133149 Fix unit test to attempt remove PID file as root 2018-02-12 18:54:23 +01:00
Bo Maryniuk
3a8e43f806 Add tear-down method 2018-02-12 18:54:23 +01:00
Bo Maryniuk
7a0e3e983c Use pytest 2018-02-12 18:54:23 +01:00
Nicole Thomas
bc13ff8b48
Merge pull request #45941 from terminalmage/issue45679
Fix incorrect translation of docker port_bindings -> ports
2018-02-12 11:28:36 -05:00
GwiYeong
45d663f435
fix for local client timeout bug 2018-02-12 13:00:22 +09:00
Nicole Thomas
d3a8f06911
Merge pull request #45927 from rallytime/utils-paths
Update old utils path to new path for which() function
2018-02-09 17:30:51 -05:00
Nicole Thomas
c0e01cea05
Merge pull request #45950 from rallytime/bp-45902
Back-port #45902 to oxygen.rc1
2018-02-09 17:30:17 -05:00
Nicole Thomas
570bbc9cd7
Merge pull request #45931 from gtmanfred/publisher
Fix publisher_acl for oxygen
2018-02-09 15:52:49 -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
29d0271b73
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:14:03 -06:00
Erik Johnson
0ff41c5835
Add regression test for issue 45893 2018-02-09 11:40:22 -05:00
rallytime
9c49c8d47c
Remove extra patch 2018-02-09 09:41:35 -05:00
rallytime
e04e7bdfc9
Remove extra patch 2018-02-09 09:40:22 -05:00
Nicole Thomas
f4acb18d4b
Merge pull request #45912 from gtmanfred/vmware
add test to verify vmware clusters can be used in vmware cloud
2018-02-09 07:15:51 -05: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
Erik Johnson
f35d9f6fef
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:22:43 -06:00
twangboy
29912adc15
Move the test_rehash test to test_win_functions 2018-02-08 17:44:30 -07:00
Erik Johnson
bb83e8b345
Add regression test for issue 45893 2018-02-08 16:31:23 -05:00
Daniel Wallace
dc91055059
Revert "Separates key_dir from cache_dir, The key files (i.e. '.root_key', '.sudo_...') must not be shared with other masters."
This reverts commit 20bf4eed1d.

This change breaks publisher_acls.

1) The key_dir's permissions are controlled by `permissive_pki_access` which is
   not required by publisher_acls.  By default, it is also changed back to 700
   each time that the salt-master restarts, so it will have to be chmodded each
   time.
2) The default directory for these keys is changed, which will break a lot of
   users publisher_acls setups on an upgrade to Oxygen, and require them to go
   back in to chmod new directories.

I was going through and switching out the key dir to default back to
/var/cache/salt/master, and allow it to be changed, and also be able to specify
that it is a sensitive dir, but once I ran across the `permissive_pki_access`
stuff, I thought it was better to just revert this change and try again against
Fluorine, since we do not have a lot of tests in this area around publisher_acl.
2018-02-08 12:55:25 -07:00
rallytime
a16ea53430
Update old utils path to new path for which() function 2018-02-08 14:38:25 -05:00
rallytime
34ecdffa71
Replace old utils paths with new paths 2018-02-08 14:23:22 -05:00
Adam Friedman
1a75786b5a
Fix linter warnings.
saltstack/salt#45884
2018-02-09 05:16:59 +11:00
Daniel Wallace
3e093ba022
fix pylint 2018-02-08 09:37:11 -07:00
rallytime
d80547e0b8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/fileclient.py
  - salt/grains/disks.py
  - salt/modules/cmdmod.py
  - salt/state.py
  - salt/states/file.py
  - salt/utils/gitfs.py
  - salt/utils/win_functions.py
  - tests/integration/modules/test_state.py
  - tests/unit/cache/test_localfs.py
2018-02-08 11:23:31 -05:00
Erik Johnson
3f42a58363
Force Salt's YAML loader to load all strings as unicode types
This reduces the likelihood that non-unicode strings make their way into
Salt and cause str/unicode mismatches resulting in UnicodeDecodeErrors.
2018-02-08 09:04:49 -06:00
Nicole Thomas
c88352a26f
Merge pull request #45844 from garethgreenaway/track_scheduled_next_time_skipped_jobs
[oxygen] Track the next scheduled fire time and when jobs are skipped.
2018-02-08 09:12:23 -05:00
Nicole Thomas
7e0cd38066
Merge pull request #45892 from terminalmage/issue45473
Add unit tests for gitfs features new to Oxygen
2018-02-08 08:50:10 -05:00
Daniel Wallace
56c5a333cd
add test to verify clusters
This test just double checks that the get_mor_containers is called twice when
trying to use a Cluster, and once if a datastore is specified.
2018-02-07 17:03:13 -07:00
Adam Friedman
a2bc155c73
Use __utils__['cloud.'] instead of salt.cloud.utils.
saltstack/salt#45884
2018-02-08 08:39:33 +11:00
Adam Friedman
de26b03e2c
Fix copy/paste bug in dimensiondata provider integration test.
saltstack/salt#45884
2018-02-08 08:39:07 +11:00
Adam Friedman
6b1b6be427
Add integration tests for dimensiondata cloud provider.
saltstack/salt#45884
2018-02-08 08:38:58 +11:00
Daniel Wallace
e892f75660
fix digital ocean tests 2018-02-07 14:04:37 -07:00
Erik Johnson
a0586748b6
Remove unused imports 2018-02-07 14:44:15 -06:00
Erik Johnson
9d200efc26
Add regression test for issue 45893 2018-02-07 14:32:59 -06:00
Gareth J. Greenaway
09d960c0cb
Updating utils/schedule.py to be able to track when jobs are skipped because of the max_running parameter. This change moves that check out of handle_func and moves it to it's own function. Also updated skip tests to include a test that _skip_reason is included in the results when a job is skipped. 2018-02-07 11:39:10 -08:00
Gareth J. Greenaway
b23e5a7db2
Updating utils/schedule.py to be able to track when jobs are skipped because of the max_running parameter. This change moves that check out of handle_func and moves it to it's own function. Also updated skip tests to include a test that _skip_reason is included in the results when a job is skipped. 2018-02-07 11:39:09 -08:00
Nicole Thomas
a309933104
Merge pull request #45885 from terminalmage/issue45845
Catch and report YAML errors in jinja load_yaml
2018-02-07 14:08:48 -05:00
Erik Johnson
fb05654b71
Add unit tests for new Oxygen gitfs features
Also expand unit tests to test both GitPython and pygit2
2018-02-07 12:00:44 -06:00
Erik Johnson
a0f7eec7e5
Work around upstream pygit2 bug affecting unicode refs
This adds a workaround for a bug fixed upstream on 2 Feb 2018, which
caused a branch or tag containing a unicode character to raise a
UnicodeDecodeError. Additionally, it changes how we handle version
analysis in salt.utils.gitfs. We should be using the LooseVersion from
salt.utils.versions instead of distutils.version.
2018-02-07 12:00:44 -06:00
Nicole Thomas
ec590aff87
Merge pull request #45834 from terminalmage/cmdmod-unicode-compat
2 unicode-compatibility fixes for cmdmod.py
2018-02-07 09:51:14 -05:00
Erik Johnson
b4e24a69e6
Move get_context to salt.utils.stringutils
This avoids circular dependencies when salt.utils.jinja (which is
imported by salt.utils.templates) needs to use get_context()
2018-02-07 02:09:56 -06:00
Erik Johnson
22c676ce57
Add option to cmdmod funcs to specify the output encoding 2018-02-07 02:01:55 -06:00
Erik Johnson
6cef37f310
2 unicode-compatibility fixes for cmdmod.py
First, `shlex.split()` will raise an exception when passed a unicode
type with unicode characters in the string. This modifies our
`shlex.split()` helper to first convert the passed string to a `str`
type, and then return a decoded copy of the result of the split.

Second, this uses our `to_unicode` helper to more gracefully decode the
stdout and stderr from the command. Unit tests have been added to
confirm that the output is properly decoded, including instances where
decoding fails because the return from the command contains binary data.
2018-02-07 02:01:55 -06:00
Daniel Wallace
57ab20308e
fix msazure cloud test 2018-02-06 14:50:20 -07:00
Daniel Wallace
f88ff75c19
fix gce tests 2018-02-06 13:27:11 -07:00
Nicole Thomas
900aadcd67
Merge pull request #45721 from garethgreenaway/44978_show_duration_when_no_state_run
[2017.7] Ensure duration and start time exist
2018-02-05 09:59:32 -05:00
Nicole Thomas
80a2d009b4
Merge pull request #45517 from kstreee/fix-mkdir
Fixes base dir making logic to ensure not raising the exception when base directory already exists.
2018-02-05 09:56:22 -05:00
Nicole Thomas
becfb56ed0
Merge pull request #45786 from isbm/isbm-localectl-use
Multiple bugfixes for localemod
2018-02-02 09:09:22 -05:00
kstreee
24d41f2451
Fixes base dir making logic to ensure not raising the exception when base directory already exists. 2018-02-02 09:55:08 +09:00
Nicole Thomas
543ef6d8a4
Merge pull request #45703 from terminalmage/path
Improve/remove PATH environment modifications
2018-02-01 16:07:16 -05:00
Nicole Thomas
7d5cf806f9
Merge pull request #45772 from terminalmage/decode-all-the-things
Decode payloads on Python 2 to preserve unicode in jobs and fileclient reqs
2018-02-01 16:06:50 -05:00
Benjamin Drung
b6181b5ed6 Fix Unicode tests when run with LC_ALL=POSIX
When running the unit tests with the locale set to POSIX, some Unicode
tests fail:

$ LC_ALL=POSIX python3 ./tests/runtests.py --unit
[...]
======================================================================
ERROR: test_list_products (unit.modules.test_zypper.ZypperTestCase)
[CPU:0.0%|MEM:73.2%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/modules/test_zypper.py", line 236, in
test_list_products
    'stdout': get_test_data(filename)
  File "tests/unit/modules/test_zypper.py", line 53, in get_test_data
    return rfh.read()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
828: ordinal not in range(128)

======================================================================
ERROR: test_non_ascii (unit.templates.test_jinja.TestGetTemplate)
[CPU:0.0%|MEM:73.2%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/templates/test_jinja.py", line 341, in test_non_ascii
    result = fp.read()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5:
ordinal not in range(128)

======================================================================
ERROR: test_non_ascii_encoding
(unit.templates.test_jinja.TestGetTemplate)
[CPU:0.0%|MEM:73.2%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/templates/test_jinja.py", line 303, in
test_non_ascii_encoding
    fp_.read(),
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 5:
ordinal not in range(128)
----------------------------------------------------------------------

Therefore open files in binary mode and explicitly decode them with
utf-8 instead of their default locale.
2018-02-01 19:24:23 +01:00
Erik Johnson
01194d6cdd
Update syslog_ng tests to reflect change in PATH behavior 2018-02-01 10:54:09 -06:00
Erik Johnson
1b78e49e1c
win_path: Do not normalize path to lowercase
This removes the lowercase normalization and handles case-insensitive
path matches. It also combines local path and system path inspection
into a single helper function in both add() and remove(), for simplicity.

Additionally, the add/remove unit tests have been rewritten to test
a wider array of use cases.
2018-02-01 10:54:09 -06:00
Erik Johnson
1b5c45a1fd
Add support for negative indexes 2018-02-01 10:54:09 -06:00
Erik Johnson
52ebc31f3d
Add comment regarding PATH handling 2018-02-01 10:54:09 -06:00
Erik Johnson
19d75b8eb9
Improve/remove PATH environment modifications
- `salt/modules/rbenv.py`: Forces use of str types in the custom env dict
  passed to `cmd.run_all`.
- `salt/modules/syslog_ng.py`: Ditches janky PATH munging in favor of
  the stable and long-existing support built into cmdmod.py
- `salt/modules/win_path.py`: Forces use of str types in path
  modification functions.
- `salt/states/win_path.py`: Completely rewritten. Duplicated code from
  the execution module removed in favor of calls to the execution
  module. Tests junked and 14 new tests written.
- `salt/utils/path.py`: The `which()` function was mistakenly modified
  in 20033ee to inject the directories in the POSIX default path into
  the PATH environment variable (even for Windows!). We never used the
  PATH to find the executables, we simply cycled through the dirs one by
  one and looked for an executable file matching the named path. The
  code that modifies the path is now removed. In addition, `which()` now
  uses `salt.utils.path.join()`, which gracefully handles mismatched
  str and unicode directory components to prevent decode errors.
  `join()` has also been simplified to use `salt.utils.data.decode()` to
  normalize directory components to unicode.
2018-02-01 10:54:09 -06:00
Erik Johnson
99de368afa
PY2: Fix system.set_computer_desc and set_computer_desc when desc is unicode
Both string_escape and unicode_escape don't like unicode content. This
scraps the escape encoding and simply does a series of string
replacements to disabmibguate quotes, newlines, and tab characters.
2018-02-01 10:30:12 -06:00
Erik Johnson
e0f4f70569
Update test to reflect type change due to unicode_literals 2018-02-01 10:30:12 -06:00
Bo Maryniuk
9e86a7d5f6 Lintfix: E8303 -- too many empty lines 2018-02-01 12:58:15 +01:00
Bo Maryniuk
5af6f147e6 Add unit test on set_locale for error handling when update-locale is not installed 2018-01-31 15:55:34 +01:00
Bo Maryniuk
4131f2e964 Fix unit test (mock everything!) 2018-01-31 15:52:36 +01:00
Bo Maryniuk
222b929d92 Add unit test for dbus locale parser which does not matching the results. 2018-01-31 15:42:32 +01:00
Bo Maryniuk
d2dcf9986e Add unit test for dbus locale parser matching the results. 2018-01-31 15:36:51 +01:00
Nicole Thomas
3cad6affbb
Lint: Add extra blank line 2018-01-31 09:29:33 -05:00
Bo Maryniuk
9468f7d91e Flatten the code 2018-01-31 13:28:07 +01:00
Bo Maryniuk
eeb08405f4 Remove old-style camel assertion in favour of PyTest built-in assertions 2018-01-31 13:24:47 +01:00
Bo Maryniuk
ec77e92dcf Move unit test test_avail to py.test 2018-01-31 13:20:46 +01:00
Bo Maryniuk
a4e44c40f9 Add unit test for gen_locale is handling error while calling not installed localedef on Suse os-family. 2018-01-31 13:17:53 +01:00
Bo Maryniuk
3d4e44e18c Add unit test gen_locale is calling localedef on Suse os-family. 2018-01-31 13:14:35 +01:00
Bo Maryniuk
16419ec6d3 Add check on gen_locale for Suse-specific path 2018-01-31 13:00:12 +01:00
Bo Maryniuk
58dde2ccbc Add unit test for gen_locale on Suse os_family with invalid locale 2018-01-31 12:54:42 +01:00
Bo Maryniuk
00f2695c79 Lintfix W1699: Python3 incompat 2018-01-31 10:19:04 +01:00
Bo Maryniuk
d423df4ded Lintfix E8301: expected 1 blank line 2018-01-31 10:17:44 +01:00
Bo Maryniuk
ea0b2e171f Lintfix: E8302, PEP8 expected two blank lines 2018-01-31 10:17:04 +01:00
Gareth J. Greenaway
59fc7fcb34
Bumping up the timeout for integration.cloud.providers.test_ec2 tests. 2018-01-30 15:01:36 -08:00
Bo Maryniuk
13087b2062 Fix unit test: capture log message and redirect it to the test assertion 2018-01-30 21:14:04 +01:00
Bo Maryniuk
8a9dacc30b Fix unit tests for HAS_DBUS removal 2018-01-30 21:05:00 +01:00
Bo Maryniuk
56f5645a09 Add unit test for localectl on arbitrary structure parser 2018-01-30 20:59:23 +01:00
Bo Maryniuk
5af33fbb0d Add unit test for localectl output parse on broken content 2018-01-30 20:51:23 +01:00
Bo Maryniuk
bcd04fa0ab Add log call verification 2018-01-30 20:47:26 +01:00
Bo Maryniuk
4f39075883 Add unit test for calling localectl parser on an empty output 2018-01-30 20:47:04 +01:00
Bo Maryniuk
a5d3098e9e Add unit test for localectl output status parser when no systemd installed 2018-01-30 20:38:33 +01:00
Bo Maryniuk
b4b0ea7d58 Add unit test for localectl output status parser 2018-01-30 20:36:17 +01:00
Bo Maryniuk
ec4ef24cd3 Add unit test for set_locale on unknown system 2018-01-30 19:16:15 +01:00
Bo Maryniuk
98c5ed8ef6 Remove an old unit test for set_locale 2018-01-30 19:15:54 +01:00
Bo Maryniuk
bdff4dc74c Fix system tuning conditions 2018-01-30 19:15:26 +01:00
Bo Maryniuk
e78dd78247 Add unit test for solaris when list_avail does not return proper locale 2018-01-30 19:07:40 +01:00
Bo Maryniuk
67d287316c Add unit test on solaris with list_avail returning proper locale 2018-01-30 18:58:44 +01:00
Bo Maryniuk
2e07701a0a Add unit test for set_locale on Gentoo system without systemd 2018-01-30 18:52:37 +01:00
Bo Maryniuk
a5acac5fc7 Add unit test for set_locale on Debian without systemd 2018-01-30 18:48:14 +01:00
Bo Maryniuk
cfb25f0e90 Add unit test for set_locale on RedHat systems without systemd 2018-01-30 18:45:55 +01:00
Bo Maryniuk
b1e8606d02 Add unit test with systemd and dbus enabled on SLE12 2018-01-30 18:43:01 +01:00
Bo Maryniuk
ceda257846 Add unit test for set_locale with dbus and systemd on any platform 2018-01-30 18:34:06 +01:00
Bo Maryniuk
b91ee79ef6 Add unit test for set_locale on any system with systemd and no dbus available 2018-01-30 18:32:34 +01:00
Bo Maryniuk
5bb80575d1 Fix unit test for calling a proper function while parsing localectl 2018-01-30 17:32:37 +01:00
Bo Maryniuk
b73c1d7308 Add unit test for calling unknown platform 2018-01-30 17:32:14 +01:00
Bo Maryniuk
d82b60a807 Add unit test for get_locale on Solaris 2018-01-30 17:28:28 +01:00
Bo Maryniuk
11805e47af Add unit test for get_locale on gentoo 2018-01-30 17:27:26 +01:00
Bo Maryniuk
933b365010 Add unit test for get_locale on Debian without systemd/dbus 2018-01-30 17:26:26 +01:00
Bo Maryniuk
409de1e5f6 Fix docstring on RedHat unit test for get_locale 2018-01-30 17:26:05 +01:00
Bo Maryniuk
7c19e235b1 Add unit test for get_locale on redhat systems with no systemd 2018-01-30 17:24:04 +01:00
Bo Maryniuk
df16df3abf Disable salt.utils.systemd.booted to be actually called 2018-01-30 17:23:40 +01:00
Bo Maryniuk
b3fff6744c Add unit test for getting locale on SLE12 with systemd and dbus available 2018-01-30 17:18:13 +01:00
Bo Maryniuk
22630b7a32 Fix doc for unit test 2018-01-30 17:17:46 +01:00
Bo Maryniuk
0ef739b8a7 Add unit test calling get_locale with systemd and dbus available 2018-01-30 17:06:10 +01:00
Bo Maryniuk
3c37cfd76a Add unit test calling get_locale with systemd but no dbus available 2018-01-30 17:04:37 +01:00
Bo Maryniuk
197586230a Skip tests if there is no pytest installed 2018-01-30 17:03:58 +01:00
Erik Johnson
0d92e0a868
Add a test for issue 40578 2018-01-30 09:51:51 -06:00
Nicole Thomas
3221d734d4
Merge pull request #45768 from garethgreenaway/724_py2_pkg_tests_failing
[oxygen] fixes to integration.modules.test_pkg.PkgModuleTest.test_pkg_upgrade_has_pending_upgrades
2018-01-30 09:30:26 -05:00
Nicole Thomas
6cb92a4b89
Merge pull request #45770 from gtmanfred/oxygen
fix modjk test
2018-01-30 08:26:07 -05:00
Erik Johnson
f95139cae3
Add an option to silently keep data that fails to decode 2018-01-29 17:22:54 -06:00
Daniel Wallace
c0e72ffd73
fix modjk test 2018-01-29 15:08:00 -07:00
Nicole Thomas
7c5fef13a9
Merge pull request #45702 from twangboy/win_fix_test_data
Endode results to utf-8
2018-01-29 17:04:46 -05:00
Gareth J. Greenaway
a4bb5be02f
pkg.upgrade does not return errors when something when wrong but raises an exception, so this code is no longer relevant. 2018-01-29 13:27:30 -08:00
Nicole Thomas
639215eb2e
Merge pull request #45754 from terminalmage/runtests
runtests.py: allow user to set optparse options in REPL
2018-01-29 13:29:25 -05:00
Nicole Thomas
0fc2309cda
Merge branch 'oxygen' into win_fix_test_data 2018-01-29 13:24:03 -05:00
Nicole Thomas
c54a07d3e5
Merge pull request #45715 from isbm/isbm-oxygen-unicode-S3172
Move to Unicode (3rd tier, tests)
2018-01-29 11:19:36 -05:00
Nicole Thomas
50af1d0641
Merge pull request #45714 from isbm/isbm-oxygen-unicode-S3170
Move to Unicode (3rd tier, tests)
2018-01-29 11:17:16 -05:00
Erik Johnson
a04087b2e2
runtests.py: allow user to set optparse options in REPL
This allows for the options set by optparse to be passed to main() as
kwargs, so that the test suite can be run from within a REPL.

>>> import runtests
>>> try:
...     runtests.main(ssh=True, verbosity=2, coverage_xml='/tmp/coverage.xml', xml='/tmp/xml-unittests-output', run_destructive=True, output_columns=80, sysinfo=True)
... except SystemExit:
...     pass
...
>>>
2018-01-29 08:53:40 -06:00
Nicole Thomas
35fbbb6857
Merge pull request #45737 from terminalmage/ssdp-unit-tests
SSDP PY3 compatibility fixes
2018-01-29 08:50:11 -05:00
Bo Maryniuk
5da83c6265 Lintfix: E9402 (use of black-listed module) 2018-01-29 14:13:45 +01:00
Bo Maryniuk
634695fb11 Lintfix: E9402 (blacklisted module usage) 2018-01-29 14:09:59 +01:00
Erik Johnson
293bdf2517
Merge pull request #45726 from rallytime/merge-oxygen
[oxygen] Merge forward from 2017.7 to oxygen
2018-01-28 13:05:00 -06:00
William Villeneuve
217791079b some code cleanup (lint errors and escape_argument as _cmd_quote) 2018-01-28 12:42:33 -05:00
Erik Johnson
c34a6f72cd
SSDP PY3 compatibility fixes 2018-01-28 11:09:20 -06:00
Nicole Thomas
2969d86237
Merge pull request #45735 from terminalmage/shellcase-debug-logging
Add debug logging to ShellCase functions
2018-01-28 08:27:20 -05:00
Nicole Thomas
cc32a641b4
Merge pull request #45731 from terminalmage/arch-tests
Fix groupadd tests for Arch Linux
2018-01-28 08:25:13 -05:00
Nicole Thomas
87a187da11
Merge pull request #45729 from terminalmage/tests
Python 3 comptibility fixes
2018-01-28 08:24:25 -05:00
Erik Johnson
1cabf31a1f
Add debug logging to ShellCase functions
Some of these have been failing in ways which are not reproducible
locally. This adds debug logging so that we can check the
salt-runtests.log for the return data, to aid in troubleshooting.

NOTE: This also contains a fix for a bug in the CLI output handler that
I think may have a chance of fixing some of these odd failures.
2018-01-27 20:55:34 -06:00
Erik Johnson
f60183b95c
Use bytestrings for struct.pack/unpack
https://github.com/saltstack/salt/pull/45687 and
https://github.com/saltstack/salt/pull/45725 fixed problems with older
Python 2 versions interacting with the struct module, since
unicode_literals turned the format strings to unicode and older Python 2
releases can't accept a unicode format string. Since Python 2 and 3 both
support using bytestrings for the format strings, this commit makes sure
we are using bytestrings everywhere else we are using struct.pack/unpack.
2018-01-27 17:34:16 -06:00
Erik Johnson
227fcbf794
Fix groupadd tests for Arch Linux
The default /etc/login.defs does not have a value assigned to MOTD_FILE,
which causes a traceback in 2 of the tests.
2018-01-27 17:02:23 -06:00
Erik Johnson
604ac80e7f
PY3-compatibility fix after unicode_literals was enabled 2018-01-27 16:30:29 -06:00
Erik Johnson
b1ae012852
Remove unnecessary additional assert
It looks like this was just written to assert the output of a failed
call to `ip.down`, which raises a KeyError at this point of the test
because it is not within the `with` block in which this function is
mocked.
2018-01-27 16:30:29 -06:00
Erik Johnson
e2b8ec9255
Merge pull request #45713 from isbm/isbm-oxygen-unicode-S3171
Move to unicode (3rd tier, tests)
2018-01-27 15:44:08 -06:00
Erik Johnson
c1b367dcb0
Merge pull request #45717 from isbm/isbm-oxygen-unicode-S3173
Move to unicode (3rd tier, tests)
2018-01-27 15:43:21 -06:00
Erik Johnson
7115cd9d39
Don't import text_type directly so it doesn't get added to lazyloader 2018-01-27 14:50:16 -06:00
Erik Johnson
fbcd9f1ef0
Merge branch 'isbm-3136-unittests-to-discovery' of https://github.com/isbm/salt into isbm-isbm-3136-unittests-to-discovery 2018-01-27 14:48:35 -06:00
rallytime
0ea728bd06
Update old utils paths to new paths 2018-01-26 17:34:29 -05:00
rallytime
0ad101d560
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - doc/man/salt.7
  - salt/modules/git.py
  - salt/modules/pacman.py
  - salt/states/git.py
  - tests/integration/modules/test_mac_user.py
  - tests/support/parser/__init__.py
2018-01-26 17:27:03 -05:00
Gareth J. Greenaway
359265869f
Adding a couple tests to ensure that duration is included in state run results even when states do not run. 2018-01-26 12:06:29 -08:00
Erik Johnson
fe9131e566
Fix unit.modules.test_inspect_fsdb.InspectorFSDBTestCase.test_create_table for PY3
This was broken when I fixed the test for PY2. The types for unicode
strings in PY3 are of course `str` and not `unicode`.
2018-01-26 11:19:15 -06:00
Erik Johnson
fa37509d1f
Fix several shadow tests for PY3
The recent unicode_literals changes broke PY3 when generating a password
using random bytes from pycryto/Cryptodome, this catches the failure to
decode and skips until we get a decodable byte.
2018-01-26 11:19:15 -06:00
Erik Johnson
b0f2a51752
Fix unit.modules.test_hosts.HostsTestCase.test_set_host_true_remove for PY3 2018-01-26 09:54:21 -06:00