Commit Graph

3399 Commits

Author SHA1 Message Date
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
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
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
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