Commit Graph

162 Commits

Author SHA1 Message Date
Pedro Algarvio
15af4c9728
Test filenames conformity. Adjust for pytest. 2017-02-23 23:19:42 +00:00
Pedro Algarvio
fc59d5e832 Python 3 Fixes (Pt. 2) (#39397)
* Typo in comment

* First convert to string if not already a string. Then to bytes under Py3.

The reason being that jids from the CLI, at least the one fed in
integration.runners.jobs.ManageTest.test_loopup_jid is loaded as an
integer, and, while the Py2 code converts JIDs to strings, under Py3, we
assume JID's are already strings.

* Mark tests which require root permissions to run

* Allow declaring that the function IS a class method.

```
Python 3.5.3 (default, Jan 21 2017, 00:29:12)
[GCC 6.3.1 20170109] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Foo:
...     def bar(self):
...         print('bar')
...
>>> import inspect
>>> inspect.ismethod(Foo.bar)
False
>>> inspect.ismethod(Foo().bar)
True
```

On Python 2, `inspect.ismethod` returns `True` for bound and unbound
methods while on Python 3 it only returns `True` for bound methods.
The explicit `is_class_method` is to avoid instantiating the class just
to get the function signature.

* Always decode responses to the Python version native string implementation

* Just compare the objects as matching list.

Asserting same item count doesn't make that much sense.

* Py3 compatibility

* Fix saltnado tests under Py3

* Python 3 compatibility

* Show me the full traceback

* Revert "Convert fileserver data from bytes to strings"

This reverts commit e53972f8c6.

* Revert "Under Py3, we get `bytes` when using the roots backend directly"

This reverts commit 9f73b240c1.

* Convert from bytes to str if not a binary file

* Py3 compatibility fixes.

Convert file contents from bytes to string if not a binary file
2017-02-14 16:20:56 -07:00
rallytime
342a5ac0b8 Merge branch '2016.11' into 'develop'
No conflicts.
2017-01-06 10:31:51 -05:00
rallytime
30f14d15df Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/config/__init__.py
  - salt/engines/slack.py
2017-01-04 16:54:58 -05:00
Megan Wilhite
1c951d152b fix gce image bug (#38542) 2017-01-04 09:08:04 -05:00
rallytime
29f45c192c Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/cloud/clouds/ec2.py
  - salt/modules/grains.py
2016-12-12 11:23:57 -07:00
rallytime
627242ab5d Merge branch '2016.3' into '2016.11'
Conflicts:
  - tests/unit/config/config_test.py
2016-12-09 11:45:14 -07:00
Ch3LL
be74c45463 enabled ec2 cloud tests 2016-12-08 12:39:42 -07:00
rallytime
6479a22c1d Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/modules/napalm_network.py
2016-11-18 07:50:16 -07:00
rallytime
1aa463b4c1 Merge branch '2016.3' into '2016.11'
No conflicts.
2016-11-16 09:27:06 -07:00
rallytime
5f4a73f880 Merge branch '2016.11' into 'develop'
No conflicts.
2016-11-16 08:55:22 -07:00
Ch3LL
363122c675 add timeout increase on azure tests 2016-11-15 10:27:44 -07:00
Ch3LL
acd4c3061e fix import for virtualbox test 2016-11-14 14:48:37 -07:00
rallytime
7b2341bbfd Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/topics/releases/releasecandidate.rst
  - salt/modules/file.py
  - salt/states/file.py
  - salt/utils/network.py
2016-11-10 15:59:51 -07:00
Nicole Thomas
2e8e56ca69 [PY3] Change log.warn statements to log.warning (#37531)
* [PY3] Change log.warn statements to log.warning

log.warn is deprecated in Python 3. This change removes the
occurance of deprecation warnings for using log.warn. For example:

```
17:24:23 [WARNING ] /testing/salt/utils/verify.py:522: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead
17:24:23   log.warn('Insecure logging configuration detected! Sensitive data may be logged.')
17:24:23
17:24:23 [WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
```

* Tweak unit.utils.verify_test to using warning instead of warn
2016-11-08 13:06:54 -07:00
Ethan Devenport
21e24a8125 Cloud API v3 updates including:
* Added server availability zone parameter.
* Added volume availability zone parameters.
* Added NAT parameter for private NIC.
* Updated documentation.
2016-11-01 21:37:53 +00:00
Mike Place
afd3dc3807
Merge branch '2016.3' into 2016_3_carbon 2016-10-26 14:08:03 +09:00
Ch3LL
23947c5944 change timeout for cloud tests 2016-10-25 13:27:57 -06:00
rallytime
caa8fc9169 Merge branch '2016.3' into 'carbon'
Conflicts:
  - pkg/deb/salt-api.service
  - pkg/deb/salt-master.service
  - salt/client/__init__.py
  - salt/fileclient.py
  - salt/modules/cp.py
  - salt/modules/status.py
  - tests/integration/__init__.py
  - tests/integration/modules/cp.py
2016-10-21 15:50:03 -06:00
Megan Wilhite
f22c686b34 fix digital ocean image name in profile (#37126)
* fix digital ocean image name in profile

* remove skip and fix test
2016-10-20 16:08:50 -06:00
rallytime
95dbe1ade4 Merge branch '2016.3' into 'carbon'
Conflicts:
  - salt/fileserver/__init__.py
  - setup.py
  - tests/integration/modules/git.py
2016-09-14 09:15:29 -06:00
Pablo Suárez Hernández
a0bbb0f648 Integration tests fixes for 2016.3 (#36263)
* Fix PillarModuleTest::test_pillar_items: 'info' does not exist in pillar

* Fixing integration tests if azure is not present

* Fixing integration tests failures if 'git' command is missing

Skip git state integration tests if 'git' does not exists
Prevent OSError if 'git' command not found during _git_version()
2016-09-13 12:40:56 -06:00
Daniel Wallace
2d716131da Add test to check openstack in libcloud
With apache-libcloud 0.20.0
2016-09-13 10:25:43 -05:00
rallytime
c8930339d3 Remove iteritems() references from integration tests 2016-07-19 10:15:23 -06:00
rallytime
7bf9f5d0f5 Merge branch '2016.3' into 'develop'
Conflicts:
  - doc/man/salt.7
  - doc/ref/executors/all/salt.executors.direct_call.rst
  - doc/ref/executors/all/salt.executors.splay.rst
  - doc/ref/executors/all/salt.executors.sudo.rst
  - salt/cloud/clouds/vultrpy.py
2016-05-18 09:40:48 -06:00
C. R. Oldham
8387657d9a Prevent salt-cloud from hanging when spinning up new Vultr instances (#33272)
* better support for named images, locations, sizes

* better support for named images, locations, sizes

* Tests for Vultr driver

* Add sleep so test instance will be old enough to delete as part of the test

* Lint.
2016-05-16 13:11:29 -07:00
rallytime
37dee42061 Pylint fixes 2016-03-18 16:27:06 -06:00
LoveIsGrief
04795b1fd2 Add a little more information to the heavy virtualbox tests
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-12 19:50:19 +01:00
LoveIsGrief
6704ad31b4 Remove unused param
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-12 18:36:33 +01:00
LoveIsGrief
a944c5d86d Fix python3 pylint error
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-12 17:41:40 +01:00
LoveIsGrief
bb6ffa80e2 from ... import ... on top for lint?
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-12 14:08:45 +01:00
LoveIsGrief
3cd04cbccc Remove unused function
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-12 12:35:32 +01:00
Mike Place
52f6887124 Lint 2016-02-11 13:52:59 -07:00
LoveIsGrief
4eab39e9ca Attempt to fix pylint errors and warnings
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-11 13:56:38 +01:00
LoveIsGrief
17735df82d Move risky event into try/except
It might leave the test env in a dirty state, maybe further tests might fail, but we have the log to trace it back to that

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:53:21 +01:00
LoveIsGrief
e5f8227e90 Move @skipIf to parent classes
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:37 +01:00
LoveIsGrief
54db49b843 Remove some TODOs
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:37 +01:00
LoveIsGrief
53c7cd87ca When creating a machine return a dict
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:36 +01:00
LoveIsGrief
95ab35203d Redtest to stop and restart a machine multiple times
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:36 +01:00
LoveIsGrief
1a8cd747c5 Feature: deploy salt on machine when creating
We need to setup the tests with a profile that wants to deploy and use the profile

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:36 +01:00
LoveIsGrief
7b4142dff3 Improve output JSON interpretation cleaning for tests
(Actually also fix it because we we popping increasing random elements from the output... not good)

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
63edda4b50 New function for ip addresses
Waits on the guest to have one.

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
f56d72b69f Helper functions should do what they are named for
New helpers also added to describe the state of the machine

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
ef24a16f4e Remove unneeded test
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
7c4b3580f1 Try and stop the running VM as a cleanup
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
1d6b94c279 Starting machines works now too
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
8111dcb092 Force actions in tests
Otherwise there is always a confirmation prompt... ain't nobody got time fo' dat!

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
04c3bae44f Move some common test functions to helpers
Introduce stop machine test (it's red :( )

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
1b3d96fa9f First test to get network address from already running guest
Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00
LoveIsGrief
b195d0f1a7 Use dict output for VirtualboxTests
This should make the output from salt-cloud more verifiable and make tests more reliable

Related to saltstack/salt#27089 Saltcloud virtualbox provider
2016-02-10 21:39:35 +01:00