Exemple #1
0
    def test_write_manually(self):
        obj = NetworkRule('inet', 'stream', allow_keyword=True)

        expected = '    allow network inet stream,'

        self.assertEqual(expected, obj.get_clean(2), 'unexpected clean rule')
        self.assertEqual(expected, obj.get_raw(2), 'unexpected raw rule')
Exemple #2
0
    def test_write_manually(self):
        obj = NetworkRule('inet', 'stream', allow_keyword=True)

        expected = '    allow network inet stream,'

        self.assertEqual(expected, obj.get_clean(2), 'unexpected clean rule')
        self.assertEqual(expected, obj.get_raw(2), 'unexpected raw rule')
Exemple #3
0
 def test_empty_net_data_2(self):
     obj = NetworkRule('inet', 'stream')
     obj.type_or_protocol = ''
     # no type_or_protocol set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)
Exemple #4
0
 def test_empty_net_data_1(self):
     obj = NetworkRule('inet', 'stream')
     obj.domain = ''
     # no domain set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)
Exemple #5
0
 def test_empty_net_data_2(self):
     obj = NetworkRule('inet', 'stream')
     obj.type_or_protocol = ''
     # no type_or_protocol set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)
Exemple #6
0
 def test_empty_net_data_1(self):
     obj = NetworkRule('inet', 'stream')
     obj.domain = ''
     # no domain set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)