Commit Graph

5997 Commits

Author SHA1 Message Date
twangboy
92dc3c0ece Use os.sep for path 2017-08-16 15:59:10 -06:00
twangboy
201ceae4c4 Fix lint, remove debug statement 2017-08-16 10:29:26 -06:00
Jochen Breuer
c8e98c8d8a Added unit tests for Kubernetes module
Added unit tests for:
    * Node listing,
    * deployment listing,
    * service listing,
    * pod listing,
    * deployment deletion and
    * deployment creation.
2017-08-16 14:51:16 +02:00
twangboy
e9febe4893 Fix unit.test_fileclient
Use os.sep instead of hard-coded, unix-style paths
2017-08-15 16:34:03 -06:00
twangboy
37029c1a16 Fix unit.test_doc test
Use findstr instead of grep on Windows
Use os.linesep for file paths
2017-08-15 15:30:13 -06:00
rallytime
c6b9ca4b9e Lint fix: add missing space 2017-08-15 14:26:44 -04:00
rallytime
5597b1a30e Skip 2 failing tests in Python 3 due to upstream bugs 2017-08-15 14:26:44 -04:00
rallytime
a0b19bdc27 Update account id value in boto_secgroup module unit test
This value was updated in moto 1.0.0 with the following commit:

5f3fbff627
2017-08-15 14:23:00 -04:00
rallytime
60b406e088 @mock_elb needs to be changed to @mock_elb_deprecated as well 2017-08-15 14:23:00 -04:00
rallytime
6ae1111295 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-15 14:22:59 -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
Nicole Thomas
4fcdab3ae9 Merge pull request #42657 from nhavens/2017.7
back-port #42612 to 2017.7
2017-08-14 15:42:25 -04:00
Erik Johnson
1764878754 Merge pull request #42883 from rallytime/fix-boto-tests
Fix failing boto tests
2017-08-11 15:29:11 -05:00
rallytime
6a7bf99848 Lint fix: add missing space 2017-08-11 14:19:15 -04:00
rallytime
43643227c6 Skip 2 failing tests in Python 3 due to upstream bugs 2017-08-11 12:57:39 -04:00
rallytime
7f46603e9c Update account id value in boto_secgroup module unit test
This value was updated in moto 1.0.0 with the following commit:

5f3fbff627
2017-08-10 17:31:14 -04:00
rallytime
7c1d493fdd @mock_elb needs to be changed to @mock_elb_deprecated as well 2017-08-10 17:15:45 -04:00
Daniel Wallace
c1f673eca4 use older name if _create_unverified_context is unvailable 2017-08-10 14:43:33 -06:00
rallytime
3055e17ed5 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-10 16:40:11 -04:00
Nicole Thomas
ddb671b8fe Merge pull request #42783 from rallytime/fix-flaky-py3-test
Sort lists before comparing them in python 3 unit test
2017-08-08 09:25:14 -04:00
rallytime
998834fbac Sort lists before compairing them in python 3 unit test 2017-08-07 16:09:43 -04:00
Erik Johnson
665de2d1f9 Fix domainname parameter input translation
Resolves #42538
2017-08-07 09:51:14 -05:00
Mike Place
834d6c605e
Set fact gathering style to 'old' for test_junos
Without this, we stacktrace because it does not appear that setting
'gather_facts' to False prevents the library from assuming the presence
of facts. I believe this to be an upstream bug with jnpr.

Because they have listed this as being a deprecated option in the future
this may re-break in the future.
2017-08-02 23:11:52 -06:00
Mike Place
4c1d931654 Merge pull request #42481 from twangboy/win_unit_test_crypt
Fix `unit.test_crypt` for Windows
2017-08-01 13:10:49 -05:00
Neile Havens
d73c4b55b7 back-port #42612 to 2017.7 2017-07-31 17:10:06 -05:00
Mike Place
5baf2650fc Merge pull request #42453 from gtmanfred/makedirs
don't pass user to makedirs on windows
2017-07-31 14:57:57 -05:00
garethgreenaway
25094ad9b1 Merge pull request #42602 from garethgreenaway/42514_2017_7_superseded_deprecated_from_pillar
Use superseded and deprecated configuration from pillar
2017-07-31 11:53:06 -07:00
Nicole Thomas
7d385f8bdc Merge pull request #42006 from redmatter/fix-dockerng-network-matching-2017.7
Fix dockerng.network_* name matching
2017-07-28 09:52:51 -06:00
Nicole Thomas
f83960c02a Lint: Remove extra line at end of file. 2017-07-28 09:13:59 -06:00
Andrew Bulford
c7d364ec56 Add regression tests for #41982
These test the scenarios where another network with a similar name
already exists, verifying that absent doesn't attempt to remove a
network which isn't specified, and present still attempts to create the
specified network despite a similarly named network already being present.
2017-07-28 10:41:44 +01:00
Andrew Bulford
d31f2913bd Fix broken unit test test_network_absent
This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of docker.networks -
as the mock didn't have this set the test started failing.
2017-07-28 09:57:45 +01:00
Nicole Thomas
22eea389fa Merge pull request #42290 from isbm/isbm-module_run_parambug_42270_217
Backport of #42270
2017-07-27 16:30:05 -06:00
Nicole Thomas
6b45debf28 Merge pull request #41988 from redmatter/fix-dockerng-network-matching
Fix dockerng.network_* name matching
2017-07-27 15:25:06 -06:00
Gareth J. Greenaway
74bae13939 Small update to something I missed in the first commit. Updating tests to also test for pillar values. 2017-07-27 13:19:48 -07:00
Mike Place
2985e4c0e6 Merge pull request #42255 from twangboy/win_unit_test_win_system
Fix `unit.modules.test_win_system` for Windows
2017-07-27 14:12:41 -05:00
Daniel Wallace
559d432930 fix tests 2017-07-27 12:00:38 -06:00
Mike Place
07c2793e86 Merge pull request #42266 from twangboy/win_unit_states_test_file
Fix `unit.states.test_file` for Windows
2017-07-25 15:26:32 -05:00
Mike Place
641a9d7efd Merge pull request #41968 from root360-AndreasUlm/fix-rabbitmqctl-output-handler
Fix rabbitmqctl output sanitizer for version 3.6.10
2017-07-25 14:12:36 -05:00
Nicole Thomas
c793d83d26 Merge pull request #42180 from twangboy/win_unit_test_timezone
Fix `unit.modules.test_timezone` for Windows
2017-07-24 08:46:16 -06:00
twangboy
102509029e Remove chown mock, fix path seps 2017-07-21 16:36:07 -06:00
Nicole Thomas
59e012b485 Merge pull request #42150 from twangboy/win_unit_test_pip
Fix `unit.modules.test_pip` for Windows
2017-07-19 10:01:17 -06:00
Nicole Thomas
ade25c6b34 Merge pull request #42154 from twangboy/win_unit_test_reg
Fix `unit.modules.test_reg_win` for Windows
2017-07-19 10:00:38 -06:00
Nicole Thomas
07593675e2 Merge pull request #42182 from twangboy/win_unit_test_useradd
Fix `unit.modules.test_useradd` for Windows
2017-07-19 09:55:32 -06:00
Mike Place
3ec5bb1c2f Merge pull request #42257 from twangboy/win_unit_pillar_test_git
Fix `unit.pillar.test_git` for Windows
2017-07-17 12:51:41 -05:00
Mike Place
36395625c2 Merge pull request #42258 from twangboy/win_unit_states_tests_environ
Fix `unit.states.test_environ` for Windows
2017-07-17 12:50:37 -05:00
Mike Place
894bdd2b19 Merge pull request #42265 from rallytime/gate-moto-version
Gate boto_elb tests if proper version of moto isn't installed
2017-07-17 12:47:51 -05:00
Mike Place
baf04f2a2d Merge pull request #42277 from twangboy/win_unit_states_test_winrepo
Fix `unit.states.test_winrepo` for Windows
2017-07-17 12:37:06 -05:00
Mike Place
acd29f9b38 Merge pull request #42206 from rallytime/fix-flaky-test
[PY3] Fix test that is flaky in Python 3
2017-07-17 12:09:52 -05:00
Mike Place
8f1cb287cf Merge pull request #42126 from rallytime/merge-2017.7
[2017.7] Merge forward from 2016.11 to 2017.7
2017-07-17 12:07:18 -05:00
Bo Maryniuk
8c71257a4b Call unnamed parameters properly 2017-07-13 10:11:00 +02:00
Bo Maryniuk
94c97a8f25 Update and correct the error message 2017-07-13 10:10:50 +02:00
twangboy
ed89cd0b93 Use os.sep for path seps 2017-07-12 10:13:26 -06:00
twangboy
669aaee10d Mock file exists properly 2017-07-11 17:09:21 -06:00
rallytime
78cdee51d5 Gate boto_elb tests if proper version of moto isn't installed
For Python 2 tests, we can use an older version. But when running
these tests of Python 3, we need a newer version of moto that supports
Python 3.

This gates the tests if the expected version of moto is missing.
2017-07-11 17:00:50 -06:00
twangboy
a4231c9827 Fix ret mock for linux 2017-07-11 16:59:42 -06:00
twangboy
0c484f8979 Fix unit tests on Windows 2017-07-11 16:55:43 -06:00
twangboy
55b278c478 Mock the reg.read_value function 2017-07-11 13:23:11 -06:00
twangboy
45be32666a Add error-handling function to shutil.rmtree 2017-07-11 13:08:00 -06:00
twangboy
acc0345bc8 Fix unit tests 2017-07-11 12:08:13 -06:00
rallytime
2be4865f48 [PY3] Fix test that is flaky in Python 3
We can't rely on lists having the same order in Python3 the same
way we rely on them in Python2. If we sort them first, and then
compare them, this test will be more reliable.
2017-07-07 09:43:52 -06:00
garethgreenaway
47ade9e91c Merge pull request #42088 from terminalmage/update-mocking
Update mocking in network tests
2017-07-06 15:03:42 -07:00
twangboy
8260a71c07 Disable tests that require pwd in Windows 2017-07-06 13:19:40 -06:00
twangboy
832a3d86dd Skip tests that use os.symlink on Windows 2017-07-06 13:11:02 -06:00
twangboy
00d9a52802 Fix problem with handling REG_QWORD in list values 2017-07-05 17:44:06 -06:00
twangboy
4ee24202fc Fix unit tests for test_pip 2017-07-05 15:49:53 -06:00
rallytime
8b35b367b3 Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/win_pkg.py
  - salt/states/dockerng.py
2017-07-05 09:14:30 -06:00
Erik Johnson
fc27c1a948 Update mocking in network tests
017fbdb changed the function calls in such a way that tests in 2017.7
now fail. This updates the mocking to account for new code paths
introduced in this commit.
2017-07-03 10:43:34 -05:00
Erik Johnson
d942752e95 Fix usage of assert_called_once in Python 3 < 3.6
This is a more complete fix which builds upon 41c65b0 and covers all
refs to assert_called_once in the suite.
2017-07-03 09:30:12 -05:00
rallytime
f0416acc37 Add mode back in for tmp file creation on Linux
The mode arg was removed in PR #41966 to get this test to pass on
Windows. However, this caused the same test to fail on Arch Linux
when running Python 3.

Let's keep the test the way it was for non-windows boxes, and only
remove the mode for windows.
2017-06-30 12:06:54 -06:00
Andrew Bulford
9eea796da8 Add regression tests for #41982
These test the scenarios where another network with a similar name
already exists, verifying that network_absent doesn't attempt to remove
a network which isn't specified, and network_present still attempts to
create the specified network despite a similarly named network already
being present.
2017-06-30 11:03:45 +01:00
Andrew Bulford
3369f0072f Fix broken unit test test_network_absent
This started failing following commit 515c612, which relied on the
'Name' key being present in the return value of dockerng.networks -
as the mock didn't have this set the test started failing.
2017-06-30 11:01:10 +01:00
Erik Johnson
26f848e111 Mock socket.getaddrinfo in unit.utils.network_test.NetworkTestCase.test_host_to_ips
This will keep future IP address changes from impacting this test. It
also tests a host which returns an IPv6 address, and a host which cannot
be resolved.
2017-06-29 14:49:39 -05:00
twangboy
cdb53c2657 Set file_roots for Windows Temp 2017-06-29 13:01:10 -06:00
Mike Place
1b194904f3 Merge pull request #41992 from twangboy/win_unit_test_archive
Fix `unit.modules.test_archive` on Windows
2017-06-29 11:53:04 -05:00
Mike Place
9f3438d5e7 Merge pull request #42000 from terminalmage/merge-2017.7
Merge 2016.11 into 2017.7 Merge remote-tracking branch 'upstream/2016.11' into merge-2017.7
2017-06-28 21:44:22 -05:00
Erik Johnson
f13ddeb394 Merge remote-tracking branch 'upstream/2016.11' into merge-2017.7
Conflicts:
- doc/_themes/saltstack2/layout.html
- salt/auth/__init__.py
- salt/utils/schedule.py
2017-06-28 20:27:32 -05:00
Erik Johnson
94316114ee Add test for pyobjects priority 2017-06-28 19:48:46 -05:00
Erik Johnson
dfd0e51794 Update test_map to test declarative ordering 2017-06-28 19:48:46 -05:00
Erik Johnson
91576a7263 Introduce "priority" feature for pyobjects
When there are multiple matches (such as when both an os_family and os
grain both match the minion), the order in which they are processed is
determined by the iteration order of the class' __dict__ attribute.
Since this would be different in different versions of Python, behavior
would be inconsistent depending on which version of Python is being used.

This adds a priority attribute to the Map subclass which, if present,
will re-order the match groups such that the results will be predictable
irrespective of Python version.
2017-06-28 19:48:46 -05:00
Erik Johnson
fb6a93314f Update IP address for unit.utils.network_test.NetworkTestCase.test_host_to_ips
The IP for saltstack.com changed, so this test needs to be updated.
2017-06-28 19:42:52 -05:00
twangboy
a5f7288ad9 Skip test that uses pwd, not available on Windows 2017-06-28 15:35:35 -06:00
twangboy
bf20938f11 Fixes problem with path 2017-06-28 15:02:12 -06:00
rallytime
9cb9547bc0 Rename transport_test file to test_transport and update imports for pytest 2017-06-28 11:35:13 -06:00
rallytime
7d7be2d375 Merge branch '2016.11' into '2017.7'
Conflicts:
  - doc/ref/configuration/master.rst
  - tests/integration/states/test_archive.py
  - tests/unit/transport/test_tcp.py
  - tests/unit/transport/test_zeromq.py
2017-06-28 10:48:37 -06:00
garethgreenaway
4fe273f78e Merge pull request #41969 from twangboy/win_unit_test_config
Fix `unit.config.test_config` for Windows
2017-06-28 08:18:07 -07:00
garethgreenaway
7c96200e42 Merge pull request #41967 from twangboy/win_unit_test_api
Fix `unit.config.test_api` for Windows
2017-06-28 08:17:21 -07:00
twangboy
98bc208db9 Fix paths, skip impossible 2017-06-27 17:31:23 -06:00
Andreas Ulm
76fd941d91 added tests for rabbitmq 3.6.10 output handler
Signed-off-by: Andreas Ulm <andreas.ulm@root360.de>
2017-06-28 01:13:30 +02:00
twangboy
1f497d8f78 Fix paths 2017-06-27 16:43:54 -06:00
twangboy
3eca45e000 Fix unit tests for ssh 2017-06-27 15:29:44 -06:00
Mike Place
4209be843d Merge pull request #41959 from DSRCorporation/bugs/minor_dict_diff_enhance
Minor dict diff enhance in tests.
2017-06-27 15:18:16 -05:00
Mike Place
f9965ccfcb Merge pull request #41939 from cachedout/mdadm_py3_test
Gate assert check behind mock ver
2017-06-27 13:04:23 -05:00
Mike Place
e3bfd5a593 Merge pull request #41952 from meaksh/2017.7-suse-leftovers-part-two
Fix "zypp_plugins" unit test for Python 3
2017-06-27 12:42:00 -05:00
Dmitry Kuzmenko
e01e566779 Minor: show full dict diffs if test fails. 2017-06-27 16:22:09 +03:00
Pablo Suárez Hernández
7affbce83a Fix zypp_plugins unit test for Python 3 2017-06-27 09:26:35 +01:00
Erik Johnson
3fac9b3b06 Add maxDiff to pyobjects test for troubleshooting 2017-06-26 12:58:49 -05:00
Mike Place
41c65b0e2c
Gate assert check behind mock ver 2017-06-26 11:04:49 -06:00
Mike Place
ff67d47a2e Merge pull request #41516 from kstreee/fix-blocking-waiting-tcp-connection
Implements MessageClientPool to avoid blocking waiting for zeromq and tcp communications.
2017-06-26 09:41:38 -05:00