Commit graph

15868 commits

Author SHA1 Message Date
Daniel A. Wozniak
6d80789cf1
Fix ipc unit tests 2019-04-10 17:36:36 +00:00
Daniel Wozniak
2df74ca6d6
Merge pull request #52476 from bloomberg/win_cmd_2018
2018.3 backport #52472 modules.cmdmod: handle windows environ better
2019-04-10 10:30:19 -07:00
Daniel Wozniak
d699485dbc
Merge pull request #52393 from waynew/52087-mine-delete-test-enhancements
Use uncommon item in mine delete test
2019-04-10 10:18:14 -07:00
Matt Phillips
736a437520 2019.2 bacpkport: modules.cmdmod: handle windows environ better
python exposes an nt.environ for case insensitive environment behavior
that is native to windows; so it makes sense to use this instead of
os.environ to avoid enexpected behavior and failure.

further detail: https://bugs.python.org/issue28824
2019-04-10 10:33:37 -04:00
Matt Phillips
0e0c42e204 2018 backport: modules.cmdmod: handle windows environ better
python exposes an nt.environ for case insensitive environment behavior
that is native to windows; so it makes sense to use this instead of
os.environ to avoid enexpected behavior and failure.

further detail: https://bugs.python.org/issue28824
2019-04-10 09:56:35 -04:00
Wayne Werner
ee3115fa94
Allow leading dots and / as pillar separators 2019-04-09 18:11:44 -05:00
Gareth J. Greenaway
b2128e8559
Merge branch '2019.2' into 51818_fix_when_sk_is_empty 2019-04-09 12:39:34 -07:00
Gareth J. Greenaway
ac950b34c8
Merge branch '2019.2' into 51932_show_diff_when_test_True 2019-04-09 08:32:10 -07:00
Gareth J. Greenaway
b618d44759
Merge branch '2019.2' into 52350_readd_and_gate_unicode_string_literal_support 2019-04-08 14:55:37 -07:00
Gareth J. Greenaway
cb01a1b6bb
Merge branch '2019.2' into 51818_fix_when_sk_is_empty 2019-04-08 14:41:47 -07:00
Gareth J. Greenaway
1a1e333583
Merge branch '51818_fix_when_sk_is_empty' of github.com:garethgreenaway/salt into 51818_fix_when_sk_is_empty 2019-04-08 14:40:45 -07:00
Gareth J. Greenaway
dd2306921f
Adding tests for NACL changes. 2019-04-08 14:40:06 -07:00
Shane Lee
a429542e91
Merge branch '2019.2' into fix_test_symlink_2019.2 2019-04-08 13:37:18 -06:00
Daniel A. Wozniak
47203f7f79
Fix ipc unit tests 2019-04-08 17:17:20 +00:00
Cédric Bosdonnat
b297e7db20
virt: handle whitespaces in VM names
The disk creation code is now ready to handle whitespaces in virtual
machine name.
2019-04-08 15:31:13 +02:00
Cédric Bosdonnat
25b968151e
virt.pool_running: fix pool start
Building a libvirt pool starts it. When defining a new pool, we need to
let build start it or we will get libvirt errors.
2019-04-08 14:46:42 +02:00
Cédric Bosdonnat
30981d25b9
Remove unneeded kwargs in virt states
Avoid using kwargs to get the states parameters, perfer documented
named parameters with default value.

(cherry picked from commit c7c5d6ee88)
2019-04-08 14:39:35 +02:00
Cédric Bosdonnat
0871c028c6
virt: allow defining the VM type and arch when creating it
Some hypervisors can handle several CPU architectures or have different
virtualization types. This is reflected in libvirt by the OS type (badly
named, indeed) and the arch value. Allow users to set them when creating
a VM using either virt.init or virt.running.

Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
(cherry picked from commit 2463ebe5a8)
2019-04-08 14:39:35 +02:00
Cédric Bosdonnat
1c65d25eb4
Updating running domains in virt.running
So far virt.running does nothing if the corresponding domain is already
defined. Use the new virt.update function to change the domain
configuration.

(cherry picked from commit 2a5f6ae5d6)
2019-04-08 14:39:35 +02:00
Cédric Bosdonnat
13d7819c7f
Add missing virt states unit tests
So far only the virt.running state is unit tested. Add tests for the
other states. Deprecated virt states have been purposedly left untested.

(cherry picked from commit fc75872fb6)
2019-04-08 14:39:34 +02:00
Cédric Bosdonnat
0681d865f6
virt.running support for all virt.init options
virt.running actually calls virt.init if the virtual machine doesn't
exist. Let the user define all the virt.init possible options in his
running states too.

(cherry picked from commit cb00a5f9b4)
2019-04-08 14:39:34 +02:00
Cédric Bosdonnat
c6a444ba87
Add test case for virt.running
Test virt.running when the domain needs to be edited and started. This
will prevent regressions when improving virt.running to handle the new
virt.init parameters.

(cherry picked from commit 495db345a5)
2019-04-08 14:39:34 +02:00
Cédric Bosdonnat
2db7a988b2
Let virt running state provide errors
As mentioned in issue 47972, applying the virt.running state doesn't
report any error if the libvirt create call actually failed.

This commit introduces proper handling of the libvirt errors to let
users see the libvirt error in case of failure.

Also add test cases for virt.running to prevent regression.

(cherry picked from commit 451e7da55b)
2019-04-08 14:39:12 +02:00
Gareth J. Greenaway
0ce0c043b5
Merge branch '2019.2' into 51932_show_diff_when_test_True 2019-04-05 14:10:04 -07:00
Gareth J. Greenaway
38a9818fec
Merge branch '2019.2' into 52350_readd_and_gate_unicode_string_literal_support 2019-04-05 13:47:14 -07:00
Gareth J. Greenaway
401c253548
Merge branch '2019.2' into fix_test_symlink_2019.2 2019-04-05 13:42:39 -07:00
Gareth J. Greenaway
cce6200fac
Fixing lint
Fixing lint
2019-04-05 13:42:18 -07:00
Gareth J. Greenaway
16733da066
Merge branch '2019.2' into merge-2019.2 2019-04-05 13:38:40 -07:00
Gareth J. Greenaway
cd78485aab
Merge branch '2019.2' into issue_51869 2019-04-05 13:35:27 -07:00
Gareth J. Greenaway
f848aa474d
Adding support back in with, a gated configuration option, for the old YAML Loader. 2019-04-05 11:31:03 -07:00
Ch3LL
fe13214bd1
Merge branch '2018.3' into '2019.2'
No conflicts.
2019-04-04 09:35:08 -04:00
Daniel Wozniak
b6028b907b
Merge pull request #52403 from bdrung/fix-test-conditions
Fix test conditions
2019-04-03 10:07:53 -07:00
Daniel Wozniak
c7cb00923e
Merge branch '2019.2' into fix_test_symlink_2019.2 2019-04-03 10:06:27 -07:00
Daniel Wozniak
e5a755d45d
Merge pull request #52250 from twangboy/fix_grains
Fix the domain grain on Windows
2019-04-03 09:28:54 -07:00
Benjamin Drung
e74f78fca6 Skip ExtendTestCase if templates directory is missing
The release tarball does not contain the `templates` directory.
Therefore `ExtendTestCase` will fail:

```
======================================================================
ERROR: test_run (unit.utils.test_extend.ExtendTestCase)
[CPU:0.0%|MEM:53.9%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/utils/test_extend.py", line 40, in test_run
    out = salt.utils.extend.run('test', 'test', 'this description', integration.CODE_DIR, False)
  File "salt/utils/extend.py", line 242, in run
    MODULE_OPTIONS = _fetch_templates(os.path.join(salt_dir, 'templates'))
  File "salt/utils/extend.py", line 76, in _fetch_templates
    for item in os.listdir(src):
FileNotFoundError: [Errno 2] No such file or directory: ' templates'
```

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2019-04-03 16:33:07 +02:00
Benjamin Drung
0473683ace Skip SampleConfTest if sample conf directories are missing
The release tarball does not contain `conf/cloud.profiles.d`,
`conf/cloud.providers.d`, and `conf/cloud.maps.d`. Therefore the test
cases will fail:

```
======================================================================
ERROR: test_conf_cloud_maps_d_files_are_commented (unit.test_config.SampleConfTest)
[CPU:0.0%|MEM:53.9%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/test_config.py", line 236, in test_conf_cloud_maps_d_files_are_commented
    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.maps.d/')
FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.maps.d/'

======================================================================
ERROR: test_conf_cloud_profiles_d_files_are_commented (unit.test_config.SampleConfTest)
[CPU:0.0%|MEM:53.9%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/test_config.py", line 200, in test_conf_cloud_profiles_d_files_are_commented
    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.profiles.d/')
FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.profiles.d/'

======================================================================
ERROR: test_conf_cloud_providers_d_files_are_commented (unit.test_config.SampleConfTest)
[CPU:0.0%|MEM:53.9%]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/test_config.py", line 218, in test_conf_cloud_providers_d_files_are_commented
    cloud_sample_files = os.listdir(SAMPLE_CONF_DIR + 'cloud.providers.d/')
FileNotFoundError: [Errno 2] No such file or directory: 'conf/cloud.providers.d/'
```

Signed-off-by: Benjamin Drung <benjamin.drung@cloud.ionos.com>
2019-04-03 16:32:58 +02:00
Justin Findlay
2f49231233
modules.network: update unit test 2019-04-02 20:45:52 -07:00
Wayne Werner
9d1b2a0217
Only return None on host.present changes when test
Previously, when using `test=True`, `host.present` would return
`None` always. In Salt we return `True` when there are (or would be)
changes, `False` when there are no changes, and `None` when there
*would* have been changes.

This brings `host.present` in-line with that convention.
2019-04-02 19:10:36 -05:00
Daniel A. Wozniak
855f31a1aa
Remove un-used file 2019-04-02 14:29:53 -07:00
Daniel A. Wozniak
affd9b88b8
Fix setup/teardown methods 2019-04-02 21:12:11 +00:00
Daniel A. Wozniak
215bf931f2
Refresh after modifying tmp pillars 2019-04-02 21:08:00 +00:00
Gareth J. Greenaway
28e76b1fb2
Merge branch '2018.3' into merge-2019.2
Conflicts:
   - tests/unit/grains/test_core.py
2019-04-02 14:05:55 -07:00
Daniel A. Wozniak
95c3aba426
Add config for listener 2019-04-02 20:24:55 +00:00
Daniel A. Wozniak
5d231f4c09
remove unused import 2019-04-02 19:50:55 +00:00
Daniel A. Wozniak
8c1b1dbd92
Use tmp pillar for signing policies 2019-04-02 19:48:52 +00:00
Wayne Werner
e3f5be36bb
Use uncommon item in mine delete test
Rather than using `grains.items`, `test.arg` is less common, and
specifiying a value that isn't currently used anywhere else should
eliminate any chance of race condition for this test.
2019-04-02 13:14:49 -05:00
Daniel A. Wozniak
a0e245800d
fix unused import 2019-04-02 17:49:26 +00:00
Daniel A. Wozniak
7f5f7ddfd4
Fix requisite path 2019-04-02 17:49:25 +00:00
Daniel A. Wozniak
56304983d0
Fix signing policies path 2019-04-02 17:49:25 +00:00
Daniel A. Wozniak
0bd08261be
Fix issue #51869 and add cert signing test 2019-04-02 17:49:20 +00:00