Skip to content

Commit

Permalink
Fix exit codes in integration tests
Browse files Browse the repository at this point in the history
Fix another exit codes based on the test run which should be 2.
  • Loading branch information
hosekadam committed Oct 23, 2024
1 parent fb4e780 commit 80065ea
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ tag+:
/convert2rhel_version:
summary+: |
convert2rhel version check
adjust+:
result: xfail
when: distro == alma-9, oracle-9, rocky-9, stream-9
because: We're unable to validate the version of convert2rhel, as there is no build GA for EL9 yet
/c2r_is_latest_with_mocked_newer_version:
summary+: |
Mock newer version of convert2rhel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ def test_duplicate_packages_installed(convert2rhel, install_duplicate_pkg):
c2r.expect("Pre-conversion analysis report", timeout=600)
c2r.expect_exact("(ERROR) DUPLICATE_PACKAGES::DUPLICATE_PACKAGES_FOUND")

# The analysis should exit with 0, if it finishes successfully
assert c2r.exitstatus == 0
# The analysis should exit with 2, if inhibitor is found
assert c2r.exitstatus == 2
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ def test_rhsm_non_els_account(convert2rhel):
c2r.expect_exact(ELS_REPOID_MSG)
c2r.expect_exact("Error: 'rhel-7-server-els-rpms' does not match a valid repository ID.")
c2r.expect_exact("SUBSCRIBE_SYSTEM::FAILED_TO_ENABLE_RHSM_REPOSITORIES")
assert c2r.exitstatus == 0
assert c2r.exitstatus == 2
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ def test_rhsm_non_eus_account(convert2rhel):
c2r.expect_exact("Error: 'rhel-8-for-x86_64-baseos-eus-rpms' does not match a valid repository ID.")
c2r.expect_exact("Error: 'rhel-8-for-x86_64-appstream-eus-rpms' does not match a valid repository ID.")
c2r.expect_exact("SUBSCRIBE_SYSTEM::FAILED_TO_ENABLE_RHSM_REPOSITORIES")
assert c2r.exitstatus == 0
assert c2r.exitstatus == 2
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def test_releasever_modified_in_c2r_config(backup_files, convert2rhel, shell):
c2r.expect("--releasever=420")
c2r.expect_exact("ERROR - (ERROR) ENSURE_KERNEL_MODULES_COMPATIBILITY::PROBLEM_WITH_PACKAGE_REPO")

assert c2r.exitstatus == 0
# Inhibitor expected
assert c2r.exitstatus == 2


@pytest.mark.parametrize("backup_files", ["/etc/system-release"], indirect=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,5 @@ def test_httpd_package_transaction_error(shell, convert2rhel, handle_packages):
assert index == 0, "The analysis found an error. Probably related to the transaction check."
assert c2r.expect_exact("VALIDATE_PACKAGE_MANAGER_TRANSACTION has succeeded") == 0

assert c2r.exitstatus == 2
# Correct handling of the httpd package dependencies is expected
assert c2r.exitstatus == 0

0 comments on commit 80065ea

Please sign in to comment.