예제 #1
0
파일: test_vlan.py 프로젝트: mwutzke/faucet
    def test_ipvs_ipv4(self):
        """Tests the ipvs() method with an IPv4 vip"""

        vlan_config = {'faucet_vips': ['10.0.0.254/24']}

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(4, vlan.ipvs())
        self.assertNotIn(6, vlan.ipvs())
예제 #2
0
파일: test_vlan.py 프로젝트: mwutzke/faucet
    def test_ipvs_ipv6(self):
        """Tests the ipvs() method with an IPv6 vip"""

        vlan_config = {'faucet_vips': ['2001::1/16']}

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(6, vlan.ipvs())
        self.assertNotIn(4, vlan.ipvs())
예제 #3
0
    def test_ipvs_ipv6(self):
        """Tests the ipvs() method with an IPv6 vip"""

        vlan_config = {
            'faucet_vips': ['2001::1/16']
        }

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(6, vlan.ipvs())
        self.assertNotIn(4, vlan.ipvs())
예제 #4
0
    def test_ipvs_ipv4(self):
        """Tests the ipvs() method with an IPv4 vip"""

        vlan_config = {
            'faucet_vips': ['10.0.0.254/24']
        }

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(4, vlan.ipvs())
        self.assertNotIn(6, vlan.ipvs())
예제 #5
0
    def test_ipvs_ipv6(self):
        """Tests the ipvs() method with an IPv6 vip"""

        self.input_config.update({'faucet_vips': ['2001::1/16']})

        vlan = VLAN(1, 1, self.input_config)
        self.assertEqual(vlan.ipvs(), [6])
예제 #6
0
    def test_ipvs_ipv4(self):
        """Tests the ipvs() method with an IPv4 vip"""

        self.input_config.update({'faucet_vips': ['10.0.0.254/24']})

        vlan = VLAN(1, 1, self.input_config)
        self.assertEqual(vlan.ipvs(), [4])
예제 #7
0
    def test_ipvs_ipv4_ipv6(self):
        """Tests the ipvs() method with both IPv4 and IPv6 vips"""

        self.input_config.update(
            {'faucet_vips': ['2001::1/16', 'fe80::1/64', '10.0.0.254/24']})

        vlan = VLAN(1, 1, self.input_config)
        self.assertEqual(set(vlan.ipvs()), set([4, 6]))
예제 #8
0
파일: test_vlan.py 프로젝트: mwutzke/faucet
    def test_ipvs_ipv4_ipv6(self):
        """Tests the ipvs() method with both IPv4 and IPv6 vips"""

        vlan_config = {
            'faucet_vips': ['2001::1/16', 'fe80::1/64', '10.0.0.254/24']
        }

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(4, vlan.ipvs())
        self.assertIn(6, vlan.ipvs())
예제 #9
0
    def test_ipvs_ipv4_ipv6(self):
        """Tests the ipvs() method with both IPv4 and IPv6 vips"""

        vlan_config = {
            'faucet_vips': [
                '2001::1/16',
                'fe80::1/64',
                '10.0.0.254/24'
            ]
        }

        vlan = VLAN(1, 1, vlan_config)
        self.assertIn(4, vlan.ipvs())
        self.assertIn(6, vlan.ipvs())
예제 #10
0
    def test_ipvs_no_ips(self):
        """Tests the ipvs() method with no vips"""

        vlan = VLAN(1, 1, {})
        self.assertEqual(len(vlan.ipvs()), 0)
예제 #11
0
파일: test_vlan.py 프로젝트: mwutzke/faucet
    def test_ipvs_no_ips(self):
        """Tests the ipvs() method with no vips"""

        vlan = VLAN(1, 1, {})
        self.assertEqual(len(vlan.ipvs()), 0)
예제 #12
0
    def test_ipvs_no_ips(self):
        """Tests the ipvs() method with no vips"""

        vlan = VLAN(1, 1, self.input_config)
        self.assertEqual(vlan.ipvs(), [])