Commit Graph

7393 Commits

Author SHA1 Message Date
Nicole Thomas
2ad2d4e27d
Merge branch 'develop' into add-vmware-vm-management 2017-12-04 16:41:37 -05:00
Nicole Thomas
0697ed0645
Merge branch 'develop' into accept-minions-from-grains 2017-12-04 16:10:32 -05:00
twangboy
0ff9fa498a
Fix test_directory 2017-12-04 14:05:54 -07:00
twangboy
d5dd42aebe
Fix integration tests for Windows 2017-12-04 14:05:53 -07:00
twangboy
a24b964ea5
Fix unit test to handle new Exception 2017-12-04 14:05:52 -07:00
twangboy
4602f499a2
Remove loader module mixin, add linux paths 2017-12-04 14:05:52 -07:00
twangboy
99b27c037f
Add tests to avoid future regression 2017-12-04 14:05:51 -07:00
Nicole Thomas
da45a7b547
Merge pull request #44555 from mcalmer/develop-teach-pkg-about-provides-try2
Teach pkg state to optionally install capabilities
2017-12-04 15:55:12 -05:00
Nicole Thomas
714d057295
Merge branch 'develop' into move-44053 2017-12-04 12:53:59 -05:00
Daniel Wallace
1d0bd5bb32
Merge branch '2016.11' into 2016.11 2017-12-04 10:13:15 -07:00
pjcreath
518e709f35 Merge branch 'develop' into add_file_tree_environments 2017-12-04 11:46:36 -05:00
pjcreath
0e6028e09f Make requested changes, fix inaccurate test description. 2017-12-04 11:35:04 -05:00
Bo Maryniuk
0d2675c4fe Use variable, instead of direct value 2017-12-04 15:51:56 +01:00
Bo Maryniuk
1ddc47da0a Add unit test for _get_pillar_errors when external pillar is clean and internal contains errors 2017-12-04 15:51:56 +01:00
Bo Maryniuk
68480d5dc9 Add unit test for _get_pillar_errors when both external and internal pillars contains errors 2017-12-04 15:51:56 +01:00
Bo Maryniuk
218a59e93b Add unit test for _get_pillar_errors when external pillar has errors and internal is clean 2017-12-04 15:51:56 +01:00
Bo Maryniuk
3ce19356c2 Add unit test for _get_pillar_errors when external and internal pillars are clean 2017-12-04 15:51:56 +01:00
Bo Maryniuk
67034139d9 Fix unit test: wrong error types in side effect 2017-12-04 15:51:56 +01:00
Bo Maryniuk
d9359bca13 Bugfix: unit test mistakenly expects pillar errors as a string, while it is a list 2017-12-04 15:51:56 +01:00
Michael Calmer
b6365aee3c fix order of parameters in unit tests 2017-12-04 15:38:22 +01:00
Nicole Thomas
4ebac09f60
Merge pull request #44735 from gracinet/42713_backport_2017.7
Backported issue #42713 to 2017.7
2017-12-03 20:43:22 -05:00
Erik Johnson
153bf45b03
Fix regression in file.managed when source_hash used with local file
This ensures that we enforce the passed source_hash when the source is a
file local to the minion.
2017-12-03 00:01:44 -06:00
Jorge Schrauwen
9e163c847e Only update props when changed in zpool.present
We make sure the values conform to what zfs expects, this should
fix the unneeded updates as mentioned in #44404

Additional test for zpool.get with whitespaces in the result.
2017-12-02 16:00:06 +01:00
Jorge Schrauwen
0e9fe895e3 Add new unit tests for zfs.list and zfs.get
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
2017-12-02 13:42:19 +01:00
Jorge Schrauwen
0813183fe8 Add new unit tests for zpool.list and zpool.get
Parsable output needs new unit tests. I update the old tests with fresh
data from one of my test systems and create new tests for the same data
but with the parsable output flag set. These tests also test the new
code that converts numbers to actually numeric values.
2017-12-02 13:09:38 +01:00
twangboy
371e210247
Add ability to reset file system object perms 2017-12-01 16:51:18 -07:00
twangboy
a5737e8fc3
Fix lint errors 2017-12-01 16:45:18 -07:00
twangboy
be96de09cc
Fix pickling error by decorating 2017-12-01 16:45:18 -07:00
rallytime
3d9eafc4bd
Lint: Remove extra empty lines at end of files 2017-12-01 14:46:27 -05:00
twangboy
5615862f23
Fix some lint 2017-12-01 10:25:48 -07:00
twangboy
627d5ab0c9
Mock salt.utils.which
cmd.run return values are mocked
2017-12-01 10:25:48 -07:00
twangboy
e5a96fe00f
Skip test_fstype on Windows
no lsblk on Windows
2017-12-01 10:25:48 -07:00
rallytime
239f3511bf
Merge branch '2016.11' into '2017.7'
Conflicts:
  - salt/modules/reg.py
  - salt/modules/state.py
  - salt/modules/win_pkg.py
  - salt/netapi/rest_cherrypy/app.py
  - salt/utils/__init__.py
  - tests/integration/modules/test_file.py
  - tests/integration/output/test_output.py
  - tests/unit/grains/test_core.py
2017-12-01 11:12:44 -05:00
Nicole Thomas
d23192c492
Merge pull request #44747 from gtmanfred/roster_defaults
use a copy so roster_defaults doesn't mangle
2017-12-01 10:13:47 -05:00
Agnes Tevesz
42fcaf6c05 Fixed esxvm module, schema, proxy, states and vmware utils, vsphere
module pr-pylint issues
2017-12-01 11:23:38 +01:00
Agnes Tevesz
a517550bc3 Added to tests.modules.test_vsphere the esxvm compatibility for tests 2017-12-01 11:23:27 +01:00
Agnes Tevesz
c1b430ca65 Added tests: unit.utils.vmware.test_vm, covers:
- vm creation
 - vm registation
2017-12-01 11:22:57 +01:00
Agnes Tevesz
c3c15a2b92 Adding vmware utils changes for virtual machine management, tests are
included
2017-12-01 11:22:43 +01:00
Bo Maryniuk
e1eec2c69d Add unit test for __virtual__ in case Ansible is installed on the Minion 2017-12-01 11:21:27 +01:00
Bo Maryniuk
fa21af69dd Add unit test for __virtual__ in case Ansible is not installed on the Minion 2017-12-01 11:21:27 +01:00
Nicole Thomas
5c737100c4
Merge pull request #44726 from terminalmage/issue42188
Add __context__ to RunnerClient and WheelClient
2017-11-30 19:03:02 -05:00
Daniel Wallace
911411ed8f
add unit test 2017-11-30 13:48:30 -07:00
Erik Johnson
c1e4bea83e
Change lock message 2017-11-30 14:30:44 -06:00
Erik Johnson
3770cd7dd3
Add unit test for lock_saltenv
Also move up the _get_opts in state.pkg to make it easier to unit test
2017-11-30 14:28:09 -06:00
Erik Johnson
683e2cc502
Rename 'environment' config option to 'saltenv'
'environment' predates the 'saltenv' nomenclature, and since we have
been using saltenv on the CLI for years, and now also have pillarenv, it
makes sense to make this change.
2017-11-30 13:08:49 -06:00
rallytime
dc3097cedd
Write a unittest for error message raised with missing "." in function 2017-11-30 11:05:22 -05:00
Denys Havrysh
d1f247e49e
Add basic unit tests for schedule util eval func 2017-11-30 12:43:52 +02:00
Erik Johnson
74a18f387f
Update orchestration unit tests 2017-11-29 15:51:53 -06:00
twangboy
4e0359b603
Skip IPC transport tests in Windows, not supported 2017-11-29 09:19:51 -07:00
Georges Racinet
fb586c6dce
Backported issue #42713 to 2017.7
Cherry-picked and squashed the two commits from the develop branch
(details at the end of this message)

The unit test module didn't exist at all on 2017.7, hence a conflict during
cherry picking, resolved by introducing only the new tests (the other ones
don't pass as is on 2017.7)

Also, the mock in unit tests for mine.get had to be adapted,
because the return of salt.utils.minions.CkMinions._check_compound_minions()
takes a different form on 2017.7 (just the list of minions).

Original cherry-picked commits:

commit 115ebef6a089dedf8dbadd3b4cca768adbb4a710
Author: Georges Racinet <gracinet@anybox.fr>
Date:   Wed Nov 8 18:02:29 2017 +0100

    Unit test for backwards compatibility of mine.get

    Could not find calls to RemoteFuncs in unit tests, therefore started a
    new one, hope it's in the appropriate place.

    The test replaces the caceh by its own (very limited) one. It's quite
    possible it could be improved by reusing another one meant for unit tests.

commit dc884478399355f3fbea8626a8366b933580dee0
Author: Georges Racinet <gracinet@anybox.fr>
Date:   Mon Oct 30 13:49:13 2017 +0100

    Backwards compat for mine.get on pre-Nitrogen minions

    With this change, the master will accept `expr_form` from
    its minions doing a `mine.get`, which is what minions versions
    before Nitrogen would do. This solves issue #42713.

    In case both `tgt_type` and `expr_form` are present, the former
    gets precedence.

    Performance-wise, this adds a single dict lookup for minions
    running Nitrogen onwards, and two for pre-Nitrogen minions.
    This is, in my opinion, acceptable.
2017-11-29 16:17:52 +01:00
Nicole Thomas
1855f3fe12
Merge pull request #43783 from garethgreenaway/43647_fix_InitiatorName_in_comments
[develop] Fix to grains/core.py
2017-11-29 09:05:59 -05:00
Gareth J. Greenaway
89b546c075
Merge branch 'develop' into netbox-module 2017-11-28 15:25:42 -08:00
Gareth J. Greenaway
6ee18e4f38
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-28 13:35:11 -08:00
Anthony Shaw
a029f70cff
merge inbound, resolve conflict and remove unfinished state test module 2017-11-29 08:21:53 +11:00
Nicole Thomas
5bc454821b
Merge branch 'develop' into fixpip 2017-11-28 16:00:51 -05:00
Nicole Thomas
a5828d6ad9
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-28 09:17:34 -05:00
Erik Johnson
682fc1b884
Fix failing grains test on CentOS
Resolves https://github.com/saltstack/salt-jenkins/issues/556
2017-11-27 21:37:46 -06:00
Zach Moody
1faa685d9e fixup pylint import error. 2017-11-27 19:05:51 -06:00
Zach Moody
871a90cbc5 add netbox execution module 2017-11-27 18:59:06 -06:00
Christian McHugh
249987f750 merge with develop 2017-11-27 22:04:59 +00: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
94001ffc64
lint: whitespace fixes 2017-11-27 16:15:44 -05:00
Nicole Thomas
e8298d734d
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-27 15:08:36 -05:00
Nicole Thomas
cae5309752
Merge pull request #44646 from mchugh19/pip-is_installed
add is_installed function
2017-11-27 14:40:55 -05:00
Erik Johnson
8ee5e57fee
Merge pull request #44649 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-11-27 11:23:29 -06:00
Nicole Thomas
9e45e4eff9
Lint: Remove extra blank lines 2017-11-27 11:25:05 -05:00
Erik Johnson
b4eb1527a6
Add test for PR 44335
This also modifies the virtual_subtype code slightly, due to an issue I
noticed in testing. We were reading from `/proc/1/cgroup` twice (once
for LXC, and then again for Docker).
2017-11-25 14:32:43 -06:00
Anthony Shaw
b95750e31c
fix minor linting errors 2017-11-25 19:04:57 +11:00
Anthony Shaw
febee3e065
patch cache replacement 2017-11-25 19:02:02 +11:00
Anthony Shaw
8ac1144c77
complete tests for grain module 2017-11-25 06:11:25 +11:00
Anthony Shaw
0a34c12147
tests for napalm grains module, still issue to resolve on is_proxy 2017-11-25 05:47:27 +11:00
Anthony Shaw
efcc0098f2
add unit tests for the proxy module 2017-11-25 05:06:41 +11:00
Anthony Shaw
8fd459af74
complete tests for napalm_yang_mod 2017-11-25 04:06:36 +11:00
Anthony Shaw
92ef7c555b
test for napalm_yang_mod 2017-11-25 03:48:22 +11:00
Anthony Shaw
7376d631f5
add napalm_users tests 2017-11-24 17:13:59 +01:00
Anthony Shaw
8da1aafb00
add napalm_snmp tests 2017-11-24 17:13:44 +01:00
Anthony Shaw
a8c3f1bd35
add napalm_route tests 2017-11-24 17:13:30 +01:00
Anthony Shaw
c7106d646c
complete tests for napalm_probes 2017-11-24 16:48:06 +01:00
Anthony Shaw
136816c109
fix missing commas in docstrings 2017-11-24 16:36:38 +01:00
Anthony Shaw
dd682106cd
add module for testing napalm_probes 2017-11-24 16:34:40 +01:00
Anthony Shaw
452a8965a3
complete coverage for NTP module 2017-11-24 16:34:16 +01:00
Christian McHugh
590834a136 Use json format with newer pip versions (> 9)
Add unit tests for both pip > 9 and legacy
2017-11-23 22:27:23 +00:00
Jorge Schrauwen
a94edecc93
Merge branch 'develop' into zpoolupdate 2017-11-23 16:53:41 +01:00
Christian McHugh
ab5520fdf7 add true and false test for is_installed 2017-11-23 14:08:46 +00:00
Ahmed AbouZaid
ff7e0292c4
add test for toml serializer 2017-11-23 00:44:55 +01:00
Georges Racinet
ebc165be45
Improving pylint score on states.glusterfs and test
the only tricky one is the shadowing of `peered` (function and local variable),
but that variable wasn't really needed.

I don't know why I get no-member errors for __salt__ and __opts__ in the
test file (read .pylintrc very quickly only).
The states modules is up to 10.0 score for me with that change
2017-11-22 21:15:34 +01:00
Georges Racinet
451fddb084 Take IPv6 into account in states.glusterfs.peered
This solves issue #44606

Resolution of the peer IP address (done to check if it is the current
minion) should not fail and return IPv6 addresses as well as IPv4.

The refactor uses functions from salt.utils.network instead of directly
calling socket.gethostbyname(), because they are already presented in
an easy to use format.
2017-11-22 20:58:54 +01:00
rallytime
1dea504f2d
Replace util path references with new ones 2017-11-22 12:44:36 -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
6d861f9a74
Disable pylint warning 2017-11-22 10:36:21 -05:00
rrroo
e3897e4820 Use assertEqual 2017-11-22 16:35:38 +01:00
Mircea Ulinic
3a0945ce3d
Merge pull request #11 from tonybaloney/gh_44332_clone
Thanks @tonybaloney
2017-11-22 10:41:01 +00:00
Anthony Shaw
dfdb43780d
coverage for ntp testing 2017-11-22 11:36:22 +01:00
Anthony Shaw
5ce67c8a7b
setup all tests for napalm_acl module 2017-11-22 09:01:26 +00:00
Anthony Shaw
40431228c8
Add test module for napalm_acl 2017-11-22 08:41:39 +00:00
Anthony Shaw
cd8d87c61f
create a common module for napalm tests, setup napalm_bgp tests 2017-11-22 08:37:56 +00:00
Anthony Shaw
88ef9f18fc
ignore lint error on import 2017-11-22 08:11:07 +00:00
Anthony Shaw
25427d845e
convert key iterator to list as python 3 wont index an iterator 2017-11-22 08:10:36 +00:00
Gareth J. Greenaway
227be73e0a
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-20 11:01:38 -08:00
Nicole Thomas
bce50154e5
Merge branch '2017.7' into improve-net-load 2017-11-20 10:59:54 -05:00
Roald Nefs
ac1a4d0817
Updated Telegram returner test
- Removed trailing newlines
2017-11-20 10:41:08 +01:00
Benedikt Werner
57b5510577
Merge branch 'develop' into accept-minions-from-grains 2017-11-20 10:19:22 +01:00
Roald Nefs
47147e2769
Added new Telegram module
Added a new Telegram module, which allows to send a message via Telegram
using the Telegram Bot API. The commit also includes:
- Update for the Telegram returner (merged in #44148); the Telegram
returner now fully utilizes the Telegram module.
- Update to the documentation in order to add the Telegram module to the
list list of all modules.
- Updated Telegram returner test.
- New Telegram module test.
2017-11-20 08:47:57 +01:00
Jorge Schrauwen
409acc1b1b Also add tests for zpool.scrub 2017-11-19 12:16:29 +01:00
Jorge Schrauwen
64e0b45e51 Add tests for zpool.labelclear and zpool.split 2017-11-19 12:09:36 +01:00
Anita Krueger
d3c4f6026b
Adding nexus state and module including unit tests 2017-11-18 15:31:37 +00:00
Benedikt Werner
6900e6ece1
Merge branch 'develop' into accept-minions-from-grains 2017-11-17 19:35:53 +01:00
Nicole Thomas
24b1d7af31
Merge pull request #44518 from twangboy/win_fix_verify_env
Pass root_dir to the win_verify_env function
2017-11-16 15:57:48 -05:00
Nicole Thomas
be930beee6
Merge branch 'develop' into add-cloud.vmware.convert_to_snapshot-feature 2017-11-16 11:26:25 -05:00
pjcreath
4ad01ba739 Fix file_tree py3 incompatibility and update test
The incompatibility was introduced in 2015.8.4, but there wasn't any
test case to catch it.
2017-11-16 10:16:28 -05:00
Nicole Thomas
d622877558
Merge branch 'develop' into sentry_return 2017-11-16 10:07:47 -05:00
Nicole Thomas
3275dbeff9
Merge branch 'develop' into add-cloud.vmware.remove_snapshot-feature 2017-11-16 09:59:29 -05:00
fishhead108
8a681751fe
change call type 2017-11-16 00:07:03 +01:00
fishhead108
fc17d47bcf
add test_remove_snapshot_call_no_snapshot_name_in_kwargs 2017-11-16 00:05:22 +01:00
fishhead108
35f3c96ade Test for convert_to_template_call 2017-11-15 22:26:42 +01:00
fishhead108
e8d1cd44ea Test for remove_snapshot_call 2017-11-15 22:21:12 +01:00
pjcreath
89a198fe98 salt.pillar.file_tree: add support for environments, add test
This modifies this ext_pillar with basic support for environments
by treating a relative root_dir as relative to the pillar_roots
of the environment specified by pillarenv.

The behavior for absolute paths is unchanged.

Also adds a unit test for file_tree testing both old and new
behavior.

Resolves #44458.
2017-11-15 13:28:14 -05:00
rrroo
f10d04c8af Add unittest for sentry_return
Move functions to top level to improve testability.
2017-11-15 16:06:56 +01:00
Nicole Thomas
4315c20195
Merge branch 'develop' into add-mandrill-mod 2017-11-14 17:29:52 -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
Erik Johnson
958e1aeb8d
Fix test to reflect changes in YAML dumper
PR #42064 modified the YAML dumper to display unicode text as a unicode
literal rather than with the !!python/unicode extension prefix. This
updates the test to reflect the change in Salt's behavior.
2017-11-14 13:43:39 -06:00
Ch3LL
9ea4db4224
mock socket.getaddrinfo 2017-11-14 14:39:15 -05:00
Tom Williams
cedd0db97a INFRA-5980 - fix unit test 2017-11-14 11:51:16 -05:00
Ch3LL
78a07e30f4
add more fqdn tests and remove some of the mocking 2017-11-14 11:39:35 -05:00
Ch3LL
5dbf4144ce
add ipv6 in opts 2017-11-14 11:39:35 -05:00
Ch3LL
eabc1b4f9c
Add fqdn and dns core grain tests 2017-11-14 11:39:31 -05:00
Mircea Ulinic
777d01e82a
Add tests for the mandrill execution module 2017-11-14 11:26:56 +00:00
Mircea Ulinic
ba4a62769c
Fix trailing spaces 2017-11-14 09:21:55 +00:00
Nicole Thomas
a5bb896ff1
Merge pull request #44340 from gracinet/42713_mine.get_back_compat
Backwards compat for mine.get on pre-Nitrogen minions
2017-11-13 16:49:51 -05:00
twangboy
47114fdb30
Pass root_dirs to the win_verify_env function
Remove while loop that was hanging when `salt` wasn't in the path
Add salt.util.path.safe_path function to check for unsafe paths
Pass root_dir to all calls to `verify_env`
2017-11-13 13:05:23 -07:00
Erik Johnson
df972db3ba
Merge pull request #42930 from CorvinM/issue36942
Jinja line statements and comments
2017-11-13 12:02:16 -08:00
Mike Place
97863f338a
Merge pull request #43410 from skob/develop
queue.insert_runner with sqlite backend
2017-11-13 12:47:32 -07:00
Mike Place
28e1160c41
Merge pull request #43474 from kstreee/separate-key-dir-from-cache-dir
Separates 'key_dir' from 'cache_dir', The key files (i.e. '.root_key', '.sudo_ACCOUNT_NAME') must not be shared with other masters.
2017-11-13 12:41:28 -07:00
Mike Place
3af0031e02
Merge pull request #43504 from isbm/isbm-ansible-module-dev
Got Ansible own modules? Run them from within the Salt just like that!
2017-11-13 12:28:25 -07:00
Mike Place
79b7eb1c33
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-13 12:20:39 -07:00
Mike Place
f9b273a894
Merge pull request #43837 from twangboy/win_unit_test_archive
Fix `unit.states.test_archive` for Windows
2017-11-13 12:12:18 -07: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
Mike Place
dd2844a645
Merge pull request #44196 from benediktwerner/develop
Fix autosign file permission check [develop]
2017-11-13 11:34:37 -07:00
Mike Place
f2aa3539ef
Merge branch 'develop' into accept-minions-from-grains 2017-11-13 11:13:50 -07:00
Mike Place
fef389d6ea
Merge branch 'develop' into 42713_mine.get_back_compat 2017-11-13 11:07:35 -07:00
Mike Place
ebbe5949ea
Merge pull request #44457 from twangboy/win_remove_wmi_monkeypatching
Remove wmi monkeypatching
2017-11-13 10:38:51 -07:00
rallytime
59ddde4671
Update old util paths to new paths 2017-11-13 12:35:31 -05:00
Gareth J. Greenaway
4d0806e28c
Merge branch '2017.7' into develop2 2017-11-13 10:29:46 -07: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
Anthony Shaw
ba0280e727
linting updates 2017-11-11 15:25:36 +02:00
Anthony Shaw
78b90f3d0c
add remaining tests 2017-11-11 15:21:24 +02:00
Anthony Shaw
386c4e5791
add tests for all the getters 2017-11-11 14:55:25 +02:00
Mike Place
bca50dedb0
Merge pull request #44361 from isbm/isbm-file.line-issues-devel
Long-awaiting set of unit tests and fixes for "file.line"
2017-11-10 16:37:56 -07:00
Sergey Kizunov
4d0d023115
Fix broken beacons_before_connect feature
The `beacons_before_connect` and `scheduler_before_connect` features
that came from PR #38289 had code that was lost and so the features
don't work. Added them back in and also added unit tests to help
prevent this type of issue in the future.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-11-10 16:26:04 -06:00
twangboy
2f30ad93b1
Skips mode check in Windows 2017-11-10 14:29:10 -07:00
Mike Place
8391b34372
Merge pull request #44148 from roaldnefs/add-telegram-returner
Add Telegram returner
2017-11-10 12:04:30 -07:00
Bo Maryniuk
f8c016cd48 Remove extra assertions 2017-11-10 20:02:04 +01:00
Bo Maryniuk
755bc35585 Fix value is not iterable error 2017-11-10 20:02:04 +01:00
Bo Maryniuk
56c52e6ab3 Fix TypeError for argument of type 'LoaderError' is not iterable 2017-11-10 20:02:04 +01:00
Bo Maryniuk
8f7ef4f45f Lintfix: E9502 2017-11-10 20:02:04 +01:00
Bo Maryniuk
0594517a2e Lintfix: E0102 2017-11-10 20:02:04 +01:00
Bo Maryniuk
7742037bcd Don't bother with non-pytest unit tests 2017-11-10 20:02:04 +01:00
Bo Maryniuk
67cede713f Add unit test for module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
4004e2f53d Add unit test for module loader 2017-11-10 20:02:04 +01:00
Bo Maryniuk
fd2fca0482 Improve module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
25990f66bc Add unit test resolver module loader failure 2017-11-10 20:02:04 +01:00
Bo Maryniuk
9d0762a8ee Refactor to setup/teardown methods 2017-11-10 20:02:04 +01:00
Bo Maryniuk
630b654544 Add unit test for modules filtering 2017-11-10 20:02:04 +01:00
Bo Maryniuk
fc24371704 Do not use mock but real resolver class 2017-11-10 20:02:04 +01:00
Bo Maryniuk
082d47f2c1 Add unit test for documentation extractor 2017-11-10 20:02:04 +01:00
Bo Maryniuk
c7a1b733ab Add scaffold for the unit test 2017-11-10 20:02:04 +01:00
Bo Maryniuk
b2ed7d0ecd Mute pylint on misdetected regex-like strings that are actually just test data. 2017-11-10 19:50:47 +01:00
Bo Maryniuk
40f1e1d954 Rewrite unit tests for file.line on delete/replace an empty line 2017-11-10 19:50:47 +01:00
Bo Maryniuk
c2d9d8f8ea Add unit test for file.line ensuring line between two lines but content already exists 2017-11-10 19:50:47 +01:00
Bo Maryniuk
9963895719 Add unit test for file.line ensuring line inside the range of lines 2017-11-10 19:50:47 +01:00
Bo Maryniuk
1e1f5e5a6f Add unit test for file.line ensuring line between two other lines nearby 2017-11-10 19:50:47 +01:00
Bo Maryniuk
59de17b260 Add unit test for file.line on calling insert/ensure after specific line 2017-11-10 19:50:47 +01:00
Bo Maryniuk
710481b25e Add unit test for file.line when calling insert/ensure mode 2017-11-10 19:50:47 +01:00
Bo Maryniuk
b42b762c57 Add unit test for file.line when inserting a line at the end of the file (append functionality) 2017-11-10 19:50:46 +01:00
Bo Maryniuk
80c40bbb11 Remove irrelevant issue number 2017-11-10 19:50:46 +01:00
Bo Maryniuk
c95b3e031c Add unit test about file.line for insert/start 2017-11-10 19:50:46 +01:00
Bo Maryniuk
926372574d Remove irrelevant issue number from the docstring 2017-11-10 19:50:46 +01:00
Bo Maryniuk
b4cd4bd165 Add unit test for file.line replacement 2017-11-10 19:50:46 +01:00
Bo Maryniuk
9a72761dc6 Add unit test for file.line delete by direct match or regular expression 2017-11-10 19:50:46 +01:00
Bo Maryniuk
60185f578e Add unit test for file.line usage together with before/after 2017-11-10 19:50:46 +01:00
Bo Maryniuk
fc79a546dd Rename unit test 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d1a41dd7bd Add unit test file.line insert before line 2017-11-10 19:50:46 +01:00
Bo Maryniuk
1ea7e33605 Harden unit test for 'after pattern' scenario 2017-11-10 19:50:46 +01:00
Bo Maryniuk
bde3611f08 Remove unnecessary code 2017-11-10 19:50:46 +01:00
Bo Maryniuk
fdffbe47b0 Add unit test for using patterns for line matching 2017-11-10 19:50:46 +01:00
Bo Maryniuk
ed171176a8 Rename unit test while using no patterns 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d08307f53b Add unit test for file.line insert=after 2017-11-10 19:50:46 +01:00
Bo Maryniuk
39126da5a2 Update unit test data 2017-11-10 19:50:46 +01:00
Bo Maryniuk
47fbe03c14 Add unit test for file._starts_till function 2017-11-10 19:50:46 +01:00
Bo Maryniuk
599310e684 Fix docs for skipif decorator 2017-11-10 19:50:46 +01:00
Bo Maryniuk
d5d653af45 Add unit test for file.line on no location/before/after check failure 2017-11-10 19:50:46 +01:00
Bo Maryniuk
5b76c41f44 Move all file.line unit tests to the own class 2017-11-10 19:50:46 +01:00
Bo Maryniuk
f0f08a10e8 Add unit test for file.line on an empty content while not deleting anything 2017-11-10 19:50:46 +01:00
Bo Maryniuk
b5a80231bd Rename a unit test and clarify its purpose in docs 2017-11-10 19:50:46 +01:00
Bo Maryniuk
cf191b01d6 Add unit test for file.line on mode checks 2017-11-10 19:50:46 +01:00
Nicole Thomas
5505a8819a
Merge branch '2017.7' into win_unit_test_archive 2017-11-10 11:48:51 -07:00
Mike Place
8b834e341d
Merge pull request #44288 from eradman/onlyif_unless
Report 'onlyif' and 'unless' conditions as true or false
2017-11-10 11:37:01 -07:00
twangboy
6c872e95e6
Add back the setup_loader_modules function
Use empty dict instead of defining wmi
2017-11-10 11:30:00 -07:00
Erik Johnson
20273e3697
No need for setup_loader_modules since we're actually importing wmi 2017-11-10 11:29:59 -07:00
twangboy
8c107873cd
Remove wmi monkeypatching
The WMI object was being monkey patched in the global namespace causing
other tests to fail
2017-11-10 11:29:54 -07:00
Nicole Thomas
9302149604
Merge branch 'develop' into develop 2017-11-10 10:56:12 -07:00
Nicole Thomas
0a8419358b
Merge branch 'develop' into separate-key-dir-from-cache-dir 2017-11-10 10:39:53 -07:00
Nicole Thomas
9fb9fecfa7
Merge branch 'develop' into 42713_mine.get_back_compat 2017-11-10 10:06:11 -07:00
rallytime
9fcc2a70b5
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/unit/modules/test_rh_ip.py
2017-11-10 10:33:25 -05:00
twangboy
0a9e862bf4
Use regex to split 2017-11-09 16:24:19 -07:00
twangboy
b1dfe9c3c8
Format patching with statements for easier reading 2017-11-09 14:32:21 -07:00
twangboy
ba2f2eb788
Add Erik's changes 2017-11-09 14:32:21 -07:00
twangboy
4ef1e3eb97
Fix unit.states.test_archive for Windows
Use os agnostic paths
Mock `salt.utils.which` for Windows
Handle urlparse return on Windows
2017-11-09 14:32:21 -07:00
Erik Johnson
c1b6d35c0c
Python 3 compatibility fixes for kubernetes
dict.keys() is not a list in Python 3, and base64.b64encode requires
a bytestring.
2017-11-09 15:05:43 -06:00
Erik Johnson
b6ccfb45c8
Wait until after restoring original resource limit before removing temp files
Invoking shutil.rmtree() first was causing a traceback since the max
open files setting was still set very low for the test. This moves the
shutil.rmtree() until after we have restored the original resource
limit.
2017-11-09 15:05:43 -06:00
Erik Johnson
5932e8a8ae
Merge pull request #44407 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-11-08 11:50:05 -08:00
Gareth J. Greenaway
df937bf2fa
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-11-08 10:58:22 -07:00
Georges Racinet
5c01c74fbc
Merge branch 'develop' of github.com:saltstack/salt into 42713_mine.get_back_compat
... and fixed conflict
2017-11-08 18:09:04 +01:00
Georges Racinet
728c9b65a5
Unit test for backwards compatibility of mine.get
Could not find calls to RemoteFuncs in unit tests, therefore started a
new one, hope it's in the appropriate place.

The test replaces the caceh by its own (very limited) one. It's quite
possible it could be improved by reusing another one meant for unit tests.
2017-11-08 18:02:29 +01:00
Nicole Thomas
8ffe91fe44
Merge pull request #44405 from SEJeff/kubernetes-updates-v2
Kubernetes updates v2
2017-11-07 12:17:43 -07:00
Jorge Schrauwen
3af235250d Remove _zpool_data from the bsd_memdata test for grains 2017-11-07 08:17:50 +01:00
Nicole Thomas
c03e997144
Merge pull request #44246 from nicholasmhughes/add-location-to-file.line-ensure
Add location support to file.line ensure
2017-11-06 22:35:18 -07:00
Sean Jenkins
ed8cccf457
#39901: Fix pylint 2017-11-06 17:02:53 -07:00
Sean Jenkins
43c81dfdee
#39901: Add unit tests 2017-11-06 15:04:22 -07:00
rallytime
2c052e34b3
Merge branch '2017.7' into 'develop'
Conflicts:
  - .gitignore
  - salt/modules/win_lgpo.py
  - salt/utils/__init__.py
  - tests/integration/spm/test_build.py
  - tests/unit/test_pydsl.py
2017-11-05 20:28:51 -07:00
Anthony Shaw
c63222358b
update tests with correct assertions and mock methods on device instance 2017-11-06 05:01:31 +02:00
Anthony Shaw
b69c559c52
fix kwargs typo
setup basic unit test class

update wrapper
2017-11-06 04:39:30 +02:00
Jeff Schroeder
eaaa4dcf8e
Up the total test coverage of the kubernetes state to 54%!
* Add 100% test coverage for the kubernetes.node_label_absent state
* Add 100% test coverage for the kubernetes.namespace_present state
* Add 100% test coverage for the kubernetes.namespace_absent state
2017-11-05 20:11:25 -06:00
Jeff Schroeder
2b44f7ca85
Small formatting fixup 2017-11-05 20:11:17 -06:00
Jeff Schroeder
7039d74e90
More kubernetes state tests
* Add 100% test coverage for the kubernetes.secret_absent state
* Add 100% coverage for kubernetes.node_label_present
* Also add 'comment' to kubernetes.node_add_label
* Make the faux test objects more believable in test_kubernetes.py
2017-11-05 17:57:29 -06:00
Jeff Schroeder
2b02a46544
Add the beginning of tests for states.kubernetes and update things
* Add 100% test coverage for the kubernetes.secret_present state
* Add 100% test coverage for the kubernetes.configmap_absent state
* Add 100% test coverage for the kubernetes.configmap_present state
* Make some fields optional to kubernetes.create_secret and add examples
* Make some fields optional to kubernetes.replace_secret and add examples
* Make some fields optional to kubernetes.create_configmap and add examples
* Make some fields optional to kubernetes.replace_configmap and add examples
* Add 'comment' when a kubernetes configmap or secret is going to be replaced
* Update 'source', 'template', and 'saltenv' kwargs to defaults from the rest of the codebase
* Allow passing empty 'data' to the kubernetes.configmap_present state to remove the existing contents
2017-11-05 13:34:37 -06:00
Mike Place
1412a42f0e
Merge pull request #44070 from gtmanfred/kitchen
begin adding kitchen-salt into the test suite
2017-11-02 15:55:33 -06:00
Benedikt Werner
4a63798e84
Fixed linting 2017-11-01 01:01:22 +01:00
Benedikt Werner
7bb85f417f
Merge branch 'develop' into develop 2017-10-31 23:15:03 +01:00
Mike Place
c46490c183
Merge pull request #44190 from prymitive/postgres_extension
Fix test=true checks so that state runs in test mode don't report cha…
2017-10-31 11:53:06 -06:00
Mike Place
57705b9e6a
Merge pull request #44231 from SEJeff/kubernetes-stuff
Kubernetes module updates round one
2017-10-31 11:21:28 -06:00
Benedikt Werner
82d6cb72f0
Merge branch 'develop' into accept-minions-from-grains 2017-10-31 13:55:11 +01:00
Gareth J. Greenaway
06080612bc
Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-10-30 17:54:57 -04:00
Benedikt Werner
4c5259da3a
Fix syntax error in unit test 2017-10-30 17:30:21 +01:00
Benedikt Werner
23d3c71a55
Fix unit test 2017-10-30 17:27:28 +01:00
Nicole Thomas
835e6714ae
Merge branch 'develop' into publish_refactor_use_check_authentication 2017-10-30 11:06:59 -04:00
Benedikt Werner
51ce80ce50
Fix style 2017-10-29 14:02:38 +01:00
Benedikt Werner
d06d031227
Moved autosign grains integration tests to its own file 2017-10-29 14:02:37 +01:00
Benedikt Werner
8f2693237c
Fixed and improved autoaccept grains docs 2017-10-29 14:02:36 +01:00
Benedikt Werner
46d0979b94
Fixed autosign grains unit test 2017-10-29 14:02:36 +01:00
Benedikt Werner
244b8c2049
Fix masterapi unit test 2017-10-29 14:02:18 +01:00
Benedikt Werner
2bd1ae6501
Added unit test for check_autosign_grains 2017-10-29 13:54:05 +01:00
Nicole Thomas
9fc7fde8d2
Merge pull request #43885 from garethgreenaway/43825_swap_total_grain
[develop] Adding swap_total to core grains
2017-10-27 13:01:11 -04:00
Nicole Thomas
b2b0c770a4
Merge pull request #44279 from rallytime/merge-2017.7
[2017.7] Merge forward from 2016.11 to 2017.7
2017-10-27 12:17:18 -04:00
Erik Johnson
17d8e46abf Merge pull request #44277 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-10-27 10:16:00 -05:00
Nicole Thomas
cf77a6bf0f Merge pull request #43754 from spenceation/panos-2017-9-26
Update to PANOS modules.
2017-10-27 10:36:02 -04:00
Jeff Schroeder
1576c9980c
Fix test_kubernetes.py after fixing bug in 25f7c4996730a578b7875e924508a5c1774e8b7c 2017-10-26 18:20:49 -05:00
Jeff Schroeder
9304a428e3
Add the change-cause annotation to kubernetes created objects
This allows commands such as `kubectl rollout history deploy/$FOO` to
automatically show the deployment changed as a result of the salt run
and follows exactly how kubectl works when passed the `--record` flag.
2017-10-26 18:20:41 -05:00
Jeff Schroeder
9ceabf29f4
Fix kubernetes.node_labels()
This prevented showing, adding, or removing any labels from nodes
2017-10-26 18:20:34 -05:00
Jeff Schroeder
ac20ddfa25
Fix a bug in the kubernetes module for ssl cert paths
When the `client_key_file` attribute was defined and the `client_key`
attribute was not, the conditional for `client_key` would wrongly zero
`kubernetes.client.configuration.key_file`.

This was a bit annoying to figure out, but the kubernetes module now can
authenticate with minikube with a configuration such as this (where jeff
is $USER):

	kubernetes.api_url: 'https://192.168.99.100:8443'
	kubernetes.certificate-authority-file: '/home/jeff/.minikube/ca.crt'
	kubernetes.client-certificate-file: '/home/jeff/.minikube/client.crt'
	kubernetes.client-key-file: '/home/jeff/.minikube/client.key'

The various options can be gotten from ~/.kube/config after running `minikube start`.
2017-10-26 18:20:28 -05:00
twangboy
6db23757bc
Fix test_pydsl on Windows
Fix salt.utils.fopen to handle the 't' mode correctly in Windows
Fix the test_pysl test issues with spacing and file paths
2017-10-26 10:18:07 -06:00
rallytime
055b0701de
Lint fix from sloppy merge conflict resolution 2017-10-25 11:58:44 -04:00
Eric Radman
d921e1e6cb
Report 'onlyif' and 'unless' conditions as true or false
Elide terminology "execution failed/succeeded" since the result of these
conditions does not indicate a failure in state execution. Instead
simply report the result of each condition.
2017-10-25 11:03:13 -04:00
rallytime
1c3cb5c6a4
Merge branch '2016.11' into '2017.7'
Conflicts:
  - .gitignore
  - tests/unit/states/test_file.py
2017-10-25 10:04:08 -04:00
rallytime
28343f0120
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/git.py
2017-10-25 09:54:37 -04:00
Daniel Wallace
1b8bd64a88 Merge branch 'develop' into develop 2017-10-24 10:42:22 -06:00
twangboy
609361bf48
Fix some lint errors 2017-10-24 09:27:39 -06:00
twangboy
7a3ff9387d
Mock the rest of the tests 2017-10-24 09:27:38 -06:00
Erik Johnson
5ce14df82c
Change how members are retrieved in win_groupadd
This is a solution that works for the other functions that interact with
group objects, making it a better overall solution to be used widely
in win_groupadd.

This also updates the mocking in the tests such that we use a more
comprehensive fake class, and more intelligent mocking of get_sam_name
using a lambda.
2017-10-24 09:27:38 -06:00
twangboy
6ab82394be
Set up mocking
Move the code that sets up the group object, computer object and gets
existing members out of the individual functions so they can be mocked

Mock the GroupObj
Mock the ComputerObj
Mock existing members
Still need to fix info, getent, and members
2017-10-24 09:27:37 -06:00
Sol Kim
af2d6a0441 Merge branch 'develop' into separate-key-dir-from-cache-dir 2017-10-24 11:00:19 +09:00
Łukasz Mierzwa
58b84c7f71
Fix test case when postgres extension is already present and test=true is passed
Currently test expects that if the extension is already present salt will indicate that it will create it (which won't really happen without test=true since the extension is present), state was fixed so now salt will return correct information with test=true so fix the test to follow correct behaviour.
2017-10-23 17:48:27 -07:00
Nicole Thomas
4278a08e40 Merge pull request #44194 from vernondcole/saltify-create-with-wake-on-lan
add wake-on-LAN feature to saltify create
2017-10-23 10:46:21 -04:00
nicholasmhughes
fa1c442943
added support for location in file.line when using ensure 2017-10-23 10:40:35 -04:00
Nicole Thomas
304dd2529d Merge pull request #44160 from gtmanfred/directory
add changes to test return
2017-10-23 10:35:20 -04:00
Nicole Thomas
2ccfaca66c Merge pull request #44067 from eradman/check_file_meta
Check file attributes if lsattr(1) is installed
2017-10-23 10:30:58 -04:00
Erik Johnson
96891a062a Merge pull request #44203 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-10-23 09:11:54 -05:00
Nicole Thomas
7374403eca Merge pull request #44225 from eradman/test_btmp_wtmp
Mock open on /var/log/btmp and /var/log/wtmp
2017-10-23 09:51:46 -04:00
Eric Radman
10d13062ec
Mock open to /var/log/btmp and /var/log/wtmp
- btmp may not exist
- wtmp may not exist, or it may not contain ASCII data

Unbreaks tests on OpenBSD 6.2
2017-10-21 09:50:08 -04:00
Roald Nefs
f430e1e33c
Added simple test for Telegram returner 2017-10-20 20:55:54 +02:00
Nicole Thomas
012477071f Merge pull request #44071 from garethgreenaway/various_beacon_fixes
[develop] Various fixes to beacons
2017-10-20 11:06:27 -04:00
rallytime
3b9d02977d
Update deprecated salt.utils paths to new salt.utils.x paths 2017-10-20 10:48:37 -04:00
rallytime
2617cf851f
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/aptpkg.py
  - salt/utils/win_functions.py
  - tests/unit/states/test_mount.py
2017-10-20 10:44:29 -04:00
Nicole Thomas
c6d27ada51 Merge pull request #43843 from twangboy/win_unit_test_mount
Fix `unit.states.test_mount` for Windows
2017-10-20 10:27:25 -04:00
Daniel Wallace
a7d3d668f4
missed removing changes in the next test 2017-10-20 08:11:44 -06:00
Nicole Thomas
33ad43eec0 Merge pull request #44085 from kstreee/fix-inconsistent-exception-handling
Fixes inconsistent exception handling in rest_tornado.
2017-10-20 09:18:28 -04:00
Nicole Thomas
c700cd9c1e Merge pull request #44162 from rallytime/jinja-test-imports
Reorder and group imports in jina template unit tests
2017-10-20 09:09:40 -04:00
Nicole Thomas
12980a6961 Merge pull request #43476 from Shados/ssh_known_hosts_improvements
Improvements to SSH known_hosts handling
2017-10-20 09:07:20 -04:00
Benedikt Werner
11920372b3
Moved patch function outside of class to fix linting 2017-10-20 14:21:45 +02:00
Benedikt Werner
295b5d4834
Added tests and doc 2017-10-20 06:02:08 +02:00
Vernon Cole
d3769b3568
add saltify wake-on-lan and document it 2017-10-19 20:14:07 -06:00
kstreee
20bf4eed1d
Separates key_dir from cache_dir, The key files (i.e. '.root_key', '.sudo_...') must not be shared with other masters. 2017-10-20 11:06:31 +09:00
Mike Place
2551454f6a Add absolute_import 2017-10-19 18:26:08 -05:00
Eric Radman
6da4fd979b
Check file attributes in check_file_meta() if lsattr(1) is installed
lsattr/chattr is not installed on many Unix-like platforms by default,
including *BSD, Solaris, and minimal Linux distributions such as Alpine.
2017-10-19 18:38:12 -04:00
Mike Place
1e3abfea59 Merge branch 'develop' into various_beacon_fixes 2017-10-19 15:58:01 -05:00
Mike Place
cc2c99c94c Merge branch 'develop' into fix-inconsistent-exception-handling 2017-10-19 15:53:24 -05:00
Mike Place
68ed8c21b2 Merge branch 'develop' into jinja-test-imports 2017-10-19 15:42:20 -05:00
Mike Place
866a78a673 Merge pull request #44176 from vernondcole/simplify-saltify
Simplify saltify cloud driver
2017-10-19 14:37:17 -05:00
twangboy
a862e0bf2d
Remove unneeded import 2017-10-19 13:30:16 -06:00
twangboy
d78f27466d
Fix unit.states.test_mount for Windows
Use `os.path.realpath` to convert paths
Mock `os.path.exists`
2017-10-19 13:30:16 -06:00
twangboy
64d2e4f732
Fix pickling errors on Windows
Moves the 4 sub functions to the global scope
2017-10-19 11:50:23 -06:00
Nicole Thomas
f0175623ed Merge branch 'develop' into ssh_known_hosts_improvements 2017-10-19 13:44:29 -04:00
Vernon Cole
4c8cd9c507
lint and comment fixes 2017-10-19 10:16:28 -06:00
Daniel Wallace
ac0b5ec440
fix test 2017-10-19 09:28:59 -06:00
Vernon Cole
2b4f69e1f8
remove unused parameter 2017-10-18 20:20:36 -06:00
Vernon Cole
cce7bc9719
add more unit tests 2017-10-18 20:06:14 -06:00
Benedikt Werner
4bfeb7f1d1
Fixed missing import 2017-10-19 03:17:16 +02:00
Gareth J. Greenaway
8bbb1088e8
Fixing lint. 2017-10-18 14:57:33 -07:00
Gareth J. Greenaway
1e312d1b59
Adding tests for _memdata, Linux & *BSD 2017-10-18 14:57:33 -07:00
twangboy
bb1d2eb85b
Skip tests that are failing on PAM eauth 2017-10-18 14:03:10 -06:00
rallytime
832aa3010c
Reorder and group imports in jina template unit tests
The imports were scattered around quite a bit, which made it hard
to see where multiple uses of salt/utils/* imports were being pulled
in.

This PR just adjusts the ordering so it's easier to see what is included
already for the future. (This is particularly useful for catching misuses
of salt.utils.__init__.py functions.)
2017-10-18 14:15:50 -04:00
kstreee
e210f12cb7
Fixes inconsistent exception handling in rest_tornado. 2017-10-19 02:22:23 +09:00
Benedikt Werner
77b948b00a
Skip shadow module unit test if not root or no shadow 2017-10-18 19:10:55 +02:00
Mike Place
990a454f99 Merge pull request #44153 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-10-18 10:51:14 -06:00
Nicole Thomas
255a20f0e7 Merge pull request #44123 from terminalmage/gitfs-singleton
Use one salt.utils.gitfs.GitFS instance per thread
2017-10-18 12:12:25 -04:00
rallytime
d712031a43
Update to_unicode util references to new stringutils path 2017-10-18 09:44:55 -04:00
rallytime
b8dc018178
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/opkg.py
  - salt/utils/templates.py
  - tests/unit/templates/test_jinja.py
2017-10-18 09:37:47 -04:00
Mike Place
71f2bc4776 Merge branch 'develop' into panos-2017-9-26 2017-10-17 15:19:48 -06:00
Daniel Wallace
319b811f2f
exclude module name checker for kitchen helpers 2017-10-17 15:18:19 -06:00
Mike Place
afcaa0c591 Merge pull request #43913 from twangboy/win_fix_test_jinja
Fix `unit.templates.test_jinja` for Windows
2017-10-17 15:09:04 -06:00
Mike Place
fc5754c6a1 Merge pull request #43917 from twangboy/win_unit_test_pillar
Fix `unit.test_pillar` for Windows
2017-10-17 15:06:45 -06:00
Mike Place
4809dd41c0 Merge branch 'develop' into gitfs-singleton 2017-10-17 14:16:28 -06:00
rallytime
74acaad46e
Refactor publish func in master/masterapi to use check_authentication
In a previous PR, the runner and wheel functions in master.py and masterapi.py
were refactored to reduce common code via the salt.auth.check_authentication
method.

The publish function also can utilize the check_authentication function in
master.py and masterapi.py.

Consolidation of this code will help us be able to differentiate between
authorization and authentication errors in the future.
2017-10-17 12:27:13 -04:00
Marc Koderer
c4d9684a90 Use correct mac prefix for kvm/qemu
Using the private mac range for vms makes it impossible to
distinguish between hypervisors.

Issues #44056

Signed-off-by: Marc Koderer <marc.koderer@sap.com>
2017-10-17 10:46:06 +02:00
Gareth J. Greenaway
a89c26c88e
Various fixes to beacons to handle situations when beacons are stored in pillar. Updating execution module to report that beacons stored in pillar can not be managed via module. Updating add function to ensure beacon is available before attempting to add it. Updaitng unit tests to include new beacon is available check. 2017-10-16 14:32:12 -07:00
Matthew Summers
bebf301976
fixed test addressing issue #43307, disk.format_ to disk.format 2017-10-16 16:35:57 -04:00
Erik Johnson
3e96225210
Use one salt.utils.gitfs.GitFS instance per thread
This reduces some of the overhead caused by many concurrent fileclient
requests from minions.

Additionally, initializing remotes has been folded into the GitBase
class' dunder init. Instantiating an instance and initializing its
remotes were initially split so that an object could simply be created
with the master opts so that the configuration was loaded and nothing
else, allowing for certain cases (like clearing the cache files) where
we didn't need to actually initialize the remotes. But this both A)
presents a problem when the instance being used is a singleton, as you
don't want to be re-initializing the remotes all the time, and B)
suppressing initialization can be (and is now being) done via a new
argument to the dunder init.
2017-10-16 15:25:29 -05:00
Nicole Thomas
68974aa74d Merge pull request #44029 from msummers42/2017.7
addresses issue #43307, disk.format_ to disk.format
2017-10-16 15:59:19 -04:00
rallytime
54c4be35ae
Update any moved utils references from the merge-forward 2017-10-16 15:47:32 -04:00
rallytime
c0f16dae74
Merge branch '2017.7' into 'develop'
Conflicts:
  - doc/topics/tutorials/index.rst
  - salt/crypt.py
  - salt/modules/cmdmod.py
  - salt/modules/grains.py
  - salt/pillar/git_pillar.py
  - salt/roster/clustershell.py
  - tests/unit/states/test_augeas.py
  - tests/unit/utils/test_utils.py
2017-10-16 15:26:19 -04:00
Nicole Thomas
9fe94d7843 Merge pull request #44098 from twangboy/win_mock_test_parsers
Return multiprocessing queue in LogSetupMock class
2017-10-16 14:14:29 -04:00
twangboy
a4e2d8059d
Fix unit.templates.test_jinja for Windows
Fix problem with files that end with new line on Windows
Fix some problems with regex
Fix some unicode conversion issues
2017-10-16 10:41:36 -06:00
Matthew Summers
16e1c1dfc8
fixed test addressing issue #43307, disk.format_ to disk.format 2017-10-16 09:47:40 -05: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
garethgreenaway
abf596bbd9 Merge branch 'develop' into 43647_fix_InitiatorName_in_comments 2017-10-15 07:35:31 -07:00
twangboy
caf086c05a
Skip Master, Minion, and Syndic parser tests 2017-10-13 16:02:01 -06:00
twangboy
cc43ca27af
Return multiprocessing queue in LogSetupMock class 2017-10-13 15:47:19 -06:00
Gareth J. Greenaway
f06bb04348
Adding the right mocked data to the Windows test. Updating the grains/core.py to check if the entire line is alpha_numeric characters to determine if it should be skipped. 2017-10-13 10:01:58 -07:00
Gareth J. Greenaway
4b1d5f3005
Adding additional tests for grains/isci_iqn 2017-10-13 10:01:58 -07:00
Erik Johnson
c6b655b6e9
Move 14 more functions from salt.utils
These functions are:

salt.utils.test_mode -> salt.utils.args.test_mode
salt.utils.split_input -> salt.utils.args.split_input
alt.utils.pem_finger -> salt.utils.crypt.pem_finger
salt.utils.is_bin_file -> salt.utils.files.is_binary
salt.utils.list_files -> salt.utils.files.list_files
salt.utils.safe_walk -> salt.utils.files.safe_walk
salt.utils.st_mode_to_octal -> salt.utils.files.st_mode_to_octal
salt.utils.normalize_mode -> salt.utils.files.normalize_mode
salt.utils.human_size_to_bytes -> salt.utils.files.human_size_to_bytes
salt.utils.get_hash -> salt.utils.hashutils.get_hash
salt.utils.is_list -> salt.utils.data.is_list
salt.utils.is_iter -> salt.utils.data.is_iter
salt.utils.isorted -> salt.utils.data.sorted_ignorecase
salt.utils.is_true -> salt.utils.data.is_true
2017-10-13 09:29:03 -05:00
Erik Johnson
1e2e2b6ac5
Move 5 functions from salt.utils
These functions are:

- salt.utils.ip_bracket -> salt.utils.zeromq.ip_bracket
- salt.utils.gen_mac -> salt.utils.network.gen_mac
- salt.utils.mac_str_to_bytes -> salt.utils.network.mac_str_to_bytes
- salt.utils.refresh_dns -> salt.utils.network.refresh_dns
- salt.utils.dns_check -> salt.utils.network.dns_check
2017-10-12 09:07:00 -05:00
Erik Johnson
554c685ce5
Move 4 functions from salt.utils
- salt.utils.reinit_crypto -> salt.utils.crypt.reinit_crypto
- salt.utils.appendproctitle -> salt.utils.process.appendproctitle
- salt.utils.daemonize -> salt.utils.process.daemonize
- salt.utils.daemonize_if -> salt.utils.process.daemonize_if
2017-10-11 14:49:50 -05:00
Nicole Thomas
3a078304d8 Merge pull request #43982 from terminalmage/salt.utils.data
Move 13 functions from salt.utils to salt.utils.data
2017-10-11 11:42:08 -04:00
Erik Johnson
d947ddf176
Move 13 functions from salt.utils to salt.utils.data
These functions are:

- salt.utils.compare_dicts
- salt.utils.compare_lists
- salt.utils.decode_dict
- salt.utils.decode_list
- salt.utils.exactly_n
- salt.utils.exactly_one
- salt.utils.traverse_dict
- salt.utils.filter_by
- salt.utils.traverse_dict_and_list
- salt.utils.subdict_match
- salt.utils.substr_in_list
- salt.utils.is_dictlist
- salt.utils.repack_dictlist
2017-10-10 17:42:42 -05:00
twangboy
00dbba5712
Fix unit.test_pillar for Windows
Use delete=True in NamedTemporaryFile command otherwise the handle to
the file isn't released and the file can't be opened by the actual test.
2017-10-10 13:44:58 -06:00
Erik Johnson
92e05cf1c0
Don't allow path separators in minion ID 2017-10-10 11:03:29 -04:00
Erik Johnson
19481423dd
Don't allow path separators in minion ID 2017-10-10 10:58:42 -04:00
garethgreenaway
76ff44bc84 Merge branch 'develop' into vagrant-module 2017-10-09 09:06:42 -07:00
Daniel Wallace
1f8ec5d335 Merge branch 'develop' into vagrant-module 2017-10-06 11:32:31 -06:00
garethgreenaway
11c7d3ab39 Merge branch 'develop' into unit-test-sdb 2017-10-06 07:28:42 -07:00
Nicole Thomas
d136650b31 Merge pull request #43938 from terminalmage/salt.utils.user
Move several functions from salt.utils to salt.utils.user
2017-10-06 09:42:42 -04:00
Erik Johnson
aa3309ef59
Move several functions from salt.utils to salt.utils.user
These functions are as follows:

- salt.utils.get_user
- salt.utils.get_uid
- salt.utils.get_specific_user
- salt.utils.chugid
- salt.utils.chugid_and_umask
- salt.utils.get_default_group
- salt.utils.get_group_list
- salt.utils.get_group_dict
- salt.utils.get_gid_list
- salt.utils.get_gid
2017-10-05 19:50:14 -05:00
twangboy
254dac7723
Fix unit.utils.test_utils for Windows
Use os agnostic path seps
Mock sys.platform to not return win
2017-10-05 16:47:32 -06:00
garethgreenaway
53509e8d46 Merge branch 'develop' into unit-test-sdb 2017-10-05 15:35:13 -07:00
Nicole Thomas
31a641ce74 Merge branch 'develop' into panos-2017-9-26 2017-10-05 16:19:37 -04:00
Nicole Thomas
7785919437 Merge pull request #43829 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-10-05 16:09:23 -04:00
garethgreenaway
4c5af8cc96 Merge branch 'develop' into unit-test-sdb 2017-10-05 13:01:01 -07:00
garethgreenaway
37d7f13926 Merge branch 'develop' into vagrant-module 2017-10-05 10:25:24 -07:00
rallytime
eaca3291e2
Merge branch '2016.11' into '2017.7'
Conflicts:
  - tests/unit/modules/test_state.py
2017-10-05 12:09:40 -04:00
Nicole Thomas
a9dc04fb7f Lint: disable the unused-import check 2017-10-05 08:51:16 -04:00
Eric Radman
0dc3c4ef1c
Skip some vsphere tests if pyvmomi library is not installed
Also fix up 'E127: continuation line over-indented' lint errors
2017-10-04 13:09:29 -04:00
Vernon Cole
73947e3103
lint (again!) blank lines can have no spaces 2017-10-04 09:10:47 -06:00
Vernon Cole
67a701de7c lint PEP-8 2017-10-03 23:23:17 -06:00
Vernon Cole
83a3678cef
provide mocked unit tests 2017-10-03 17:24:05 -06:00
Vernon Cole
7d5a121265
Skip unit tests under Python3 until loader is fixed 2017-10-03 10:22:18 -06:00
rallytime
b7dae5addd
Bump with statements in one level
This is needed because the previous commit changed the context
management style from nested with statements to stacked with
statements.
2017-10-03 12:18:27 -04:00
garethgreenaway
6034b36bf6 Merge branch 'develop' into unit-test-sdb 2017-10-03 09:07:35 -07:00
Vernon Cole
c6b2e1e35b
update tests to match improved module
(cherry picked from commit 7fcdc51)
2017-10-02 22:10:37 -06:00
Vernon Cole
f96740d278
use recommended source for TMP directory 2017-10-02 21:07:27 -06:00
Vernon Cole
2bccf228ba
fix code-lint complaint 2017-10-02 12:18:11 -06:00
garethgreenaway
6c20e146c3 Lint Fixes
Lint Fixes
2017-10-02 10:10:53 -07:00
Erik Johnson
5d56a03a67
Improve failures for module.run states
Bare asserts are zero help in troubleshooting. This commit changes the
tests that uses bare asserts such that they fail with a useful error
mesage as well as the return data from the module.run call.
2017-10-02 10:48:45 -05:00
Vernon Cole
22792e56cc
lint, style, and Windows fixes 2017-10-02 09:48:27 -06:00
Corvin Mcpherson
c67db52c73 Merge branch 'develop' into issue36942 2017-10-01 18:56:58 -04:00
Alexandru Bleotu
3c6418b98f pylint 2017-09-29 19:45:56 -04:00
Vernon Cole
18357ac59d
provide a unit test for the sdb utility 2017-09-29 13:58:13 -06:00
spenceation
0f3503ee22 Added unit test for utils/xmlutil. 2017-09-29 15:30:15 -04:00
twangboy
fd1d6c31de
Fix unit.states.test_augeas for Windows
Mock `os.path.isfile` so the test will continue
2017-09-29 12:52:32 -06:00
rallytime
c976df7c09
Fix mocking in test_status since the "which" util has moved 2017-09-29 13:56:01 -04:00
Alexandru Bleotu
0c6a49ba38 Added tests for salt.utils.vsan.remove_diskgroup 2017-09-29 13:39:59 -04:00
Alexandru Bleotu
9de868fdfb Added tests for salt.utils.vsan.remove_capacity_from_diskgroup 2017-09-29 13:39:57 -04:00
Alexandru Bleotu
32d44142f2 Added tests for salt.utils.vsan.add_capacity_to_diskgroup 2017-09-29 13:39:54 -04:00
Alexandru Bleotu
d813164d18 Added tests for salt.utils.vsan.create_diskgroup 2017-09-29 13:39:52 -04:00
Alexandru Bleotu
523a2ac21d Added tests for salt.utils.vsan.get_host_vsan_system 2017-09-29 13:39:49 -04:00
Alexandru Bleotu
dac9522814 Added tests for salt.utils.vsan.get_vsan_disk_management_system 2017-09-29 13:39:47 -04:00
Alexandru Bleotu
b4a05dc7c0 Added tests for salt.modules.vsphere.remove_capacity_from_diskgroup 2017-09-29 13:39:44 -04:00
Alexandru Bleotu
ec2637db44 Added tests for salt.modules.vsphere.remove_diskgroup 2017-09-29 13:39:41 -04:00
Alexandru Bleotu
4e0755de20 Added tests for salt.modules.vsphere.remove_datastore 2017-09-29 13:39:39 -04:00
Alexandru Bleotu
51703a8a34 Added tests for salt.modules.vsphere.erase_disk_partitions 2017-09-29 13:39:36 -04:00
rallytime
a38ceab7cf
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/cli/batch.py
  - salt/master.py
  - salt/utils/path.py
  - tests/unit/modules/test_state.py
2017-09-29 11:48:33 -04:00
Mike Place
952b5d8e87 Merge branch 'develop' into vagrant-module 2017-09-29 12:34:41 +02:00
Mike Place
2f3f4705bd Merge pull request #43791 from alexbleotu/extra_minion_data_in_pillar-gh
External pillar that includes extra minion data in the minion pillar
2017-09-29 12:02:06 +02:00
Vernon Cole
e9661aea07
lint: must not use bare except: even in teardown 2017-09-28 18:27:54 -06:00
vernoncole
8d27e20b63 replace salt.utils.sdb calls with __utils__ 2017-09-28 16:43:47 -06:00
Alexandru Bleotu
503cb9c93a pylint 2017-09-28 11:32:03 -04:00
Alexandru Bleotu
8c5b021519 Added * as an include all wildcard in extra_minion_data_in_pillar external pillar (+ test) 2017-09-28 11:32:01 -04:00
Mike Place
77ef439ee0 Merge pull request #41956 from yagnik/encrypted-salt
Add support for encrypted tag in yaml serializer
2017-09-28 16:41:01 +02:00
Mike Place
6f687fdcff Merge pull request #43779 from twangboy/win_fix_test_state
Fix `unit.modules.test_state` for Windows
2017-09-28 16:27:02 +02:00
Mike Place
db0f569f7a Merge pull request #43782 from twangboy/win_fix_test_virt
Fix `unit.modules.test_virt` for Windows
2017-09-28 16:25:15 +02:00
Mike Place
8ddf2e9442 Merge pull request #43751 from alexbleotu/esxi_vsan_states-gh
ESXi diskgroup and host cache creation/configuration + dependencies
2017-09-28 15:21:36 +02:00
Alexandru Bleotu
998c4a95fa Added tests for salt.pillar.extra_minion_data_in_pillar 2017-09-28 09:14:30 -04: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
Mike Place
5e29507c21 Merge pull request #43781 from twangboy/win_fix_test_status
Fix `unit.modules.test_status` for Windows
2017-09-28 11:06:18 +02:00
Mike Place
05c78ae649 Merge pull request #43785 from twangboy/win_fix_test_znc
Fix `unit.modules.test_znc` for Windows
2017-09-28 10:56:10 +02:00
Alexandru Bleotu
90a174c915 more pylint 2017-09-28 04:42:44 -04:00
Alexandru Bleotu
adfa462c05 Fixed tests for salt.utils.vmware.get_hosts 2017-09-28 04:42:42 -04:00
vernoncole
d59cc13ca4 try to pass unit tests on jenkins 2017-09-28 00:59:20 -06:00
garethgreenaway
1c05e37a66 Merge branch '2017.7' into win_fix_test_zypper 2017-09-27 20:15:18 -07:00
garethgreenaway
7d90721f6b Merge branch '2017.7' into win_fix_test_znc 2017-09-27 20:14:53 -07:00
vernoncole
cfda0d54e2 test inside sandbox, fix two lines of docs 2017-09-27 17:07:29 -06:00