[apparmor] [patch] Change minitools_test.py to use aa-* --no-reload

Christian Boltz apparmor at cboltz.de
Sun May 31 17:56:56 UTC 2015


Hello,

Am Sonntag, 31. Mai 2015 schrieb Kshitij Gupta:
> On Mon, May 25, 2015 at 7:31 PM, Christian Boltz wrote:
> > Am Montag, 25. Mai 2015 schrieb Christian Boltz:
> > > [ 34-minitools_test-use-no-reload.diff ]
> > 
> > I accidently added a --no-reload between -d and the path in the
> > aa-audit test. The test still fails for another reason ;-) but
> > nevertheless here's v2:
> > 
> > 
> > Change minitools_test.py to use aa-* --no-reload.
> > This allows to run minitools_test.py as non-root user.
> 
> Thats a good thing but this change in tests probably breaks two things
> as the remainder of code in reload_profile and unload_profile is
> ignored due to the flag.

Yes, obviously ;-) - but being able to test the minitools as part of 
"make check" (instead of not running those tests) is worth it.

(Note that the missing step to run those tests is renaming 
minitools_test.py to test-minitools.py.)

> I think there should be additional tests for them.

Well, those tests would basically check that parser call works (that's 
the only skipped thing when --no-reload is given), and require root 
permissions for obvious reasons.

If we add some tests, they should be in a separate file or require a 
commandline parameter so that the root-only tests run only when called 
manually.

> > Also add a check that only creates the force-complain directory if 
> > it doesn't exist yet.
> > 
> > 
> > Note: With this patch applied, there are still 4 failing tests,
> > probably caused by changes in the profiles that are used in the
> > tests.
> > 
> > 
> > I propose this patch for trunk and 2.9.
> > 
> > 
> > [ 34-minitools_test-use-no-reload.diff ]
> > 
> > === modified file utils/test/minitools_test.py

> >      def test_disable(self):
> >          #Disable the ntpd profile and check if it was correctly
> >          disabled
> 
> Nitpick: As the next patch changes the used profile from ntpd to
> winbind I think the above comment is rendered wrong.
> A replacement of "ntpd" with "test" in such comments would be nice.

Indeed, nice catch.

I'll send a separate patch to update the comments.


Regards,

Christian Boltz
-- 
> Du testest hflacs ;-)  Mit existieren Dateien testen (erwartetes
> Ergebnis: "geht") ist langweilig.
Ich teste goldrichtig. Dazu hat der liebe Gott nämlich die User
erschaffen. :-)   [> Christian Boltz und Ratti in fontlinge-devel]




More information about the AppArmor mailing list