diff --git a/changes/1548.fix.rst b/changes/1548.fix.rst new file mode 100644 index 00000000..80195c05 --- /dev/null +++ b/changes/1548.fix.rst @@ -0,0 +1,4 @@ +Mock+Test: Added missing defaults for properties 'shared', 'description' and +'fulfillment-state' to the mocked 'Create Storage Group' operation. +Added missing properties and fixed property name typos in the end2end +mock test files mocked_hmc_z14.yaml and mocked_hmc_z16.yaml. diff --git a/tests/end2end/mocked_hmc_z14.yaml b/tests/end2end/mocked_hmc_z14.yaml index 54d49de1..90852db2 100644 --- a/tests/end2end/mocked_hmc_z14.yaml +++ b/tests/end2end/mocked_hmc_z14.yaml @@ -277,17 +277,18 @@ hmc_definition: - properties: object-id: sg1 name: Storage group 1 - description: Storage group 1 + description: Storage group 1 attached to CPC_DPM shared: false type: fcp fulfillment-state: complete + cpc-uri: /api/cpcs/cpc_dpm storage_volumes: - properties: element-id: sv1 name: Storage volume 1 description: Storage volume 1 fulfillment-state: complete - site: 10.0 + size: 10.0 usage: boot cpcs: - properties: @@ -494,6 +495,7 @@ hmc_definition: next-activation-profile-name: "LPAR1" last-used-activation-profile: "LPAR1" has-unacceptable-status: false + has-operating-system-messages: true - properties: object-id: lpar2 name: "LPAR2" @@ -505,6 +507,7 @@ hmc_definition: next-activation-profile-name: "LPAR2" last-used-activation-profile: "LPAR2" has-unacceptable-status: true + has-operating-system-messages: false reset_activation_profiles: - properties: name: "CPC_CLA" diff --git a/tests/end2end/mocked_hmc_z16.yaml b/tests/end2end/mocked_hmc_z16.yaml index 76205d4f..645720e0 100644 --- a/tests/end2end/mocked_hmc_z16.yaml +++ b/tests/end2end/mocked_hmc_z16.yaml @@ -277,17 +277,18 @@ hmc_definition: - properties: object-id: sg1 name: Storage group 1 - description: Storage group 1 + description: Storage group 1 attached to CPC_DPM shared: false type: fcp fulfillment-state: complete + cpc-uri: /api/cpcs/cpc_dpm storage_volumes: - properties: element-id: sv1 name: Storage volume 1 description: Storage volume 1 fulfillment-state: complete - site: 10.0 + size: 10.0 usage: boot cpcs: - properties: @@ -494,6 +495,7 @@ hmc_definition: next-activation-profile-name: "LPAR1" last-used-activation-profile: "LPAR1" has-unacceptable-status: false + has-operating-system-messages: true - properties: object-id: lpar2 name: "LPAR2" @@ -505,6 +507,7 @@ hmc_definition: next-activation-profile-name: "LPAR2" last-used-activation-profile: "LPAR2" has-unacceptable-status: true + has-operating-system-messages: false reset_activation_profiles: - properties: name: "CPC_CLA" diff --git a/zhmcclient_mock/_urihandler.py b/zhmcclient_mock/_urihandler.py index 1479a469..f949b47b 100644 --- a/zhmcclient_mock/_urihandler.py +++ b/zhmcclient_mock/_urihandler.py @@ -3973,6 +3973,9 @@ def post(method, hmc, uri, uri_parms, body, logon_required, body2 = body.copy() sv_requests = body2.pop('storage-volumes', None) + body2.setdefault('shared', True) + body2.setdefault('description', '') + body2['fulfillment-state'] = 'pending' new_storage_group = hmc.consoles.console.storage_groups.add(body2) sv_uris = []