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

[RHELC-1226] Host metering integration #1060

Merged
merged 9 commits into from
Feb 22, 2024
Merged

[RHELC-1226] Host metering integration #1060

merged 9 commits into from
Feb 22, 2024

Conversation

r0x0d
Copy link
Member

@r0x0d r0x0d commented Jan 31, 2024

Jira Issues: RHELC-1226

Checklist

  • PR has been tested manually in a VM (either author or reviewer)
  • Jira issue has been made public if possible
  • [RHELC-] is part of the PR title
  • GitHub label has been added to help with Release notes
  • PR title explains the change from the user's point of view
  • Code and tests are documented properly
  • The commits are squashed to as few commits as possible (without losing data)
  • When merged: Jira issue has been updated to Release Pending if relevant

@r0x0d
Copy link
Member Author

r0x0d commented Jan 31, 2024

Picking up the work from Petr Vobornik. This is draft mode as I'm reading all the material to figure out what needs to be done to complete the PR.

convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (773af3e) 94.92% compared to head (bbc080c) 94.86%.

Files Patch % Lines
convert2rhel/hostmetering.py 88.52% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1060      +/-   ##
==========================================
- Coverage   94.92%   94.86%   -0.07%     
==========================================
  Files          50       51       +1     
  Lines        4593     4671      +78     
  Branches      816      829      +13     
==========================================
+ Hits         4360     4431      +71     
- Misses        157      161       +4     
- Partials       76       79       +3     
Flag Coverage Δ
centos-linux-7 90.00% <91.13%> (+0.01%) ⬆️
centos-linux-8 90.97% <91.13%> (+<0.01%) ⬆️
centos-linux-9 91.02% <91.13%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pr-watson pr-watson added the kind/feature New feature or request label Feb 15, 2024
convert2rhel/hostmetering.py Outdated Show resolved Hide resolved
@pr-watson pr-watson force-pushed the host-metering branch 2 times, most recently from 279657b to 33b7b59 Compare February 16, 2024 15:06
@pr-watson pr-watson added the tests/all Run the full test suite. Equivalent to `/packit test`. label Feb 16, 2024
@has-bot
Copy link
Member

has-bot commented Feb 16, 2024

/packit test


Comment generated by an automation.

@pr-watson pr-watson force-pushed the host-metering branch 5 times, most recently from cd8a413 to c65d696 Compare February 16, 2024 15:41
convert2rhel/subscription.py Outdated Show resolved Hide resolved
@r0x0d
Copy link
Member Author

r0x0d commented Feb 16, 2024

We still have some occurrences of the word hyperscaller:

convert2rhel/hostmetering.py
40:    Check if the system is running on hyperscaller. Currently supported
41:    hyperscallers are aws, azure and gcp.
45:    :return: True if the system is running on hyperscaller, False otherwise.
62:    - "force": forces configuration of host-metering (e.g., even if not running on a hyperscaller)

tests/integration/tier1/destructive/host-metering/test_host_metering.py
25:    hyperscaller.

tests/integration/tier1/destructive/host-metering/run_conversion.py
58:    service on hyperscallers on RHEL 7.9.

convert2rhel/unit_tests/hostmetering_test.py
38:            False,  # not on hyperscaller

@pr-watson
Copy link
Contributor

/packit test

@pr-watson
Copy link
Contributor

/packit build

@pr-watson
Copy link
Contributor

/packit test

2 similar comments
@r0x0d
Copy link
Member Author

r0x0d commented Feb 21, 2024

/packit test

@pr-watson
Copy link
Contributor

/packit test

@pr-watson
Copy link
Contributor

/packit build

@pr-watson
Copy link
Contributor

/packit test

@pr-watson
Copy link
Contributor

/packit build

@pr-watson
Copy link
Contributor

/packit test

1 similar comment
@pr-watson
Copy link
Contributor

/packit test

pvoborni and others added 9 commits February 22, 2024 10:24
Add integration tests that and verifies that
host-metering service was einabled and started.

It forces the behavior to be able to test it in
various environments (and not only hyperscaller).

https://issues.redhat.com/browse/RHELC-1226

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
When running on hyperscaller and converted to RHEL7:
- install host-metering rpm and its deps (host-metering-selinux)
- enable host-metering service
- start host-metering service

The behavior can be changed via CONVERT2RHEL_CONFIGURE_HOST_METERING
env var.

- "no": disables the functionality
- "force": forces the functionality (e.g. for testing)

https://issues.redhat.com/browse/RHELC-1226

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
Signed-off-by: Rodolfo Olivieri <rolivier@redhat.com>
Co-authored-by: Rodolfo Olivieri <rodolfo.olivieri3@gmail.com>
* add a new check validating no traceback appears in a log file
* modify the test and plan metadata to a new format
* append the pytest.ini

Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
* add a new check validating no traceback appears in a log file
* modify the test and plan metadata to a new format
* append the pytest.ini

Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
@danmyway
Copy link
Member

/packit test --labels tier1

@bookwar bookwar self-requested a review February 22, 2024 13:08
@r0x0d r0x0d merged commit 463634d into oamg:main Feb 22, 2024
24 of 57 checks passed
@r0x0d r0x0d deleted the host-metering branch February 22, 2024 13:09
@Venefilyn Venefilyn mentioned this pull request Feb 22, 2024
@pr-watson pr-watson changed the title [RHELC-1226] Host metering [RHELC-1226] Host metering integration Feb 28, 2024
jochapma pushed a commit to jochapma/convert2rhel that referenced this pull request Mar 11, 2024
* [RHELC-1226] Add host-metering integration test

Add integration tests that and verifies that
host-metering service was einabled and started.

It forces the behavior to be able to test it in
various environments (and not only hyperscaller).

https://issues.redhat.com/browse/RHELC-1226

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>

* [RHELC-1226] Configure host-metering on hyperscallers on RHEL7

When running on hyperscaller and converted to RHEL7:
- install host-metering rpm and its deps (host-metering-selinux)
- enable host-metering service
- start host-metering service

The behavior can be changed via CONVERT2RHEL_CONFIGURE_HOST_METERING
env var.

- "no": disables the functionality
- "force": forces the functionality (e.g. for testing)

https://issues.redhat.com/browse/RHELC-1226

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>

* WIP

Signed-off-by: Rodolfo Olivieri <rolivier@redhat.com>

* [RHELC-1226] Update CONVERT2RHEL_CONFIGURE_HOST_METERING env var behavior

* Apply suggestions from code review

Co-authored-by: Rodolfo Olivieri <rodolfo.olivieri3@gmail.com>

* Update doc string

* Fix test_get_rhsm_facts

* Fix the integration tests

* add a new check validating no traceback appears in a log file
* modify the test and plan metadata to a new format
* append the pytest.ini

Signed-off-by: Daniel Diblik <ddiblik@redhat.com>

* Fix the integration tests

* add a new check validating no traceback appears in a log file
* modify the test and plan metadata to a new format
* append the pytest.ini

Signed-off-by: Daniel Diblik <ddiblik@redhat.com>

---------

Signed-off-by: Petr Vobornik <pvoborni@redhat.com>
Signed-off-by: Rodolfo Olivieri <rolivier@redhat.com>
Signed-off-by: Daniel Diblik <ddiblik@redhat.com>
Co-authored-by: Petr Vobornik <pvoborni@redhat.com>
Co-authored-by: Preston Watson <prwatson@redhat.com>
Co-authored-by: Daniel Diblik <ddiblik@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request tests/all Run the full test suite. Equivalent to `/packit test`.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants