예제 #1
0
    def test_it_should_have_ip_addresses_on_if1(self):
        l = Link('A')
        m = Link('B')
        r = TestRouter('TNN',   link0=l, ips0=[IPAddress.identify("2001:500:88:200::10"), IPAddress.identify("2001:500:88:200::11"), IPAddress.identify("fe80:500:88:200::10"), IPAddress.identify("192.0.43.10")],
                                link1=m, ips1=[IPAddress.identify("2001:600:88:200::10"), IPAddress.identify("2001:600:88:200::11"), IPAddress.identify("fe80:600:88:200::10"), IPAddress.identify("192.1.43.10")])

        self.assertEqual("2001:600:88:200::10", r.ip(1).short_form())
        self.assertEqual("2001:600:88:200::10", r.global_ip(1).short_form())
        self.assertEqual("2001:600:88:200::11", r.global_ip(1, offset=1).short_form())
        self.assertEqual("192.1.43.10", r.ip(1, type='v4').short_form())