Commit Graph

100 Commits

Author SHA1 Message Date
rallytime
f23207002d
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/states/file.py
  - tests/unit/beacons/test_btmp_beacon.py
  - tests/unit/beacons/test_wtmp_beacon.py
  - tests/unit/grains/test_core.py
2018-06-15 17:00:59 -04:00
Erik Johnson
767cc7e87f
fix tabs 2018-06-13 21:10:30 -05:00
Erik Johnson
7427e192ba
Fix more crappy mocking 2018-06-13 15:01:12 -05: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
be8d34ec21
Merge branch '2018.3' into 'develop'
No conflicts.
2018-06-01 15:19:09 -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
rallytime
e5d386e91c
Update solaris core grains test
The check for zpool grains was moved out of core grains and into
zfs grains. The mock for the call to zpool grains function was failing.

We also need to update any calls to the salt.utils file to use the new
paths.
2018-05-30 13:50:22 -04:00
rallytime
120ee16b70
Replace old utils paths with new utils paths 2018-05-29 11:19:34 -04:00
rallytime
dc32b67c03
Merge branch '2017.7' into '2018.3'
Conflicts:
  - salt/modules/win_snmp.py
  - tests/integration/modules/test_saltutil.py
  - tests/integration/states/test_pkg.py
  - tests/support/helpers.py
  - tests/support/runtests.py
  - tests/unit/fileserver/test_gitfs.py
  - tests/whitelist.txt
2018-05-29 11:14:39 -04:00
lomeroe
49053bc106 lint fix 2018-05-17 13:56:24 -05:00
lomeroe
6f185c9179 another lint fix 2018-05-17 12:20:49 -05:00
lomeroe
dbffba6876 fix tons of errors in my tests 2018-05-17 10:50:50 -05:00
lomeroe
8c9355d34c Lint fix 2018-05-17 08:34:19 -05:00
lomeroe
b29ec75da7 Update regexes in core grains for detecting the 'product' grain on
Solaris Sparc systems.  Additionally, copy the 'product' grain to
'productname' to be consistent with other OSes.
2018-05-16 16:34:07 -05:00
rallytime
969296ecbe
Merge branch '2018.3' into 'develop'
No conflicts.
2018-05-15 12:38:01 -04:00
Ch3LL
0763f96458
update salt.utils.platform path for virt core test 2018-05-09 18:02:17 -04:00
Ch3LL
718252c1ef
Update salt.utils.path mock in virtual core test 2018-05-09 13:24:39 -04:00
rallytime
bd184a257f
Merge branch '2018.3' into 'develop'
Conflicts:
  - tests/unit/grains/test_core.py
2018-05-02 15:28:21 -04:00
rallytime
13e8124031
Merge branch '2017.7' into '2018.3'
Due to the many merge conflicts created from #47106 against the 2017.7 branch
and #46002 against the 2018.3 branch, the changes from #47106 have been largely
removed from this merge forward and the HEAD of 2018.3 was taken.

A separate fix for Tornado 5.0 support will need to be made directly against the
2018.3 branch.

Conflicts:
  - doc/topics/development/conventions/formulas.rst
  - salt/master.py
  - salt/minion.py
  - salt/netapi/rest_tornado/saltnado.py
  - salt/states/zfs.py
  - salt/transport/ipc.py
  - salt/transport/tcp.py
  - salt/transport/zeromq.py
  - salt/utils/async.py
  - tests/support/helpers.py
  - tests/support/parser/cover.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_ssh.py
  - tests/unit/test_minion.py
  - tests/unit/utils/test_safe_walk.py
2018-04-27 13:38:35 -04:00
Ch3LL
daa68b4877
Add virtual grains test for core grains 2018-04-25 11:03:35 -04:00
Jochen Breuer
c22c81304f
Test is now also working with Python2
Since assertCountEqual was Python>=3.2 only, we backported this
to Python2.
2018-04-11 10:51:20 +02:00
Mike Place
5279a3a947
Kill extra newline for lint 2018-04-09 10:08:34 -06:00
Jochen Breuer
5fa174a4e9
Switch to assertCountEqual since order can change
Since the order of the list in the dict can change, the assertEqual
might fail. assertCountEqual not only checks the count, it also checks
for matching elements regardless of the order. assertCountEqual is
Python=>3.2.
2018-04-09 14:55:47 +02:00
Bo Maryniuk
2c53d29195 Fix unit test for reversed fqdns return data 2018-04-03 15:31:47 +02:00
rallytime
81211f07fd
Remove 2 tests from core grains unit tests
These tests were moved to tests/unit/grains/test_iscsi.py in PR #46530

During the merge-forward commit, the tests were inadvertently added back
into the test_core.py file during the merge-conflict resolution.
2018-03-28 10:14:20 -04:00
rallytime
2c4668a5cb
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/modules/kubernetes.py
  - salt/states/netconfig.py
  - salt/states/zfs.py
  - tests/integration/cloud/providers/test_profitbricks.py
  - tests/integration/scheduler/test_eval.py
  - tests/unit/grains/test_core.py
  - tests/unit/test_pillar.py
2018-03-27 11:57:29 -04:00
Mike Place
2e1f7c37f7
Merge pull request #46569 from rallytime/merge-2018.3
[2018.3] Merge forward from 2017.7 to 2018.3
2018-03-21 20:57:04 +00:00
rallytime
b03cda3cea
Merge branch '2018.3.0rc1' into '2018.3'
No conflicts.
2018-03-20 09:13:13 -04:00
rallytime
8d1e1e7f94
Merge branch '2017.7' into '2018.3'
Conflicts:
  - .kitchen.yml
  - Gemfile
  - pkg/windows/build_env_2.ps1
  - pkg/windows/build_env_3.ps1
  - pkg/windows/req.txt
  - salt/client/ssh/__init__.py
  - salt/client/ssh/ssh_py_shim.py
  - salt/modules/boto_vpc.py
  - salt/modules/file.py
  - salt/modules/heat.py
  - salt/modules/smartos_vmadm.py
  - salt/modules/win_dsc.py
  - salt/returners/elasticsearch_return.py
  - salt/runners/salt.py
  - salt/states/module.py
  - salt/utils/win_functions.py
  - setup.py
  - tests/integration/modules/test_state.py
  - tests/unit/grains/test_core.py
  - tests/unit/test_pillar.py
2018-03-15 17:22:05 -04:00
twangboy
16949c0b93
Fix failing tests, add new tests 2018-03-14 16:37:42 -06:00
Gareth J. Greenaway
0a0abf1a48
Returning a sorted list of the FQDNS names so the results are consistent. 2018-03-14 09:22:07 -07:00
Justin Findlay
d5561bedaf
tests.unit.grains.core add scoped IPv6 nameserver 2018-03-05 12:31:04 -08:00
rallytime
ed46ce3c74
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/auth/ldap.py
  - salt/modules/zfs.py
  - salt/modules/zpool.py
  - salt/states/cmd.py
  - salt/utils/schedule.py
  - tests/integration/scheduler/test_eval.py
  - tests/integration/scheduler/test_postpone.py
  - tests/unit/grains/test_core.py
2018-03-02 11:55:06 -05:00
rallytime
aad61c77bd
Update old utils paths to new paths 2018-02-27 17:20:45 -05:00
rallytime
7243baf2c0
Merge branch '2017.7' into '2018.3'
Conflicts:
  - doc/topics/orchestrate/orchestrate_runner.rst
  - salt/grains/core.py
  - salt/modules/git.py
  - salt/pillar/ec2_pillar.py
  - salt/runner.py
  - salt/utils/ssh.py
  - tests/integration/modules/test_cp.py
  - tests/unit/grains/test_core.py
  - tests/unit/modules/test_file.py
  - tests/unit/modules/test_git.py
2018-02-27 17:13:28 -05:00
Benjamin Drung
0b445f2a37 tests: Add unit tests for _parse_os_release()
Add tests cases to fully cover _parse_os_release().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:38:23 +01:00
Benjamin Drung
f6069b77ed Fix osfinger grain on Debian
Rework _run_os_grains_tests() to check all os grains including osfinger.
Fix osfinger on Debian (e.g. use "Debian-9" instead of
"Debian GNU/Linux-9").

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
8dde55a761 tests: Add os_grains test cases for Debian
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
ff02ab9937 tests: Add Ubuntu 17.10 (artful) os_grains test case
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
77d5356aba Fix incorrect oscodename grain on Ubuntu
Use the full content of /etc/os-release for the Ubuntu 16.04 (artful)
os_grains test case. This reveals a bug that 'oscodename' is not
correctly calculated if /etc/os-release provides PRETTY_NAME:

FAIL: test_ubuntu_os_grains (tests.unit.grains.test_core.CoreGrainsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/grains/test_core.py", line 439, in test_ubuntu_os_grains
    self._run_ubuntu_os_grains_tests(_os_release_map)
  File "tests/unit/grains/test_core.py", line 446, in _run_ubuntu_os_grains_tests
    self._run_os_grains_tests(os_release_map)
  File "tests/unit/grains/test_core.py", line 262, in _run_os_grains_tests
    self.assertEqual(os_grains.get('oscodename'), os_release_map['oscodename'])
AssertionError: 'Ubuntu 16.04.3 LTS' != 'xenial'
- Ubuntu 16.04.3 LTS
+ xenial

fixes #34423 for Ubuntu
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
7e62dc9fd2 tests: Support reading os-release files from disk
Instead of storing pre-parsed os-release files, add support for reading
os-release files from disk.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
a92ec0db1b Make _parse_os_release() always callable
To simplify running unit tests against os_data(), make the
_parse_os_release() function always callable to avoid needing to mock
os.path.isfile().

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
eee1fe5b38 tests: Dissolve _run_ubuntu_os_grains_tests
_run_ubuntu_os_grains_tests is only used once and does not provide any
useful abstraction since the introduction of _run_os_grains_tests.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Benjamin Drung
1d6ef731fe tests: Deduplicate _run_os_grains_tests()
_run_suse_os_grains_tests() and _run_ubuntu_os_grains_tests() share most
of their logic. Combine the common part in _run_os_grains_tests() and
let the remaining small parts live in their origin functions.

Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
2018-02-26 13:36:33 +01:00
Bo Maryniuk
1b75f98a91 Catch proper exception type 2018-02-21 13:11:44 +01:00
Bo Maryniuk
5149cdbbd9 Fix unit test for py3 2018-02-21 10:53:20 +01:00
Bo Maryniuk
b24a8c3653 Use salt.utils.platform for OS detection 2018-02-20 18:36:27 +01:00
Bo Maryniuk
98cb94ae73 Update unit test on ignoring logging while file do not exist 2018-02-20 16:47:05 +01:00
Bo Maryniuk
2e76606edf Update unit test for catching out permission error 2018-02-20 16:46:43 +01:00