Browse Source

VPN: add test for 7f2b79f7 (IP endpoint consistency)

Baptiste Jonglez 11 years ago
parent
commit
f82108296d
1 changed files with 15 additions and 0 deletions
  1. 15 0
      coin/vpn/tests.py

+ 15 - 0
coin/vpn/tests.py

@@ -67,3 +67,18 @@ class VPNTestCase(TestCase):
             subnet = abo.ip_subnet.get(ip_pool=self.v6_pool)
             subnet = abo.ip_subnet.get(ip_pool=self.v6_pool)
             self.assertIn(vpn.ipv6_endpoint, subnet.inet)
             self.assertIn(vpn.ipv6_endpoint, subnet.inet)
 
 
+    def test_change_v4subnet_is_vpn_endpoint_correct(self):
+        abo = OfferSubscription.objects.get()
+        subnet = abo.ip_subnet.get(ip_pool=self.v4_pool)
+        subnet.inet = "192.168.42.42/31"
+        subnet.full_clean()
+        subnet.save()
+        self.test_has_correct_ipv4_endpoint()
+
+    def test_change_v6subnet_is_vpn_endpoint_correct(self):
+        abo = OfferSubscription.objects.get()
+        subnet = abo.ip_subnet.get(ip_pool=self.v6_pool)
+        subnet.inet = "2001:db8:4242:4200::/56"
+        subnet.full_clean()
+        subnet.save()
+        self.test_has_correct_ipv6_endpoint()