Example #1
0
    def discovery_fails_test(self):
        """Test the failing discovery task."""

        with self.assertRaises(StorageDiscoveryError):
            ZFCPDiscoverTask("", "", "").run()

        with self.assertRaises(StorageDiscoveryError):
            ZFCPDiscoverTask("0.0.fc00", "", "").run()

        with self.assertRaises(StorageDiscoveryError):
            ZFCPDiscoverTask("0.0.fc00", "0x5105074308c212e9", "").run()
Example #2
0
    def test_discovery_fails(self):
        """Test the failing discovery task."""

        with pytest.raises(StorageDiscoveryError):
            ZFCPDiscoverTask("", "", "").run()

        with pytest.raises(StorageDiscoveryError):
            ZFCPDiscoverTask("0.0.fc00", "", "").run()

        with pytest.raises(StorageDiscoveryError):
            ZFCPDiscoverTask("0.0.fc00", "0x5105074308c212e9", "").run()
Example #3
0
    def discover_with_task(self, device_number, wwpn, lun):
        """Discover a zFCP device.

        :param device_number: a device number
        :param wwpn: a worldwide port name
        :param lun: an FCP LUN number
        :return: a task
        """
        return ZFCPDiscoverTask(device_number, wwpn, lun)
Example #4
0
    def discover_with_task(self, device_number, wwpn, lun):
        """Discover a zFCP device.

        :param device_number: a device number
        :param wwpn: a worldwide port name
        :param lun: an FCP LUN number
        :return: a DBus path to a task
        """
        task = ZFCPDiscoverTask(device_number, wwpn, lun)
        path = self.publish_task(ZFCP.namespace, task)
        return path
Example #5
0
    def test_discovery(self, blockdev, zfcp):
        """Test the discovery task."""
        ZFCPDiscoverTask("0.0.fc00", "0x5105074308c212e9", "0x401040a000000000").run()

        blockdev.s390.sanitize_dev_input.assert_called_once_with("0.0.fc00")
        blockdev.s390.zfcp_sanitize_wwpn_input.assert_called_once_with("0x5105074308c212e9")
        blockdev.s390.zfcp_sanitize_lun_input.assert_called_once_with("0x401040a000000000")

        sanitized_dev = blockdev.s390.sanitize_dev_input.return_value
        sanitized_wwpn = blockdev.s390.zfcp_sanitize_wwpn_input.return_value
        sanitized_lun = blockdev.s390.zfcp_sanitize_lun_input.return_value

        zfcp.add_fcp.assert_called_once_with(sanitized_dev, sanitized_wwpn, sanitized_lun)