Skip to content

Make the unit tests work for FreeBSD #1360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 28, 2022
Merged

Conversation

dfr
Copy link
Contributor

@dfr dfr commented Sep 25, 2022

This exposed a couple of FreeBSD bugs in pkg/archive which are also fixed here.

@rhatdan
Copy link
Member

rhatdan commented Sep 26, 2022

LGTM

This avoids code having to cast the value returned by Mkdev and coding
in assuptions on the type of Mknod's dev argument.

Signed-off-by: Doug Rabson <dfr@rabson.org>
dfr added 4 commits September 27, 2022 17:47
On FreeBSD, the link syscall follows symlinks which makes
TestUntarHardlinkToSymlink fail. We can match the expected semantics on
FreeBSD using linkat.

Signed-off-by: Doug Rabson <dfr@rabson.org>
This fixes a failure in TestApplyLayer caused by different modes on the
symlinks in the test due to the test setup using a different umask from
ApplyLayer. FreeBSD actually has an lchmod syscall and supports changing
the mode on symlinks so we can use that.

Signed-off-by: Doug Rabson <dfr@rabson.org>
Signed-off-by: Doug Rabson <dfr@rabson.org>
These are testing things like /etc/os-release and cgroups which are
linux-only.  Note: /etc/os-release does exist on FreeBSD but
GetOperatingSystem is implemented using uname.

Signed-off-by: Doug Rabson <dfr@rabson.org>
Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 42f81a2 into containers:main Sep 28, 2022
@dfr dfr deleted the freebsd-tests branch September 29, 2022 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants