Exemple #1
0
    def test_allow_icmp(self):
        '''
        Test ICMP allow
        '''
        with patch.object(firewalld, '__firewall_cmd', return_value='success'):
            with patch.object(firewalld, 'get_icmp_types', return_value='echo-reply'):
                self.assertEqual(firewalld.allow_icmp('zone', 'echo-reply'), 'success')

        with patch.object(firewalld, '__firewall_cmd', return_value='success'):
            self.assertFalse(firewalld.allow_icmp('zone', 'echo-reply'))
Exemple #2
0
    def test_allow_icmp(self):
        '''
        Test ICMP allow
        '''
        with patch.object(firewalld, '__firewall_cmd', return_value='success'):
            with patch.object(firewalld, 'get_icmp_types', return_value='echo-reply'):
                self.assertEqual(firewalld.allow_icmp('zone', 'echo-reply'), 'success')

        with patch.object(firewalld, '__firewall_cmd', return_value='success'):
            self.assertFalse(firewalld.allow_icmp('zone', 'echo-reply'))
    def test_allow_icmp(self):
        """
        Test ICMP allow
        """
        with patch.object(firewalld, "__firewall_cmd", return_value="success"):
            with patch.object(firewalld, "get_icmp_types", return_value="echo-reply"):
                self.assertEqual(firewalld.allow_icmp("zone", "echo-reply"), "success")

        with patch.object(firewalld, "__firewall_cmd", return_value="success"):
            self.assertFalse(firewalld.allow_icmp("zone", "echo-reply"))