Add linker.config.pb test
In apex, ./etc/linker.config.pb file should be readable by linkerconfig. Bug: 218922042 Test: apex_sepolicy_tests_test Change-Id: Id41710dc127b5f5bda2d5bbb65271bcc0c5179b1
This commit is contained in:
parent
69af6d9f1c
commit
babd0604bd
2 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,8 @@ rules = [
|
|||
# ./ and apex_manifest.pb
|
||||
(Is('./apex_manifest.pb'), AllowRead('file', {'linkerconfig', 'apexd'})),
|
||||
(Is('./'), AllowRead('dir', {'linkerconfig', 'apexd'})),
|
||||
# linker.config.pb
|
||||
(Is('./etc/linker.config.pb'), AllowRead('file', {'linkerconfig'})),
|
||||
]
|
||||
|
||||
|
||||
|
|
|
@ -88,6 +88,11 @@ class ApexSepolicyTests(unittest.TestCase):
|
|||
self.assert_ok('./etc/init.x32rc u:object_r:vendor_file:s0')
|
||||
self.assert_ok('./etc/init.x32rc u:object_r:unknown:s0')
|
||||
|
||||
def test_linkerconfig(self):
|
||||
self.assert_ok('./etc/linker.config.pb u:object_r:system_file:s0')
|
||||
self.assert_ok('./etc/linker.config.pb u:object_r:linkerconfig_file:s0')
|
||||
self.assert_error('./etc/linker.config.pb u:object_r:vendor_file:s0',
|
||||
r'Error: .*linkerconfig.* can\'t read')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(verbosity=2)
|
||||
|
|
Loading…
Reference in a new issue