mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-22 22:12:16 +00:00
sepolgen unit tests fail
Patch to fix unit test. Signed-off-by: Joshua Brindle <method@manicmethod.com>
This commit is contained in:
parent
bc256454b7
commit
6e35202e20
@ -82,8 +82,8 @@ class TestAccessVector(unittest.TestCase):
|
||||
a.obj_class = "file"
|
||||
a.perms.update(["read", "write"])
|
||||
|
||||
self.assertEquals(str(a), "allow foo bar : file { read write };")
|
||||
self.assertEquals(a.to_string(), "allow foo bar : file { read write };")
|
||||
self.assertEquals(str(a), "allow foo bar:file { read write };")
|
||||
self.assertEquals(a.to_string(), "allow foo bar:file { read write };")
|
||||
|
||||
def test_cmp(self):
|
||||
a = access.AccessVector()
|
||||
|
@ -86,17 +86,17 @@ interface(`files_search_usr',`
|
||||
')
|
||||
|
||||
allow $1 usr_t:dir search;
|
||||
allow { domain $1 } { usr_t usr_home_t } : { file dir } { read write getattr };
|
||||
allow { domain $1 } { usr_t usr_home_t }:{ file dir } { read write getattr };
|
||||
typeattribute $1 file_type;
|
||||
|
||||
if (foo) {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
}
|
||||
|
||||
if (bar) {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
} else {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
}
|
||||
')
|
||||
|
||||
@ -135,8 +135,8 @@ interface(`foo',`
|
||||
gen_require(`
|
||||
type usr_t;
|
||||
')
|
||||
allow $1 usr_t : dir { create add_name };
|
||||
allow $1 usr_t : file { read write };
|
||||
allow $1 usr_t:dir { create add_name };
|
||||
allow $1 usr_t:file { read write };
|
||||
')
|
||||
"""
|
||||
|
||||
@ -145,16 +145,16 @@ interface(`foo',`
|
||||
gen_require(`
|
||||
type usr_t;
|
||||
')
|
||||
allow $1 usr_t : dir { create add_name };
|
||||
allow $1 usr_t : file { read write };
|
||||
allow $1 usr_t:dir { create add_name };
|
||||
allow $1 usr_t:file { read write };
|
||||
')
|
||||
|
||||
interface(`map', `
|
||||
gen_require(`
|
||||
type bar_t;
|
||||
')
|
||||
allow $1 bar_t : file read;
|
||||
allow $2 bar_t : file write;
|
||||
allow $1 bar_t:file read;
|
||||
allow $2 bar_t:file write;
|
||||
|
||||
foo($2)
|
||||
')
|
||||
@ -163,9 +163,9 @@ interface(`hard_map', `
|
||||
gen_require(`
|
||||
type baz_t;
|
||||
')
|
||||
allow $1 baz_t : file getattr;
|
||||
allow $2 baz_t : file read;
|
||||
allow $3 baz_t : file write;
|
||||
allow $1 baz_t:file getattr;
|
||||
allow $2 baz_t:file read;
|
||||
allow $3 baz_t:file write;
|
||||
|
||||
map($1, $2)
|
||||
map($2, $3)
|
||||
|
@ -98,16 +98,16 @@ interface(`foo',`
|
||||
gen_require(`
|
||||
type usr_t;
|
||||
')
|
||||
allow $1 usr_t : dir { create add_name };
|
||||
allow $1 usr_t : file { read write };
|
||||
allow $1 usr_t:dir { create add_name };
|
||||
allow $1 usr_t:file { read write };
|
||||
')
|
||||
|
||||
interface(`map', `
|
||||
gen_require(`
|
||||
type bar_t;
|
||||
')
|
||||
allow $1 bar_t : file read;
|
||||
allow $2 bar_t : file write;
|
||||
allow $1 bar_t:file read;
|
||||
allow $2 bar_t:file write;
|
||||
|
||||
foo($2)
|
||||
')
|
||||
@ -116,9 +116,9 @@ interface(`hard_map', `
|
||||
gen_require(`
|
||||
type baz_t;
|
||||
')
|
||||
allow $1 baz_t : file getattr;
|
||||
allow $2 baz_t : file read;
|
||||
allow $3 baz_t : file write;
|
||||
allow $1 baz_t:file getattr;
|
||||
allow $2 baz_t:file read;
|
||||
allow $3 baz_t:file write;
|
||||
|
||||
map($1, $2)
|
||||
map($2, $3)
|
||||
|
@ -37,17 +37,17 @@ interface(`files_search_usr',`
|
||||
')
|
||||
|
||||
allow $1 usr_t:dir search;
|
||||
allow { domain $1 } { usr_t usr_home_t } : { file dir } { read write getattr };
|
||||
allow { domain $1 } { usr_t usr_home_t }:{ file dir } { read write getattr };
|
||||
typeattribute $1 file_type;
|
||||
|
||||
if (foo) {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
}
|
||||
|
||||
if (bar) {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
} else {
|
||||
allow $1 foo : bar baz;
|
||||
allow $1 foo:bar baz;
|
||||
}
|
||||
')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user