@@ -60,6 +60,7 @@ def test_volume_detail(self):
6060
6161 self .assert_no_fail (result )
6262 isinstance (json .loads (result .output )['IOPs' ], float )
63+ self .assert_called_with ('SoftLayer_Network_Storage' , 'getObject' , identifier = 1234 )
6364 self .assertEqual ({
6465 'Username' : 'username' ,
6566 'LUN Id' : '2' ,
@@ -99,47 +100,22 @@ def test_volume_detail(self):
99100 }, json .loads (result .output ))
100101
101102 def test_volume_detail_name_identifier (self ):
102- result = self .run_command (['block' , 'volume-detail' , 'username' ])
103-
103+ result = self .run_command (['block' , 'volume-detail' , 'SL-12345' ])
104+ expected_filter = {
105+ 'iscsiNetworkStorage' : {
106+ 'serviceResource' : {
107+ 'type' : {
108+ 'type' : {'operation' : '!~ ISCSI' }
109+ }
110+ },
111+ 'storageType' : {
112+ 'keyName' : {'operation' : '*= BLOCK_STORAGE' }
113+ },
114+ 'username' : {'operation' : '_= SL-12345' }}}
115+
116+ self .assert_called_with ('SoftLayer_Account' , 'getIscsiNetworkStorage' , filter = expected_filter )
117+ self .assert_called_with ('SoftLayer_Network_Storage' , 'getObject' , identifier = 100 )
104118 self .assert_no_fail (result )
105- isinstance (json .loads (result .output )['IOPs' ], float )
106- self .assertEqual ({
107- 'Username' : 'username' ,
108- 'LUN Id' : '2' ,
109- 'Endurance Tier' : 'READHEAVY_TIER' ,
110- 'IOPs' : 1000 ,
111- 'Snapshot Capacity (GB)' : '10' ,
112- 'Snapshot Used (Bytes)' : 1024 ,
113- 'Capacity (GB)' : '20GB' ,
114- 'Target IP' : '10.1.2.3' ,
115- 'Data Center' : 'dal05' ,
116- 'Type' : 'ENDURANCE' ,
117- 'ID' : 100 ,
118- '# of Active Transactions' : '1' ,
119- 'Ongoing Transaction' : 'This is a buffer time in which the customer may cancel the server' ,
120- 'Replicant Count' : '1' ,
121- 'Replication Status' : 'Replicant Volume Provisioning '
122- 'has completed.' ,
123- 'Replicant Volumes' : [[
124- {'Replicant ID' : 'Volume Name' , '1784' : 'TEST_REP_1' },
125- {'Replicant ID' : 'Target IP' , '1784' : '10.3.174.79' },
126- {'Replicant ID' : 'Data Center' , '1784' : 'wdc01' },
127- {'Replicant ID' : 'Schedule' , '1784' : 'REPLICATION_HOURLY' },
128- ], [
129- {'Replicant ID' : 'Volume Name' , '1785' : 'TEST_REP_2' },
130- {'Replicant ID' : 'Target IP' , '1785' : '10.3.177.84' },
131- {'Replicant ID' : 'Data Center' , '1785' : 'dal01' },
132- {'Replicant ID' : 'Schedule' , '1785' : 'REPLICATION_DAILY' },
133- ]],
134- 'Original Volume Properties' : [
135- {'Property' : 'Original Volume Size' ,
136- 'Value' : '20' },
137- {'Property' : 'Original Volume Name' ,
138- 'Value' : 'test-original-volume-name' },
139- {'Property' : 'Original Snapshot Name' ,
140- 'Value' : 'test-original-snapshot-name' }
141- ]
142- }, json .loads (result .output ))
143119
144120 def test_volume_list (self ):
145121 result = self .run_command (['block' , 'volume-list' ])
0 commit comments