[apparmor] [patch] Add tests for RlimitRule and RlimitRuleset

Christian Boltz apparmor at cboltz.de
Fri Jun 5 14:04:28 UTC 2015


Hello,

Am Donnerstag, 4. Juni 2015 schrieb Steve Beattie:
> On Tue, May 26, 2015 at 12:41:19AM +0200, Christian Boltz wrote:
> > Am Dienstag, 26. Mai 2015 schrieb Christian Boltz:
> > > $subject.
> > > 
> > > This time we "only" have 98% coverage (2 missing, 3 partial)
> > > because
> > > I didn't find corner cases that raise some exceptions ;-)
> > > (maybe we can even drop those checks if they are never hit?)
> > 
> > Here's the patch again, but without linebreaks caused by my mail
> > client:
> > 
> > [ 42-add-tests-for-rlimit-rule.diff ]
> > 
> > === modified file utils/test/test-rlimit.py4

> > +class CapabilityLogprofHeaderTest(AATest):
> I suspect you intended this to be s/Capability/Rlimit/

Oops, indeed.

> > +class RlimitDeleteTestAATest(AATest):
> > +    pass
> 
> Sorry, what's this class intended for?

Have a look at the capability, network or change_profile tests ;-)
(If you didn't notice yet - sed is very helpful in writing the 
*Rule{,set} tests ;-)

The intention is to test de-duplication.

That said - de-duplication consists of is_covered() (which we already
test) and code from BaseRuleset (which is already tested in the 
capability, network and change_profile tests). 

Therefore I don't think we need to exercise de-duplication for every 
rule type, and added a comment saying that to my local copy of the 
patch.


Regards,

Christian Boltz
-- 
Your mail is 7 pages of printout. Do you seriously expect people that do
openSUSE in their free time to read that? Little less Castro, little
more JFK... [Stephan Kulow in opensuse-project]




More information about the AppArmor mailing list