Skip to content

Comments

Fix pytest flag for rootful test#623

Merged
inknos merged 1 commit intocontainers:mainfrom
inknos:fix-tests
Feb 18, 2026
Merged

Fix pytest flag for rootful test#623
inknos merged 1 commit intocontainers:mainfrom
inknos:fix-tests

Conversation

@inknos
Copy link
Contributor

@inknos inknos commented Feb 3, 2026

I found a test that needs to be run if root only

@inknos
Copy link
Contributor Author

inknos commented Feb 5, 2026

/packit retest-failed

@inknos
Copy link
Contributor Author

inknos commented Feb 5, 2026

/packit rebuild-failed

f"size={mount['size']},rprivate,nosuid,nodev,tmpcopyup",
)

@pytest.mark.skipif(os.geteuid() != 0, reason='Skipping, not running as root')
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little confused by the reason text and the PR description. Should it be reason="Skipping, rootless user"?

Non-blocking:
I would also suggest creating a helper function:

def is_root():
    return os.geteuid() == 0

This would be more readable and could be reused in other cases if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I had twisted brain cells at the time of writing. also, your comment made sense so I implemented the helper, and finally, I changed commit message an fixed the reasons. Now it should be better

Signed-off-by: Nicola Sella <nsella@redhat.com>
Copy link
Member

@Honny1 Honny1 left a comment

Choose a reason for hiding this comment

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

LGTM

@inknos inknos merged commit 3e46e2f into containers:main Feb 18, 2026
21 checks passed
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.

2 participants