Skip to content

Commit 622dda2

Browse files
authored
Document correction 2025 dec (#152)
1 parent 2f35be3 commit 622dda2

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

plugins/modules/powervm_lpar_instance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
- Option to display advanced information of the logical partition.
308308
- Applicable only for C(facts) state.
309309
- Default is false.
310-
- Currently it is showing only NPIV storage details.
310+
- Currently it is showing only NPIV storage, SCSI adapters and Virtual Network adapter details.
311311
type: bool
312312
install_settings:
313313
description:
@@ -464,7 +464,7 @@
464464
- C(poweron) poweron a partition of the specified I(vm_name) with specified I(prof_name), I(keylock), I(iIPLsource) on specified I(system_name).
465465
- C(restart) restart a partition of the specified I(vm_name) on specified I(system_name).
466466
- C(install_os) install Aix/Linux OS through NIM Server on specified I(vm_name).
467-
- C(modify_vm) rename a logical partition.
467+
- C(modify_vm) rename a logical partition with I(new_vm_name).
468468
type: str
469469
choices: ['poweron', 'shutdown', 'restart', 'install_os', 'modify_vm']
470470
'''

tests/unit/modules/test_hmc_powervm.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
virt_network_config = {'network_name': 'test'}
1414
install_Settings = {'vm_ip': '00.00.00.00', 'nim_ip': '00.00.00.00'}
1515
vnic_config = {'vnic_adapter_id': 0, 'backing_devices': 'bd'}
16+
update_config = {'new_vm_name': 'test'}
1617
test_data = [
1718
# ALL Create partition testdata
1819
# system name is missing
@@ -57,7 +58,7 @@
5758
# unsupported parameter os_type,proc,mem
5859
({'hmc_host': "0.0.0.0", 'hmc_auth': hmc_auth, 'state': 'absent',
5960
'system_name': "systemname", 'vm_name': 'vmname', 'proc': '4', 'mem':
60-
'1024', 'os_type': 'aix_linux', 'new_name': None, 'proc_unit': '4', 'prof_name': 'default', 'keylock': 'manual', 'iIPLsource': 'a',
61+
'1024', 'os_type': 'aix_linux', 'proc_unit': '4', 'prof_name': 'default', 'keylock': 'manual', 'iIPLsource': 'a',
6162
'volume_config': volume_config, 'virt_network_config': virt_network_config, 'all_resources': True, 'max_virtual_slots': 25, 'advanced_info': True,
6263
'min_proc': '1', 'max_proc': '2', 'min_proc_unit': '0.1', 'max_proc_unit': '1', 'proc_mode': 'uncapped', 'weight': '124',
6364
'proc_compatibility_mode': 'POWER8', 'shared_proc_pool': '1', 'min_mem': '2048', 'max_mem': '1024', 'vm_id': 4, 'install_settings': install_Settings,
@@ -99,7 +100,7 @@
99100
({'hmc_host': None, 'hmc_auth': hmc_auth, 'state': None, 'action': 'poweron',
100101
'system_name': "systemname", 'vm_name': "vm_name"}, "ParameterError: mandatory parameter 'hmc_host' is missing"),
101102
# hmc_auth is missing
102-
({'hmc_host': "0.0.0.0", 'hmc_auth': None, 'state': None, 'action': 'poweron',
103+
({'hmc_host': "0.0.0.0", 'hmc_auth': None, 'state': None, 'action': 'poweron', 'update_config': None,
103104
'system_name': "systemname", 'vm_name': "vmname"}, "ParameterError: mandatory parameter 'hmc_auth' is missing"),
104105
# unsupported parameter os_type,proc,mem
105106
({'hmc_host': "0.0.0.0", 'hmc_auth': hmc_auth, 'state': None, 'action': 'poweron',
@@ -112,6 +113,23 @@
112113
"ParameterError: unsupported parameters: proc, mem, os_type, proc_unit, volume_config, virt_network_config, retain_vios_cfg, delete_vdisks,"
113114
" all_resources, max_virtual_slots, advanced_info, min_proc, max_proc, min_proc_unit, max_proc_unit, proc_mode, weight, proc_compatibility_mode,"
114115
" shared_proc_pool, min_mem, max_mem, vm_id, install_settings, vnic_config, shutdown_option, restart_option")]
116+
test_data4 = [
117+
# ALL modify partition testdata
118+
# vmname is missing
119+
({'hmc_host': "0.0.0.0", 'hmc_auth': hmc_auth, 'state': None, 'action': 'modify_vm',
120+
'system_name': "systemname", 'vm_name': None, 'update_config': update_config}, "ParameterError: mandatory parameter 'vm_name' is missing"),
121+
# update config is missing
122+
({'hmc_host': "0.0.0.0", 'hmc_auth': hmc_auth, 'state': None, 'action': 'modify_vm',
123+
'system_name': "systemname", 'vm_name': 'vm_name', 'update_config': None}, "ParameterError: mandatory parameter 'update_config' is missing"),
124+
# system name is missing
125+
({'hmc_host': "0.0.0.0", 'hmc_auth': hmc_auth, 'state': None, 'action': 'modify_vm',
126+
'system_name': None, 'vm_name': 'vm_name', 'update_config': update_config}, "ParameterError: mandatory parameter 'system_name' is missing"),
127+
# hmc host is missing
128+
({'hmc_host': None, 'hmc_auth': hmc_auth, 'state': None, 'action': 'modify_vm',
129+
'system_name': 'systemname', 'vm_name': 'vm_name', 'update_config': update_config}, "ParameterError: mandatory parameter 'hmc_host' is missing"),
130+
# hmc_auth is missing
131+
({'hmc_host': '0.0.0.0', 'hmc_auth': None, 'state': None, 'action': 'modify_vm',
132+
'system_name': 'systemname', 'vm_name': 'vm_name', 'update_config': update_config}, "ParameterError: mandatory parameter 'hmc_auth' is missing")]
115133

116134

117135
def common_mock_setup(mocker):
@@ -163,3 +181,14 @@ def test_call_inside_powervm_poweron_partition(mocker, powervm_test_input, expec
163181
assert expectedError == repr(e.value)
164182
else:
165183
hmc_powervm.poweron_partition(hmc_powervm, powervm_test_input)
184+
185+
186+
@pytest.mark.parametrize("powervm_test_input, expectedError", test_data3)
187+
def test_call_inside_powervm_poweron_partition(mocker, powervm_test_input, expectedError):
188+
hmc_powervm = common_mock_setup(mocker)
189+
if 'ParameterError' in expectedError:
190+
with pytest.raises(ParameterError) as e:
191+
hmc_powervm.rename_partition(hmc_powervm, powervm_test_input)
192+
assert expectedError == repr(e.value)
193+
else:
194+
hmc_powervm.rename_partition(hmc_powervm, powervm_test_input)

0 commit comments

Comments
 (0)