Exemplo n.º 1
0
    def setUp(self):
        """Set up the module."""
        self.iscsi_module = ISCSIModule()
        self.iscsi_interface = ISCSIInterface(self.iscsi_module)

        self._portal = Portal()
        self._portal.ip_address = "10.43.136.67"
        self._portal.port = "3260"

        self._credentials = Credentials()
        self._credentials.username = "******"
        self._credentials.password = "******"
        self._credentials.reverse_username = "******"
        self._credentials.reverse_password = "******"

        self._node = Node()
        self._node.name = "iqn.2014-08.com.example:t1"
        self._node.address = "10.43.136.67"
        self._node.port = "3260"
        self._node.iface = "iface0"
        self._node.net_ifacename = "ens3"

        # Connect to the properties changed signal.
        self.callback = PropertiesChangedCallback()
        self.iscsi_interface.PropertiesChanged.connect(self.callback)
Exemplo n.º 2
0
    def _get_portal(self):
        """Get the portal for the discovery

        :return: an instance of Portal
        """
        portal = Portal()
        portal.ip_address = self._get_text("portalEntry")
        return portal