Skip to content

TestXattr fails as unsupported on linux tmpfs #8564

Closed

Description

@imsodin

Running tests on main I get the following failure:

--- FAIL: TestXattr (0.00s)
    basicfs_test.go:596: set xattrs /tmp/TestXattr427785272/001/test: Setxattr "user.test-0": operation not supported
FAIL

Looking at the test there's a check for ErrXattrsNotSupported to skip the test, but it's just used for completely unsupported systems. Apparently tmpfs does support xattrs, but not user extended ones:

The tmpfs filesystem supports extended attributes (see xattr(7)),
but user extended attributes are not permitted.

Looks like the random attrs we write in that test are such an extend user attributes. I don't really know much about xattrs, so not sure if this warrants a wider or more elegant fix. A quick fix would be to check for "operation not supported" string in the test and skip too.
I'd assume the quick fix is fine, as getting errors if one activates syncing xattrs on a tmpfs or otherwise unsupported FS seems correct. What do you think @calmh ?

(Also bit confused CI didn't catch this - thought /tmp on tmpfs is pretty standard.)

Activity

  1. added
    bug
    needs-triage
    on Sep 30, 2022
  2. calmh commented on Sep 30, 2022

    @calmh
    Member

    I guess the build dockers don't have separate /tmp. Maybe we can check something like errors.Is(..., syscall.ENOTSUPP) or something, but if that fails I suppose string checking is the thing

  3. added
    skip-changelog
    and removed
    needs-triage
    on Sep 30, 2022
  4. added a commit that references this issue on Sep 30, 2022
    7c9eb1e
  5. added 3 commits that reference this issue on Oct 2, 2022
    81bdde7
    69cbd9b
    5744380
  6. added this to the v1.22.1 milestone on Oct 17, 2022
  7. added
    frozen-due-to-age
    on Oct 12, 2023
  8. locked and limited conversation to collaborators on Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfrozen-due-to-ageskip-changelog

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions