[apparmor] [PATCH] utils: Handle unmount rules
Tyler Hicks
tyhicks at canonical.com
Tue Jun 3 21:29:28 UTC 2014
On 2014-06-03 19:19:28, Christian Boltz wrote:
> Hello,
>
> Am Montag, 2. Juni 2014 schrieb Tyler Hicks:
> > Bug: https://bugs.launchpad.net/bugs/1325109
> >
> > The parser will accept rules with either umount or unmount rule types.
> > The utils should follow suite.
> >
> > Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> > ---
> > utils/apparmor/aa.py | 2 +-
> > utils/test/test-mount_parse.py | 12 ++++++++++++
> > utils/test/test-regex_matches.py | 2 ++
> > 3 files changed, 15 insertions(+), 1 deletion(-)
> [...]
> > --- a/utils/test/test-mount_parse.py
> > +++ b/utils/test/test-mount_parse.py
>
> > + def test_parse_plain_unmount_rule(self):
> > + rule = 'unmount,'
> > + mount = aa.parse_mount_rule(rule)
> > + self.assertEqual(rule, mount.serialize(),
> > + 'mount object returned "%s", expected "%s"' %
> > (mount.serialize(), rule)) +
> > + def test_parse_unmount_with_mount_point(self):
> > + rule = 'unmount /mnt/external,'
> > + mount = aa.parse_mount_rule(rule)
> > + self.assertEqual(rule, mount.serialize(),
> > + 'mount object returned "%s", expected "%s"' %
>
> Doing this with an array and a loop is still on your TODO list, right?
> ;-)
Lets get aa.parse_*_rule() to actually do something other than saving
off the rule string before we worry about optimizing the test cases. The
tests are essentially comparing the rule string to itself right now.
>
>
> That said,
> Acked-by: Christian Boltz <apparmor at cboltz.de>
Thanks!
Tyler
>
>
> Regards,
>
> Christian Boltz
> --
> >Jetzt, wo du es sagst. Ich benutze aber immer cat. Auch wenn ich mit
> >grep eine Datei durchsuchen will. Keine Ahnung warum.
> >Ich glaube, dass ich das mal am Anfang irgendwo gelesen habe, und dann
> >hat es sich ins Hirn eingebrannt.
> *tsk* Ich glaub, wir muessen dich mal einer Gehirnwaesche unterziehen...
> [> Marcus Habermehl und David Haller in suse-linux]
>
>
> --
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140603/60a083d2/attachment.pgp>
More information about the AppArmor
mailing list