File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -547,6 +547,16 @@ import SWBTestSupport
547547 @Test ( . skipHostOS( . windows) )
548548 func extendedAttributesSupport( ) throws {
549549 try withTemporaryDirectory { ( tmpDir: Path ) in
550+ // Many filesystems on other platforms (e.g. various non-ext4 temporary filesystems on Linux) don't support xattrs and will return ENOTSUP.
551+ // In particular, tmpfs doesn't support xattrs on Linux unless `CONFIG_TMPFS_XATTR` is enabled in the kernel config.
552+ if try ProcessInfo . processInfo. hostOperatingSystem ( ) == . linux {
553+ do {
554+ try localFS. setExtendedAttribute ( tmpDir, key: " user.test " , value: [ ] )
555+ } catch let error as SWBUtil . POSIXError where error. code == ENOTSUP {
556+ return
557+ }
558+ }
559+
550560 let testDataPath = tmpDir. join ( " test-data.txt " )
551561 try localFS. write ( testDataPath, contents: ByteString ( " best-data " ) )
552562
You can’t perform that action at this time.
0 commit comments