Commit Graph

94 Commits

Author SHA1 Message Date
Pedro Algarvio
8e505fb91a
Move tests to existing test modules 2019-05-09 14:20:23 +01:00
Pedro Algarvio
46816092eb
tests/unit/config/__init__.py -> tests/unit/config/test_config.py
No top level `__init__.py` should contain tests
2019-05-09 14:19:56 +01:00
Gareth J. Greenaway
6c99cb161f
Merge branch '2018.3' into merge-2018.3
Conflicts:
	doc/man/salt-api.1
	doc/man/salt-call.1
	doc/man/salt-cloud.1
	doc/man/salt-cp.1
	doc/man/salt-key.1
	doc/man/salt-master.1
	doc/man/salt-minion.1
	doc/man/salt-proxy.1
	doc/man/salt-run.1
	doc/man/salt-ssh.1
	doc/man/salt-syndic.1
	doc/man/salt-unity.1
	doc/man/salt.1
	doc/man/salt.7
	doc/man/spm.1
	pkg/osx/build_env.sh
	salt/utils/dns.py
	tests/integration/netapi/rest_tornado/test_app.py
	tests/support/case.py
	tests/unit/utils/test_dns.py
2019-02-11 15:45:43 -08:00
Daniel A. Wozniak
c614198477
Use pillar roots validation method 2019-01-22 12:19:06 -07:00
Daniel A. Wozniak
0d2b0c635f
Fix linter warnings 2019-01-22 10:40:57 -07:00
Daniel A. Wozniak
5b98895588
Fix wart in pillar_roots validation
Adds tests for pillar and file roots validation
2019-01-22 10:23:08 -07:00
Erik Johnson
80dcb44a0d
Merge remote-tracking branch 'upstream/2018.3' into merge-fluorine
Conflicts:
- salt/utils/mac_utils.py
- tests/unit/config/test_config.py
- tests/unit/loader/test_globals.py
- tests/unit/ssh/test_ssh.py
- tests/unit/templates/test_jinja.py
- tests/unit/utils/vmware/test_host.py
- tests/unit/utils/vmware/test_license.py
2018-08-17 07:52:59 -05:00
Erik Johnson
e0d95b640f
Consolidate misplaced tests into tests/unit/test_config.py 2018-08-14 13:53:29 -05:00
markuskramerIgitt
560fab5da5 Test lowercase on id_function 2018-07-25 14:05:55 +02:00
markuskramerIgitt
88786da025 Reduceded config, commented, dedented 2018-07-25 07:29:25 +02:00
markuskramerIgitt
e9c310c2a5 PEP8 E303: too many blank lines (3) 2018-07-25 00:58:47 +02:00
markuskramerIgitt
aec73330bb Add configuration test for minion_id_lowercase 2018-07-25 00:13:22 +02:00
rallytime
7dc1e770c4
Merge branch '2018.3' into 'develop'
Conflicts:
  - doc/topics/installation/freebsd.rst
  - salt/cloud/clouds/oneandone.py
  - salt/grains/core.py
  - salt/modules/napalm_ntp.py
  - salt/modules/win_update.py
  - salt/modules/win_wua.py
  - salt/modules/zabbix.py
  - salt/renderers/pass.py
  - salt/states/vault.py
  - tests/unit/states/test_win_update.py
2018-06-06 13:35:36 -04:00
rallytime
3273bbdab7
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/ref/configuration/master.rst
  - doc/ref/modules/all/index.rst
  - doc/topics/grains/index.rst
  - doc/topics/releases/2016.3.4.rst
  - doc/topics/spm/spm_formula.rst
  - doc/topics/tutorials/cron.rst
  - doc/topics/tutorials/index.rst
  - doc/topics/tutorials/stormpath.rst
  - salt/engines/slack.py
  - salt/log/handlers/fluent_mod.py
  - salt/modules/cyg.py
  - salt/modules/junos.py
  - salt/modules/namecheap_dns.py
  - salt/modules/namecheap_domains.py
  - salt/modules/namecheap_ns.py
  - salt/modules/namecheap_ssl.py
  - salt/modules/namecheap_users.py
  - salt/modules/reg.py
  - salt/modules/tomcat.py
  - salt/modules/vault.py
  - salt/modules/win_file.py
  - salt/modules/zpool.py
  - salt/output/highstate.py
  - salt/renderers/pass.py
  - salt/runners/cache.py
  - salt/states/boto_apigateway.py
  - salt/states/boto_iam.py
  - salt/states/boto_route53.py
  - salt/states/msteams.py
  - salt/states/reg.py
  - salt/states/win_iis.py
  - tests/integration/modules/test_cmdmod.py
  - tests/integration/states/test_user.py
  - tests/support/helpers.py
  - tests/unit/cloud/clouds/test_openstack.py
  - tests/unit/fileserver/test_gitfs.py
  - tests/unit/modules/test_junos.py
  - tests/unit/pillar/test_git.py
  - tests/unit/states/test_win_path.py
  - tests/unit/test_pillar.py
  - tests/unit/utils/test_format_call.py
  - tests/unit/utils/test_utils.py
  - tests/unit/utils/test_warnings.py
2018-06-01 14:54:12 -04:00
Erik Johnson
93ee5ee2b0
Fix all Sphinx warnings
Well, all but one, which we expect to see
2018-05-31 15:28:25 -05:00
pengyao
b6d5eb500b Security first 2018-05-22 14:13:20 +08:00
pengyao
21beeb249a add priv_passwd property for Roster unittest 2018-05-22 14:00:15 +08:00
Erik Johnson
879c557264
Use decorators for temp files/dirs in test suite
This adds a new decorator which creates a temporary directory and cleans
it after the test completes. It also modifies an existing decorator for
creating temporary files so that it accepts arguments, which will be
passed through to salt.utils.files.mkstemp().
2018-04-18 19:46:29 -05:00
Erik Johnson
5c4c0468ad
Fix regression in handling of environment/saltenv
This was broken sometime between when the change was made and 2018.3.0
was released. This fixes the issue and adds a regression test.
2018-04-13 13:44:55 -05:00
Erik Johnson
aeeb533225
Fix master conf test for PY3
PY3 should have no non-unicode strings, this was a bug in the test
2018-03-02 11:06:13 -06:00
Erik Johnson
2f7ae45088
Add conf file unicode test for master 2018-03-01 13:43:33 -06:00
Erik Johnson
a7575aed67
Add unit test for config loading 2018-02-28 08:44:15 -06:00
Ch3LL
1fd0295cca
Add stringutils.to_str in test_roster_config_validate test 2018-02-20 16:22:15 -05:00
Erik Johnson
de7eea42fb
Add test for modified virtualnames in salt.config 2018-01-09 19:11:17 -06:00
Erik Johnson
7c9d95a725
[PY3] Add unicode_literals to config, executors 2018-01-07 14:48:45 -06:00
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
Erik Johnson
7b13a7df8b
Replace json module usage with a helper to ensure unicode content is handled properly
This adds wrappers for json.dump{,s} which disable `ensure_ascii` by
default.
2017-12-27 09:30:58 -06: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
Daniel Wallace
3bae894306
digitalocean should be one word.
Everything on their webpage is a reference to DigitalOcean
2017-09-19 12:47:16 -06:00
Alexandru Bleotu
bf3785739e Fixed failing config.test_api tests for when the ROOT_DIR is / 2017-09-13 13:01:15 -04:00
Alexandru Bleotu
5c3dd00692 Updated config.test_api tests to take into account a ROOT_DIR override 2017-09-12 18:27:26 -04:00
Sergey Kizunov
88ee8ad566 Add config option id_function
Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
2017-09-07 13:41:10 -05: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
ccf790a83f Update all references for moved functions to use "files" util
- fopen
- flopen
- fpopen
- safe_rm
- is_empty
- is_fcntl_available
2017-07-18 10:31:01 -06:00
rallytime
e512a29f08 Merge branch '2017.7' into 'develop'
Conflicts:
  - salt/modules/state.py
  - salt/modules/yumpkg.py
  - salt/modules/zypper.py
  - salt/states/pkg.py
  - salt/version.py
  - tests/unit/config/test_config.py
  - tests/unit/modules/test_zypper.py
2017-06-28 11:31:53 -06:00
garethgreenaway
4fe273f78e Merge pull request #41969 from twangboy/win_unit_test_config
Fix `unit.config.test_config` for Windows
2017-06-28 08:18:07 -07:00
twangboy
98bc208db9 Fix paths, skip impossible 2017-06-27 17:31:23 -06:00
twangboy
1f497d8f78 Fix paths 2017-06-27 16:43:54 -06:00
rallytime
833b2145c4 Merge branch 'nitrogen' into 'develop'
No conflicts.
2017-06-01 17:15:36 -06:00
Dmitry Kuzmenko
64954d8e40 Fixed pylint errors. 2017-06-01 16:49:57 +03:00
Dmitry Kuzmenko
2b3276077c Py3: Fixed schema serialization. Enabled tests back. 2017-06-01 16:49:49 +03:00
Alexandru Bleotu
513254678f Fixed tests in test_api to not have a side-effect of changing the salt.config.DEFAULT_API_OPTS array 2017-05-17 17:21:15 +01:00
Alexandru Bleotu
4737b0d4fd Added test to prevent errors when the config root path includes the default root path 2017-05-17 17:21:15 +01:00
Pedro Algarvio
abe608d739
Drop @patch usage 2017-04-28 13:36:42 +01:00
Pedro Algarvio
61003bca0a
Take care of resource leakage on tests 2017-04-04 18:58:20 +01:00
Pedro Algarvio
e6f43b46c0
Import from the original modules 2017-04-04 18:58:20 +01:00
Pedro Algarvio
8031ac0209
Move mixins to tests.support.mixins.
The adapted config mixin get config methods are not static methods
2017-04-04 17:29:34 +01:00
rallytime
2222e1cae9 Merge branch '2016.11' into 'develop'
Conflicts:
  - salt/modules/napalm_network.py
  - tests/integration/states/test_archive.py
  - tests/integration/states/test_file.py
  - tests/unit/modules/test_docker.py
2017-03-21 10:19:52 -06:00
rallytime
f4d4768a6d Merge branch '2016.3' into '2016.11'
Conflicts:
  - salt/utils/__init__.py
2017-03-20 11:08:28 -06:00
Ivan Babrou
af1545deed
Use the first address if cannot connect to any
This fixes #39995. The previous work happened in #39289.
2017-03-18 21:09:16 -07:00