[apparmor] [patch] severity.py: change rank_capability() to not expect the CAP_ prefix

Steve Beattie steve at nxnw.org
Fri May 29 22:00:37 UTC 2015


On Fri, May 29, 2015 at 11:29:14PM +0200, Christian Boltz wrote:
> Hello,
> 
> Am Freitag, 29. Mai 2015 schrieb Steve Beattie:
> > On Sun, May 24, 2015 at 03:45:13PM +0200, Christian Boltz wrote:
> > > this patch changes rank_capability() so that it doesn't expect the
> > > CAP_ prefix. This makes usage easier because callers can simply
> > > hand over the capability name.
> > > 
> > > Also change rank() to call rank_capability() without the CAP_
> > > prefix.
> > > 
> > > [ 15-severity-drop-CAP_prefix.diff ]
> > 
> > Acked-by: Steve Beattie <steve at nxnw.org>
> > 
> > I'm surprised this didn't require any test changes.
> 
> Well, that's a) not too surprising and b) expected - I don't want any 
> behaviour changes here ;-)

You've made an interface change, I would have expected that would
require changes to tests that exercise that interface directly => no
tests exercise that interface directly. No code outside of severity.py
does either (yet).

> We have tests for rank() - and they continue to work because rank() 
> still expects the CAP_ prefix (and cuts it off before calling 
> rank_capability()).
> 
> Tests that test rank_capability() in a direct way get added in patch 16 
> and patch 20.

rank_capability() is still only tested indirectly even after applying
those patches.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- 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/20150529/819323ce/attachment.pgp>


More information about the AppArmor mailing list