ansible/test/units/module_utils
Anatoly Pugachev fe8412128b facts: solaris: introduce distribution_major version detection for Solaris (#43978)
* facts: solaris: introduce distribution_major version detection for Solaris

Currently, there's no distribution_major in facts module on Solaris OS.
Use "uname -r" output to report major version.

Before the patch we get this on Solaris 11.3 :

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {}, "changed": false}

and after this patch, output is the following:

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "11"}, "changed": false}

Tested with Solaris 11.3 and Solaris 10 (both are x86_64 VMs)

Includes patch for test/units.

Fixes #18197

* Try to fix test unit

* should work now...

* fixes for W291 (trailing whitespace) and E265 (block comment)

* mock uname_release for solaris 10 and solaris 11

* facts: solaris: introduce distribution_major version detection for Solaris

Currently, there's no distribution_major in facts module on Solaris OS.
Use "uname -r" output to report major version.

Before the patch we get this on Solaris 11.3 :

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {}, "changed": false}

and after this patch, output is the following:

$ ansible -o solaris11 -m setup -a filter=ansible_distribution_major_version
solaris11 | SUCCESS => {"ansible_facts": {"ansible_distribution_major_version": "11"}, "changed": false}

Tested with Solaris 11.3 and Solaris 10 (both are x86_64 VMs)

Includes patch for test/units.

Fixes #18197

* Try to fix test unit

* should work now...

* fixes for W291 (trailing whitespace) and E265 (block comment)

* mock uname_release for solaris 10 and solaris 11

* typo uname_v -> uname_r

* rebase

* fix pep8 E302: 2 blank lines

* remove int() cast to match test case

* use single function for uname_r and uname_v

* add solaris 11.4 OS to distribution test unit

* fix pep8 sanity - E231 missing whitespace

* distribution_major_version variable strip newline

* mocker test function for mock_get_uname with parameters instead of two different functions

* failed to make one fuction with test unit, revert to use 2 different functions

* try to use single get_uname function

* fix pep8: E703
2019-01-23 20:33:32 -05:00
..
aws Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
basic Cleanups to the common.sys_info API 2019-01-03 16:21:09 -08:00
cloud Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
common Add a CLIArgs Singleton class that will hold the parse cli arguments 2019-01-03 18:12:23 -08:00
ec2 Update bare exceptions to specify Exception. 2018-12-16 15:03:19 -08:00
facts parallelize getting mount info (#49398) 2019-01-23 12:33:59 -05:00
gcp Enable additional pylint rules and resolve issues found. (#47221) 2018-10-18 13:38:08 -07:00
json_utils Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
net_tools Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
network Replace nose with pytest 2018-11-26 13:41:57 -08:00
parsing
urls Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628) 2018-09-19 10:53:16 -05:00
__init__.py
conftest.py Python 3.8 collections compatibility fixes. 2018-10-08 11:26:37 -07:00
test_acme.py Code style adjustment. (#49329) 2018-11-29 21:57:32 +01:00
test_database.py Fix unit test parametrize order on Python 3.5. 2018-09-17 22:45:42 -07:00
test_distribution_version.py facts: solaris: introduce distribution_major version detection for Solaris (#43978) 2019-01-23 20:33:32 -05:00
test_distro.py Port from plaform.dist to ansible.module_utils.distro.linux_distribution 2018-12-17 11:01:01 -08:00
test_docker_common.py docker_* modules: simplify idempotency comparisons (#47709) 2018-10-30 08:50:34 +00:00
test_known_hosts.py Fix unit test parametrize order on Python 3.5. 2018-09-17 22:45:42 -07:00
test_postgresql.py Move unit test compat code out of lib/ansible/. (#46996) 2018-10-12 20:01:14 -07:00
test_text.py
test_utm_utils.py Add optional headers to utm modules (#49856) 2019-01-17 19:06:50 +05:30
test_vmware.py VMware: Fix module usages in module_utils (#49421) 2018-12-04 10:11:29 +05:30