url.appendChild(url_text)
storage.appendChild(url)
+ storagepool = doc.createElement('StoragePool')
+ pool_text = doc.createTextNode('OpenStack_Pool')
+ storagepool.appendChild(pool_text)
+ storage.appendChild(storagepool)
+
lun = doc.createElement('LUN')
config.appendChild(lun)
storagepool = doc.createElement('StoragePool')
re = self.driver.restclient._get_id_from_result(result, name, key)
self.assertEqual('1', re)
+ @mock.patch.object(rest_client.RestClient, 'find_pool_info',
+ return_value={'ID': 1,
+ 'CAPACITY': 110362624,
+ 'TOTALCAPACITY': 209715200})
+ def test_get_capacity(self, mock_find_pool_info):
+ expected_pool_capacity = {'total_capacity': 100.0,
+ 'free_capacity': 52.625}
+ pool_capacity = self.driver.restclient._get_capacity(None,
+ None)
+ self.assertEqual(expected_pool_capacity, pool_capacity)
+
def create_fake_conf_file(self):
"""Create a fake Config file
url.appendChild(url_text)
storage.appendChild(url)
+ storagepool = doc.createElement('StoragePool')
+ pool_text = doc.createTextNode('OpenStack_Pool')
+ storagepool.appendChild(pool_text)
+ storage.appendChild(storagepool)
+
lun = doc.createElement('LUN')
config.appendChild(lun)
storagepool = doc.createElement('StoragePool')