You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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
6 years ago
..
aws Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
basic Cleanups to the common.sys_info API 6 years ago
cloud Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
common Add a CLIArgs Singleton class that will hold the parse cli arguments 6 years ago
ec2 Update bare exceptions to specify Exception. 6 years ago
facts parallelize getting mount info (#49398) 6 years ago
gcp Enable additional pylint rules and resolve issues found. (#47221) 6 years ago
json_utils Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
net_tools Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
network Replace nose with pytest 6 years ago
parsing Consolidate boolean/mk_boolean conversion functions into a single location 7 years ago
urls Fixing HTTPError case of fetch_url for Python 3 compatibility. (#45628) 6 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
conftest.py Python 3.8 collections compatibility fixes. 6 years ago
test_acme.py Code style adjustment. (#49329) 6 years ago
test_database.py Fix unit test parametrize order on Python 3.5. 6 years ago
test_distribution_version.py facts: solaris: introduce distribution_major version detection for Solaris (#43978) 6 years ago
test_distro.py Port from plaform.dist to ansible.module_utils.distro.linux_distribution 6 years ago
test_docker_common.py docker_* modules: simplify idempotency comparisons (#47709) 6 years ago
test_known_hosts.py Fix unit test parametrize order on Python 3.5. 6 years ago
test_postgresql.py Move unit test compat code out of `lib/ansible/`. (#46996) 6 years ago
test_text.py Porting tests to pytest (#33387) 7 years ago
test_utm_utils.py Add optional headers to utm modules (#49856) 6 years ago
test_vmware.py VMware: Fix module usages in module_utils (#49421) 6 years ago