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

HTTP Proxy customer cases update #14513

Merged
merged 1 commit into from
May 16, 2024

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Mar 25, 2024

This PR just addresses a few changes from the component eval

  • adds a case for insights client registration via HTTP proxy
  • removes old stub covered in foreman-maintain
  • updates http_proxy fixture to remove the proxy on teardown

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/cli/test_http_proxy.py -k insights

@vsedmik vsedmik added CherryPick PR needs CherryPick to previous branches 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Mar 25, 2024
@vsedmik vsedmik self-assigned this Mar 25, 2024
@vsedmik vsedmik requested review from a team as code owners March 25, 2024 15:04
@vsedmik
Copy link
Contributor Author

vsedmik commented Mar 25, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_http_proxy.py -k insights

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6186
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_http_proxy.py -k insights --external-logging
Test Result : ========== 6 passed, 3 deselected, 428 warnings in 3326.86s (0:55:26) ==========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
tests/foreman/cli/test_http_proxy.py Show resolved Hide resolved
Comment on lines -167 to -176
@pytest.mark.tier3
def test_positive_environment_variable_unset_set():
"""Verify that satellite installer unsets and then sets back the environment variables

:id: 596d753b-660b-49cb-b663-ff3cec439564

:BZ: 1886040

:customerscenario: true

Copy link
Collaborator

Choose a reason for hiding this comment

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

I remember this test, its related to old feature added in installer, which identifies and fails, if proxy is set on system, with this mentioned environment variable. So, I understand that this test is valid, but can I ask why are you considering removing it instead of automating it?

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 considered removing because the BZ says

3. Why does the customer need this? (List the business requirements here)

Since satellite maintain takes care of end to end upgrade, it should also have an additional check to unset an environment variable along with alerting the user.
The addition of this check will ensure that we can avoid the installer execution failure and fixing a potential issue at the pre-upgrade stage.

This coverage already exists here, so I considered it redundant.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see it as redundant as the test you linked is being verified by foreman-maintain check which verifies it it exists in the environment, and here we use the installer to test, where behaviour here is different, installers unsets the variable while running and then sets it back when installer run completes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, my assumptions were following:

  1. The foreman-maintain health check (covered by the test linked above) checks if HTTP_PROXY env var is set and fails if it is.
  2. Satellite upgrade leverages the foremain-maintain health check as pre-upgrade check.
  3. If the pre-upgrade check fails (e.g. because of the HTTP_PROXY env var is set or otherwise), no upgrade nor satellite-installer is run. So the satellite-installer unset/set functionality is unreachable and thus appears redundant to me.

Is any of the assumptions wrong?

org=rhcloud_manifest_org.label,
rhel_distro=f"rhel{rhel_contenthost.os_version.major}",
)
assert rhel_contenthost.execute('insights-client --register').status == 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

configure_rhai_client() will register this client to satellite, so here are we checking if it could be registered again to same satelllite? if not, can we remove this assertion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is correct, I think testing re-register won't harm.

Comment on lines -98 to -102
1. Create HTTP Proxy.
2. Set created proxy as "Default HTTP Proxy" in settings.
3. Edit /etc/resolv.conf and comment out all entries so that
satellite can not directly communicate outside. Ensure that
NetworkManger won't change it.
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we're still following steps as part of setup with fixture, so can we keep this steps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes and no. Right now we don't do this kind of setup for any HTTP proxy testing, so this would be an exception. If we decide to hack the Satellite like this, I would rather do it for all tests through some fixture, not just for this particular case. It will require more testing for potential side-effects, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Gauravtalreja1 PoC for the above #14754

Copy link
Contributor

@pondrejk pondrejk left a comment

Choose a reason for hiding this comment

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

ack pending other reviewer's comments

Copy link
Contributor

@damoore044 damoore044 left a comment

Choose a reason for hiding this comment

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

Nice! ack pending prior comments

@Gauravtalreja1 Gauravtalreja1 added the AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing label Apr 9, 2024
This commit:
- adds a case for insights client registration via HTTP proxy
- removes old stub covered in foreman-maintain
- updates http_proxy fixture to remove the proxy on teardown
@vsedmik vsedmik force-pushed the http-insights-client branch from aa2a952 to de79b85 Compare May 2, 2024 14:19
@vsedmik
Copy link
Contributor Author

vsedmik commented May 2, 2024

rebased

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label May 2, 2024
@vsedmik
Copy link
Contributor Author

vsedmik commented May 2, 2024

trigger: test-robottelo
pytest: tests/foreman/cli/test_http_proxy.py -k insights

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6779
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/cli/test_http_proxy.py -k insights --external-logging
Test Result : ===== 3 failed, 3 passed, 3 deselected, 479 warnings in 2910.62s (0:48:30) =====

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label May 2, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6793
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_http_proxy.py -k insights --external-logging
Test Result : ========== 6 passed, 3 deselected, 495 warnings in 2965.79s (0:49:25) ==========

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels May 6, 2024
@pondrejk pondrejk merged commit c4507eb into SatelliteQE:master May 16, 2024
13 checks passed
github-actions bot pushed a commit that referenced this pull request May 16, 2024
This commit:
- adds a case for insights client registration via HTTP proxy
- removes old stub covered in foreman-maintain
- updates http_proxy fixture to remove the proxy on teardown

(cherry picked from commit c4507eb)
github-actions bot pushed a commit that referenced this pull request May 16, 2024
This commit:
- adds a case for insights client registration via HTTP proxy
- removes old stub covered in foreman-maintain
- updates http_proxy fixture to remove the proxy on teardown

(cherry picked from commit c4507eb)
jyejare pushed a commit to jyejare/robottelo that referenced this pull request Oct 19, 2024
This commit:
- adds a case for insights client registration via HTTP proxy
- removes old stub covered in foreman-maintain
- updates http_proxy fixture to remove the proxy on teardown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants