def test_scanning_empty_sr(self, context): sr = create_hba_sr() sr._init_hbadict() result = devscan.scan(sr) self.assertXML(""" <?xml version="1.0" ?> <Devlist/> """, result)
def test_scanning_empty_sr(self, context): sr = create_hba_sr() sr._init_hbadict() result = devscan.scan(sr) self.assertXML( """ <?xml version="1.0" ?> <Devlist/> """, result)
def test_scanning_sr_with_devices(self, context): sr = create_hba_sr() adapter = context.add_adapter(testlib.SCSIAdapter()) adapter.add_disk() sr._init_hbadict() result = devscan.scan(sr) self.assertXML(""" <?xml version="1.0" ?> <Devlist> <Adapter> <host>host0</host> <name>Unknown</name> <manufacturer>Unknown-description</manufacturer> <id>0</id> </Adapter> </Devlist> """, result)
def test_scanning_sr_with_devices(self, context): sr = create_hba_sr() adapter = context.add_adapter(testlib.SCSIAdapter()) adapter.add_disk() sr._init_hbadict() result = devscan.scan(sr) self.assertXML( """ <?xml version="1.0" ?> <Devlist> <Adapter> <host>host0</host> <name>Unknown</name> <manufacturer>Unknown-description</manufacturer> <id>0</id> </Adapter> </Devlist> """, result)
def test_scanning_sr_includes_parameters(self, context): sr = create_hba_sr() adapter = context.add_adapter(testlib.SCSIAdapter()) adapter.add_disk() sr._init_hbadict() adapter.add_parameter('fc_host', dict(port_name='VALUE')) result = devscan.scan(sr) self.assertXML(""" <?xml version="1.0" ?> <Devlist> <Adapter> <host>host0</host> <name>Unknown</name> <manufacturer>Unknown-description</manufacturer> <id>0</id> <fc_host> <port_name>VALUE</port_name> </fc_host> </Adapter> </Devlist> """, result)
def test_scanning_sr_includes_parameters(self, context): sr = create_hba_sr() adapter = context.add_adapter(testlib.SCSIAdapter()) adapter.add_disk() sr._init_hbadict() adapter.add_parameter('fc_host', dict(port_name='VALUE')) result = devscan.scan(sr) self.assertXML( """ <?xml version="1.0" ?> <Devlist> <Adapter> <host>host0</host> <name>Unknown</name> <manufacturer>Unknown-description</manufacturer> <id>0</id> <fc_host> <port_name>VALUE</port_name> </fc_host> </Adapter> </Devlist> """, result)
def print_devs(self): self.attach("") self._init_hbadict() return devscan.scan(self)