Skip to content

Commit d8d8d65

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

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
@@ -184,25 +184,19 @@ TEST_F(RtsanFileTest, OpenatDiesWhenRealtime) {
184184
ExpectNonRealtimeSurvival(func);
185185
}
186186

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

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

0 commit comments

Comments
 (0)