示例#1
0
    def test_net_address_search_key_not_found_bridge_doesnt_match(self):
        pns = [
            {'network': {'container_bridge': 'lxcbr0'}}
        ]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertNotIn('is_ssh_address', new_pns[0]['network'])
示例#2
0
    def test_net_address_search_key_not_found(self):
        pns = [
            {'network': {'container_bridge': 'br-mgmt'}}
        ]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertTrue(new_pns[0]['network']['is_ssh_address'])
示例#3
0
    def test_net_address_search_key_found(self):
        pns = [
            {'network': {'container_bridge': 'br-mgmt',
                         'is_ssh_address': True}}
        ]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertEqual(pns, new_pns)
示例#4
0
    def test_net_address_search_key_found(self):
        pns = [{
            'network': {
                'container_bridge': 'br-mgmt',
                'is_ssh_address': True
            }
        }]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertEqual(pns, new_pns)
示例#5
0
    def test_net_address_search_key_not_found_bridge_doesnt_match(self):
        pns = [{'network': {'container_bridge': 'lxcbr0'}}]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertNotIn('is_ssh_address', new_pns[0]['network'])
示例#6
0
    def test_net_address_search_key_not_found(self):
        pns = [{'network': {'container_bridge': 'br-mgmt'}}]
        new_pns = di._net_address_search(pns, 'br-mgmt', 'is_ssh_address')

        self.assertTrue(new_pns[0]['network']['is_ssh_address'])