Lines Matching refs:sc
34 sc = refpolicy.SecurityContext()
35 sc = refpolicy.SecurityContext("user_u:object_r:foo_t")
39 sc = refpolicy.SecurityContext()
40 sc.from_string(context)
41 self.assertEquals(sc.user, "user_u")
42 self.assertEquals(sc.role, "object_r")
43 self.assertEquals(sc.type, "foo_t")
44 self.assertEquals(sc.level, None)
46 self.assertEquals(str(sc), context + ":s0")
48 self.assertEquals(str(sc), context)
49 self.assertEquals(sc.to_string(default_level="s1"), context + ":s1")
52 sc = refpolicy.SecurityContext()
53 sc.from_string(context)
54 self.assertEquals(sc.user, "user_u")
55 self.assertEquals(sc.role, "object_r")
56 self.assertEquals(sc.type, "foo_t")
57 self.assertEquals(sc.level, "s0-s0:c0-c255")
58 self.assertEquals(str(sc), context)
59 self.assertEquals(sc.to_string(), context)
61 sc = refpolicy.SecurityContext()
62 self.assertRaises(ValueError, sc.from_string, "abc")