mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-01 07:50:38 +00:00
sepolgen: Close files after reading/writing in tests.
Signed-off-by: Robert Kuska <rkuska@redhat.com>
This commit is contained in:
parent
15a7553d22
commit
a9fb9053f7
@ -166,6 +166,7 @@ class TestAuditParser(unittest.TestCase):
|
||||
f = open("audit.txt")
|
||||
a = sepolgen.audit.AuditParser()
|
||||
a.parse_file(f)
|
||||
f.close()
|
||||
self.assertEqual(len(a.avc_msgs), 21)
|
||||
self.assertEqual(len(a.compute_sid_msgs), 0)
|
||||
self.assertEqual(len(a.invalid_msgs), 0)
|
||||
|
@ -268,6 +268,7 @@ class TestInterfaceSet(unittest.TestCase):
|
||||
i2 = interfaces.InterfaceSet()
|
||||
f = open("output")
|
||||
i2.from_file(f)
|
||||
f.close()
|
||||
if_status = [False, False, False]
|
||||
for ifv in i2.interfaces.values():
|
||||
if ifv.name == "files_search_usr":
|
||||
|
@ -25,6 +25,7 @@ class TestInfoFlow(unittest.TestCase):
|
||||
info = sepolgen.objectmodel.PermMappings()
|
||||
fd = open("perm_map")
|
||||
info.from_file(fd)
|
||||
fd.close()
|
||||
|
||||
pm = info.get("filesystem", "mount")
|
||||
self.assertEqual(pm.perm, "mount")
|
||||
|
Loading…
Reference in New Issue
Block a user