コード例 #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
ファイル: test_vlan.py プロジェクト: anarkiwi/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())
コード例 #4
0
ファイル: test_vlan.py プロジェクト: anarkiwi/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())
コード例 #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
ファイル: test_vlan.py プロジェクト: anarkiwi/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())
コード例 #10
0
ファイル: test_vlan.py プロジェクト: anarkiwi/faucet
    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(), [])