Skip to content
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

buildah: increase rootless test coverage with rootless + unshare #3812

Merged

Conversation

flouthoc
Copy link
Collaborator

@flouthoc flouthoc commented Mar 8, 2022

Tests for rootless added here #3804 skipped some of the cases.

Almost all of the skipped test cases can be covered under an environment of rootless + unshare.
Following PR attempts to solve that by modifying test infrastructure and adding a cirrus task dedicated to rootless+unshare testing.

@edsantiago
Copy link
Member

I think there's some confusion here. What I meant to do with my patch is eliminate the need to run the whole entire thing unshared.

With my patch, you can remove a lot of the skips: the tests will pass under plain simple rootless. unshare is only used for buildah mount/unmount, so it's a better test of actual rootless.

Running the entire test suite under unshare does not seem terribly useful to me

@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 8, 2022

@edsantiago Yes. Actually this is intentional. My motive is to perform isolated testing for rootless and rootless+unshare in different environments cause they both are testing different things.

With this we can make sure that user namespacing is working correctly.

@edsantiago
Copy link
Member

I have no real idea what that means, but given what I see, you do not need my patch for anything: my patch was intended to make more tests pass. You have not removed any skips, you have only added more skips. That is the opposite of my intention.

Please either remove skips, or remove my patch.

@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 8, 2022

I have no real idea what that means, but given what I see, you do not need my patch for anything: my patch was intended to make more tests pass.

@edsantiago I think this we can still do this. Scratch my previous comment and let me try the original patch which you posted again since it only works for mount / unmount i think it does what we are trying to achieve.

@flouthoc flouthoc force-pushed the test-rootless-unshared branch 3 times, most recently from 02c2a5d to dfcce46 Compare March 9, 2022 06:12
@flouthoc flouthoc marked this pull request as ready for review March 9, 2022 08:15
@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 9, 2022

@edsantiago Thanks 😄 . I looked at it again and re-used your patch as it is and this enables us to remove skip from almost all of the rootless tests some are still skipped but they are more of a root user test so we should be good.

@rhatdan @cevich @nalind @edsantiago PTAL

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Thank you @flouthoc, that is exactly what I intended.

My patch was hasty and did not include comments; could you please add some for benefit of future maintainers?

tests/helpers.bash Outdated Show resolved Hide resolved
tests/helpers.bash Show resolved Hide resolved
@edsantiago
Copy link
Member

Oh, one more. Since there's no longer the need for multiple confusing rootless_this_and_that, could you just rename everything to skip_if_rootless?

@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 9, 2022

@edsantiago Thanks added requested comments.

Oh, one more. Since there's no longer the need for multiple confusing rootless_this_and_that, could you just rename everything to skip_if_rootless?

I agree I think we can merge all existing function into one. I don't know why did we add $BUILDAH_ISOLATION" = "rootless" check and skip_if_rootless_and_cgroupv1 we might not even need all of this now. But I just want to go through commit history once before removing these. But since this look unrelated to this PR I'll do that in a new PR after reading commit history.

@flouthoc flouthoc requested a review from edsantiago March 9, 2022 13:21
Copy link
Member

@cevich cevich left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 9, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, flouthoc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cevich
Copy link
Member

cevich commented Mar 9, 2022

Oh, and super-big thanks for doing this, it really helped everyone out a lot, especially me 😁

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Language suggestions. Also, I have a medium-strong preference for eighty-column formatting especially in comments. I don't think we have a style guide, so I will not make my preference a blocker.

I see what you mean re: skip_if_rootless but we seem to have a very very bad situation that needs to be fixed: the existing skip_if_rootless bears no relation whatsoever to the is_rootless() function, and that is going to cause a lot of confusion one day (including today). That would be a very good topic for a followup PR.

tests/helpers.bash Outdated Show resolved Hide resolved
tests/helpers.bash Outdated Show resolved Hide resolved
tests/helpers.bash Outdated Show resolved Hide resolved
flouthoc and others added 2 commits March 9, 2022 21:35
Mount and umount can must be unshared for rootless environment.

Co-authored-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
@flouthoc flouthoc requested a review from edsantiago March 9, 2022 16:06
@flouthoc
Copy link
Collaborator Author

flouthoc commented Mar 9, 2022

Restarted flakes.

@rhatdan
Copy link
Member

rhatdan commented Mar 9, 2022

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Mar 9, 2022
@openshift-merge-robot openshift-merge-robot merged commit cf6d58b into containers:main Mar 9, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants