Skip to content

test: fix integration test_combined for rhel#6791

Open
xiachen-rh wants to merge 1 commit intocanonical:mainfrom
xiachen-rh:fix_testcombined_rhel
Open

test: fix integration test_combined for rhel#6791
xiachen-rh wants to merge 1 commit intocanonical:mainfrom
xiachen-rh:fix_testcombined_rhel

Conversation

@xiachen-rh
Copy link
Copy Markdown
Contributor

@xiachen-rh xiachen-rh commented Mar 13, 2026

To Fix issue #6790 step by step, I submit the first PR,
integraton tests: add RHEL distro support

  • add default usename for RHEL distro and platform specific.
  • add optional LAUNCH_USERNAME in integration_settings to override default username per run.
  • use distro-specific USER_DATA in test_combined and adjust rsyslog and locale config so they work on RHEL, and removing the modules which not support RHEL.
  • skip the tests in test_combined which do not surport RHEL.

Test Steps

I have run tests with RHEL on AWS and Azure, no problem.

AWS
CLOUD_INIT_PLATFORM='ec2' CLOUD_INIT_OS_IMAGE='ami-id::rhel::9::9.7' CLOUD_INIT_CLOUD_INIT_SOURCE='NONE'  tox -e integration-tests -- tests/integration_tests/modules/test_combined.py::TestCombined

tests/integration_tests/modules/test_combined.py::TestCombined::test_netplan_permissions SKIPPED (Uses netplan) 
tests/integration_tests/modules/test_combined.py::TestCombined::test_final_message PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_deprecated_message PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_ntp_with_apt SKIPPED (rhel does not support ntp module) 
tests/integration_tests/modules/test_combined.py::TestCombined::test_byobu SKIPPED (rhel does not enable byobu by default)
tests/integration_tests/modules/test_combined.py::TestCombined::test_configured_locale PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_random_seed_data PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_rsyslog PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_runcmd PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_snap SKIPPED (rhel does not support snap module)
tests/integration_tests/modules/test_combined.py::TestCombined::test_timezone PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_no_problems PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_correct_datasource_detected PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_cloud_id_file_symlink PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_run_frequency PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_combined_cloud_config_json SKIPPED (Testing default_user ubuntu)
tests/integration_tests/modules/test_combined.py::TestCombined::test_network_config_json SKIPPED (Test is LXD specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_lxd SKIPPED (Test is LXD container specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_lxd_vm SKIPPED (Test is LXD VM specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_ec2 PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_gce SKIPPED (Test is GCE specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_cloud_id_across_reboot PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_unicode PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_networkd_wait_online SKIPPED (Ubuntu-only behavior)                                    [100%]

===14 passed, 10 skipped===

Azure
CLOUD_INIT_PLATFORM='azure' CLOUD_INIT_OS_IMAGE='RedHat:RHEL:9_7:latest::rhel::9::9.7' CLOUD_INIT_CLOUD_INIT_SOURCE='NONE'  tox -e integration-tests -- tests/integration_tests/modules/test_combined.py::TestCombined

tests/integration_tests/modules/test_combined.py::TestCombined::test_netplan_permissions SKIPPED (Uses netplan) 
tests/integration_tests/modules/test_combined.py::TestCombined::test_final_message PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_deprecated_message PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_ntp_with_apt SKIPPED (rhel does not support ntp module) 
tests/integration_tests/modules/test_combined.py::TestCombined::test_byobu SKIPPED (rhel does not enable byobu by default)
tests/integration_tests/modules/test_combined.py::TestCombined::test_configured_locale PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_random_seed_data PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_rsyslog PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_runcmd PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_snap SKIPPED (rhel does not support snap module)
tests/integration_tests/modules/test_combined.py::TestCombined::test_timezone PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_no_problems PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_correct_datasource_detected PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_cloud_id_file_symlink PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_run_frequency PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_combined_cloud_config_json SKIPPED (Testing default_user ubuntu)
tests/integration_tests/modules/test_combined.py::TestCombined::test_network_config_json SKIPPED (Test is LXD specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_lxd SKIPPED (Test is LXD container specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_lxd_vm SKIPPED (Test is LXD VM specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_ec2 SKIPPED (Test is ec2 specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_json_gce SKIPPED (Test is GCE specific)
tests/integration_tests/modules/test_combined.py::TestCombined::test_instance_cloud_id_across_reboot PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_unicode PASSED
tests/integration_tests/modules/test_combined.py::TestCombined::test_networkd_wait_online SKIPPED (Ubuntu-only behavior)                                    [100%]

=== 13 passed, 11 skipped ===
  integration-tests: OK 
  congratulations :)

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@xiachen-rh xiachen-rh force-pushed the fix_testcombined_rhel branch 3 times, most recently from fa8b7cb to 1d8230e Compare March 13, 2026 12:17
Copy link
Copy Markdown
Member

@holmanb holmanb left a comment

Choose a reason for hiding this comment

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

Thanks for this @xiachen-rh. I left a couple of nitpick comments but otherwise this looks good to me.

expected_locale_gen = ["en_GB.UTF-8", "en_US.UTF-8"]
verify_ordered_items_in_text(expected_locales, locale_a)
verify_ordered_items_in_text(expected_locale_gen, locale_gen)
if not IS_RHEL:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we reduce the diff size by exiting early when IS_RHEL is true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I will change the code to 'exiting early', thanks for your comments.

Copy link
Copy Markdown
Contributor Author

@xiachen-rh xiachen-rh Mar 18, 2026

Choose a reason for hiding this comment

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

I have updated the PR.

"ubuntu": USER_DATA_UBUNTU,
"rhel": USER_DATA_RHEL,
"centos": USER_DATA_RHEL,
}.get(CURRENT_RELEASE.os, USER_DATA_UBUNTU)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This would cause the Ubuntu userdata to be silently passed if this test suite is later updated to support other distros with this data structure not updated.

It would make it easier for developers to update this datastructure by failing loudly instead.

Copy link
Copy Markdown
Contributor Author

@xiachen-rh xiachen-rh Mar 17, 2026

Choose a reason for hiding this comment

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

Oh, I thought this would have minimal impact on other distros, since I’m not sure what kind of USER_DATA they use. Before and after this change, they would still use the same USER_DATA.
Do you mean it’s better not to set USER_DATA_UBUNTU as the default value?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Right, I'd rather not assume the ubuntu config for new distros.

I think raising a pytest failure exception (or even just a stack trace) when an unsupported distro is passed would make it easier to bring up support for additional distros.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, I will update the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I resent the PR, could you please help to review it when you are available?

@holmanb holmanb self-assigned this Mar 17, 2026
@xiachen-rh xiachen-rh force-pushed the fix_testcombined_rhel branch from 1d8230e to 92f7fb1 Compare March 18, 2026 09:37
integraton tests: add RHEL distro support
- add default usename for RHEL distro and platform specific.
- add optional LAUNCH_USERNAME in integration_settings to override
  default username per run.
- use distro-specific USER_DATA in test_combined and
  adjust rsyslog and locale config so they work on RHEL,
  and removing the modules which not support RHEL.
- skip the tests in test_combined which do not surport RHEL.

Signed-off-by: Amy Chen <xiachen@redhat.com>
@xiachen-rh xiachen-rh force-pushed the fix_testcombined_rhel branch from 92f7fb1 to 556c409 Compare March 18, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants