Skip to content

Commit 3f13fe8

Browse files
Merge pull request #2004 from ramkishor-ch/issue_1732
block volume-list errors for this issue #1732
2 parents 43e2ff5 + d594b96 commit 3f13fe8

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

SoftLayer/fixtures/SoftLayer_Network_Storage.py

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,75 @@
263263
'deDuplicateConversionPercentage': 50,
264264
'volumeUsername': 'testUser'
265265
}
266+
267+
BLOCK_LIST_ISSUES_1732 = {
268+
'capacityGb': 16000,
269+
'id': 167214314,
270+
'notes': 'test',
271+
'username': 'SL02SEL307608-60',
272+
'activeTransactionCount': 0,
273+
'replicationPartnerCount': 1,
274+
'lunId': '1',
275+
'parentVolume': {
276+
'accountId': 307608,
277+
'capacityGb': 16000,
278+
'createDate': '2020-09-02T14:55:32-06:00',
279+
'guestId': None,
280+
'hardwareId': None,
281+
'hostId': None,
282+
'id': 167214302,
283+
'nasType': 'NAS_CONTAINER',
284+
'serviceProviderId': 1,
285+
'storageTypeId': '3',
286+
'upgradableFlag': True,
287+
'username': 'SL02SEVC307608_60',
288+
'serviceResourceBackendIpAddress': 'fsf-mex0101b-fz.service.softlayer.com',
289+
'serviceResourceName': 'Storage Type 02 Aggregate stxf-mex0101b',
290+
'snapshotSizeBytes': '831488'
291+
},
292+
'provisionedIops': '4096',
293+
'replicationPartners': [{
294+
'id': 167236648,
295+
'username': 'SL02SEL307608_60_REP_1',
296+
'replicationSchedule': {
297+
'active': 1,
298+
'createDate': '2020-09-02T17:10:04-06:00',
299+
'id': 542062,
300+
'modifyDate': None,
301+
'name': 'SL02SEVC307608_60_WEEKLY',
302+
'partnershipId': None,
303+
'typeId': 34,
304+
'volumeId': 167214302,
305+
'type': {
306+
'keyname': 'REPLICATION_WEEKLY'
307+
}
308+
},
309+
'serviceResource': {
310+
'backendIpAddress': 'fsf-sao0102c-fz.service.softlayer.com',
311+
'id': 30650,
312+
'name': 'Storage Type 02 Aggregate stxf-sao0102c',
313+
'datacenter': {
314+
'name': 'sao01'
315+
},
316+
'type': {
317+
'type': 'NETAPP_STOR_AGGR'
318+
}
319+
},
320+
'serviceResourceBackendIpAddress': '10.200.14.72'
321+
}],
322+
'replicationStatus': 'FAILBACK_COMPLETED',
323+
'serviceResource': {
324+
'backendIpAddress': 'fsf-mex0101b-fz.service.softlayer.com',
325+
'id': 9291,
326+
'name': 'Storage Type 02 Aggregate stxf-mex0101b',
327+
'datacenter': {
328+
'name': 'mex01'
329+
}
330+
},
331+
'serviceResourceBackendIpAddress': '10.2.190.99',
332+
'snapshotCapacityGb': '1000',
333+
'storageTierLevel': 'LOW_INTENSITY_TIER',
334+
'storageType': {
335+
'keyName': 'ENDURANCE_BLOCK_STORAGE'
336+
}
337+
}

tests/CLI/modules/block_tests.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:license: MIT, see LICENSE for more details.
66
"""
77
from SoftLayer.CLI import exceptions
8+
from SoftLayer.fixtures import SoftLayer_Network_Storage
89
from SoftLayer import SoftLayerAPIError
910
from SoftLayer import testing
1011

@@ -96,6 +97,16 @@ def test_volume_detail(self):
9697
]
9798
}, json.loads(result.output))
9899

100+
def test_block_detail_issue1732(self):
101+
lun_mock = self.set_mock('SoftLayer_Network_Storage', 'getObject')
102+
lun_mock.return_value = SoftLayer_Network_Storage.BLOCK_LIST_ISSUES_1732
103+
result = self.run_command(['--format=table', 'block', 'volume-detail', '1234'])
104+
self.assert_no_fail(result)
105+
self.assertIn('│ Username │ SL02SEL307608-60 │', result.output)
106+
self.assertIn('│ Capacity (GB) │ 16000GB │', result.output)
107+
self.assertIn('│ Replication Status │ FAILBACK_COMPLETED │', result.output)
108+
self.assertIn('│ Notes │ test │', result.output)
109+
99110
def test_volume_detail_name_identifier(self):
100111
result = self.run_command(['block', 'volume-detail', 'SL-12345'])
101112
expected_filter = {

0 commit comments

Comments
 (0)