Lines Matching refs:Yama
79 TEST(Yama, GetStatus) { in TEST() argument
80 int status1 = Yama::GetStatus(); in TEST()
84 ASSERT_GE(Yama::STATUS_KNOWN | Yama::STATUS_PRESENT | Yama::STATUS_ENFORCING | in TEST()
85 Yama::STATUS_STRICT_ENFORCING, in TEST()
89 int status2 = Yama::GetStatus(); in TEST()
94 EXPECT_NE(0, Yama::STATUS_KNOWN & status1); in TEST()
96 if (status1 & Yama::STATUS_STRICT_ENFORCING) { in TEST()
98 EXPECT_TRUE(status1 & Yama::STATUS_ENFORCING); in TEST()
101 if (status1 & Yama::STATUS_ENFORCING) { in TEST()
103 EXPECT_NE(0, status1 & Yama::STATUS_PRESENT); in TEST()
107 EXPECT_EQ(static_cast<bool>(status1 & Yama::STATUS_ENFORCING), in TEST()
108 Yama::IsEnforcing()); in TEST()
109 EXPECT_EQ(static_cast<bool>(status1 & Yama::STATUS_PRESENT), in TEST()
110 Yama::IsPresent()); in TEST()
114 Yama::IsPresent() ? "Y" : "N", in TEST()
115 Yama::IsEnforcing() ? "Y" : "N"); in TEST()
118 SANDBOX_TEST(Yama, RestrictPtraceSucceedsWhenYamaPresent) { in SANDBOX_TEST() argument
120 bool restricted = Yama::RestrictPtracersToAncestors(); in SANDBOX_TEST()
121 CHECK_EQ(restricted, Yama::IsPresent()); in SANDBOX_TEST()
127 Yama::RestrictPtracersToAncestors(); in SetYamaRestrictions()
129 Yama::DisableYamaRestrictions(); in SetYamaRestrictions()
133 TEST(Yama, RestrictPtraceWorks) { in TEST() argument
140 if (Yama::IsEnforcing()) { in TEST()
145 if (!(Yama::GetStatus() & Yama::STATUS_STRICT_ENFORCING)) { in TEST()
156 SANDBOX_TEST(Yama, RestrictPtraceIsDefault) { in SANDBOX_TEST() argument
157 if (!Yama::IsPresent() || HasLinux32Bug()) in SANDBOX_TEST()
160 CHECK(Yama::DisableYamaRestrictions()); in SANDBOX_TEST()
163 if (Yama::IsEnforcing()) { in SANDBOX_TEST()