Commit Graph

160 Commits

Author SHA1 Message Date
rallytime
e9cb080a00
Cleanup weird spaces
Some spaces between the `@` and the `skipIf` snuck into the branch
and the linter, nor the tests, caught this for some reason.
2018-05-07 14:51:39 -04:00
rallytime
be0731da5f
Add skipIfs back in for rest_tornado tests
These were removed in a downstream PR, #47415, and are now failing again
in this merge forward.

I will contact the OP about addressing this in 2018.3 as these test failures
are not something I have been able to track down in a merge-forward PR.
2018-05-03 16:23:59 -04:00
rallytime
a94cdf8a0d
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/daemons/flo/zero.py
  - salt/minion.py
  - salt/pillar/pillar_ldap.py
  - salt/transport/zeromq.py
  - salt/utils/async.py
  - salt/utils/zeromq.py
  - tests/integration/modules/test_service.py
  - tests/integration/netapi/rest_tornado/test_app.py
  - tests/unit/fileserver/test_gitfs.py
  - tests/unit/modules/test_pip.py
2018-05-02 15:00:40 -04:00
Mike Place
2f5fc4ecc5
Merge pull request #47399 from isbm/isbm-zeromq17-deprecationwarning-2017.7.2-v2
zeromq 17 deprecation warning backport from 2018.3 + tornado 5 fixes
2018-05-02 10:11:15 -05:00
kstreee@gmail.com
b8d37e0a1e
To add a test case for the syndic environment, copies the test case which was written by @mattp- that was already merged into develop branch, related pr is #46692. 2018-05-02 03:21:06 +09:00
kstreee
4627bad1fd
Realizes 'tgt' field into actual minions using ckminions to subscribe results of the minions before publishing a payload. 2018-05-02 02:20:56 +09:00
Bo Maryniuk
296c589f4b Use ZMQ switch utility in the integration tests 2018-04-30 16:06:05 +02: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
Bo Maryniuk
48b40eede9 Use ZMQ switch utility in the integration tests 2018-02-15 14:04:45 +01:00
rallytime
fb4f2dd0fa
Distinguish between Authorization and Authentication errors
And handle the error distiction being returned from the publish function
instead of sending empty strings.
2018-01-23 17:05:22 -05:00
Erik Johnson
49dd5b32e9
[PY3] Add unicode_literals to acl, auth, and netapi modules 2018-01-05 10:31:11 -06:00
Erik Johnson
7b13a7df8b
Replace json module usage with a helper to ensure unicode content is handled properly
This adds wrappers for json.dump{,s} which disable `ensure_ascii` by
default.
2017-12-27 09:30:58 -06:00
Erik Johnson
8cdb9ea54f
[PY3] Add print_function import to files with unicode_literals already added
This makes the 2.x usage invalid syntax and forces the use of print as a
function. This adds the import to the files which I've updated in the
last couple of days but forgot to add it.
2017-12-15 12:14:18 -06:00
Erik Johnson
239fc8d774
[PY3] Add unicode literals to the clients and associated files/tests 2017-12-15 00:19:55 -06:00
Erik Johnson
877abb89d0
Complete the salt.utils refactor
This moves the remaining 30 functions from salt.utils to new locations.
2017-10-15 09:43:31 -05:00
Erik Johnson
3184168365 Use explicit unicode strings + break up salt.utils
This PR is part of what will be an ongoing effort to use explicit
unicode strings in Salt. Because Python 3 does not suport Python 2's raw
unicode string syntax (i.e. `ur'\d+'`), we must use
`salt.utils.locales.sdecode()` to ensure that the raw string is unicode.
However, because of how `salt/utils/__init__.py` has evolved into the
hulking monstrosity it is today, this means importing a large module in
places where it is not needed, which could negatively impact
performance. For this reason, this PR also breaks out some of the
functions from `salt/utils/__init__.py` into new/existing modules under
`salt/utils/`. The long term goal will be that the modules within this
directory do not depend on importing `salt.utils`.

A summary of the changes in this PR is as follows:

* Moves the following functions from `salt.utils` to new locations
  (including a deprecation warning if invoked from `salt.utils`):
  `to_bytes`, `to_str`, `to_unicode`, `str_to_num`, `is_quoted`,
  `dequote`, `is_hex`, `is_bin_str`, `rand_string`,
  `contains_whitespace`, `clean_kwargs`, `invalid_kwargs`, `which`,
  `which_bin`, `path_join`, `shlex_split`, `rand_str`, `is_windows`,
  `is_proxy`, `is_linux`, `is_darwin`, `is_sunos`, `is_smartos`,
  `is_smartos_globalzone`, `is_smartos_zone`, `is_freebsd`, `is_netbsd`,
  `is_openbsd`, `is_aix`
* Moves the functions already deprecated by @rallytime to the bottom of
  `salt/utils/__init__.py` for better organization, so we can keep the
  deprecated ones separate from the ones yet to be deprecated as we
  continue to break up `salt.utils`
* Updates `salt/*.py` and all files under `salt/client/` to use explicit
  unicode string literals.
* Gets rid of implicit imports of `salt.utils` (e.g. `from salt.utils
  import foo` becomes `import salt.utils.foo as foo`).
* Renames the `test.rand_str` function to `test.random_hash` to more
  accurately reflect what it does
* Modifies `salt.utils.stringutils.random()` (née `salt.utils.rand_string()`)
  such that it returns a string matching the passed size. Previously
  this function would get `size` bytes from `os.urandom()`,
  base64-encode it, and return the result, which would in most cases not
  be equal to the passed size.
2017-08-08 13:33:43 -05:00
rallytime
9ff2694155 Merge branch '2016.11' into 'nitrogen'
Conflicts:
  - pkg/salt-minion.service
  - salt/modules/junos.py
  - salt/modules/localemod.py
  - salt/modules/win_system.py
  - salt/states/junos.py
  - tests/unit/modules/test_localemod.py
  - tests/unit/modules/test_win_powercfg.py
  - tests/unit/states/dockerng_test.py
2017-05-24 16:32:59 -06:00
Benjamin Drung
33a7f8b2ec Fix typos
lintian found several spelling errors.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2017-05-24 12:50:29 +02:00
Erik Johnson
b7cc420e6f decode to string before trying to load JSON 2017-05-16 14:20:05 -05:00
rallytime
d4e42b8e74 Use cptc.BaseRestCherryPyTest as test class 2017-05-11 09:09:40 -06:00
rallytime
12a75c1108 Merge branch '2016.11' into 'nitrogen'
No conflicts.
2017-05-10 15:32:23 -06:00
Ch3LL
dac16583b7
add test to query results of /jobs call in api 2017-05-10 12:39:17 -04:00
Pedro Algarvio
80b80e5416
Fix cherrypy memory leakage
* Clean its event/signal bus since our tests don't rely on those.
* No test class level dictionaries
2017-04-28 13:33:35 +01:00
Pedro Algarvio
6364128ad3
Fix tornado test cases 2017-04-28 13:33:34 +01:00
Pedro Algarvio
7b713d9256
Use the more portable helper skip_if_not_root. 2017-04-04 18:58:21 +01:00
Pedro Algarvio
2ee6d5d589
Import from the original modules not tests.integration 2017-04-04 18:58:19 +01:00
Pedro Algarvio
863d8d453f
Ignore the unimplemented abstract method 2017-04-01 23:23:50 +01:00
Pedro Algarvio
f5c36f0048
Integration tests should not use the temporary config 2017-04-01 18:33:28 +01:00
Pedro Algarvio
ff8cb0455f
Account for a timeout when resolving the future 2017-03-28 19:00:54 +01:00
Nicole Thomas
1d66961ce7 Merge pull request #40242 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-23 13:31:39 -06:00
rallytime
235a768872 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/returners/influxdb_return.py
  - salt/states/dockerng.py
  - salt/utils/schedule.py
  - tests/unit/modules/test_docker.py
  - tests/unit/states/dockerng_test.py
  - tests/unit/utils/test_schedule.py
2017-03-22 17:44:08 -06:00
Erik Johnson
1cdf5ea737 PY3 compatibility fixes to netapi tests 2017-03-22 16:09:56 -05:00
rallytime
0ba773d86b Skip flaky test for now 2017-03-21 15:47:20 -06:00
rallytime
fe4a208569 Add flaky decorator to flaky rest_tornado test 2017-03-14 16:30:54 -06:00
rallytime
e7fa367548 [develop] Fix pylint error 2017-03-09 13:04:51 -07:00
Nicole Thomas
2f0f7cd224 Merge pull request #39897 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-09 09:03:46 -07:00
Pedro Algarvio
06c063a609
Test assertion cannot be done in the callback context 2017-03-08 18:34:34 +00:00
Pedro Algarvio
07d0a5ed20
Cleanup after ourselves 2017-03-08 18:34:32 +00:00
rallytime
4fc9b5484b Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/client/ssh/__init__.py
  - salt/pillar/makostack.py
  - tests/integration/client/test_runner.py
  - tests/integration/states/test_file.py
2017-03-08 09:04:26 -07:00
Pedro Algarvio
7b4d849540
Moved some test supporting modules to tests/support
Previously they were in tests/utils which also had test case modules.
2017-03-02 19:56:05 +00:00
Mike Place
523e377b33
Disable one API test that is flaky 2017-03-02 09:16:43 -07: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
1daa2e24cd
Moved some test supporting modules to tests/support
Previously they were in tests/utils which also had test case modules.
2017-02-28 22:52:48 +00:00
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
30e8a66fb0 Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/netapi/rest_tornado/saltnado.py
  - tests/integration/netapi/rest_tornado/test_app.py
2017-01-16 18:54:14 -07:00
rallytime
d24776f5e9 Merge branch '2015.8' into '2016.3'
Conflicts:
  - conf/master
  - doc/topics/netapi/index.rst
  - salt/netapi/__init__.py
2017-01-15 16:07:55 -07:00
rallytime
34282322c0 Clean up tests and docs for batch execution
Batch execution was removed from NetapiClient and Saltnado in
previous commits. This change is a follow up that removes related
test cases and doc references.
2017-01-09 11:29:34 -07:00
Mike Place
a85ab3e59c Just check for keys, not compare all keys for wheel netapi test 2016-08-21 22:17:27 +09:00