Run foundation test in `root` user causes 4 of `TestFileManager` failed

foundation
(Sam Ding) #1

When running the foundation test of the master branch with root user on x86_64 Linux, there are 4 failed tests on TestFileManager:

  /home/work/sw/master/swift-corelibs-foundation/TestFoundation/TestFileManager.swift:238: error: TestFileManager.test_isReadableFile : XCTAssertFalse failed -
 Test Case 'TestFileManager.test_isReadableFile' failed (0.003 seconds)

  /home/work/sw/master/swift-corelibs-foundation/TestFoundation/TestFileManager.swift:258: error: TestFileManager.test_isWritableFile : XCTAssertFalse failed -
 Test Case 'TestFileManager.test_isWritableFile' failed (0.001 seconds)

 /home/work/sw/master/swift-corelibs-foundation/TestFoundation/TestFileManager.swift:301: error: TestFileManager.test_isDeletableFile : XCTAssertFalse failed -
  /home/work/sw/master/swift-corelibs-foundation/TestFoundation/TestFileManager.swift:310: error: TestFileManager.test_isDeletableFile : XCTAssertFalse failed -
Test Case 'TestFileManager.test_isDeletableFile' failed (0.001 seconds)

However, if change to a normal user of the Linux then run the same test, they are all passed. As root is supper user and file/directory access permission is not obeyed so that the tests failed.

Is that possible to add some message or warning output in the test case for a root user? it will help to identify if they are really issues.

Thanks,