Skip to content

Commit

Permalink
WIP integration tests experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0d committed May 9, 2024
1 parent 4c42b16 commit d24850b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions plans/tier0.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,29 @@ description+: |
# Exclude the rhel_subman check, we don't use RHSM for the conversion
exclude:
- checks-after-conversion/rhel_subman

/offline_system_analysis:
adjust+:
# Disabled due to known issue: https://issues.redhat.com/browse/RHELC-1040
# Enable once this gets fixed
- enabled: false
when: distro == oracle-7
environment+:
CONVERT2RHEL_OUTDATED_PACKAGE_CHECK_SKIP: 1
when: distro == oracle-8
because: |
The subman is installed from CentOS repo, resulting in outdated python3-ethtool
package which is then interfering with the test, inhibiting the conversion.
prepare+:
- name: Install subscription manager
how: ansible
playbook: tests/ansible_collections/roles/install-submgr/main.yml
- name: Allow access to Satellite only
how: shell
script: pytest --setup-show -svv tests/integration/*/destructive/offline-system-conversion/prepare_system.py
discover+:
test+<:
- offline-system-conversion/offline_system_analysis
# Exclude the rhel_subman check, we don't use RHSM for the conversion
exclude:
- checks-after-conversion/rhel_subman
1 change: 1 addition & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ markers =
test_satellite_conversion
test_pre_registered_conversion
test_offline_system_conversion
test_offline_system_analysis
test_failures_and_skips_in_report
test_successful_report
test_convert_successful_report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ tag+:

/offline_system_conversion:
test: pytest -m test_offline_system_conversion

/offline_system_analysis:
test: pytest -m test_offline_system_analysis
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import pytest

from conftest import TEST_VARS


@pytest.mark.test_offline_system_analysis
def test_offline_system_analysis(shell, convert2rhel):
"""Test analysis systems not connected to the Internet but requiring sub-mgr (e.g. managed by Satellite)."""

enabled_repositories_prior_analysis = shell("subscription-manager repos --list-enabled").output

with convert2rhel(
"-y -k {} -o {} --debug".format(
TEST_VARS["SATELLITE_KEY"],
TEST_VARS["SATELLITE_ORG"],
)
) as c2r:
c2r.expect("Rollback: Enabling RHSM repositories")
assert c2r.exitstatus == 0

enabled_repositories_after_analysis = shell("subscription-manager repos --list-enabled").output
assert enabled_repositories_prior_analysis == enabled_repositories_after_analysis

0 comments on commit d24850b

Please sign in to comment.