|
|
|
@ -33,7 +33,7 @@ def test_get_cpu_info_nproc(mocker):
|
|
|
|
|
for test in CPU_INFO_TEST_SCENARIOS:
|
|
|
|
|
mocker.patch('ansible.module_utils.facts.hardware.linux.get_file_lines', side_effect=[[], test['cpuinfo']])
|
|
|
|
|
mocker.patch('os.sched_getaffinity', create=True, side_effect=AttributeError)
|
|
|
|
|
mocker.patch('ansible.module_utils.basic.AnsibleModule.get_bin_path', return_value='/usr/bin/nproc')
|
|
|
|
|
mocker.patch('ansible.module_utils.facts.hardware.linux.get_bin_path', return_value='/usr/bin/nproc')
|
|
|
|
|
module.run_command.return_value = (0, test['nproc_out'], '')
|
|
|
|
|
collected_facts = {'ansible_architecture': test['architecture']}
|
|
|
|
|
|
|
|
|
|