Commit Graph

102 Commits

Author SHA1 Message Date
twangboy
1379627334 Fix unit.cloud.clouds.test_ec2 for Windows
Mock instead of create tempfile
2017-09-08 15:36:52 -06: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
16a2747d7d Merge branch '2016.11' into '2017.7'
Conflicts:
  - pkg/windows/buildenv/salt.bat
  - salt/modules/pillar.py
  - salt/utils/openstack/nova.py
  - tests/unit/cloud/clouds/test_dimensiondata.py
  - tests/unit/cloud/clouds/test_gce.py
2017-06-14 13:31:42 -06:00
rallytime
1e9a06000b Bump version check down to 1.4.0 and use distutils.version lib 2017-06-14 09:30:22 -06:00
rallytime
a30f654b04 Support apache-libcloud work-around for issue #32743 for versions older than 2.0.0
If apache-libcloud 2.0.0 is installed, the workaround outlined in issue #32743
no longer applies and should be avoided. However, we still need to support older
versions of apache-libcloud that need this work-around.

The minimum version required of apache-libcloud has been updated to 2.0.0 in pull
request #40837, which will released in Oxygen. #40837 has removed all of the
work-arounds needed for issue #32743 for 2.0.0. Until Oxygen is released, however,
we need to support both the work-around for older versions of apache-libcloud as
well as 2.0.0.
2017-06-13 14:22:32 -06:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
rallytime
2f1998ac00 Pylint extra space 2017-04-25 16:41:39 -06:00
rallytime
ad9914353b Pylint fixes 2017-04-25 14:18:50 -06:00
rallytime
c3f4874c21 Pylint fixes and rework new test in dimensiondata cloud unit tests 2017-04-25 11:06:55 -06:00
rallytime
8e24b3a8b2 Pylint fixes for some cloud unit tests 2017-04-25 11:06:39 -06:00
rallytime
7f14a6491e Rename nova and openstack unit tests to test_*.py 2017-04-25 09:27:11 -06:00
rallytime
5372f25fde Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - salt/cloud/clouds/rackspace.py
  - tests/unit/cloud/clouds/test_dimensiondata.py
2017-04-24 15:35:28 -06:00
Bo Maryniuk
116c96a4b7 Fix UT parameter changes 2017-04-22 10:08:20 +02:00
Bo Maryniuk
ed84420df0 Add unit test for node ip filtering 2017-04-22 10:08:20 +02:00
Bo Maryniuk
82582cff77 Skip test, if libcloud is not around 2017-04-22 10:08:20 +02:00
Bo Maryniuk
f005d53c56 Fix name error exception 2017-04-22 10:08:20 +02:00
Bo Maryniuk
5e574a24d9 Add unit test for nova connector 2017-04-22 10:08:19 +02:00
Bo Maryniuk
cd43805770 Add initial unit test for openstack cloud module 2017-04-22 10:08:19 +02:00
Bo Maryniuk
177f31446d Add fake preferred IP function for testing 2017-04-22 10:08:19 +02:00
Pedro Algarvio
3a5ec6bb0a
Minor lint fix 2017-04-01 14:22:58 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Adam Mendlik
6c6e8d17bc Update unit test for Saltify with credential verification 2017-03-27 19:20:38 -06:00
Pedro Algarvio
0b41b92d7d
Use salt.utils.versions instead of distutils.version 2017-03-08 19:22:33 +00:00
Pedro Algarvio
d13b40554b
Use the __version__ variable from tests.support.mock 2017-03-06 14:35:12 +00:00
Pedro Algarvio
40a64191a1
Absolute imports and A LOT of code cleanup. 2017-03-01 01:33:07 +00:00
Pedro Algarvio
3beb3fb801
Move whatever we need from salttesting to salt.
Let's drop the salttesting dependency cycle.
2017-02-28 22:52:49 +00:00
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Pedro Algarvio
ce71f6d45f
Code cleanup 2017-02-23 12:55:53 +00:00
Pedro Algarvio
e48ea8fa1b
Don't use assert_called_once() or assert_not_called().
These worked in Py2 but not in Py3.
A read of http://engineroom.trackmaven.com/blog/mocking-mistakes/ specially the section "Mocking the unexpected" will enlighten one.
2017-02-23 10:40:58 +00:00
rallytime
5db986860c [develop] Fix some pylint errors that snuck into develop 2017-02-22 17:02:21 -07:00
Sergei Zviagintsev
313e9cae06 Add unit test for _validate_key_file_permissions in ec2 module 2017-02-22 11:38:40 +01:00
Mike Place
b341357942
Remove Joyent test
Removed per https://github.com/saltstack/salt/pull/37756#issuecomment-263618695
2016-11-29 09:54:46 -07:00
Mike Place
c8fb487590 Added space for lint check in in-line comment 2016-11-15 13:56:47 +13:00
Eric Radman
a42ca638ec joyent: Properly handle error if deployment fails
Previous behavior if an invalid profile parameter was used:

TypeError: 'NoneType' object has no attribute '__getitem__'

New Behavior:

Error: There was a profile error: Failed to deploy VM

Also fix up some pylint complaints
2016-11-14 18:44:07 -05:00
rallytime
2e68da3e52 Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/topics/cloud/vmware.rst
  - salt/cloud/clouds/vmware.py
2016-11-07 08:22:17 -07:00
rallytime
4080cb4f12 Merge branch '2016.3' into 'carbon'
No conflicts.
2016-11-03 08:54:32 -06:00
Aditya Kulkarni
e9b4620fac Add unit tests for cloning from snapshot (#37414) 2016-11-02 11:22:37 -06:00
rallytime
8d3957f250 Merge branch 'carbon' into 'develop'
Conflicts:
  - salt/cloud/clouds/vmware.py
  - salt/modules/boto_ec2.py
  - salt/modules/cmdmod.py
  - salt/modules/win_lgpo.py
2016-10-28 11:58:41 -06:00
Eric Radman
f42480a1a9 Joyent: wait for node state to flip to 'ready' (#37305)
When provisioning a SmartOS machine on Joyent using salt-cloud, the IP
is often set before SSH is fully configured. This can result in a
successful SFTP transfer, followed by a failure to run
salt-bootstrap.sh.
2016-10-28 09:32:54 -06:00
C. R. Oldham
6a7eab9e16 Remove this test, it is no longer illegal to leave out image
and clonefrom parameters.  It is possible to create a VM from scratch.
2016-10-25 15:23:32 -06:00
rallytime
0a5b1f5466 Merge branch 'carbon' into 'develop'
No conflicts.
2016-10-13 09:58:18 -06:00
rallytime
1d3aaf8097 Merge branch '2016.3' into 'carbon'
Conflicts:
  - doc/ref/configuration/minion.rst
2016-10-12 15:26:27 -06:00
Justin Findlay
4d8fb03b79 return opennebula errors to user (#36930)
* cloud.clouds.opennebula: return errors to user

* cloud.clouds.opennebula._get_xml: add unit test
2016-10-12 10:19:11 -06:00
rallytime
8e0b1a3718 Merge branch 'carbon' into 'develop'
No conflicts.
2016-09-22 10:09:06 -06:00
rallytime
18c6a736cf The "assert_called_once" mock testing function is only available in mock 2.0.0 or greater
We have a couple of tests using the "assert_called_once" function, however, our salt-jenkins
states pin the version of mock at 1.0.1 (This is the last version that is compatible with
Python 2.6). We either need to use something else that works for all versions of mock or gate
the test.

In the pacman tests, it is possible to use "assert_called_with" instead of "assert_called_once"

In the dimension_data and gce unit tests, we need to gate the assertion behind a mock version check.
This way the tests won't fail if the version of mock installed is less than 2.0.0.
2016-09-21 14:46:50 -06:00
rallytime
2edfef33ae Merge branch 'carbon' into 'develop'
Conflicts:
  - salt/scripts.py
  - salt/thorium/key.py
  - tests/unit/cloud/clouds/dimensiondata_test.py
  - tests/unit/cloud/clouds/gce_test.py
2016-09-08 17:31:29 -06:00
rallytime
c30f697dfd Pylint fix 2016-09-08 17:23:15 -06:00
rallytime
6da0fbbe96 Merge branch '2016.3' into 'carbon'
Conflicts:
  - salt/modules/cmdmod.py
  - salt/modules/linux_sysctl.py
  - tests/unit/cloud/clouds/dimensiondata_test.py
  - tests/unit/cloud/clouds/gce_test.py
  - tests/unit/modules/boto_iot_test.py
  - tests/unit/modules/mount_test.py
  - tests/unit/states/boto_iot_test.py
  - tests/unit/utils/network.py
2016-09-08 16:14:04 -06:00
Pablo Suárez Hernández
235d6308a4 Fixing unit tests for develop (#36141)
* Fixing skipped boto tests to prevent errors if boto3 does not exists.

* Fix tests to prevent errors when libcloud is not present

* Fix PortageConfigTestCase in case of portage is not present
2016-09-08 11:15:41 -06:00