Esempio n. 1
0
    def test_write_manually(self):
        obj = SignalRule('send', 'quit', '/foo', allow_keyword=True)

        expected = '    allow signal send set=quit peer=/foo,'

        self.assertEqual(expected, obj.get_clean(2), 'unexpected clean rule')
        self.assertEqual(expected, obj.get_raw(2), 'unexpected raw rule')
Esempio n. 2
0
 def test_empty_data_3(self):
     obj = SignalRule('send', 'quit', '/foo')
     obj.peer = ''
     # no signal set, and ALL not set
     with self.assertRaises(AppArmorBug):
         obj.get_clean(1)