Ejemplo n.º 1
0
    def test_dev_conf_proxy_arp_set(self):
        """Test enabling of proxy ARP on interface.
        """
        mock_handle = io.open.return_value

        netdev.dev_conf_proxy_arp_set('foo', True)

        io.open.assert_called_with('/proc/sys/net/ipv4/conf/foo/proxy_arp',
                                   'w')
        mock_handle.write.assert_called_with('1')
Ejemplo n.º 2
0
    def test_dev_conf_proxy_arp_set(self, mock_open):
        """Test enabling of proxy ARP on interface.
        """
        mock_file = mock_open.return_value
        mock_filectx = mock_file.__enter__.return_value

        netdev.dev_conf_proxy_arp_set('foo', True)

        mock_open.assert_called_with('/proc/sys/net/ipv4/conf/foo/proxy_arp',
                                     'w')
        mock_filectx.write.assert_called_with('1')