* sepolgen unit tests fail
@ 2010-03-24 16:19 Joshua Brindle
2010-03-24 16:41 ` Daniel J Walsh
2010-03-24 17:08 ` Daniel J Walsh
0 siblings, 2 replies; 4+ messages in thread
From: Joshua Brindle @ 2010-03-24 16:19 UTC (permalink / raw)
To: SE Linux, Karl MacMillan, Daniel J Walsh
I'm not sure when this happened or what caused it but when I try to run
the unit tests in the userspace repo I get this:
python run-tests.py
...........F...............................
======================================================================
FAIL: test_to_string (test_access.TestAccessVector)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/dev/selinux/sepolgen/tests/test_access.py", line 85, in
test_to_string
self.assertEquals(str(a), "allow foo bar : file { read write };")
AssertionError: 'allow foo bar:file { read write };' != 'allow foo bar :
file { read write };'
----------------------------------------------------------------------
Ran 43 tests in 3.112s
FAILED (failures=1)
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sepolgen unit tests fail
2010-03-24 16:19 sepolgen unit tests fail Joshua Brindle
@ 2010-03-24 16:41 ` Daniel J Walsh
2010-03-24 17:08 ` Daniel J Walsh
1 sibling, 0 replies; 4+ messages in thread
From: Daniel J Walsh @ 2010-03-24 16:41 UTC (permalink / raw)
To: Joshua Brindle; +Cc: SE Linux, Karl MacMillan
On 03/24/2010 12:19 PM, Joshua Brindle wrote:
> I'm not sure when this happened or what caused it but when I try to
> run the unit tests in the userspace repo I get this:
>
> python run-tests.py
> ..........F...............................
> ======================================================================
> FAIL: test_to_string (test_access.TestAccessVector)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/root/dev/selinux/sepolgen/tests/test_access.py", line 85, in
> test_to_string
> self.assertEquals(str(a), "allow foo bar : file { read write };")
> AssertionError: 'allow foo bar:file { read write };' != 'allow foo bar
> : file { read write };'
>
> ----------------------------------------------------------------------
> Ran 43 tests in 3.112s
>
> FAILED (failures=1)
>
> --
> This message was distributed to subscribers of the selinux mailing list.
> If you no longer wish to subscribe, send mail to
> majordomo@tycho.nsa.gov with
> the words "unsubscribe selinux" without quotes as the message.
>
>
Looks like the space I removed between "bar : file" -> bar:file might be
causing the problem.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: sepolgen unit tests fail
2010-03-24 16:19 sepolgen unit tests fail Joshua Brindle
2010-03-24 16:41 ` Daniel J Walsh
@ 2010-03-24 17:08 ` Daniel J Walsh
2010-03-24 17:47 ` Joshua Brindle
1 sibling, 1 reply; 4+ messages in thread
From: Daniel J Walsh @ 2010-03-24 17:08 UTC (permalink / raw)
To: Joshua Brindle; +Cc: SE Linux, Karl MacMillan
[-- Attachment #1: Type: text/plain, Size: 24 bytes --]
Patch to fix unit test.
[-- Attachment #2: sepolgen_test.patch --]
[-- Type: text/plain, Size: 4292 bytes --]
diff --git a/sepolgen/tests/test_access.py b/sepolgen/tests/test_access.py
index 16d856e..fec699e 100644
--- a/sepolgen/tests/test_access.py
+++ b/sepolgen/tests/test_access.py
@@ -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()
diff --git a/sepolgen/tests/test_interfaces.py b/sepolgen/tests/test_interfaces.py
index 674ccb9..b589bdf 100644
--- a/sepolgen/tests/test_interfaces.py
+++ b/sepolgen/tests/test_interfaces.py
@@ -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)
diff --git a/sepolgen/tests/test_matching.py b/sepolgen/tests/test_matching.py
index 63e89ed..2282eca 100644
--- a/sepolgen/tests/test_matching.py
+++ b/sepolgen/tests/test_matching.py
@@ -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)
diff --git a/sepolgen/tests/test_refparser.py b/sepolgen/tests/test_refparser.py
index c5f7278..3fe6d79 100644
--- a/sepolgen/tests/test_refparser.py
+++ b/sepolgen/tests/test_refparser.py
@@ -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;
}
')
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: sepolgen unit tests fail
2010-03-24 17:08 ` Daniel J Walsh
@ 2010-03-24 17:47 ` Joshua Brindle
0 siblings, 0 replies; 4+ messages in thread
From: Joshua Brindle @ 2010-03-24 17:47 UTC (permalink / raw)
To: Daniel J Walsh; +Cc: SE Linux, Karl MacMillan
Merged in sepolgen 1.0.23
Daniel J Walsh wrote:
> Patch to fix unit test.
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-24 17:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 16:19 sepolgen unit tests fail Joshua Brindle
2010-03-24 16:41 ` Daniel J Walsh
2010-03-24 17:08 ` Daniel J Walsh
2010-03-24 17:47 ` Joshua Brindle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.