Commit Graph

640 Commits

Author SHA1 Message Date
rallytime
776f2ea5d7
Merge branch '2018.3.0rc1' into '2018.3'
Conflicts:
  - salt/pillar/file_tree.py
  - tests/unit/modules/test_yumpkg.py
2018-02-26 11:01:42 -05: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
rallytime
e060a74fd8
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/cloud/clouds/dimensiondata.py
  - salt/config/__init__.py
  - salt/modules/yumpkg.py
  - salt/pillar/ec2_pillar.py
  - salt/utils/docker/__init__.py
  - salt/utils/vault.py
  - tests/integration/states/test_docker_container.py
  - tests/unit/modules/test_yumpkg.py
  - tests/unit/templates/test_jinja.py
  - tests/unit/utils/test_docker.py
2018-02-14 16:31:31 -05:00
Nicole Thomas
007214f7bf
Merge pull request #45908 from DimensionDataResearch/fix/issue/45884
Fix for #45884 ("TypeError: can't serialize <NodeImage" when calling salt-cloud with the dimensiondata driver)
2018-02-12 17:05:28 -05:00
Erik Johnson
0ff41c5835
Add regression test for issue 45893 2018-02-09 11:40:22 -05:00
Adam Friedman
a2bc155c73
Use __utils__['cloud.'] instead of salt.cloud.utils.
saltstack/salt#45884
2018-02-08 08:39:33 +11:00
Adam Friedman
6b1b6be427
Add integration tests for dimensiondata cloud provider.
saltstack/salt#45884
2018-02-08 08:38:58 +11:00
Daniel Wallace
e892f75660
fix digital ocean tests 2018-02-07 14:04:37 -07:00
Erik Johnson
9d200efc26
Add regression test for issue 45893 2018-02-07 14:32:59 -06:00
Erik Johnson
6cef37f310
2 unicode-compatibility fixes for cmdmod.py
First, `shlex.split()` will raise an exception when passed a unicode
type with unicode characters in the string. This modifies our
`shlex.split()` helper to first convert the passed string to a `str`
type, and then return a decoded copy of the result of the split.

Second, this uses our `to_unicode` helper to more gracefully decode the
stdout and stderr from the command. Unit tests have been added to
confirm that the output is properly decoded, including instances where
decoding fails because the return from the command contains binary data.
2018-02-07 02:01:55 -06:00
Erik Johnson
0d92e0a868
Add a test for issue 40578 2018-01-30 09:51:51 -06:00
Erik Johnson
629e6c9674
Further fixes to for salt-ssh test under heavy load
This makes some further tweaks to make the test more stable under heavy
load. Firstly, the background job sleeps longer, and secondly, we make
up to 3 attempts run state.running instead of just the one, in case our
first attempt was too early. It also uses threading to make the job
sleep, since the method of adding a & to the command seemed to be
producing intermittent failures with returning clean JSON.
2018-01-22 07:33:42 -05:00
Nicole Thomas
d48230a9e6
Merge pull request #45582 from terminalmage/salt-ssh-fixes
Two salt-ssh fixes
2018-01-22 07:31:43 -05:00
Erik Johnson
2817101041
Further fixes to for salt-ssh test under heavy load
This makes some further tweaks to make the test more stable under heavy
load. Firstly, the background job sleeps longer, and secondly, we make
up to 3 attempts run state.running instead of just the one, in case our
first attempt was too early. It also uses threading to make the job
sleep, since the method of adding a & to the command seemed to be
producing intermittent failures with returning clean JSON.
2018-01-21 21:19:53 -06:00
Erik Johnson
c27bb7c116
[PY3] Update fileserver for Unicode/PY3 compatibility
This adds a unicode_literals import to the fileserver code, and also ensures
that we return unicode paths from the serialized file/env list caches
(which when deserialized are still encoded str types on PY2).

It also adds a test and modifies a few other existing tests to confirm
that unicode paths/envs are returned *as unicode* in the return data.
2018-01-20 22:25:23 -06:00
Nicole Thomas
4d03162227
Merge pull request #45396 from rallytime/merge-oxygen
[oxygen] Merge forward from 2017.7 to oxygen
2018-01-14 07:44:37 -05:00
Ch3LL
62035a04ff
update provider rackspace config 2018-01-12 12:02:01 -05:00
Ch3LL
40677cad21
migrate rackspace to openstack in cloud test 2018-01-12 11:08:28 -05:00
Ch3LL
f7cf8b6e94
Change rackspace provider name for >=oxygen cloud tests 2018-01-12 10:55:31 -05:00
rallytime
60370f5fb6
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - salt/config/__init__.py
  - salt/daemons/masterapi.py
  - salt/proxy/dummy.py
  - salt/states/file.py
  - tests/integration/modules/test_state.py
  - tests/integration/runners/test_runner_returns.py
  - tests/integration/ssh/test_state.py
  - tests/support/parser/__init__.py
  - tests/unit/grains/test_core.py
  - tests/unit/states/test_file.py
2018-01-11 16:00:08 -05:00
twangboy
0356b3d56f
Backport changes from #45308 2018-01-11 15:36:38 -05:00
Nicole Thomas
2340f0b487
Merge pull request #45380 from twangboy/backport_45308
Backport changes from #45308
2018-01-11 14:45:20 -05:00
Daniel Wallace
3cb91b4d63
disable discovery in test suite 2018-01-11 09:58:14 -07:00
twangboy
419be8a9b5
Backport changes from #45308 2018-01-10 11:16:59 -07:00
Erik Johnson
3565bc2bf2
Don't use include-test SLS in orch tests
This was the _actual_ cause of the failing test in the state module
integration tests.
2018-01-10 10:29:15 -05:00
Erik Johnson
8bc17e0d7a
Fix integration.modules.test_state.StateModuleTest.test_exclude
test_exclude shares file paths with test_include, and while I can't
reproduce the failures, it is likely that improperly cleaned-up files
from test_include are causing the failures in test_exclude. This is
backed up by the fact that the state.sls return data from the
salt-runtests.log shows no trace of the "to-include-test" file
(suggesting it was excluded as expected), yet os.path.isfile() returns
True for this path, causing the test to fail.

This commit uses a distinct base dir for both tests, which should keep
this sort of failure from happening.
2018-01-10 10:29:15 -05:00
twangboy
e3e0dba15d
Fix failing ubuntu test 2018-01-09 21:30:51 -07:00
twangboy
53506a5e86
Fix some additional tests
- Fix problem with invalid characters in requisites.prereq_simple2
- Fix problem with true/false commands in Windows. Need to use exit
- Fix some issues with hard-coded paths to /tmp
2018-01-09 16:50:29 -07:00
Nicole Thomas
8d04c2b3d4
Merge pull request #44856 from Ch3LL/running_test
Add state.running ssh integration test
2018-01-08 16:40:49 -05:00
Erik Johnson
0d975c335d
Add unicode_literals to engines 2018-01-07 14:01:48 -06:00
rallytime
a3d251b2cd
Merge branch '2016.11' into '2017.7' 2018-01-02 15:21:58 -05:00
Daniel Wallace
2d0a9bbf7e
enable UsePAM for ssh tests 2018-01-02 12:29:43 -05:00
rallytime
da1e33abea
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - pkg/windows/req_base.txt
  - salt/engines/slack.py
  - salt/modules/cmdmod.py
  - salt/modules/osquery.py
  - salt/modules/pip.py
  - salt/modules/win_pkg.py
  - salt/states/pip_state.py
  - tests/integration/modules/test_cmdmod.py
2017-12-30 08:44:11 -05:00
Daniel Wallace
0495c0de7f
enable UsePAM for ssh tests 2017-12-28 15:41:25 -07:00
rallytime
a26d4795bd
[2017.7] Fix docstring integration test failure 2017-12-28 10:59:16 -05:00
Erik Johnson
a73c380341
Don't use include-test SLS in orch tests
This was the _actual_ cause of the failing test in the state module
integration tests.
2017-12-24 12:49:45 -06:00
Erik Johnson
4bf072435d
Fix integration.modules.test_state.StateModuleTest.test_exclude
test_exclude shares file paths with test_include, and while I can't
reproduce the failures, it is likely that improperly cleaned-up files
from test_include are causing the failures in test_exclude. This is
backed up by the fact that the state.sls return data from the
salt-runtests.log shows no trace of the "to-include-test" file
(suggesting it was excluded as expected), yet os.path.isfile() returns
True for this path, causing the test to fail.

This commit uses a distinct base dir for both tests, which should keep
this sort of failure from happening.
2017-12-24 12:08:57 -06:00
rallytime
fe81e2d39a
Merge branch '2016.11' into '2017.7'
No conflicts.
2017-12-20 10:26:10 -05:00
Erik Johnson
80b6bd6813
Fix integration.states.test_pip.PipStateTest.test_pip_installed_weird_install
Carbon 1.1.1 for some reason added six to their setup.py, which breaks
this test since it's not installed into the virtualenv. This PR forces
this test to use a version of carbon which does not dep on six in its
setup.py.
2017-12-20 06:54:30 -05:00
Erik Johnson
109c9936d3
Fix integration.states.test_pip.PipStateTest.test_pip_installed_weird_install
Carbon 1.1.1 for some reason added six to their setup.py, which breaks
this test since it's not installed into the virtualenv. This PR forces
this test to use a version of carbon which does not dep on six in its
setup.py.
2017-12-19 18:37:59 -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
Nicole Thomas
e631ce1276
Merge pull request #45030 from terminalmage/moar-unicode
[PY3] Add unicode_literals to tops, thorium, proxy, tokens
2017-12-15 12:04:05 -05: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
7147ac69ac
Add unicode_literals to tops, thorium, proxy, tokens 2017-12-14 21:56:49 -06:00
rallytime
08c71f13e4
Merge branch '2017.7' into 'oxygen'
Conflicts:
  - doc/ref/configuration/minion.rst
  - doc/topics/thorium/index.rst
  - salt/beacons/__init__.py
  - salt/client/mixins.py
  - salt/client/ssh/wrapper/state.py
  - salt/daemons/masterapi.py
  - salt/grains/extra.py
  - salt/minion.py
  - salt/modules/cron.py
  - salt/modules/file.py
  - salt/modules/mac_user.py
  - salt/modules/napalm_network.py
  - salt/modules/state.py
  - salt/modules/win_file.py
  - salt/modules/win_pkg.py
  - salt/proxy/dummy.py
  - salt/state.py
  - salt/states/file.py
  - salt/states/lxc.py
  - salt/utils/__init__.py
  - salt/utils/schedule.py
  - tests/integration/modules/test_file.py
  - tests/integration/modules/test_groupadd.py
  - tests/integration/ssh/test_state.py
  - tests/integration/states/test_file.py
  - tests/unit/daemons/test_masterapi.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_disk.py
  - tests/unit/modules/test_napalm_network.py
  - tests/unit/modules/test_state.py
  - tests/unit/test_minion.py
  - tests/unit/utils/test_process.py
2017-12-11 18:24:41 -05:00
Nicole Thomas
95d9eb5744
Merge pull request #44324 from benediktwerner/accept-minions-from-grains
Automatically accept minion keys based on grains
2017-12-08 09:02:01 -05:00
Ch3LL
aeb5f4e248
Add state.running ssh integration test 2017-12-06 13:23:55 -05:00
Erik Johnson
ce13d8f2e6
Update busybox image script to include /etc/{passwd,group,shadow}
These are necessary to make sure users work
2017-12-06 12:12:25 -06:00
Erik Johnson
ee3486a671
Include failed state/function orchestration results in changes dict
Before this commit they would be in the comment, making it difficult to
programatically analyze the failures.
2017-12-05 00:56:05 -06:00
Nicole Thomas
0697ed0645
Merge branch 'develop' into accept-minions-from-grains 2017-12-04 16:10:32 -05:00
Nicole Thomas
97ec0e6ea0
Merge branch '2017.7' into ssh_pillar_items 2017-11-29 09:39:38 -05:00
Erik Johnson
18905cf32b
Add integration test for triggering orchestration failure via context 2017-11-28 22:03:11 -06:00
Ch3LL
c7f5af1274
Add pillar ssh integration tests 2017-11-28 12:19:41 -05:00
Nicole Thomas
f6a72acfe3
Merge branch '2017.7' into mine_ssh 2017-11-27 17:01:51 -05:00
Nicole Thomas
f2f6817e86
Merge pull request #44608 from Ch3LL/ssh_jinja
Add jinja to ssh sls test file
2017-11-27 17:00:27 -05:00
Ch3LL
f90b4f7653
Add salt-ssh mine.get integration test 2017-11-27 16:38:19 -05:00
Nicole Thomas
7adc0b5b6f
Merge pull request #43893 from olivier-mauras/saltclass
SaltClass: Correct when dict is NoneType because of the value doesn't exist
2017-11-27 16:24:25 -05:00
Nicole Thomas
5ec7ea0bb5
Merge pull request #44572 from Ch3LL/watchin_test
Add watch_in integration test
2017-11-27 15:52:31 -05:00
rallytime
052b13c98e
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/daemons.py
  - salt/client/ssh/__init__.py
  - salt/modules/win_pkg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/proxy/fx2.py
  - salt/utils/__init__.py
  - salt/utils/jinja.py
  - salt/utils/napalm.py
  - salt/utils/path.py
  - salt/utils/verify.py
  - tests/integration/modules/test_saltutil.py
  - tests/integration/states/test_service.py
  - tests/unit/utils/test_verify.py
2017-11-22 12:36:03 -05:00
Nicole Thomas
df669b551d
Merge branch '2017.7' into ssh_jinja 2017-11-22 11:20:01 -05:00
Ch3LL
c9ba33432e
Add Non Base Environement salt:// source integration test 2017-11-20 16:53:56 -05:00
Ch3LL
ca97517795
Add jinja to ssh sls test file 2017-11-20 12:26:09 -05:00
Benedikt Werner
6900e6ece1
Merge branch 'develop' into accept-minions-from-grains 2017-11-17 19:35:53 +01:00
Gareth J. Greenaway
dea335e3d0
Adding state files used by new integration tests. 2017-11-16 13:26:53 -08:00
Ch3LL
5f2b4f434e
Add watch_in integration test 2017-11-16 12:18:30 -05:00
Nicole Thomas
2c6f8f5f9e
Merge pull request #44510 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-11-14 17:21:13 -05:00
Olivier Mauras
61f30a9d80 Correct when dict is NoneType because of the value doesn't exist
Example:

``` yaml
pillars:
  default:
    commands:
{% if grains['os'] == 'RedHat' %}
      pkg_grains: /usr/bin/rpm_grains
{% endif %}
```

In this case `pkg_grains` wouldn't be found on anything else that RedHat systems and would be NoneType which would return an error and break the module.
2017-11-13 19:49:25 +01:00
rallytime
4e2280157a
Merge branch '2017.7' into 'develop'
Conflicts:
  - .kitchen.yml
  - tests/unit/test_doc.py
  - tests/unit/utils/test_cloud.py
2017-11-13 12:27:59 -05:00
Nicole Thomas
5b95495e75
Merge pull request #44484 from Ch3LL/orch_test
Add orchestration tests when target exists or not
2017-11-10 12:24:21 -07:00
Ch3LL
f3ec6df76e
Add orchestration tests when target exists or not 2017-11-10 12:00:12 -05:00
Ch3LL
faef0886a7
Add state tests and state request system to salt-ssh 2017-11-10 10:48:30 -05:00
Gareth J. Greenaway
7cdf703884
Updating tests for watch_any_fail and require_any_fail. 2017-11-08 16:06:44 -08:00
Gareth J. Greenaway
4dbd3e5567
Updating unit tests to limit to two required states. 2017-11-08 16:06:44 -08:00
Gareth J. Greenaway
efbfa5abf2
Adding state file used in integration tests. 2017-11-08 16:06:44 -08:00
Gareth J. Greenaway
58d22a169c
Adding docs and integration tests. 2017-11-08 16:06:43 -08:00
Benedikt Werner
4a4088c869
Fix typo 2017-10-29 14:02:40 +01:00
Benedikt Werner
a546bac5f8
Fix test autosign files by using regexes 2017-10-29 14:02:40 +01:00
Benedikt Werner
64e30ac0b2
Changed integration tests to use autosign_file to authenticate minions 2017-10-29 14:02:38 +01:00
Benedikt Werner
757a64a1c7
Added integration tests for autosign grains 2017-10-29 13:54:08 +01:00
Mike Place
6a25bf4475 Merge pull request #42349 from coredumb/saltclass
New pillar/master_tops saltclass module
2017-09-28 14:26:45 +02:00
rallytime
e0ae50e489
Merge branch '2017.7' into 'develop'
Conflicts:
  - pkg/salt.bash
  - salt/client/mixins.py
  - salt/minion.py
  - salt/modules/aptpkg.py
  - salt/modules/boto_vpc.py
  - salt/modules/win_pkg.py
  - salt/utils/reactor.py
  - tests/unit/utils/test_reactor.py
2017-09-22 10:24:04 -04:00
Daniel Wallace
f84b50a06b
results and columns are lists for mysql returns 2017-09-19 15:08:17 -06:00
Daniel Wallace
3bae894306
digitalocean should be one word.
Everything on their webpage is a reference to DigitalOcean
2017-09-19 12:47:16 -06:00
Olivier Mauras
139e065ce9 New pillar/master_tops saltclass module 2017-09-12 15:53:39 +02:00
garethgreenaway
92bc4fa39b Merge branch 'develop' into missing_minions_branch 2017-08-23 12:56:02 -07:00
rallytime
67cdfd28ad Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/cp.py
  - salt/modules/testinframod.py
  - salt/states/jenkins.py
  - tests/unit/utils/test_find.py
2017-08-22 09:07:26 -04:00
rallytime
84829a6f8c Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/jenkins.py
  - salt/states/jenkins.py
2017-08-18 09:13:54 -04:00
garethgreenaway
daa2537c75 Merge branch 'develop' into missing_minions_branch 2017-08-17 08:27:58 -07:00
aajdinov
d365888489 Initial commit of oneandone salt cloud driver. 2017-08-17 08:03:01 +00:00
Gareth J. Greenaway
e6b750d6a1 Adding some integration tests. 2017-08-15 20:24:40 -07:00
Gareth J. Greenaway
366bed8998 Updating twilio_txt_msg beacon for list based configuration. 2017-08-14 12:04:37 -07:00
Dmitry Kuzmenko
9fedf6012e Fixed 'test_valid_docs' test. 2017-08-14 10:54:16 +03: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
Mike Place
66a2a8edc0 Merge pull request #42398 from garethgreenaway/42189_show_docs_then_error
Show documentation when no function is included
2017-07-27 13:49:35 -05:00
rallytime
1f0b90aa57 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cloud/clouds/joyent.py
  - salt/engines/slack.py
2017-07-26 17:51:36 -06:00
Gareth J. Greenaway
016e2e7a34 Updating tests to reflect changes. Updating to include passed function name in returned docs with message that it is not available. 2017-07-26 09:04:22 -07:00
rallytime
c673b64583 Merge branch '2016.11' into '2017.7'
Conflicts:
  - doc/conf.py
  - doc/ref/configuration/master.rst
  - doc/ref/configuration/minion.rst
  - salt/engines/hipchat.py
  - salt/engines/slack.py
  - salt/grains/core.py
  - salt/version.py
  - tests/integration/states/test_renderers.py
2017-07-20 09:54:08 -06:00
Andrew Pashkin
b0148c15c7 Revert "Make possible to reference previous pillars from subsequent pillars, as they specified in the top file" 2017-07-19 12:25:22 +03:00
Pablo Suárez Hernández
915d94219e Allow to check whether a function is available on the AliasesLoader wrapper 2017-07-18 12:57:36 +01:00
Andrew Pashkin
7d59f7a6c6 Make possible to reference pillars, that come before current pillar in the top file 2017-07-12 19:03:05 +03:00