def test_get_dasd_info_returns_none_if_bad_blocksize( self, m_dview, m_block): devname = random_string() id_path = random_string() device = {'DEVNAME': devname, 'ID_PATH': 'ccw-' + id_path} m_dview.return_value = self._load_test_data('dasdd.view') m_block.return_value = None self.assertIsNone(dasd.get_dasd_info(device))
def test_get_dasd_info(self, m_dview): devname = random_string() id_path = random_string() device = {'DEVNAME': devname, 'ID_PATH': 'ccw-' + id_path} m_dview.return_value = self._load_test_data('dasdd.view') self.assertEqual( update_probe_data(expected_probe_data['/dev/dasdd'], name=devname, device_id=id_path), dasd.get_dasd_info(device))
def test_get_dasd_info(self, m_dview): devname = random_string() id_path = random_string() device = {'DEVNAME': devname, 'ID_PATH': 'ccw-' + id_path} m_dview.return_value = self._load_test_data('dasdd.view') self.assertEqual( { 'name': devname, 'device_id': id_path, 'disk_layout': 'cdl', 'blocksize': 4096 }, dasd.get_dasd_info(device))
def test_get_dasd_info_returns_none_if_not_all(self, m_dview): devname = random_string() id_path = random_string() device = {'DEVNAME': devname, 'ID_PATH': 'ccw-' + id_path} m_dview.return_value = random_string() self.assertIsNone(dasd.get_dasd_info(device))