Skip to content

Commit 4d96eaf

Browse files
committed
Revert "[rtsan][compiler-rt] Disable file permissions test causing build failure (#106079)"
This reverts commit 11ba2ee.
1 parent 556e9d0 commit 4d96eaf

File tree

1 file changed

+13
-19
lines changed

1 file changed

+13
-19
lines changed

compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -193,25 +193,19 @@ TEST_F(RtsanFileTest, OpenatDiesWhenRealtime) {
193193
ExpectNonRealtimeSurvival(func);
194194
}
195195

196-
// FIXME: This fails on the build machines, but not locally!
197-
// see https://github.com/llvm/llvm-project/pull/105732#issuecomment-2310286530
198-
// Value of: st.st_mode & 0777
199-
// Expected: is equal to 420
200-
// Actual: 384
201-
// TEST_F(RtsanFileTest, OpenCreatesFileWithProperMode) {
202-
// const int mode = S_IRGRP | S_IROTH | S_IRUSR | S_IWUSR;
203-
//
204-
// const int fd = open(GetTemporaryFilePath(), O_CREAT | O_WRONLY, mode);
205-
// ASSERT_THAT(fd, Ne(-1));
206-
// close(fd);
207-
//
208-
// struct stat st;
209-
// ASSERT_THAT(stat(GetTemporaryFilePath(), &st), Eq(0));
210-
//
211-
// // Mask st_mode to get permission bits only
212-
//
213-
// //ASSERT_THAT(st.st_mode & 0777, Eq(mode)); FAILED ASSERTION
214-
// }
196+
TEST_F(RtsanFileTest, OpenCreatesFileWithProperMode) {
197+
const int mode = S_IRGRP | S_IROTH | S_IRUSR | S_IWUSR;
198+
199+
const int fd = open(GetTemporaryFilePath(), O_CREAT | O_WRONLY, mode);
200+
ASSERT_THAT(fd, Ne(-1));
201+
close(fd);
202+
203+
struct stat st;
204+
ASSERT_THAT(stat(GetTemporaryFilePath(), &st), Eq(0));
205+
206+
// Mask st_mode to get permission bits only
207+
ASSERT_THAT(st.st_mode & 0777, Eq(mode));
208+
}
215209

216210
TEST_F(RtsanFileTest, CreatDiesWhenRealtime) {
217211
auto func = [this]() { creat(GetTemporaryFilePath(), S_IWOTH | S_IROTH); };

0 commit comments

Comments
 (0)