Ejemplo n.º 1
0
class FakeNetwork(object):
    def __init__(self):
        self.uuid = 'notauuid'
        self.ipmanager = IPManager('uuid', '10.0.0.0/8')
        self.router = self.ipmanager.get_address_at_index(1)
        self.dhcp_start = '10.0.0.2'
        self.netmask = '255.0.0.0'
        self.broadcast = '10.255.255.255'
        self.provide_nat = True
Ejemplo n.º 2
0
 def test_get_address_at_index(self):
     ipm = IPManager('uuid', '192.168.1.0/24')
     self.assertEqual('192.168.1.1', str(ipm.get_address_at_index(1)))
     self.assertEqual('192.168.1.254', str(ipm.get_address_at_index(-2)))