Esempio n. 1
0
 def testAddressMapping(self):
     dns = self.dns1
     yield dns.remove_mapping("not.existing", "0.0.0.0")
     yield self.assert_not_resolves('not.existing.test.lan', "0.0.0.0")
     yield dns.add_mapping("dummy", "123.45.67.89")
     yield self.assert_resolves('dummy.test.lan', "123.45.67.89")
     yield dns.add_mapping("dummy", "123.45.67.89")
     yield self.assert_resolves('dummy.test.lan', "123.45.67.89")
     yield dns.remove_mapping("dummy", "0.0.0.0")
     yield self.assert_resolves('dummy.test.lan', "123.45.67.89")
     yield dns.remove_mapping("dummy", "123.45.67.89")
     yield self.assert_not_resolves('dummy.test.lan', "123.45.67.89")
Esempio n. 2
0
    def testAddressMapping(self):
        dns = self.get_local("dns1")

        res = yield dns.remove_mapping("not.existing.test.lan", "0.0.0.0")
        self.assertFalse(res)
        res = yield dns.add_mapping("dummy.test.lan", "123.45.67.89")
        self.assertTrue(res)
        res = yield dns.add_mapping("dummy.test.lan", "123.45.67.89")
        self.assertFalse(res)
        res = yield dns.remove_mapping("dummy.test.lan", "0.0.0.0")
        self.assertFalse(res)
        res = yield dns.remove_mapping("dummy.test.lan", "123.45.67.89")
        self.assertTrue(res)
Esempio n. 3
0
 def do_add(self, state, prefix, ip):
     return dns.add_mapping(self, prefix, ip)
Esempio n. 4
0
 def register(self, state):
     return dns.add_mapping(self, state.prefix, state.ip)