2016-10-01 20:57:09 +02:00
#! /usr/bin/python3
2015-09-05 01:23:43 +02:00
# ------------------------------------------------------------------
#
2021-05-16 16:23:55 +02:00
# Copyright (C) 2015-2021 Christian Boltz <apparmor@cboltz.de>
2015-09-05 01:23:43 +02:00
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# ------------------------------------------------------------------
import os
2018-05-06 17:42:43 +02:00
import sys
2022-08-07 20:32:07 -04:00
import unittest
2015-09-05 01:23:43 +02:00
2016-10-17 21:04:05 +02:00
import apparmor . aa
2024-10-20 22:35:40 +02:00
from apparmor . common import open_file_read , split_name
2015-09-05 01:23:43 +02:00
from apparmor . logparser import ReadLog
2022-08-07 20:32:07 -04:00
from common_test import AATest , read_file , setup_aa , setup_all_loops
2015-09-05 01:23:43 +02:00
2019-06-22 02:06:54 -07:00
2015-09-05 01:23:43 +02:00
class TestLibapparmorTestMulti ( AATest ) :
2022-08-07 14:57:30 -04:00
""" Parse all libraries/libapparmor/testsuite/test_multi tests and compare the result with the *.out files """
2016-10-17 21:04:05 +02:00
tests = ' invalid ' # filled by parse_test_profiles()
2015-09-05 01:23:43 +02:00
def _run_test ( self , params , expected ) :
# tests[][expected] is a dummy, replace it with the real values
2019-06-22 02:06:54 -07:00
if params . split ( ' / ' ) [ - 1 ] in log_to_skip :
return
2015-09-05 01:23:43 +02:00
expected = self . _parse_libapparmor_test_multi ( params )
2022-06-26 12:06:22 +00:00
loglines = [ ]
2023-02-19 16:26:14 -05:00
with open_file_read ( params + ' .in ' ) as f_in :
2022-06-26 12:06:22 +00:00
for line in f_in :
if line . strip ( ) :
loglines . append ( line )
2015-09-05 01:23:43 +02:00
2023-02-19 16:26:14 -05:00
self . assertEqual ( len ( loglines ) , 1 , params + ' .in should only contain one line! ' )
2015-09-05 01:23:43 +02:00
2019-05-04 00:22:46 +02:00
parser = ReadLog ( ' ' , ' ' , ' ' )
2022-06-26 12:06:22 +00:00
parsed_event = parser . parse_event ( loglines [ 0 ] )
2015-09-05 01:23:43 +02:00
if parsed_event and expected :
parsed_items = dict ( parsed_event . items ( ) )
2015-10-03 20:18:54 +02:00
# check if the line passes the regex in logparser.py
2022-06-26 12:06:22 +00:00
if not parser . RE_LOG_ALL . search ( loglines [ 0 ] ) :
2015-10-03 20:18:54 +02:00
raise Exception ( " Log event doesn ' t match RE_LOG_ALL " )
2015-09-05 01:23:43 +02:00
for label in expected :
2022-06-18 14:30:49 -04:00
if label in (
2015-09-05 01:23:43 +02:00
' file ' , # filename of the *.in file
' event_type ' , # mapped to aamode
' audit_id ' , ' audit_sub_id ' , # not set nor relevant
' comm ' , # not set, and not too useful
# XXX most of the keywords listed below mean "TODO"
' fsuid ' , ' ouid ' , # file events
' flags ' , ' fs_type ' , # mount
' namespace ' , # file_lock only?? (at least the tests don't contain this in other event types with namespace)
' net_local_addr ' , ' net_foreign_addr ' , ' net_local_port ' , ' net_foreign_port ' , # detailed network events
' peer ' , ' signal ' , # signal
' src_name ' , # pivotroot
' dbus_bus ' , ' dbus_interface ' , ' dbus_member ' , ' dbus_path ' , # dbus
' peer_pid ' , ' peer_profile ' , # dbus
2024-03-29 13:09:06 +00:00
' net_addr ' , ' peer_addr ' , # unix
2022-08-07 12:26:24 -04:00
) :
2015-09-05 01:23:43 +02:00
pass
2022-06-18 14:30:49 -04:00
elif parsed_items [ ' operation ' ] == ' exec ' and label in ( ' sock_type ' , ' family ' , ' protocol ' ) :
2015-09-05 01:23:43 +02:00
pass # XXX 'exec' + network? really?
2017-05-19 22:45:30 +02:00
elif parsed_items [ ' operation ' ] == ' ptrace ' and label == ' name2 ' and params . endswith ( ' /ptrace_garbage_lp1689667_1 ' ) :
pass # libapparmor would better qualify this case as invalid event
2015-09-05 01:23:43 +02:00
elif not parsed_items . get ( label , None ) :
2023-02-19 16:26:14 -05:00
raise Exception ( ' parsed_items[ {} ] not set ' . format ( label ) )
2015-09-05 01:23:43 +02:00
elif not expected . get ( label , None ) :
2023-02-19 16:26:14 -05:00
raise Exception ( ' expected[ {} ] not set ' . format ( label ) )
2015-09-05 01:23:43 +02:00
else :
2023-02-19 16:26:14 -05:00
self . assertEqual ( str ( parsed_items [ label ] ) , expected [ label ] , label + ' differs ' )
2015-09-05 01:23:43 +02:00
elif expected :
self . assertIsNone ( parsed_event ) # that's why we end up here
self . assertEqual ( dict ( ) , expected , ' parsed_event is none ' ) # effectively print the content of expected
elif parsed_event :
self . assertIsNone ( expected ) # that's why we end up here
self . assertEqual ( parsed_event , dict ( ) , ' expected is none ' ) # effectively print the content of parsed_event
else :
self . assertIsNone ( expected ) # that's why we end up here
self . assertIsNone ( parsed_event ) # that's why we end up here
self . assertEqual ( parsed_event , expected ) # both are None
# list of labels that use a different name in logparser.py than in the test_multi *.out files
# (additionally, .lower() is applied to all labels)
label_map = {
2022-08-07 12:26:24 -04:00
' Mask ' : ' request_mask ' ,
' Command ' : ' comm ' ,
' Token ' : ' magic_token ' ,
' ErrorCode ' : ' error_code ' ,
' Network family ' : ' family ' ,
' Socket type ' : ' sock_type ' ,
' Local addr ' : ' net_local_addr ' ,
' Foreign addr ' : ' net_foreign_addr ' ,
' Local port ' : ' net_local_port ' ,
' Foreign port ' : ' net_foreign_port ' ,
' Audit subid ' : ' audit_sub_id ' ,
' Attribute ' : ' attr ' ,
' Epoch ' : ' time ' ,
2015-09-05 01:23:43 +02:00
}
def _parse_libapparmor_test_multi ( self , file_with_path ) :
2022-08-07 14:57:30 -04:00
""" parse the libapparmor test_multi *.in tests and their expected result in *.out """
2015-09-05 01:23:43 +02:00
2023-02-19 16:26:14 -05:00
with open_file_read ( file_with_path + ' .out ' ) as f_in :
2015-09-05 01:23:43 +02:00
expected = f_in . readlines ( )
if expected [ 0 ] . rstrip ( ' \n ' ) != ' START ' :
2023-02-19 16:26:14 -05:00
raise Exception ( " {} .out doesn ' t have ' START ' in its first line! ( {} ) " . format (
file_with_path , expected [ 0 ] ) )
2015-09-05 01:23:43 +02:00
expected . pop ( 0 )
exresult = dict ( )
for line in expected :
label , value = line . split ( ' : ' , 1 )
# test_multi doesn't always use the original labels :-/
if label in self . label_map . keys ( ) :
label = self . label_map [ label ]
label = label . replace ( ' ' , ' _ ' ) . lower ( )
exresult [ label ] = value . strip ( )
if not exresult [ ' event_type ' ] . startswith ( ' AA_RECORD_ ' ) :
2023-02-19 16:26:14 -05:00
raise Exception ( " event_type doesn ' t start with AA_RECORD_: {} in file {} " . format (
exresult [ ' event_type ' ] , file_with_path ) )
2015-09-05 01:23:43 +02:00
exresult [ ' aamode ' ] = exresult [ ' event_type ' ] . replace ( ' AA_RECORD_ ' , ' ' )
if exresult [ ' aamode ' ] == ' ALLOWED ' :
exresult [ ' aamode ' ] = ' PERMITTING '
if exresult [ ' aamode ' ] == ' DENIED ' :
exresult [ ' aamode ' ] = ' REJECTING '
if exresult [ ' event_type ' ] == ' AA_RECORD_INVALID ' : # or exresult.get('error_code', 0) != 0: # XXX should events with errors be ignored?
exresult = None
return exresult
2022-08-07 12:26:24 -04:00
2019-06-22 02:06:54 -07:00
# tests that cause crashes or need user interaction (will be skipped)
log_to_skip = [
' testcase_dbus_09 ' , # multiline log not currently supported
]
2015-09-05 01:23:43 +02:00
2016-11-01 21:40:29 +01:00
# tests that do not produce the expected profile (checked with assertNotEqual)
2016-10-17 21:04:05 +02:00
log_to_profile_known_failures = [
2024-10-20 22:09:17 +02:00
# 'testcase31', # works, but including the link source would be nice
2016-11-01 21:40:29 +01:00
]
# tests that cause crashes or need user interaction (will be skipped)
log_to_profile_skip = [
' testcase_dmesg_changehat_negative_error ' , # fails in write_header -> quote_if_needed because data is None
2016-10-17 21:04:05 +02:00
' testcase_syslog_changehat_negative_error ' , # fails in write_header -> quote_if_needed because data is None
2016-11-01 21:40:29 +01:00
2016-10-17 21:04:05 +02:00
' testcase_changehat_01 ' , # interactive, asks to add a hat
2019-06-22 02:06:54 -07:00
' testcase_dbus_09 ' , # multiline log not currently supported
2016-10-17 21:04:05 +02:00
]
2018-10-01 20:49:42 +02:00
# tests that cause an empty log
log_to_profile_known_empty_log = [
' change_onexec_lp1648143 ' , # change_onexec not supported in logparser.py yet (and the log is about "no new privs" error)
' ptrace_garbage_lp1689667_1 ' , # no denied= in log
' ptrace_no_denied_mask ' , # no denied= in log
' unconfined-change_hat ' , # unconfined trying to change_hat, which isn't allowed
]
2022-08-07 12:26:24 -04:00
2016-10-17 21:04:05 +02:00
class TestLogToProfile ( AATest ) :
2022-08-07 14:57:30 -04:00
""" Check if the libraries/libapparmor/testsuite/test_multi tests result in the expected profile """
2016-10-17 21:04:05 +02:00
tests = ' invalid ' # filled by parse_test_profiles()
def _run_test ( self , params , expected ) :
2023-02-19 16:26:14 -05:00
logfile = params + ' .in '
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
if params . split ( ' / ' ) [ - 1 ] in log_to_profile_skip :
2016-10-17 21:04:05 +02:00
return
2018-05-06 17:42:43 +02:00
profile , new_profile = logfile_to_profile ( logfile )
if profile is None :
2016-10-17 21:04:05 +02:00
return
2023-02-19 16:26:14 -05:00
expected_profile = read_file ( params + ' .profile ' )
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
if params . split ( ' / ' ) [ - 1 ] in log_to_profile_known_failures :
self . assertNotEqual ( new_profile , expected_profile ) # known failure
else :
self . assertEqual ( new_profile , expected_profile )
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
def logfile_to_profile ( logfile ) :
profile_dummy_file = ' AATest_does_exist '
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
# we need to find out the profile name and aamode (complain vs. enforce mode) so that the test can access the correct place in storage
2019-05-04 00:22:46 +02:00
parser = ReadLog ( ' ' , ' ' , ' ' )
2018-05-06 17:42:43 +02:00
parsed_event = parser . parse_event ( read_file ( logfile ) )
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
if not parsed_event : # AA_RECORD_INVALID
return None , ' INVALID '
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
aamode = parsed_event [ ' aamode ' ]
2016-10-17 21:04:05 +02:00
2022-08-07 12:26:24 -04:00
if aamode in ( ' AUDIT ' , ' STATUS ' , ' HINT ' ) : # ignore some event types # XXX maybe we shouldn't ignore AUDIT events?
2018-05-06 17:42:43 +02:00
return None , aamode
2016-10-17 21:04:05 +02:00
2022-06-18 14:30:49 -04:00
if aamode not in ( ' PERMITTING ' , ' REJECTING ' ) :
2023-02-19 16:26:14 -05:00
raise Exception ( ' Unexpected aamode {} ' . format ( parsed_event [ ' aamode ' ] ) )
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
# cleanup apparmor.aa storage
2024-10-20 22:35:40 +02:00
apparmor . aa . reset_aa ( )
2016-10-17 21:04:05 +02:00
2024-10-20 22:42:18 +02:00
apparmor . aa . load_sev_db ( )
2016-10-17 21:04:05 +02:00
2024-11-01 19:52:43 +01:00
full_profile = parsed_event [ ' profile ' ]
profile , hat = split_name ( full_profile )
2016-10-17 21:04:05 +02:00
2021-04-05 13:21:36 +02:00
dummy_prof = apparmor . aa . ProfileStorage ( ' TEST DUMMY for active_profiles ' , profile_dummy_file , ' logprof_to_profile() ' )
2018-10-22 23:56:07 +02:00
# optional for now, might be needed one day
# if profile.startswith('/'):
2021-04-05 13:21:36 +02:00
# apparmor.aa.active_profiles.add_profile(profile_dummy_file, profile, profile, dummy_prof)
2018-10-22 23:56:07 +02:00
# else:
2024-11-01 19:52:43 +01:00
# create (only) the main/parent profile in active_profiles so that ask_exec() can add an exec rule to it
# If we ever add tests that create an exec rule in a child profile (for nested childs), we'll have to create the child profile that will get the grandchild exec rule
apparmor . aa . active_profiles . add_profile ( profile_dummy_file , profile , ' ' , dummy_prof )
2024-10-20 22:42:18 +02:00
2019-05-04 00:22:46 +02:00
log_reader = ReadLog ( logfile , apparmor . aa . active_profiles , ' ' )
2019-05-04 00:09:51 +02:00
hashlog = log_reader . read_log ( ' ' )
Remove a level of indirection on logparser.py
logparser.py puts each log event on a big "stack" in self.pid. Later,
handle_children() in aa.py then converts that (named 'log' in aa.py) to
the prelog hasher.
This commit changes logparser.py to create the prelog structure itsself
(named hashlog), which
- removes one level of indirection
- probably saves some memory because the hashlog automatically
de-duplicates events
This commit does this for capability, network and signal events, and
adds the infrastructure needed for all event/rule types.
In aa.py, the new function handle_hashlog() copies the hashlog content
to prelog. OTOH, the now superfluous code handling capability, network
and signal events gets removed from handle_children().
Long-term, hashlog will replace log in aa.py. When this is done,
handle_hashlog() will be replaced by a simple prelog = hashlog.
logparser.py gets a new function init_hashlog() to initialize hashlog
for each profile. It also gets changed to store capability, network and
signal events into hashlog instead of storing them in self.pid.
hashlog uses the full profile name as key, which is the first baby step
to support nested child profiles. (for now, handle_hashlog() still
splits the profile name into profile and hat.)
Known issue: The new implementation doesn't handle exec yet, which means
that events get lost at the exec boundary (= in cases aa-logprof asks
which execute mode to use). This will be fixed in a later commit.
2019-05-01 18:58:58 +02:00
2024-10-20 22:42:18 +02:00
apparmor . aa . ask_exec ( hashlog , ' CMD_ix ' )
2019-05-02 22:22:04 +02:00
apparmor . aa . ask_addhat ( hashlog )
2018-05-06 17:42:43 +02:00
2019-05-09 17:49:09 +02:00
log_dict = apparmor . aa . collapse_log ( hashlog , ignore_null_profiles = False )
2018-05-06 17:42:43 +02:00
2024-10-20 22:42:18 +02:00
# ask_exec modifies 'aa', not log_dict. "transfer" exec rules from 'aa' to log_dict
for tmpaamode in hashlog :
for tmpprofile in hashlog [ tmpaamode ] :
2024-11-01 19:52:43 +01:00
for rule_obj in apparmor . aa . active_profiles [ profile ] [ ' file ' ] . rules : # when the log contains an exec event, the exec event/rule will be in the parent profile, therefore check 'profile', not 'full_profile'.
# Also, at this point, tmpprofile might contain a child profile - which we didn't create in active_profiles, so trying to read it would trigger an error.
2024-10-20 22:42:18 +02:00
log_dict [ tmpaamode ] [ tmpprofile ] [ ' file ' ] . add ( rule_obj )
2021-04-04 14:55:31 +02:00
if list ( log_dict [ aamode ] . keys ( ) ) != [ parsed_event [ ' profile ' ] ] :
2023-02-19 16:26:14 -05:00
raise Exception ( ' log_dict[ {} ] contains unexpected keys. Logfile: {} , keys {} ' . format ( aamode , logfile , log_dict . keys ( ) ) )
2021-04-04 14:55:31 +02:00
2024-11-01 19:52:43 +01:00
if ' // ' in full_profile :
2018-05-10 11:22:03 +02:00
# log event for a child profile means log_dict only contains the child profile
# initialize parent profile in log_dict as ProfileStorage to ensure writing the profile doesn't fail
# (in "normal" usage outside of this test, log_dict will not be handed over to serialize_profile())
2021-04-04 14:55:31 +02:00
log_dict [ aamode ] [ profile ] = apparmor . aa . ProfileStorage ( ' TEST DUMMY for empty parent profile ' , profile_dummy_file , ' logfile_to_profile() ' )
2021-05-16 16:23:55 +02:00
log_dict [ aamode ] [ parsed_event [ ' profile ' ] ] [ ' is_hat ' ] = True # for historical reasons, generate hats, not child profiles
2018-05-10 11:22:03 +02:00
Remove a level of indirection on logparser.py
logparser.py puts each log event on a big "stack" in self.pid. Later,
handle_children() in aa.py then converts that (named 'log' in aa.py) to
the prelog hasher.
This commit changes logparser.py to create the prelog structure itsself
(named hashlog), which
- removes one level of indirection
- probably saves some memory because the hashlog automatically
de-duplicates events
This commit does this for capability, network and signal events, and
adds the infrastructure needed for all event/rule types.
In aa.py, the new function handle_hashlog() copies the hashlog content
to prelog. OTOH, the now superfluous code handling capability, network
and signal events gets removed from handle_children().
Long-term, hashlog will replace log in aa.py. When this is done,
handle_hashlog() will be replaced by a simple prelog = hashlog.
logparser.py gets a new function init_hashlog() to initialize hashlog
for each profile. It also gets changed to store capability, network and
signal events into hashlog instead of storing them in self.pid.
hashlog uses the full profile name as key, which is the first baby step
to support nested child profiles. (for now, handle_hashlog() still
splits the profile name into profile and hat.)
Known issue: The new implementation doesn't handle exec yet, which means
that events get lost at the exec boundary (= in cases aa-logprof asks
which execute mode to use). This will be fixed in a later commit.
2019-05-01 18:58:58 +02:00
log_is_empty = True
for tmpaamode in hashlog :
for tmpprofile in hashlog [ tmpaamode ] :
for tmpruletype in hashlog [ tmpaamode ] [ tmpprofile ] :
2019-05-08 23:29:36 +02:00
if tmpruletype == ' final_name ' and hashlog [ tmpaamode ] [ tmpprofile ] [ ' final_name ' ] == tmpprofile :
continue # final_name is a copy of the profile name (may be changed by ask_exec(), but that won't happen in this test)
Remove a level of indirection on logparser.py
logparser.py puts each log event on a big "stack" in self.pid. Later,
handle_children() in aa.py then converts that (named 'log' in aa.py) to
the prelog hasher.
This commit changes logparser.py to create the prelog structure itsself
(named hashlog), which
- removes one level of indirection
- probably saves some memory because the hashlog automatically
de-duplicates events
This commit does this for capability, network and signal events, and
adds the infrastructure needed for all event/rule types.
In aa.py, the new function handle_hashlog() copies the hashlog content
to prelog. OTOH, the now superfluous code handling capability, network
and signal events gets removed from handle_children().
Long-term, hashlog will replace log in aa.py. When this is done,
handle_hashlog() will be replaced by a simple prelog = hashlog.
logparser.py gets a new function init_hashlog() to initialize hashlog
for each profile. It also gets changed to store capability, network and
signal events into hashlog instead of storing them in self.pid.
hashlog uses the full profile name as key, which is the first baby step
to support nested child profiles. (for now, handle_hashlog() still
splits the profile name into profile and hat.)
Known issue: The new implementation doesn't handle exec yet, which means
that events get lost at the exec boundary (= in cases aa-logprof asks
which execute mode to use). This will be fixed in a later commit.
2019-05-01 18:58:58 +02:00
if hashlog [ tmpaamode ] [ tmpprofile ] [ tmpruletype ] :
log_is_empty = False
2018-10-01 20:49:42 +02:00
if logfile . split ( ' / ' ) [ - 1 ] [ : - 3 ] in log_to_profile_known_empty_log :
# unfortunately this function might be called outside Unittest.TestCase, therefore we can't use assertEqual / assertNotEqual
2022-07-20 21:53:35 -04:00
if not log_is_empty :
2023-02-19 16:26:14 -05:00
raise Exception ( ' got non-empty log for logfile in log_to_profile_known_empty_log: {} {} ' . format ( logfile , hashlog ) )
2018-10-01 20:49:42 +02:00
else :
2022-07-20 21:53:35 -04:00
if log_is_empty :
2023-02-19 16:26:14 -05:00
raise Exception ( ' got empty log for logfile not in log_to_profile_known_empty_log: {} {} ' . format ( logfile , hashlog ) )
2018-10-01 20:49:42 +02:00
2021-04-11 12:52:29 +02:00
new_profile = apparmor . aa . serialize_profile ( log_dict [ aamode ] , profile , { } )
2016-10-17 21:04:05 +02:00
2018-05-06 17:42:43 +02:00
return profile , new_profile
2016-10-17 21:04:05 +02:00
2022-08-07 12:26:24 -04:00
2015-09-05 01:23:43 +02:00
def find_test_multi ( log_dir ) :
2022-08-07 14:57:30 -04:00
""" find all log sniplets in the given log_dir """
2015-09-05 01:23:43 +02:00
log_dir = os . path . abspath ( log_dir )
tests = [ ]
for root , dirs , files in os . walk ( log_dir ) :
for file in files :
if file . endswith ( ' .in ' ) :
file_with_path = os . path . join ( root , file [ : - 3 ] ) # filename without '.in'
2022-06-18 14:30:49 -04:00
tests . append ( ( file_with_path , True ) ) # True is a dummy testresult, parsing of the *.out files is done while running the tests
2015-09-05 01:23:43 +02:00
2016-10-17 21:04:05 +02:00
elif file . endswith ( ' .out ' ) or file . endswith ( ' .err ' ) or file . endswith ( ' .profile ' ) :
2015-09-05 01:23:43 +02:00
pass
else :
2023-02-19 16:26:14 -05:00
raise Exception ( ' Found unknown file {} in libapparmor test_multi ' . format ( file ) )
2015-09-05 01:23:43 +02:00
return tests
2022-08-07 12:26:24 -04:00
2020-11-19 12:30:04 -08:00
# if a logfile is given as parameter, print the resulting profile and exit (with $? = 42 to make sure tests break if the caller accidentally hands over a parameter)
2018-05-06 17:42:43 +02:00
if __name__ == ' __main__ ' and len ( sys . argv ) == 2 :
print ( logfile_to_profile ( sys . argv [ 1 ] ) [ 1 ] )
2022-08-28 22:40:28 -04:00
sys . exit ( 42 )
2015-09-05 01:23:43 +02:00
2018-05-06 17:42:43 +02:00
# still here? That means a normal test run
2016-10-17 21:04:05 +02:00
print ( ' Testing libapparmor test_multi tests... ' )
2015-09-05 01:23:43 +02:00
TestLibapparmorTestMulti . tests = find_test_multi ( ' ../../libraries/libapparmor/testsuite/test_multi/ ' )
2016-10-17 21:04:05 +02:00
TestLogToProfile . tests = find_test_multi ( ' ../../libraries/libapparmor/testsuite/test_multi/ ' )
2015-09-05 01:23:43 +02:00
2017-03-02 21:21:53 +00:00
setup_aa ( apparmor . aa )
2015-09-05 01:23:43 +02:00
setup_all_loops ( __name__ )
if __name__ == ' __main__ ' :
2018-04-08 20:18:30 +02:00
unittest . main ( verbosity = 1 )