Move all tests from test-signal_parse.py to test-signal.py

It's pointless to keep a separate file for those tests - they integrate
well in test-signal.py.

After the move, test-signal_parse.py is empty and will be deleted.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
Christian Boltz 2015-11-24 00:15:27 +01:00
parent f1e08d0684
commit 4364a3781e
2 changed files with 13 additions and 42 deletions

View file

@ -232,6 +232,19 @@ class WriteSignalTestAATest(AATest):
(' deny signal send set=(quit, int ),' , 'deny signal send set=(int quit),'),
(' deny signal send ,# foo bar' , 'deny signal send, # foo bar'),
(' allow signal set=int ,# foo bar' , 'allow signal set=int, # foo bar'),
('signal,' , 'signal,'),
('signal (receive),' , 'signal receive,'),
('signal (send),' , 'signal send,'),
('signal (send receive),' , 'signal (receive send),'),
('signal r,' , 'signal r,'),
('signal w,' , 'signal w,'),
('signal rw,' , 'signal rw,'),
('signal send set=("hup"),' , 'signal send set=hup,'),
('signal (receive) set=kill,' , 'signal receive set=kill,'),
('signal w set=(quit int),' , 'signal w set=(int quit),'),
('signal receive peer=foo,' , 'signal receive peer=foo,'),
('signal (send receive) peer=/usr/bin/bar,' , 'signal (receive send) peer=/usr/bin/bar,'),
('signal wr set=(pipe, usr1) peer=/sbin/baz,' , 'signal wr set=(pipe usr1) peer=/sbin/baz,'),
]
def test_write_manually(self):

View file

@ -1,42 +0,0 @@
#! /usr/bin/env python
# ------------------------------------------------------------------
#
# Copyright (C) 2014 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
import unittest
from common_test import AATest, setup_all_loops
from apparmor.rule.signal import SignalRule
class AAParseSignalTest(AATest):
def _run_test(self, params, expected):
parsed = SignalRule.parse(params)
self.assertEqual(expected, parsed.get_clean())
tests = [
('signal,', 'signal,'),
('signal (receive),', 'signal receive,'),
('signal (send),', 'signal send,'),
('signal (send receive),', 'signal (receive send),'),
('signal r,', 'signal r,'),
('signal w,', 'signal w,'),
('signal rw,', 'signal rw,'),
('signal send set=("hup"),', 'signal send set=hup,'),
('signal (receive) set=kill,', 'signal receive set=kill,'),
('signal w set=(quit int),', 'signal w set=(int quit),'),
('signal receive peer=foo,', 'signal receive peer=foo,'),
('signal (send receive) peer=/usr/bin/bar,', 'signal (receive send) peer=/usr/bin/bar,'),
('signal wr set=(pipe, usr1) peer=/sbin/baz,', 'signal wr set=(pipe usr1) peer=/sbin/baz,'),
]
setup_all_loops(__name__)
if __name__ == '__main__':
unittest.main(verbosity=2)