Skip to content

skip 000 permission tests for root user #561

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

burnout-projects
Copy link

What

This pull request modifies the unit tests to skip two specific tests if the underlying user is "root".

Why

Two of the unit tests fail (false negatives) if executed as the "root" user on Linux. This change is necessary because the tests involve changing file permissions to 000 and verifying if the user can access the file. Since the root user has unrestricted access to the entire file system, these tests are not applicable to the root user.

Details

  • Tests Affected:

    1. test_set_key_permission_error()
    2. test_set_key_unauthorized_file()
  • Implementation: The tests now include a condition to check if the underlying user is "root". If the user is root, the tests are skipped using the pytest.skip function.

Impact

  • Positive: Ensures that the test suite runs correctly and avoids false negatives when executed by the root user.
  • Negative: None identified.

Testing

  • The changes have been tested in both root and non-root environments to verify that the tests are skipped for the root user and executed correctly for non-root users.

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.

1 participant