Skip to content

Commit

Permalink
Fixed errors in the mock support and its end2end_mock tests
Browse files Browse the repository at this point in the history
Details:

* Mock: Added missing defaults for properties 'shared', 'description' and
'fulfillment-state' to the mocked 'Create Storage Group' operation.

* Test: Added missing properties and fixed property name typos in the end2end
  mock test files mocked_hmc_z14.yaml and mocked_hmc_z16.yaml.

Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Jun 21, 2024
1 parent fa1edfa commit 2e805a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changes/1548.fix.rst
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 5 additions & 2 deletions tests/end2end/mocked_hmc_z14.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions tests/end2end/mocked_hmc_z16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions zhmcclient_mock/_urihandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 2e805a6

Please sign in to comment.