Exemple #1
0
    def testCreateNetXmlBridged(self):
        expectedDoc = """<network>
                           <name>vdsm-awesome_net</name>
                           <forward mode='bridge'/>
                           <bridge name='awesome_net'/>
                         </network>"""
        actualDoc = libvirtCfg.createNetworkDef('awesome_net', bridged=True)

        self.assertEqualXml(expectedDoc, actualDoc)
Exemple #2
0
    def testCreateNetXmlBridged(self):
        expectedDoc = """<network>
                           <name>vdsm-awesome_net</name>
                           <forward mode='bridge'/>
                           <bridge name='awesome_net'/>
                         </network>"""
        actualDoc = libvirtCfg.createNetworkDef('awesome_net', bridged=True)

        self.assertEqualXml(expectedDoc, actualDoc)
Exemple #3
0
    def testCreateNetXml(self):
        iface = "dummy"
        expectedDoc = ("""<network>
                            <name>vdsm-awesome_net</name>
                            <forward mode='passthrough'/>
                            <interface dev='%s'/>
                          </network>""" % iface)
        actualDoc = libvirtCfg.createNetworkDef('awesome_net', bridged=False,
                                                iface=iface)

        self.assertEqualXml(expectedDoc, actualDoc)
Exemple #4
0
    def testCreateNetXml(self):
        iface = "dummy"
        expectedDoc = ("""<network>
                            <name>vdsm-awesome_net</name>
                            <forward mode='passthrough'>
                            <interface dev='%s'/>
                            </forward>
                          </network>""" % iface)
        actualDoc = libvirtCfg.createNetworkDef('awesome_net',
                                                bridged=False,
                                                iface=iface)

        self.assertEqualXml(expectedDoc, actualDoc)
Exemple #5
0
    def testCreateNetXmlBridgedQos(self):
        inbound = {'average': '1024', 'burst': '5000'}
        outbound = {'average': '666', 'burst': '666', 'peak': '400'}
        expectedDoc = (
            """<network>
                            <name>vdsm-awesome_net</name>
                            <forward mode='bridge'/>
                            <bridge name='awesome_net'/>
                            <bandwidth>
                                <inbound average='%s' burst='%s' />
                                <outbound average='%s' burst='%s' peak='%s' />
                            </bandwidth>
                          </network>""" %
            (inbound['average'], inbound['burst'], outbound['average'],
             outbound['burst'], outbound['peak']))
        actualDoc = libvirtCfg.createNetworkDef('awesome_net',
                                                qosInbound=inbound,
                                                qosOutbound=outbound)

        self.assertEqualXml(expectedDoc, actualDoc)
Exemple #6
0
    def testCreateNetXmlBridgedQos(self):
        inbound = {'average': '1024', 'burst': '5000'}
        outbound = {'average': '666', 'burst': '666',
                    'peak': '400'}
        expectedDoc = ("""<network>
                            <name>vdsm-awesome_net</name>
                            <forward mode='bridge'/>
                            <bridge name='awesome_net'/>
                            <bandwidth>
                                <inbound average='%s' burst='%s' />
                                <outbound average='%s' burst='%s' peak='%s' />
                            </bandwidth>
                          </network>"""
                       % (inbound['average'], inbound['burst'],
                          outbound['average'], outbound['burst'],
                          outbound['peak']))
        actualDoc = libvirtCfg.createNetworkDef('awesome_net',
                                                qosInbound=inbound,
                                                qosOutbound=outbound)

        self.assertEqualXml(expectedDoc, actualDoc)