Skip to content

Commit

Permalink
[RHELC-1615] Add integration test coverage for EL9 systems (#946)
Browse files Browse the repository at this point in the history
* Prepare for test coverage

* modify the main.fmf in plans
* point packit to the EL9 targets

Signed-off-by: Daniel Diblik <[email protected]>

* Simplify playbooks, include el9, add almalinux-repos

* simplify the playbooks hardcoding eus versions
* include el9 systems in some of the playbooks
* include almalinux-repos package in almalinux-9-x86_64.cfg to handle
  the package
* fix OL9 not booting to different kernel by calling grub2-set-default

Signed-off-by: Daniel Diblik <[email protected]>

* Include el9 in more tests, remove unnecessary code

* include the EL9 in more tests
* remove the install-submgr ansible role as it was not used anymore
  anywhere
* don't use yum_conf_exclude to exclude the rhn-client-tools packages,
use a no obsolete flag in yum calls installing sub-man
* fix booting to RHCK on OL9 for real this time
* add workaround to the satellite registration fixture to enable the
  repositories
* fix the language test

Signed-off-by: Daniel Diblik <[email protected]>

* Add a new check, fix tests, remove remediation

* Add a new post-coversion check verifying default grub entry and
  correct running kernel
* fix broken test, where /etc/yum.repos.d got removed
* remove python3-syspurpose outdated remediation to validate RHELC-1389
  is resolved

Signed-off-by: Daniel Diblik <[email protected]>

* Fix more tests, move rocky-logos to excluded

* move rocky logos out of packages to swap to excluded packages in rocky
  9 config
* adjust wrong package in repofile_pkgs in oracle-9-x86_64.cfg

Signed-off-by: Daniel Diblik <[email protected]>

* Update kernel fixture in conftest

* rework test_custom_kernel
* add a workaround to set GRUB_ENABLE_BLSCFG to true

Signed-off-by: Daniel Diblik <[email protected]>

* Call the grub_setup_workaround in specific places

* the enablement of the BLSCFG needs to be done in specific places to be
  able to boot to a different kernel

Signed-off-by: Daniel Diblik <[email protected]>

* Fix single yum transaction and isolated system tests

* move the standard kernel setup inside the test preparation for oracle
* fix bad conditions in the single yum transaction tests

Signed-off-by: Daniel Diblik <[email protected]>

* Refactor kernel fixture, fix isolated_system prep

* simplify the fixture, set an older kernel as default if present,
  downgrade otherwise
* if we're unable to even downgrade the kernel, try to install an older
  version from an older repo
* fix kernel installation on Oracle in the isolated system test

Signed-off-by: Daniel Diblik <[email protected]>

* Clean up, fix failing tests

* fix custom kernel installation, by looking for an available kernel
  version first
* fix the grub title string assertion
* add rpmdevtools to a list of required packages
* fix the workaround_remove_uek fixture to work with python3.6
* use rpmdev-sort to sort installed kernel versions
* clean up metadata, remove adjust where unneccessary

Signed-off-by: Daniel Diblik <[email protected]>

* Address review comments

Signed-off-by: Daniel Diblik <[email protected]>

* address reviews

Signed-off-by: Daniel Diblik <[email protected]>

---------

Signed-off-by: Daniel Diblik <[email protected]>
  • Loading branch information
danmyway authored Aug 26, 2024
1 parent 37f31ca commit 9ee4fe3
Show file tree
Hide file tree
Showing 54 changed files with 1,105 additions and 626 deletions.
197 changes: 197 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,141 @@ jobs:
# TEST JOBS
## Tests on pull request stage. Tests are run on demand
### Definitions of the tier0 tests (non-destructive and destructive separately)
- &tests-tier0-oraclelinux-9
job: tests
# Run tests on-demand
manual_trigger: true
# Do not merge the PR into the target branch, in case the merge is broken
# Given we are rebasing the source branches regularly, we do not need this feature enabled
merge_pr_in_ci: false
targets:
epel-9-x86_64:
distros: ["OL9.3-x86_64-HVM-2024-02-02"] # Owner ID for Oracle Linux images 131827586825
trigger: pull_request
identifier: "tier0-ol9"
tmt_plan: "tier0/core"
# Run on Red Testing Farm Hat Ranch, tag resources to sst_conversions
use_internal_tf: True
# For some targets we use official AWS marketplace images, those do not support root ssh login as default,
# therefore we need to pass post-install-script to enable root login on the host
tf_post_install_script: '#!/bin/bash\nsudo sed -i "s/^.*ssh-rsa/ssh-rsa/" /root/.ssh/authorized_keys'
tf_extra_params:
environments:
- tmt:
context:
distro: oracle-9-latest
settings:
provisioning:
tags:
BusinessUnit: sst_conversions
settings:
pipeline:
parallel-limit: 20
labels:
- tier0
- oracle9
- el9

- &tests-sanity-oraclelinux-9
<<: *tests-tier0-oraclelinux-9
identifier: "sanity-ol9"
tmt_plan: "tier0/sanity"
labels:
- tier0
- oracle9
- sanity
- el9

- &tests-tier0-almalinux-9
job: tests
# Run tests on-demand
manual_trigger: true
# Do not merge the PR into the target branch, in case the merge is broken
# Given we are rebasing the source branches regularly, we do not need this feature enabled
merge_pr_in_ci: false
targets:
epel-9-x86_64:
distros: ["AlmaLinux OS 9.4.20240509 x86_64"] # Owner ID for Rocky Linux images 764336703387
trigger: pull_request
identifier: "tier0-al9"
tmt_plan: "tier0/core"
# Run on Red Testing Farm Hat Ranch, tag resources to sst_conversions
use_internal_tf: True
# For some targets we use official AWS marketplace images, those do not support root ssh login as default,
# therefore we need to pass post-install-script to enable root login on the host
tf_post_install_script: '#!/bin/bash\nsudo sed -i "s/^.*ssh-rsa/ssh-rsa/" /root/.ssh/authorized_keys'
tf_extra_params:
environments:
- tmt:
context:
distro: alma-9-latest
settings:
provisioning:
tags:
BusinessUnit: sst_conversions
settings:
pipeline:
parallel-limit: 20
labels:
- tier0
- alma9
- el9

- &tests-sanity-almalinux-9
<<: *tests-tier0-almalinux-9
identifier: "sanity-al9"
tmt_plan: "tier0/sanity"
labels:
- tier0
- alma9
- sanity
- el9

- &tests-tier0-rockylinux-9
job: tests
# Run tests on-demand
manual_trigger: true
# Do not merge the PR into the target branch, in case the merge is broken
# Given we are rebasing the source branches regularly, we do not need this feature enabled
merge_pr_in_ci: false
targets:
epel-9-x86_64:
distros: ["Rocky-9-EC2-Base-9.4-20240509.0.x86_64"] # Owner ID for Rocky Linux images 792107900819
trigger: pull_request
identifier: "tier0-rl9"
tmt_plan: "tier0/core"
# Run on Red Testing Farm Hat Ranch, tag resources to sst_conversions
use_internal_tf: True
# For some targets we use official AWS marketplace images, those do not support root ssh login as default,
# therefore we need to pass post-install-script to enable root login on the host
tf_post_install_script: '#!/bin/bash\nsudo sed -i "s/^.*ssh-rsa/ssh-rsa/" /root/.ssh/authorized_keys'
tf_extra_params:
environments:
- tmt:
context:
distro: rocky-9-latest
settings:
provisioning:
tags:
BusinessUnit: sst_conversions
settings:
pipeline:
parallel-limit: 20
labels:
- tier0
- rocky9
- el9

- &tests-sanity-rockylinux-9
<<: *tests-tier0-rockylinux-9
identifier: "sanity-rl9"
tmt_plan: "tier0/sanity"
labels:
- tier0
- rocky9
- sanity
- el9

- &tests-stream-8
job: tests
# Run tests on-demand
Expand Down Expand Up @@ -440,6 +575,33 @@ jobs:
- tier1
- rocky-8

- &tests-tier1-manual-rockylinux-9
<<: *tests-tier0-rockylinux-9
identifier: "tier1-rl9"
tmt_plan: "tier1"
labels:
- tier1
- rocky9
- el9

- &tests-tier1-manual-almalinux-9
<<: *tests-tier0-almalinux-9
identifier: "tier1-al9"
tmt_plan: "tier1"
labels:
- tier1
- alma9
- el9

- &tests-tier1-manual-oraclelinux-9
<<: *tests-tier0-oraclelinux-9
identifier: "tier1-ol9"
tmt_plan: "tier1"
labels:
- tier1
- oracle9
- el9

## Tests on merge to main stage. Tests are run automatically
- &tests-main-tier1-centos
<<: *tests-tier0-centos
Expand Down Expand Up @@ -503,3 +665,38 @@ jobs:
tmt_plan: "tier1"
trigger: commit
branch: main

- &tests-main-stream-8
<<: *tests-stream-8
# Run test automatically with merge commit to main branch
manual_trigger: false
identifier: "stream8"
trigger: commit
branch: main

- &tests-main-tier1-rockylinux-9
<<: *tests-tier0-rockylinux-9
# Run test automatically with merge commit to main branch
manual_trigger: false
identifier: "tier1-rl9"
tmt_plan: "tier1"
trigger: commit
branch: main

- &tests-main-tier1-almalinux-9
<<: *tests-tier0-almalinux-9
# Run test automatically with merge commit to main branch
manual_trigger: false
identifier: "tier1-al9"
tmt_plan: "tier1"
trigger: commit
branch: main

- &tests-main-tier1-oraclelinux-9
<<: *tests-tier0-oraclelinux-9
# Run test automatically with merge commit to main branch
manual_trigger: false
identifier: "tier1-ol9"
tmt_plan: "tier1"
trigger: commit
branch: main
1 change: 1 addition & 0 deletions convert2rhel/data/9/x86_64/configs/almalinux-9-x86_64.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ repofile_pkgs =
almalinux-release*
elrepo-release
epel-release
almalinux-repos

# List of repoids to enable through subscription-manager when the --enablerepo option is not used.
# Delimited by any whitespace(s).
Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/data/9/x86_64/configs/oracle-9-x86_64.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ swap_pkgs =
# List of packages that either contain repofiles or affect variables in the repofiles (e.g. $releasever).
# Delimited by any whitespace(s).
repofile_pkgs =
oracle*-release-el8
oracle*-release-el9
oraclelinux-release
redhat-release

Expand Down
2 changes: 1 addition & 1 deletion convert2rhel/data/9/x86_64/configs/rocky-9-x86_64.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ gpg_fingerprints = 702d426d350d275d
excluded_pkgs =
rocky-obsolete-packages
rocky-gpg-keys
rocky-logos

# Mapping of packages that need to be swapped during the transaction
swap_pkgs =
rocky-logos | redhat-logos
rocky-logos-httpd | redhat-logos-httpd
rocky-logos-ipa | redhat-logos-ipa
rocky-indexhtml | redhat-indexhtml
Expand Down
18 changes: 18 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,31 @@ adjust+:
- environment+:
SYSTEM_RELEASE_ENV: stream-8-latest
when: distro == stream-8-latest
- environment+:
SYSTEM_RELEASE_ENV: oracle-9-latest
when: distro == oracle-9-latest
- environment+:
SYSTEM_RELEASE_ENV: alma-9-latest
when: distro == alma-9-latest
- environment+:
SYSTEM_RELEASE_ENV: rocky-9-latest
when: distro == rocky-9-latest
# NOT A PART OF THE CI YET
- environment+:
SYSTEM_RELEASE_ENV: stream-9-latest
when: distro == stream-9-latest

prepare+:
- name: install latest copr build
how: install
copr: '@oamg/convert2rhel'
package: convert2rhel
missing: fail
- name: Install general dependencies
how: install
package:
- rpmdevtools
- yum-utils
- name: main preparation step
how: ansible
playbook: tests/ansible_collections/main.yml
Expand Down
12 changes: 5 additions & 7 deletions plans/stream.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ adjust+:
test+<:
- conversion-method/satellite_conversion
/pre_registered_system_conversion:
adjust+:
- environment+:
C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1
C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1
environment+:
C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1
C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1
discover+:
test+<:
- conversion-method/pre_registered_system_conversion
Expand All @@ -61,9 +60,8 @@ adjust+:
exclude:
- checks-after-conversion/rhel_subman
/isolated_system_conversion:
adjust+:
- environment+:
TESTS_DONT_UPDATE_SYSTEM: 1
environment+:
TESTS_DONT_UPDATE_SYSTEM: 1
prepare+:
- name: Allow access to Satellite only
how: shell
Expand Down
20 changes: 11 additions & 9 deletions plans/tier0.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ adjust+:
- conversion-method/one_key_satellite_conversion

/pre_registered_system_conversion:
adjust+:
- environment+:
C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1
C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1
environment+:
C2R_TESTS_CHECK_RHSM_UUID_MATCH: 1
C2R_TESTS_SUBMAN_REMAIN_REGISTERED: 1
discover+:
test+<:
- conversion-method/pre_registered_system_conversion
Expand Down Expand Up @@ -159,8 +158,8 @@ adjust+:
/resolve_dependency:
adjust+:
- enabled: true
when: distro == centos, oracle
because: We do not have any tracked packages with Rocky and Alma for this test case
when: distro == centos, oracle and distro != oracle-9
because: We do not have any tracked packages for Alma, Rocky or Oracle Linux 9 for this test case
summary+: |
Handle dependency packages
description+: |
Expand All @@ -174,6 +173,10 @@ adjust+:
script: pytest tests/integration/*/destructive/single-yum-transaction/install_dependency_packages.py

/yum_distro_sync:
adjust+:
- enabled: false
when: distro == stream-9, oracle-9, alma-9, rocky-9
because: We don't have any reported/reproduced problematic package for EL9
prepare+:
- name: enable CentOS' extras repo
how: ansible
Expand All @@ -187,9 +190,8 @@ adjust+:


/isolated_system_conversion:
adjust+:
- environment+:
TESTS_DONT_UPDATE_SYSTEM: 1
environment+:
TESTS_DONT_UPDATE_SYSTEM: 1
prepare+:
- name: Allow access to Satellite only
how: shell
Expand Down
11 changes: 11 additions & 0 deletions plans/tier1.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,13 @@ adjust+:
- changed-grub-file/valid_changes_to_grub_file

/changed_grub_invalid:
adjust+:
- enabled: false
when: distro == alma-8-latest and boot_method == uefi
because: The changes to the grub file result in a unbootable system.
- enabled: false
when: distro == alma-9, rocky-9, oracle-9
because: The changes break the conversion or the bootloader at the moment.
discover+:
test+<:
- changed-grub-file/invalid_changes_to_grub_file
Expand Down Expand Up @@ -282,6 +289,10 @@ adjust+:
test+:
- host-metering/check_active_host_metering
/proxy-server:
adjust+:
- enabled: false
when: distro == alma-9, oracle-9
because: The test is currently flaky on these targets. Needs further investigation.
discover+:
test+<:
- proxy-conversion/proxy_conversion
3 changes: 3 additions & 0 deletions tests/ansible_collections/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- role: update-system
when: lookup('env', 'TESTS_DONT_UPDATE_SYSTEM') != "1"

- role: grub-setup
when: ansible_facts['distribution_major_version'] == "9"

- role: oracle-linux-specific
when: ansible_facts['distribution'] == "OracleLinux"

Expand Down
7 changes: 6 additions & 1 deletion tests/ansible_collections/roles/add-custom-repos/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
when: ansible_facts['distribution_major_version'] == "7"
#TODO(danmyway) bump when new minor available
- import_playbook: rhel8-repos.yml
when: ansible_facts['distribution_version'] in ["8.5", "8.9", "8.10"] or ansible_facts['distribution_release'] == "Stream"
when: ansible_facts['distribution_major_version'] == "8"
- import_playbook: rhel8-eus-repos.yml
# We need to skip for Oracle Linux machines since we don't test EUS on OL
when: ansible_facts['distribution_version'] == "8.8" and ansible_facts['distribution'] != "OracleLinux"
- import_playbook: rhel9-repos.yml
when: ansible_facts['distribution_major_version'] == "9"
- import_playbook: rhel9-eus-repos.yml
# We need to skip for Oracle Linux machines since we don't test EUS on OL
when: ansible_facts['distribution_version'] in ["9.2", "9.4", "9.6", "9.8"] and ansible_facts['distribution'] != "OracleLinux"
Loading

0 comments on commit 9ee4fe3

Please sign in to comment.