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

test fixed for contentview #10426

Closed
wants to merge 2 commits into from
Closed

Conversation

vijaysawant
Copy link
Contributor

server_config for user with "readonly" role not set, and depending calls was failing, It was using admin users credentials.
Now with this PR issue will be resolved.

@vijaysawant vijaysawant added the CherryPick PR needs CherryPick to previous branches label Dec 14, 2022
@omkarkhatavkar
Copy link

Can one of the admins verify this patch?

@omkarkhatavkar
Copy link

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py -k 'test_positive_readonly_user_actions'

@devendra104
Copy link
Member

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py -k 'test_positive_readonly_user_actions'

Comment on lines 1175 to 1176
# Check that we can read our content view with custom user
content_view = target_sat.api.ContentView(server_config=cfg, id=content_view.id).read()
content_view_readonly_user = target_sat.api.ContentView(server_config=cfg, id=content_view.id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the comment here, we should still attempt to read the content view as that is the only thing this user should be able to do.

Choose a reason for hiding this comment

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

I think this needs to be fixed in the nailgun as the nailgun does not return the correct auth details, It is been reset to default auth details even though when the custom auth details are passed.

Choose a reason for hiding this comment

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

While me and @vijaysawant debug this further https://github.com/SatelliteQE/nailgun/blob/master/nailgun/entity_mixins.py#L822 line where we are getting type error for doing read call over target_sat (using Dec Class) which results in setting default nailgun object and that is returned

@Griffin-Sullivan
Copy link
Contributor

To fix the CI failures here:

  1. cd to robottelo directory
  2. switch to your robottelo virtual environment
  3. $ pip install pre-commit
  4. $ pre-commit run --all-files
  5. git add, commit --amend, and push --force the changes here.

Copy link
Member

@jyejare jyejare left a comment

Choose a reason for hiding this comment

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

Missing Branch labels in this PR to auto-cherrypick!

@jyejare jyejare marked this pull request as draft December 20, 2022 06:47
@vijaysawant vijaysawant added 6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 labels Dec 29, 2022
@vijaysawant vijaysawant requested a review from jyejare December 29, 2022 11:50
@jyejare jyejare marked this pull request as ready for review January 2, 2023 16:49
@vijaysawant vijaysawant marked this pull request as draft January 11, 2023 10:52
@vijaysawant
Copy link
Contributor Author

  • Require changes in the current PR are depends on changes from nailgun PR#864, once changes are incorporated into the class ContentView we are good to make changes in current PR.

@vijaysawant
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py -k 'test_negative_readonly_user_actions'

@vijaysawant vijaysawant marked this pull request as ready for review January 31, 2023 02:09
@vijaysawant
Copy link
Contributor Author

vijaysawant commented Jan 31, 2023

  • Looks like the changes from current PR #10426 are not require so far, because changes from nailgun PR #864 makes test executable.
  • admin/reviewer, shall we drop the current PR changes?

@shweta83
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/api/test_contentview.py -k test_positive_readonly_user_actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants