Commit Graph

2793 Commits

Author SHA1 Message Date
Pedro Algarvio
83db7547e7
Proper mocking. 2017-04-01 14:22:55 +01:00
Pedro Algarvio
da7192014e
Py3 compat 2017-04-01 14:22:52 +01:00
Pedro Algarvio
d05028e88c
These are not integration tests 2017-04-01 14:22:51 +01:00
rallytime
55405bcd30 Renamed unit.modules.tuned_test.py to test_tuned.py and updated salttesting imports 2017-03-31 12:23:46 -06:00
rallytime
2d73fca4d0 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/cloud/clouds/vmware.py
  - salt/modules/win_dsc.py
  - salt/modules/win_psget.py
  - tests/unit/utils/vmware_test/test_cluster.py
  - tests/unit/utils/vmware_test/test_common.py
  - tests/unit/utils/vmware_test/test_connection.py
  - tests/unit/utils/vmware_test/test_datacenter.py
  - tests/unit/utils/vmware_test/test_host.py
2017-03-31 10:09:56 -06:00
rajvidhimar
8d83d482c5 Correct the junos unit tests which mock getattr 2017-03-31 16:19:21 +05:30
Nicole Thomas
fbbe0127f5 Merge pull request #40432 from rallytime/merge-develop
[develop] Merge forward from 2016.11 to develop
2017-03-30 15:57:57 -06:00
Lukas Raska
24cc9b2a0c [WIP] Refactor Elasticsearch execution and state modules (#40192)
* Add Ingest pipeline methods to Elasticsearch execution module

* Refactor Elasticsearch execution module and properly handle exceptions

* Throw CommandExecutionError in methods applicable for different Elasticsearch versions

* Refactor Elasticsearch states to reflect execution module changes

* Add state for managing Elasticsearch pipelines

* Fix few typos in Elasticsearch module, return None when deleted document doesn't exist

* Implements stats and health methods for Elasticsearch

* Add Elasticsearch methods to open/close index, manage search templates and repositories

* Merge existing Elasticsearch states into single one, add Search Template handling

* Add index alias state for Elasticsearch, fix documentation

* Catch all global exceptions in Elasticsearch states, unit test all of them

* Implement few Unit tests for Elasticsearch execution module, merge fixes into deprecated elastic states

* Implement additional unit tests for Elasticsearch execution module

* Finalize Elasticsearch module documentation
2017-03-30 13:22:58 -06:00
rallytime
1792acedc0 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/template.py
  - tests/unit/modules/dockerng_test.py
2017-03-30 12:32:24 -06:00
rallytime
762e08634a Skip 2 junos module unit tests: "salt.modules.junos.getattr" patch stacktraces 2017-03-30 10:10:16 -06:00
Dheeraj
77a40a0c44 Lint fixes 2017-03-30 10:31:16 +05:30
Dheeraj
8c1adfafd5 More complete fix for 39692
The existing fix did not work if the profile name itself had a dash `-`.
For example - `virtual-guest`. This commit fixes that by using `split('- ')`
rather than `split('-')`. This commit also provides two simple tests for the
`list_()` function to emulate behaviour of both old and new tuned-adm versions

Fixes #39692
2017-03-30 10:31:16 +05:30
rallytime
99c8dcc18e Handle AttributeError for dockerng_mod.docker attempt fails and docker is installed
When we hit that attribute error, we need to set the docker version
variable to a tuple starting with 0 so we can use it in other test
comparisons. If docker is installed, but at a lower version, we will
see this attribute error.

Fixes the test failure on the 2016.11 branch on CentOS 6 VMs.
2017-03-29 10:28:51 -06:00
rallytime
d61b9631c6 Update docker execution module unit tests for develop branch
This test module was updated for both the 2016.11 and develop
branches in different ways. This commits removes some of the
changes that were merged-forward from the 2016.11 branch and
restores the develop branch tests functionality.
2017-03-29 09:07:22 -06:00
rallytime
52edbffc85 Merge branch '2016.11' into 'develop'
Conflicts:
  - doc/ref/cache/all/index.rst
  - doc/topics/cache/index.rst
  - salt/cache/localfs.py
  - salt/modules/boto_rds.py
  - salt/roster/cloud.py
  - salt/states/virtualenv_mod.py
  - tests/integration/states/test_archive.py
  - tests/unit/modules/test_dockermod.py
  - tests/unit/states/dockerng_test.py
2017-03-28 17:09:30 -06:00
Pedro Algarvio
4c17fad6b6
No need to use tests.unit.ModuleTestCase. Proper Mocking. 2017-03-28 19:04:04 +01:00
Pedro Algarvio
4baabcfb1e
Proper mocking. Some additional mocking and fixes. 2017-03-28 19:04:02 +01:00
Pedro Algarvio
da5ee155d1
Proper mocking. If this fails @twangboy, let me known. 2017-03-28 19:04:02 +01:00
Pedro Algarvio
99bc71dc4e
Proper mocking. 2017-03-28 19:04:01 +01:00
Pedro Algarvio
14db38979c
Proper mocking. Py3 Compat. 2017-03-28 19:04:01 +01:00
Pedro Algarvio
d397763553
Adjust to the new LoaderModuleMockMixin usage 2017-03-28 19:03:59 +01:00
Pedro Algarvio
608402359f
Proper mocking. Windows compat. 2017-03-28 19:02:51 +01:00
Pedro Algarvio
e7768705f9
Allow passing different loader_module_globals per loader_module 2017-03-28 19:02:51 +01:00
Pedro Algarvio
93ad2cc428
Proper mocking. Code is mocked! Runs on non windows too. 2017-03-28 19:02:51 +01:00
Pedro Algarvio
5c13f7b2bb
Proper mocking. 2017-03-28 19:02:50 +01:00
Pedro Algarvio
cb532fb9ef
Code cleanup. Proper mocking. 2017-03-28 19:02:50 +01:00
Pedro Algarvio
f23596cbd1
Proper mocking. Py3 Compat. 2017-03-28 19:02:50 +01:00
Pedro Algarvio
9b1e55aa85
Import the full module namespace to avoid import shadowing.
https://github.com/saltstack/salt/pull/39996#issuecomment-287857698
2017-03-28 19:02:47 +01:00
Pedro Algarvio
8325a58a35
Proper mocking but I'm lost as to what is actually being tests here 2017-03-28 19:00:53 +01:00
Pedro Algarvio
a894eebf31
Code cleanup. Proper mocking!!! 2017-03-28 19:00:53 +01:00
Pedro Algarvio
5216ff0932
Code cleanup. Proper mocking 2017-03-28 19:00:52 +01:00
Pedro Algarvio
ea81540cce
Code cleanup. Proper mocking. 2017-03-28 19:00:52 +01:00
Pedro Algarvio
1f7a0aa65b
Proper mocking 2017-03-28 19:00:51 +01:00
Pedro Algarvio
87e9f5e676
Mock patching. The right way. 2017-03-28 19:00:51 +01:00
Pedro Algarvio
b25b26e23d
Cleanup test attributes once finished 2017-03-28 19:00:51 +01:00
Pedro Algarvio
6f79dd6af3
Not an integration test 2017-03-28 19:00:51 +01:00
Mike Place
d7e745a53a Merge pull request #40281 from terminalmage/rename-docker
Rename docker execution module to avoid shadowing in the loader
2017-03-28 11:06:08 -06:00
Erik Johnson
774a3f1147 Rename docker execution module to avoid shadowing in the loader
With the merging of #39996, salt/modules/docker.py now imports
salt.utils.docker. However, our loader appends the module dir (in
this case salt/modules/) to sys.path temporarily for the length of the
loading process. So, as the docker execution module tries to import
salt.utils.docker, when salt.utils.docker attempts to do an "import
docker", and docker-py is *not* installed, this results in
salt/modules/docker.py (the docker execution module) being loaded in its
place, which results in tracebacks in the minion log.

Renaming the docker execution module keeps this import shadowing from
occurring. Note that we don't need to do this for the placeholder
salt/states/docker.py as it does not import salt.utils.docker.
2017-03-28 10:50:47 -05:00
zer0def
d68067f1d7 Merge remote-tracking branch 'main/2016.11' into pip-cache-fixes 2017-03-28 16:39:19 +02:00
zer0def
4f23a23ca8 Fixed the test_install_download_cache_argument_in_resulting_command to accomodate introduced cache directory argument fixes and renamed it to test_install_download_cache_dir_arguments_in_resulting_command. 2017-03-28 11:53:54 +02:00
Mike Place
75565df5da Merge pull request #39884 from Juniper/develop
unit tests for junos specific code
2017-03-27 18:35:58 -06:00
rallytime
0f263a52e0 Mock out the get_client_args mocks in the dockerng module tests more aggressively
The tests pass fine when run independently, but when the full unit test suite
runs, the dockerng state tests are setting global values. This change makes the
module tests avoid those problem by relying on its own mocks.
2017-03-27 11:27:52 -06:00
vnitinv
a9acd532d1 fix lint in test_junos.py 2017-03-27 11:33:42 +05:30
rajvidhimar
f629feaabd Take care of import error and add condition to skip tests if PyEZ is not installed 2017-03-26 17:27:32 +05:30
rallytime
f1352fe253 Add one more dockerng.version mock that was missed previously 2017-03-24 10:57:12 -06:00
vnitinv
146f8abc4c sync with upstream 2017-03-24 12:18:14 +05:30
Sergey Kizunov
64d224ad02 rabbitmq: Do not use __context__ for persistent globals
The rabbitmq module was using `__context__` to store paths of
rabbitmq executables. `__context__` may be cleared but the module
still could remain in use, in which case it would fail to work
correctly. Move the paths of the rabbitmq executables to their own
global variables so that they are not affected by the lifespan of
`__context__`.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-03-23 14:46:36 -05:00
rallytime
0d31d2c4d1 Add a couple more patches for docker.version information 2017-03-23 12:57:46 -06:00
rallytime
a9c5eebaf0 Clean up dockerng unit tests to avoid global variables and fixup some patching 2017-03-23 12:44:57 -06:00
rajvidhimar
2868755128 Remove usage of nose in junos unit tests 2017-03-22 17:08:19 +05:30