Commit Graph

3575 Commits

Author SHA1 Message Date
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
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
Nicole Thomas
8ffe91fe44
Merge pull request #44405 from SEJeff/kubernetes-updates-v2
Kubernetes updates v2
2017-11-07 12:17:43 -07: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
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
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
57705b9e6a
Merge pull request #44231 from SEJeff/kubernetes-stuff
Kubernetes module updates round one
2017-10-31 11:21:28 -06: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
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
28343f0120
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/git.py
2017-10-25 09:54:37 -04: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
nicholasmhughes
fa1c442943
added support for location in file.line when using ensure 2017-10-23 10:40:35 -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
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
Benedikt Werner
4bfeb7f1d1
Fixed missing import 2017-10-19 03:17:16 +02:00
Benedikt Werner
77b948b00a
Skip shadow module unit test if not root or no shadow 2017-10-18 19:10:55 +02: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
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
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
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
Daniel Wallace
1f8ec5d335 Merge branch 'develop' into vagrant-module 2017-10-06 11:32:31 -06: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
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
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
Vernon Cole
c6b2e1e35b
update tests to match improved module
(cherry picked from commit 7fcdc51)
2017-10-02 22:10:37 -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
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
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
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
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
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
twangboy
aafec7ab0e
Fix unit.modules.test_zypper for Windows
Use `os.linesep` for newline in expected return
2017-09-27 16:59:36 -06:00
twangboy
228e74c8e3
Fix unit.modules.test_znc for Windows
Mock the signal object as it's missing SIGUSR1 and SIGHUP on Windows
2017-09-27 16:54:06 -06:00
twangboy
058e50e530
Fix unit.modules.test_win_service
Mock `cmd.run`
2017-09-27 16:37:12 -06:00
twangboy
7192332758
Fix unit.modules.test_virt for Windows
Use os agnostic paths
Get system root from salt config
2017-09-27 16:12:05 -06:00
vernoncole
1f4451faaf lint and documentation cleanup for vagrant module 2017-09-27 14:59:47 -06:00
vernoncole
88d9e7ed83 replace cache storage with sdb 2017-09-27 14:59:47 -06:00
vernoncole
eb5cd38f85 remove unused keyword argument 'deploy' in tests too 2017-09-27 14:59:47 -06:00
vernoncole
879ae3b291 lint fix round 2 2017-09-27 14:59:47 -06:00
vernoncole
2e162280a9 replace subprocess calls with salt cmd.x calls 2017-09-27 14:59:47 -06:00
vernoncole
7fd1e29ce9 lint fixes 2017-09-27 14:59:47 -06:00
vernoncole
c8a78c7ceb provide unit tests 2017-09-27 14:59:47 -06:00
vernoncole
2524dd9bba skeleton unit test 2017-09-27 14:59:47 -06:00
twangboy
16ae8253c1
Mock which, use os.linesep for cmd.run return 2017-09-27 14:41:25 -06:00
vernoncole
52acfd980d merge upstream develop 2017-09-27 14:26:32 -06:00
twangboy
a64fe75816
Use os agnostic paths 2017-09-27 14:16:39 -06:00
Nicole Thomas
e4be436ca1 Merge pull request #43674 from alexbleotu/storage_policies-gh
VMware vCenter proxy + storage policies states & dependencies
2017-09-27 14:56:39 -04:00
Nicole Thomas
92c10689e4 Merge pull request #43757 from eradman/is_windows
Fix DeprecationWarning for use of 'salt.utils.is_windows'
2017-09-27 10:47:20 -04:00
Nicole Thomas
a48afa7175 Merge pull request #43763 from twangboy/win_fix_test_disk
Fix `unit.modules.test_disk` for Windows
2017-09-27 10:32:41 -04:00
twangboy
b41b9c8378
Skip snapper tests on Windows 2017-09-26 17:12:37 -06:00
twangboy
35505ac966
Honor 80 char limit 2017-09-26 15:52:04 -06:00
twangboy
26b23b37bc
Skip test if missing binaries 2017-09-26 15:51:22 -06:00
Eric Radman
617c5b72ac Fix DeprecationWarning for use of 'salt.utils.is_windows' 2017-09-26 15:13:18 -04:00
rallytime
74d315fd28
Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/file.py
  - tests/unit/modules/test_file.py
2017-09-26 13:45:10 -04:00
Nicole Thomas
10f3d47498 Merge pull request #43724 from brejoc/2017.7.kubernetes_delete_test
Improved delete_deployment test for kubernetes module
2017-09-26 12:19:30 -04:00
Nicole Thomas
13cc27bdab Merge pull request #43734 from twangboy/win_unit_test_poudriere
Fix `unit.modules.test_poudriere` for Windows
2017-09-26 10:13:46 -04:00
Erik Johnson
d78b9a3294 Merge pull request #41998 from twangboy/win_unit_test_environ
Fix `unit.modules.test_environ` for Windows
2017-09-26 07:25:48 -05:00
Alexandru Bleotu
b6577e4328 pylint 2017-09-25 18:25:04 -04:00
Alexandru Bleotu
58445e927b Updated all vsphere tests to support the vcenter proxy 2017-09-25 18:24:51 -04:00
twangboy
922e60fa67
Add os agnostic paths 2017-09-25 15:25:31 -06:00
Erik Johnson
5b3be6e8af
Fix failing unit test 2017-09-25 16:06:33 -05:00
twangboy
d73ef44cf6
Mock with uppercase KEY 2017-09-25 09:37:15 -06:00
twangboy
048e16883f
Use uppercase KEY 2017-09-25 09:37:15 -06:00
twangboy
056f3bb4c0
Use with to open temp file 2017-09-25 09:35:25 -06:00
twangboy
716e99c453
Fix py3 bytestring problems 2017-09-25 09:35:24 -06:00
twangboy
543610570c
Fix bytestring issues, fix errored tests 2017-09-25 09:35:24 -06:00
twangboy
9fe83a34a5
Remove old variable declaration 2017-09-25 09:35:23 -06:00
twangboy
c5cf5e92c1
Fix many tests 2017-09-25 09:35:23 -06:00
Jochen Breuer
85b0a8c401 Improved delete_deployment test for kubernetes module
This is a follow up of this PR: https://github.com/saltstack/salt/pull/43235

With the fix in PR 43235, we are polling the status of the deletion via
show_deployment. This is now also reflected in the tests with this change.
2017-09-25 17:29:27 +02:00
Mike Place
cae79d2020 Merge pull request #43699 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-24 19:27:17 -06:00
Mike Place
75dd97ee50 Merge pull request #43645 from alexbleotu/cluster_states-gh
VMware cluster states + dependencies
2017-09-22 11:46:25 -06: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
Mike Place
ed22e0f2fd Merge pull request #43507 from rallytime/replace-utils-calls
Update which and is_windows calls to use new paths
2017-09-21 14:11:21 -06:00
Alexandru Bleotu
71b10b81f9 Added tests for salt.modules.vspere.rename_datastore 2017-09-20 06:28:26 -04:00
Jochen Breuer
d1b5ec098c Merge branch '2017.7' into improve-async-operation-handling-in-kubernetes-module 2017-09-19 10:44:31 +02:00
rallytime
9afc84091d Update which and is_windows calls to use new paths 2017-09-15 17:27:02 -04:00
Alexandru Bleotu
d9b5424aab Merge branch 'develop' into list_cluster-gh 2017-09-15 20:04:33 +01:00
Mike Place
a1b871304b Merge pull request #43345 from ribx/develop
better atom extraction from portage version string
2017-09-15 12:29:25 -06:00
Mike Place
b262695301 Merge pull request #43493 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-15 12:23:09 -06:00
Alexandru Bleotu
c3d6af502b Added tests for modules.vsphere.list_cluster 2017-09-14 12:47:34 -04:00
rallytime
75abf0a2a9 Test fix: update mock util path 2017-09-14 11:01:06 -04:00
Alexandru Bleotu
15a2499d27 Added tests for salt.vsphere._get_proxy_target 2017-09-14 10:52:28 -04:00
Nicole Thomas
aee52a20e0 Lint: Add empty line at end of file 2017-09-14 09:48:09 -04:00
Robin Lutz
e1428dec5f corrected some PEP8 problems reported by jenkins 2017-09-14 14:24:54 +02:00
Nicole Thomas
f8ef7dce40 Merge pull request #43469 from alexbleotu/test_fixes-gh
Fixed several tests
2017-09-13 15:53:53 -04:00
rallytime
bfcfcd75e8 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/fileclient.py
  - salt/loader.py
  - salt/minion.py
  - salt/modules/alternatives.py
  - salt/modules/genesis.py
  - tests/unit/modules/test_hosts.py
  - tests/unit/modules/test_ini_manage.py
2017-09-13 15:15:04 -04:00
Alexandru Bleotu
449dccdaa1 pylint 2017-09-13 05:13:01 -04:00
Alexandru Bleotu
0222a5a056 Fix to vsphere tests 2017-09-12 18:43:08 -04:00
Alexandru Bleotu
afa4921d37 Fixed vsphere tests to support the esxcluster proxy 2017-09-12 18:43:05 -04:00
Alexandru Bleotu
26710fa8fc Added tests for esxcluster execution module 2017-09-12 18:42:58 -04:00
Alexandru Bleotu
f11a618274 Fixed Linux sysctl tests to be run in a local environment 2017-09-12 18:27:28 -04:00
Alexandru Bleotu
4cadfdcb56 Updated kubernetes tests to be skipped if library is not loaded 2017-09-12 18:27:23 -04:00
ribx
b712f971f7 Merge branch 'develop' into develop 2017-09-12 11:49:29 +02:00
Mike Place
50ab79f0cb Merge pull request #43424 from twangboy/win_unit_test_hosts
Fix `unit.modules.test_hosts` for Windows
2017-09-11 15:28:41 -06:00
Mike Place
2ac185b055 Merge pull request #43439 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-11 15:18:40 -06:00
Mike Place
e7a411c7f4 Merge pull request #43252 from rallytime/utils-files-moves
Move salt.utils.istextfile to salt.utils.files.is_text_file
2017-09-11 12:42:40 -06:00
rallytime
5413a5337e Lint: remove unused import 2017-09-11 14:34:20 -04:00
Mike Place
ca091bc8a4 Merge pull request #43438 from rallytime/merge-2017.7
[2017.7] Merge forward from 2016.11 to 2017.7
2017-09-11 12:33:38 -06:00
Mike Place
a9592dd3e2 Merge pull request #43320 from twangboy/win_fix_alternatives
Fix `unit.modules.test_alternatives` for Windows
2017-09-11 11:27:59 -06:00
Mike Place
9b89e49846 Merge pull request #43363 from twangboy/scratch_ini_tests
Fix `unit.modules.test_ini_manage` for Windows
2017-09-11 11:10:30 -06:00
rallytime
984fa35062 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/key.py
  - salt/modules/mount.py
  - salt/modules/system.py
  - tests/unit/modules/test_mount.py
  - tests/unit/modules/test_pam.py
  - tests/unit/modules/test_parted.py
2017-09-11 12:55:39 -04:00
Mike Place
2964707e5d Merge pull request #43341 from ixs/fedora-rh_ip
Fix rh_ip template use for Fedora
2017-09-11 10:30:53 -06:00
rallytime
ef7b4242c3 Merge branch '2016.11' into '2017.7'
No conflicts.
2017-09-11 12:24:10 -04:00
Mike Place
9f421dde89 Merge pull request #43370 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-11 09:38:20 -06:00
rallytime
e11aa7e5ef Adjust test mocking to handle __utils__['files.is_text_file'] 2017-09-11 10:25:00 -04:00
twangboy
90dcf8287c Fix unit.modules.test_hosts for Windows
Fix problem with TmpStringIO Class on Windows. The module uses this
class twice in normal operation. In Windows there's an additional run
before the real runs where it is opened with mode='w'. This causes the
data to be wiped out. So, this sets it to only save the value in the
instance to data if it is not empty.

Use the windows path to the hosts file in Windows
2017-09-08 17:21:01 -06:00
twangboy
b2cea18d13 Fix unit.modules.test_gem for Windows
Mock `salt.utils.is_windows` to return False so the test will run on
Windows
2017-09-08 15:53:07 -06:00
Alessandro -oggei- Ogier
496f14a7e7 forgot to mock the proper one 2017-09-08 21:37:09 +02:00
Nicole Thomas
97f05ff603 Merge pull request #43398 from twangboy/win_fix_test_mount
Fix `unit.modules.test_mount` for Windows
2017-09-08 09:39:28 -04:00
Nicole Thomas
6a4cc5c1b0 Merge pull request #43399 from twangboy/win_fix_test_pam
Fix `unit.modules.test_pam` for Windows
2017-09-08 09:37:49 -04:00
Nicole Thomas
2b5cfae3f8 Merge pull request #43400 from twangboy/win_unit_test_parted
Fix `unit.modules.test_parted` for Windows
2017-09-08 09:36:59 -04:00
Nicole Thomas
332deeb013 Merge pull request #43401 from twangboy/win_unit_test_pw_group
Fix `unit.modules.test_pw_group` for Windows
2017-09-08 09:35:44 -04:00
Nicole Thomas
c0f54bfef1 Merge pull request #43402 from twangboy/win_unit_test_qemu_nbd
Fix `unit.modules.test_qemu_nbd` for Windows
2017-09-08 09:34:57 -04:00
Alessandro -oggei- Ogier
70642e495d better qemu_static parameter mangle in deboostrap management, tests 2017-09-08 10:17:32 +02:00
twangboy
6ceb895a84 Use os.path.join for paths 2017-09-07 16:51:10 -06:00
twangboy
531ce8022b Fix unit.modules.test_qemu_nbd for Windows
Use os.sep
2017-09-07 15:44:35 -06:00
twangboy
78e39a1b9d Fix unit.modules.test_pw_group for Windows
Skip `test_info` and `test_getent` because they require grp which is not
available on Windows
2017-09-07 15:34:57 -06:00
twangboy
8e3e897ee2 Fix unit.modules.test_parted for Windows
Mock salt.utils.is_windows to be False so that the __virtual__ tests
will run
2017-09-07 15:27:11 -06:00
twangboy
6257aa964a Fix unit.modules.test_pam for Windows
Mocks os.path.exists
2017-09-07 15:18:14 -06:00
twangboy
4a8d7e522c Fix tests, Use full path to salt.utils.which 2017-09-07 14:41:56 -06:00
Nicole Thomas
6106aec696 Merge pull request #43356 from gtmanfred/2016.11
never-download got readded
2017-09-07 13:46:04 -04:00
Nicole Thomas
3f19b247f3 Add handler.messages back in for test comparison 2017-09-07 11:51:39 -04:00
Jochen Breuer
20619b24c4
Fixed test for delete_deployment
Due to implementation change, we need to mock the return value.
2017-09-07 10:20:46 +02:00
twangboy
a909813fa5 Remove unused import (lint) 2017-09-06 15:56:24 -06:00
twangboy
3ef8d714cb Fix unit tests to mock salt.utils.path.readlink 2017-09-06 13:03:14 -06:00
twangboy
7c4460164b Fix alternatives for Windows
Not sure this is necessary... I don't think alternatives is a thing in
Windows. Anyway, it uses `__salt__['file.readlink']` instead of
`os.readlink` as there is no `os.readlink` in Windows.
Modifies the tests to mock `__salt__['file.readlink']` instead of
`os.readlink`
2017-09-06 13:03:14 -06:00
Nicole Thomas
7d462d29c2 Merge branch 'develop' into expand-list_pkg-attr-parameter 2017-09-06 12:15:01 -04:00
Nicole Thomas
5111cf8bad Merge branch '2016.11' into 43086-no-member 2017-09-06 10:41:18 -04:00
rallytime
5701d54516 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/state.py
  - salt/utils/gitfs.py
2017-09-06 09:39:27 -04:00
Andreas Thienemann
6aefa5c3f8 Update unit test to provide osmajorrelease grain. 2017-09-06 03:46:00 +02:00
twangboy
a94319a082 Make sure formatting of TEST_FILE_CONTENT matches original 2017-09-05 17:03:50 -06:00
twangboy
6263bc8983 Remove print statement 2017-09-05 16:48:58 -06:00
twangboy
79cd3831ae Fix empty value preserved test 2017-09-05 16:44:12 -06:00
twangboy
85997391f1 Is this handled the same on Linux and Windows 2017-09-05 16:32:43 -06:00
Mike Place
f902bd8bc9 Merge pull request #43152 from garethgreenaway/adding_custom_beacons
Adding custom beacons with beacon module
2017-09-05 15:37:39 -06:00
Mike Place
9c57869234 Merge pull request #43276 from rallytime/utils-state-moves
Move state-related utils to salt.utils.state.py
2017-09-05 14:20:08 -06:00
Daniel Wallace
9911b04208 fix test 2017-09-05 13:52:02 -06:00
rallytime
ed9b45ceaa Adjust a couple more tests to handle __utils__['state.check_result'] mocking 2017-09-05 10:11:11 -04:00
Robin Lutz
ba7d00f58e use dep_getkey for atom extraction to allow non existing versions and packages, added unit test to verify behaviour 2017-09-05 09:34:54 +02:00
Silvio Moioli
130c1b1c21 Merge branch 'develop' into expand-list_pkg-attr-parameter 2017-09-04 15:36:44 +02:00
twangboy
5bd5ea042a Fix unit.modules.test_chef for Windows
Mocks the __opts__ to contain cachedir
2017-09-01 14:49:50 -06:00
rallytime
4322f009cf Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/auth/__init__.py
  - salt/auth/ldap.py
  - salt/grains/metadata.py
  - salt/master.py
  - salt/modules/apache.py
  - salt/modules/dockermod.py
2017-09-01 16:37:29 -04:00
rallytime
d891433214 Adjust test mocking to handle __utils__['state.check_result'] 2017-09-01 16:09:59 -04:00
Mike Place
24962587bc Merge pull request #43269 from rallytime/merge-develop
[develop] Merge forward from 2017.7 to develop
2017-09-01 12:12:36 -06:00
Silvio Moioli
3dc46212cc test_yumpkg: adapt to new supported attrs 2017-08-31 16:21:26 +02:00
Silvio Moioli
7b0a7432f4 test_zypper: adapt to new supported attrs 2017-08-31 16:21:26 +02:00
William Cannon
58eef3dc2c fixed dunder usage problem in unit test 2017-08-30 17:00:27 -05:00
wcannon
c080b263d5 Merge branch 'develop' into develop 2017-08-30 15:54:57 -05:00
Nicole Thomas
479e0e06ac Merge pull request #42975 from brejoc/tests-for-kubernetes-module
Added unit tests for Kubernetes module
2017-08-30 16:30:15 -04:00
Nicole Thomas
ca7df1d4cf Merge pull request #43176 from terminalmage/issue42935
docker_image states: Handle Hub images prefixed with "docker.io/"
2017-08-30 16:08:13 -04:00
Nicole Thomas
fdad9177b5 Merge branch '2017.7' into tests-for-kubernetes-module 2017-08-30 14:47:37 -04:00
rallytime
14f5e5e023 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/augeas_cfg.py
  - salt/modules/inspectlib/collector.py
2017-08-30 12:16:28 -04:00
Nicole Thomas
ec1bedc646 Merge pull request #43254 from twangboy/win_fix_test_inspect_collector
Fix `unit.modules.test_inspect_collector` on Windows
2017-08-30 11:46:07 -04:00
Nicole Thomas
25666f88f7 Merge pull request #43251 from twangboy/win_skip_test_groupadd
Skips `unit.modules.test_groupadd` on Windows
2017-08-30 09:56:36 -04:00
twangboy
cec627a60b Skip mac tests for user and group
They use grp and pwd
2017-08-29 16:28:12 -06:00
twangboy
b401340e6c Fix unit.modules.test_inspect_collector on Windows
Uses os.sep instead of unix-style paths in the test
Uses salt.utils.path.islink() to detect symlinks instead of
os.path.islink(). os.path.islink() does not correctly detect symlinks in
Windows
Put grp and pwd imports inside a try/except block
2017-08-29 15:59:08 -06:00
twangboy
5185071d5a Skips unit.modules.test_groupadd on Windows
There is a test_win_groupadd modules for testing the win_groupadd module
on Windows.
2017-08-29 14:29:50 -06:00
rallytime
26410c662f Update some salt.utils.x paths for moved util functions
Through merge forwards, some of the old-style paths have made their
way into develop. This PR corrects some of these instances on the more
popular functions.
2017-08-29 16:24:47 -04:00
Jochen Breuer
c227cb25ad
Skipping test on ImportError
This most probably means that the Kubernetes client lib is not
installed.
2017-08-29 17:12:25 +02:00
rallytime
6fad40454a Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/aptpkg.py
  - salt/utils/napalm.py
2017-08-28 09:28:41 -04:00
rallytime
3911df2f4b Merge branch '2016.11' into '2017.7'
No conflicts.
2017-08-28 09:25:49 -04:00
Jochen Breuer
bd76a870ce
Dunder vars are now defined via setup_loader_modules 2017-08-28 14:17:00 +02:00
Erik Johnson
7279f98e92 docker_image states: Handle Hub images prefixed with "docker.io/"
On some platforms, for reason which I do not yet grok, images pulled
from the Hub are prefixed with "docker.io/". This causes the
docker_image states to fail unless the user manually adds "docker.io/"
before the image name.

This commit adds a new function called "docker.resolve_tag" which
disambiguates this variance and allows images to be specified without
the "docker.io/" prefix.

Resolves #42935.
2017-08-25 00:06:28 -05:00
garethgreenaway
0186835ebf Fix docstring in test 2017-08-24 17:08:52 -05:00
garethgreenaway
a0bb654e46 Fixing lint issues 2017-08-24 12:09:29 -07:00
Gareth J. Greenaway
41790d4f28 Missing the test_add Beacon test. 2017-08-24 10:24:27 -07:00
Alessandro -oggei- Ogier
db94f3bb1c better formatting 2017-08-24 15:07:08 +02:00
Alessandro -oggei- Ogier
e5cc667762 tests: fix a leftover and simplify some parts 2017-08-24 15:04:37 +02:00
Alessandro -oggei- Ogier
13e5997457 lint 2017-08-24 12:49:39 +02:00
Alessandro -oggei- Ogier
216ced69e5 allow comma-separated pkgs lists, quote args, test deb behaviour 2017-08-24 12:00:36 +02:00
Andy Bulford
89ac3f9092 Merge branch 'develop' into add-docker-network-ipam-support 2017-08-23 23:02:07 +01:00
Mike Place
0f4d1dd767 Merge pull request #41662 from lordcirth/nfs-exports
Expand module nfs3
2017-08-23 12:19:34 -06:00
Mike Place
970003731a Merge pull request #42111 from bechtoldt/fix_ssh_auth_keys_newline
stripping whitespaces/newlines in authorized key file lines
2017-08-23 12:12:25 -06:00
Mike Place
ae5d3ffe99 Merge pull request #43013 from amendlik/kernelpkg-remove
Add kernelpkg functions to remove kernel packages
2017-08-23 11:47:58 -06:00
Erik Johnson
d5b2a0be68 Resolve image ID during container comparison
This fixes an issue where inspecting the container returns an image ID
instead of an image name, resulting in a spurious report of a changed
image. By resolving the image down to its ID for both the existing and
new containers, we ensure we're comparing ID to ID.
2017-08-23 12:23:33 -05:00
Mike Place
87c918583d Merge branch 'develop' into nfs-exports 2017-08-22 15:09:49 -06:00
Adam Mendlik
017eb849f1 Remove kernelpkg test assertions added in Python 3.6 2017-08-22 13:05:32 -06:00
Mike Place
7d52bcee46 Merge pull request #42894 from gilbsgilbs/postgres-valid-until
Add support for PostgreSQL password expiration.
2017-08-22 12:14:53 -06:00
Alessandro -oggei- Ogier
42a118ff56 fixed cmd composition and unified his making across module 2017-08-22 16:25:54 +02:00
Tarjei Husøy
1a987cb948 Fix broken negation in iptables
Introduced in 7c6ff77c and released with 2017.7.
2017-08-22 09:43:20 -04: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
Andy Bulford
49f4f990c3 Merge branch 'develop' into add-docker-network-ipam-support 2017-08-22 09:44:21 +01:00
Mike Place
3940084df9 Merge branch 'develop' into postgres-valid-until 2017-08-21 16:16:18 -06:00
Mike Place
1a531169fc Merge pull request #43088 from gtmanfred/2017.7
allow docker util to be reloaded with reload_modules
2017-08-21 16:14:36 -06:00
Mike Place
5482524270 Merge pull request #41994 from twangboy/win_unit_test_cmdmod
Fix `unit.modules.test_cmdmod` on Windows
2017-08-21 15:53:01 -06:00
Daniel Wallace
373a9a0be4 allow docker util to be reloaded with reload_modules
If we reference the actual import, the utils module won't be reloaded, but if
we use `__utils__` it can be reloaded on a pip install
2017-08-21 13:18:08 -06:00
William Cannon
e9cdbe7266 fixing pylint issues 2017-08-18 19:45:17 -05:00
William Cannon
3f490f63f5 fixes for pylint 2017-08-18 19:24:30 -05:00
William Cannon
1499314595 Merge branch 'develop' of https://github.com/saltstack/salt into salt-check-feature 2017-08-18 16:37:40 -05:00
Jochen Breuer
3c99e61637
Renamed test to match new convention 2017-08-18 15:19:34 +02:00
Jochen Breuer
caf78d206d
Fixed imports for pytest
Imports now match the new test-suite introduced in 2017.7.
2017-08-18 15:15:20 +02:00
Andrew Bulford
ec2a8a82c8 Add support for IPAM config in Docker networks
Fixes #43047
2017-08-18 13:35:48 +01:00
Adam Mendlik
f87fe54b7b Fix linter errors for kernelpkg modules and states 2017-08-17 11:27:57 -06:00
Adam Mendlik
8f575ade60 Add kernelpkg.remove function for APT-based systems 2017-08-17 11:27:57 -06:00
Adam Mendlik
5c4a5ca59a Add kernelpkg.remove function for YUM-based systems 2017-08-17 11:27:57 -06:00
Tarjei Husøy
6f19fc023c Fix broken negation in iptables
Introduced in 7c6ff77c and released with 2017.7.
2017-08-16 10:30:55 -07:00
Jochen Breuer
c8e98c8d8a Added unit tests for Kubernetes module
Added unit tests for:
    * Node listing,
    * deployment listing,
    * service listing,
    * pod listing,
    * deployment deletion and
    * deployment creation.
2017-08-16 14:51:16 +02:00
Gilbert Gilb's
08d453eb37 Fix unit tests. 2017-08-16 09:00:26 +02:00
Mike Place
f881aa5117 Merge branch 'develop' into nfs-exports 2017-08-15 13:28:12 -06:00
rallytime
c6b9ca4b9e Lint fix: add missing space 2017-08-15 14:26:44 -04:00
rallytime
a0b19bdc27 Update account id value in boto_secgroup module unit test
This value was updated in moto 1.0.0 with the following commit:

5f3fbff627
2017-08-15 14:23:00 -04:00
rallytime
60b406e088 @mock_elb needs to be changed to @mock_elb_deprecated as well 2017-08-15 14:23:00 -04:00
rallytime
6ae1111295 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-15 14:22:59 -04:00
garethgreenaway
8b48341a36 Merge branch 'develop' into fixing_beacons 2017-08-15 09:00:09 -07:00
Gareth J. Greenaway
474b6dbdf8 Updating various documentation and beacons. Adding unit tests for the beacon module. 2017-08-14 12:04:38 -07:00
Gareth J. Greenaway
8b507b1635 Updating twilio_txt_msg & memusage beacons to ensure list based configuration. Adding/Updating unit tests for both. Updating twilio related things to support newer version of twilio python library. 2017-08-14 12:04:37 -07:00
rallytime
78e744bda4 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/client/mixins.py
  - salt/fileclient.py
  - salt/modules/status.py
  - tests/integration/states/test_npm.py
2017-08-14 14:21:17 -04:00
Gilbert Gilb's
3c136e3138 Add support for PostgreSQL password expiration. 2017-08-12 13:48:12 +02:00
rallytime
6a7bf99848 Lint fix: add missing space 2017-08-11 14:19:15 -04:00
rallytime
7f46603e9c Update account id value in boto_secgroup module unit test
This value was updated in moto 1.0.0 with the following commit:

5f3fbff627
2017-08-10 17:31:14 -04:00
rallytime
7c1d493fdd @mock_elb needs to be changed to @mock_elb_deprecated as well 2017-08-10 17:15:45 -04:00
rallytime
3055e17ed5 Replace @mock_ec2 calls with @mock_ec2_deprecated calls
moto versions >= 1.0.0 have changed the way the mocked connections through
boto are handled with the @mock_ec2 decorator. They use the boto3 connection
method. However, since we are still using boto in many places, we need to use
the new @mock_ec2_deprecated decorator instead to handle the boto connection
functions for the unit tests.

Versions of moto < 1.0.0 are not Python 3 compatible, so salt-jenkins should
be installing newer versions of moto for those tests. Unfortunately, we cannot
install an older version of moto for Python2 that use the original @mock_ec2 call
and also import the @mock_ec2_deprecated function for newer versions of moto
simultaneously as the @mock_ec2_deprecated function doesn't exist in older
versions of moto.
2017-08-10 16:40:11 -04:00
Nicole Thomas
e6357abdda Merge pull request #42718 from moio/yumpkg-list_pkg-attr-parameter
yumpkg.list_pkgs: add parameter for returned attribute selection
2017-08-09 16:58:02 -04:00
Silvio Moioli
5a15e53886 yumpkg.list_pkg: add/adapt tests
This includes changes to the zypper tests because of the refactoring that
affected both modules.
2017-08-09 11:43:56 +02: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
f20f3742cb Merge branch '2017.7' into 'develop'
Conflicts:
  - tests/unit/test_crypt.py
2017-08-07 10:43:06 -04:00
Mike Place
834d6c605e
Set fact gathering style to 'old' for test_junos
Without this, we stacktrace because it does not appear that setting
'gather_facts' to False prevents the library from assuming the presence
of facts. I believe this to be an upstream bug with jnpr.

Because they have listed this as being a deprecated option in the future
this may re-break in the future.
2017-08-02 23:11:52 -06:00
Mike Place
a09091a696 Merge pull request #42517 from alexbleotu/linux_acl_fixes-gh
Fixes to linux_acl.present state & cmd.run function
2017-07-31 14:44:57 -05:00
garethgreenaway
bab7503f68 Merge branch 'develop' into linux_acl_fixes-gh 2017-07-27 16:59:36 -07:00