Commit Graph

9104 Commits

Author SHA1 Message Date
Sergei Zviagintsev
ad5b52ce3c Add unit test for salt.utils.cloud.check_key_path_and_mode 2017-02-22 11:38:40 +01:00
Sergei Zviagintsev
313e9cae06 Add unit test for _validate_key_file_permissions in ec2 module 2017-02-22 11:38:40 +01:00
Pedro Algarvio
0b3071ee3a
.iter<items|keys|values>() Py3 compatibility 2017-02-22 10:20:26 +00:00
Erik Johnson
ec2b617a5d Fixes for docker tests
These tests were failing because of improper mocking. The mocks were
assigned to the __salt__ dunder but we should have been patching the
attributes of the docker execution module directly.
2017-02-18 21:58:25 -06:00
Erik Johnson
c673d06f48 Rename dockerng state/execution module to docker 2017-02-18 21:58:25 -06:00
Erik Johnson
6e24dd85c4 Remove dockerio state/module (moved to salt-contrib) 2017-02-18 21:58:24 -06:00
Mike Place
deba6d2655 Merge pull request #39367 from gtmanfred/develop
add extmod_blacklist to make it easier to remove modules
2017-02-17 16:57:44 -07:00
Mike Place
179e143272 Merge pull request #39385 from curiositycasualty/develop
modules.file: Return true when a symlink is already in desired state
2017-02-17 15:24:53 -07:00
Mike Place
0c411bfbb0 Merge pull request #39430 from s0undt3ch/features/py3
More Py3 Fixes
2017-02-17 15:24:12 -07:00
twangboy
77d3a584a4 Set hard limit on Windows 2017-02-17 13:52:27 -07:00
Pedro Algarvio
2ed05ab399
We really don't need to be root to run these 2017-02-17 20:48:58 +00:00
Pedro Algarvio
20882bfcb4
These tests require root for default paths and create directories if non existing 2017-02-17 20:48:57 +00:00
Pedro Algarvio
a8e32cf076
**kwargs ordering is different under Py3 2017-02-17 20:48:56 +00:00
Pedro Algarvio
f921c1e131
Sort before asserting since the order changes between py2 and py3 2017-02-17 20:48:56 +00:00
Pedro Algarvio
9503045b05
Use tempfile.gettempdir() since that depends on current user and distro setup 2017-02-17 20:48:56 +00:00
Pedro Algarvio
33d8832e40
Assert different outcome under Py3 2017-02-17 20:48:56 +00:00
Pedro Algarvio
90adbe925f
Force dictionary order 2017-02-17 20:48:56 +00:00
Pedro Algarvio
9b2d79317a
Handle different test outcome under Py3 2017-02-17 20:48:55 +00:00
Pedro Algarvio
1d060096e3
Force ordering under Py3 2017-02-17 20:48:55 +00:00
Pedro Algarvio
04b4d0947e
Disable tests on Py3.
The order of attributes is sketchy under Py3 and this code will be
deprecated.
2017-02-17 20:48:55 +00:00
Pedro Algarvio
c093d97a93
Only run the ascii case on Py2 2017-02-17 20:48:55 +00:00
Pedro Algarvio
20a4d7bb39
Under Py3, stat.S_ISLNK() expects an integer. Mock it. 2017-02-17 20:47:55 +00:00
Mike Place
e85eff4865 Merge pull request #39468 from twangboy/win_git_test_init
Fix test_init for Windows
2017-02-17 09:57:12 -07:00
twangboy
812c857770 Fix test_init for Windows 2017-02-16 16:00:45 -07:00
Nicole Thomas
1577bb68af Merge pull request #39459 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-02-16 14:30:31 -07:00
rallytime
dda39d4e63 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/minion.py
  - salt/modules/file.py
  - salt/modules/grains.py
  - salt/utils/gitfs.py
2017-02-16 12:18:46 -07:00
Megan Wilhite
1acf00da3b add 2016.11.3 changelog to release notes (#39451) 2017-02-16 10:49:53 -07:00
rallytime
3a8bd786e0 Remove global dunder definistions from tests
These dunders are already being mocked appropriately below in the test, so we
don't need to define them in the test module's namespace.

The global definitions here were conflicting with the globals defined in
`saltmod_test.py`, and causing the following stacktrace in the test suite:

```
Traceback (most recent call last):
  File "/root/SaltStack/salt/tests/unit/saltmod_test.py", line 71, in test_state
    self.assertDictEqual(saltmod.state(name, tgt, highstate=True), test_ret)
  File "/root/SaltStack/salt/salt/states/saltmod.py", line 252, in state
    masterless = __opts__['__role'] == 'minion' and \
KeyError: '__role'
```
2017-02-16 10:33:32 -07:00
Mike Place
16332ae957 Merge pull request #39433 from twangboy/win_new_tests
Add additional tests to the Windows whitelist
2017-02-15 17:03:17 -07:00
twangboy
2e9122e134 Fix fileserver.fileclient reference 2017-02-15 22:44:09 +00:00
rallytime
2acb188ac9 Change `path` value from a tuple to a list
The type of the ``path`` value changed in #38188.

This updates the type in the unit test, as well as rearranges some
of the imports to be more standardized with ``ensure_in_syspath``.
2017-02-15 15:39:53 -07:00
twangboy
98d5cc3e1b Add additional tests to the Windows whitelist 2017-02-15 21:21:55 +00:00
Joseph Hall
b34d42f98c Add version control to SPM repo creation 2017-02-15 14:21:03 -07:00
Daniel Wallace
d332b33c8a add extmod_blacklist to make it easier to remove modules 2017-02-15 12:47:32 -06:00
rallytime
6d78adbf08 Merge branch '2016.3' into '2016.11'
Conflicts:
  - doc/topics/tutorials/gitfs.rst
  - salt/fileserver/roots.py
  - salt/loader.py
2017-02-15 10:35:02 -07:00
Erik Johnson
4ff13acf8b salt.fileserver.roots: Fix regression in symlink_list (#39409)
A recent PR of mine removed the logic in symlink_list and fell back to
the cached file list generated in _file_lists(). However, this code
dates back from before the fileserver backends' symlink_list() functions
were modified to return a dict mapping links to their destinations.

This fixes the code in _file_lists() so that it returns the correct
data. It also fixes the fact that '.' was showing up in the dir list
produced by _file_lists(), and updates the associated integration test
to include the cachedir in the mocked opts.
2017-02-15 10:06:17 -07: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
Nicole Thomas
3a39e15dff Rewrite blockdev unit test to target more specific state returns (#39402)
The previous way this test was written was over-mocking some of the
state returns as well as tested and asserted against incorrect
behavior as shown in issue #39255. (The test asserted that a return
of '' from the call to _checkblk() was correct, which was hiding a
bug as noted in #39255 and fixed in #39272.)
2017-02-14 13:49:14 -07:00
Mike Place
868e170b92 Merge pull request #39376 from jmickle/develop
adding librato metrics returner
2017-02-14 11:39:34 -07:00
Mike Place
1ecc9d1315 Add newline for lint 2017-02-14 11:26:23 -07:00
Mike Place
2b67008770 Merge pull request #39374 from techhat/spmcache
Switch SPM to salt.cache
2017-02-14 10:58:10 -07:00
Mike Place
471baea629 Merge pull request #39381 from cachedout/docs_fix
Docs test fix
2017-02-14 10:53:27 -07:00
Mihai Dinca
91383c5a19 Add cp.push test 2017-02-14 17:16:28 +01:00
Isa
72d2188cbb return true when symlinks already in desired state 2017-02-13 18:10:28 -08:00
Joseph Hall
4f072c9ad8 Add cache default for spm 2017-02-13 16:59:07 -07:00
Mike Place
89ed6a38f7
Typo 2017-02-13 16:46:53 -07:00
Mike Place
8fbbb781bc
Fix docs test 2017-02-13 16:45:47 -07:00
Jonathan Mickle
ec938e5f73 linter fixes 2017-02-13 15:27:07 -08:00
mephi42
6570392abd Support globbing in sources parameter of salt.modules.archive (#32356)
Add globbing support to tar, zip and rar.
Update tests to show bad return value on error.
2017-02-14 00:02:19 +01:00
Jonathan Mickle
d61865c2bc adding librato metrics returner 2017-02-13 14:18:54 -08:00