Commit Graph

176 Commits

Author SHA1 Message Date
Nicole Thomas
0e1ed7b923
Merge pull request #49055 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-08-13 15:20:10 -04:00
Daniel Wallace
4386a9ca1f
Merge branch '2018.3' into isbm-python37-support-2018.3 2018-08-10 15:47:12 -05:00
rallytime
201031fa8a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - 	doc/man/salt.7
  - 	doc/ref/configuration/minion.rst
  - 	salt/cloud/clouds/ec2.py
  - 	salt/returners/highstate_return.py
  - 	tests/support/gitfs.py
  - 	tests/unit/loader/test_loader.py
2018-08-10 13:12:14 -04:00
Daniel Wallace
6bc44c91c4
remove localhost from tests
now that enable_ssh_minions is turned off, remove localhost from
returns.
2018-08-10 09:03:35 -05:00
Bo Maryniuk
35eaebb8a4 Fix docstrings 2018-08-10 15:59:23 +02:00
rallytime
f08ee6c6ae
Update netapi client tests
This change does 2 things:
- Skip 2 tests: they are not actually _testing_ anything, just running functions
  Let's skip these for now until we can dedicate some time to investigate what
  should be tested here. This will also help the tests breath a little bit.
- Add a small sleep to the async test. This test needs a little breathing room so
  the procs don't get stepped on. I think this is what is causing the master to
  shut down sometimes during test runs:

```
08:41:47          test_wheel_async (integration.netapi.test_client.NetapiClientTest)
08:41:47        [CPU:0.0%|MEM:13.2%]  ... 12:41:47,280 [salt.utils.process                         :670 ][ERROR   ] An un-handled exception from the multiprocessing process 'SignalHandlingMultiprocessingProcess-24' was caught:
08:41:47        Traceback (most recent call last):
08:41:47          File "/tmp/kitchen/testing/salt/utils/process.py", line 663, in _run
08:41:47            return self._original_run()
08:41:47          File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
08:41:47            self._target(*self._args, **self._kwargs)
08:41:47          File "/tmp/kitchen/testing/salt/client/mixins.py", line 457, in _proc_function
08:41:47            salt.utils.daemonize()
08:41:47          File "/tmp/kitchen/testing/salt/utils/__init__.py", line 514, in daemonize
08:41:47            os.dup2(dev_null.fileno(), sys.stdout.fileno())
08:41:47        io.UnsupportedOperation: fileno
08:41:47        Process SignalHandlingMultiprocessingProcess-24:
08:41:47        Traceback (most recent call last):
08:41:47          File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
08:41:47            self.run()
08:41:47          File "/tmp/kitchen/testing/salt/utils/process.py", line 663, in _run
08:41:47            return self._original_run()
08:41:47          File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
08:41:47            self._target(*self._args, **self._kwargs)
08:41:47          File "/tmp/kitchen/testing/salt/client/mixins.py", line 457, in _proc_function
08:41:47            salt.utils.daemonize()
08:41:47          File "/tmp/kitchen/testing/salt/utils/__init__.py", line 514, in daemonize
08:41:47            os.dup2(dev_null.fileno(), sys.stdout.fileno())
08:41:47        io.UnsupportedOperation: fileno
```
2018-08-09 10:11:20 -04:00
rallytime
3e6445a9d6
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/man/salt-api.1
  - doc/man/salt-call.1
  - doc/man/salt-cloud.1
  - doc/man/salt-cp.1
  - doc/man/salt-key.1
  - doc/man/salt-master.1
  - doc/man/salt-minion.1
  - doc/man/salt-proxy.1
  - doc/man/salt-run.1
  - doc/man/salt-ssh.1
  - doc/man/salt-syndic.1
  - doc/man/salt-unity.1
  - doc/man/salt.1
  - doc/man/salt.7
  - doc/man/spm.1
  - salt/beacons/log.py
  - salt/client/ssh/__init__.py
  - salt/modules/cmdmod.py
  - salt/utils/win_functions.py
  - tests/integration/modules/test_cmdmod.py
  - tests/integration/netapi/rest_tornado/test_app.py
  - tests/integration/runners/test_state.py
2018-08-08 13:31:57 -04:00
rallytime
0bd838ab6c
Skip unreliable tornado tests
Marked as flaky originally, but they're still flaky with undetermined
race-conditions. These are skipped in 2018.3 and forward, so let's skip
them here as well.
2018-08-07 11:22:18 -04:00
rallytime
7320aa9104
Skip unreliable tornado test.
Even with the flaky decorator, it still fails _sometimes_. This is not
a useful test as it sits. Skipping it for now.
2018-08-01 15:46:03 -04:00
rallytime
7332cce567
[2017.7] Mark some tornado tests as flaky 2018-07-23 12:53:26 -04:00
rallytime
c4fd2a0930
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/rabbitmq.py
  - tests/integration/modules/test_pip.py
2018-06-30 09:33:21 -04:00
Thomas Jackson
c0180ff33d
Properly configure syndic in test case
Without this option we aren't really a syndic and it won't wait
2018-06-25 10:26:30 -04:00
Gareth J. Greenaway
aea4f7ae14
Fixing test_local_batch 2018-06-24 16:03:47 -07:00
Gareth J. Greenaway
ce3e1eaf2c
Removing sort. 2018-06-23 11:25:46 -07:00
Gareth J. Greenaway
83accf3b20
Fixing test_local_batch 2018-06-22 12:19:41 -07:00
Gareth J. Greenaway
85cef126e0
Adding note about why salt.utils.versions is being re-imported. Adding a test for local_batch. 2018-06-22 12:19:40 -07:00
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