Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
    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)
Beispiel #5
0
    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)
Beispiel #6
0
    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)
Beispiel #7
0
 def print_devs(self):
     self.attach("")
     self._init_hbadict()
     return devscan.scan(self)
Beispiel #8
0
 def print_devs(self):
     self.attach("")
     self._init_hbadict()
     return devscan.scan(self)