[apparmor] [patch] test the mountains and pay the dbusdriver a pivot_rootbeer

Tyler Hicks tyhicks at canonical.com
Fri Apr 25 20:07:52 UTC 2014


On 2014-04-25 21:21:36, Christian Boltz wrote:
> Hello,
> 
> the subject says it all ;-)

I'd prefer that we don't commit failing tests to trunk. Are you planning
on fixing the corresponding regexes? If not, it would probably be best
to open a bug and attach this patch to the bug to a) keep from losing
the patch and b) to aid in the development of a fix.

Thanks!

Tyler

> 
> 
> === modified file 'utils/test/test-regex_matches.py'
> --- utils/test/test-regex_matches.py    2014-04-23 21:41:44 +0000
> +++ utils/test/test-regex_matches.py    2014-04-25 19:11:57 +0000
> @@ -224,6 +224,42 @@
>      ]
>  
>  
> +class AARegexDbus(unittest.TestCase):
> +    '''Tests for RE_PROFILE_DBUS'''
> +
> +    regex = aa.RE_PROFILE_DBUS
> +
> +    tests = [
> +        ('   dbus,', (None, None, 'dbus,', None)),
> +        ('   audit dbus,', ('audit', None, 'dbus,', None)),
> +        ('   dbus send member=no_comment,', (None, None, 'dbus send member=no_comment,', None)),
> +        ('   dbus send member=no_comment, # comment', (None, None, 'dbus send member=no_comment,', '# comment')),
> +
> +        ('   dbusdriver,', False),
> +        ('   audit dbusdriver,', False),
> +    ]
> +
> +class AARegexMount(unittest.TestCase):
> +    '''Tests for RE_PROFILE_MOUNT'''
> +
> +    regex = aa.RE_PROFILE_MOUNT
> +
> +    tests = [
> +        ('   mount,', (None, None, 'mount,', 'mount', None, None)),
> +        ('   audit mount,', ('audit', None, 'mount,', 'mount', None, None)),
> +        ('   umount,', (None, None, 'umount,', 'umount', None, None)),
> +        ('   audit umount,', ('audit', None, 'umount,', 'umount', None, None)),
> +        ('   remount,', (None, None, 'remount,', 'remount', None, None)),
> +        ('   deny remount,', (None, 'deny', 'remount,', 'remount', None, None)),
> +
> +        ('   mount, # comment', (None, None, 'mount,', 'mount', None, '# comment')),
> +
> +        ('   mountain,', False),
> +        ('   audit mountain,', False),
> +    ]
> +
> +
> +
>  class AARegexSignal(unittest.TestCase):
>      '''Tests for RE_PROFILE_SIGNAL'''
>  
> @@ -242,6 +278,10 @@
>          ('   signal send set=(hup, quit) peer=/usr/sbin/daemon,',
>           (None, None,
>            'signal send set=(hup, quit) peer=/usr/sbin/daemon,', None)),
> +
> +        ('   signalling,', False),
> +        ('   audit signalling,', False),
> +        ('   signalling receive,', False),
>      ]
>  
>  
> @@ -259,6 +299,10 @@
>          ('   audit ptrace (read),', ('audit', None, 'ptrace (read),', None)),
>          ('   ptrace trace peer=/usr/sbin/daemon,',
>           (None, None, 'ptrace trace peer=/usr/sbin/daemon,', None)),
> +
> +        ('   ptraceback,', False),
> +        ('   audit ptraceback,', False),
> +        ('   ptraceback trace,', False),
>      ]
>  
>  
> @@ -278,6 +322,14 @@
>           (None, None, 'pivot_root oldroot=/new/old /new -> child,', None)),
>          ('   audit pivot_root oldroot=/new/old /new -> child,',
>           ('audit', None, 'pivot_root oldroot=/new/old /new -> child,', None)),
> +
> +        ('pivot_root', False),  # comma missing
> +
> +        ('pivot_rootbeer,', False),
> +        ('pivot_rootbeer    ,  ', False),
> +        ('pivot_rootbeer, # comment', False),
> +        ('pivot_rootbeer /new,  ', False),
> +        ('pivot_rootbeer /new, # comment', False),
>      ]
>  
>  if __name__ == '__main__':
> @@ -291,6 +343,7 @@
>      test_suite.addTest(unittest.TestLoader().loadTestsFromTestCase(AARegexSplitComment))
>  
>      for tests in (AARegexCapability, AARegexPath, AARegexBareFile,
> +                  AARegexDbus, AARegexMount, 
>                    AARegexSignal, AARegexPtrace, AARegexPivotRoot):
>          setup_regex_tests(tests)
>          test_suite.addTest(unittest.TestLoader().loadTestsFromTestCase(tests))
> 
> 
> 
> BTW: Are you ok with $SUBJECT as commit message? ;-)
> (if not, please propose a better one ;-)
> 
> 
> Regards,
> 
> Christian Boltz
> -- 
> > AFAIK they are still working on it... But you know, there are also so
> > called human beeings, who normally do not work the weekend ;-)
> It rather seems to me that there are so many uncommented bugs that there
> will be no weekends for some months...
> [> Marcel Hilzinger and Eberhard Moenkeberg in opensuse]
> 
> 
> -- 
> 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/20140425/5bfc4acf/attachment.pgp>


More information about the AppArmor mailing list