From 819fd1b33168059ef4922a3538d11c05eeb7f1ee Mon Sep 17 00:00:00 2001 From: Antonios Pappas Date: Wed, 21 Aug 2024 18:29:08 +0200 Subject: [PATCH] Simplify schedule to create Incident SLES4SAP HDD The schedule to create the image that all the on-prem SAP specific scenarios are using was complicated because it had: 1. Cases for unsupported versions 2. Workarounds for YAMLs being unable to loop 3. Unused options 4. Nested cases that were always true This commit fixes that by: 1. Removing unsupported versions 2. Modifying system_role.pm to remove the need to unroll a version loop inside the yaml 3. Removing unused options. 4. Moving the cases up the tree. Related Ticket: TEAM-9610 Delete unsupported SLES4SAP version Remove conditionals from the schedule that are always true --- .../qam/common/qam_install_sles4sap.yaml | 85 ++----------------- tests/installation/system_role.pm | 15 +++- 2 files changed, 23 insertions(+), 77 deletions(-) diff --git a/schedule/sles4sap/qam/common/qam_install_sles4sap.yaml b/schedule/sles4sap/qam/common/qam_install_sles4sap.yaml index 24ef91ef91bb..feb5ff1676c6 100644 --- a/schedule/sles4sap/qam/common/qam_install_sles4sap.yaml +++ b/schedule/sles4sap/qam/common/qam_install_sles4sap.yaml @@ -12,13 +12,12 @@ schedule: - '{{sles4sap_product_installation_mode_sle12}}' - '{{update_test_repo}}' - installation/addon_products_sle - - '{{system_role}}' - - '{{sles4sap_product_installation_mode}}' + - installation/system_role + - '{{sles4sap_product_installation_mode_sle15}}' - installation/partitioning - installation/partitioning_finish - installation/installer_timezone - installation/hostname_inst - - '{{user_settings}}' - installation/user_settings_root - installation/resolve_dependency_issues - installation/installation_overview @@ -29,98 +28,32 @@ schedule: - installation/reboot_after_installation - installation/grub_test - installation/first_boot - - '{{patch_and_reboot}}' + - qa_automation/patch_and_reboot - console/system_prepare - '{{setup_fips}}' - - '{{test_sles4sap}}' - '{{scc_deregister}}' - - '{{generate_image}}' + - console/hostname + - console/force_scheduled_tasks + - shutdown/grub_set_bootargs + - shutdown/cleanup_before_shutdown + - shutdown/shutdown conditional_schedule: sles4sap_product_installation_mode_sle12: VERSION: - 12-SP2: - - installation/sles4sap_product_installation_mode - 12-SP3: - - installation/sles4sap_product_installation_mode - 12-SP4: - - installation/sles4sap_product_installation_mode 12-SP5: - - '{{product_installation_mode}}' - product_installation_mode: - SLE_PRODUCT: - sles4sap: - installation/sles4sap_product_installation_mode update_test_repo: QAM_INCI: 1: - installation/add_update_test_repo - system_role: - VERSION: - 12-SP2: - - installation/system_role - 12-SP3: - - installation/system_role - 12-SP4: - - installation/system_role - 12-SP5: - - '{{qam_system_role}}' - 15: - - installation/system_role - 15-SP1: - - installation/system_role - 15-SP2: - - installation/system_role - 15-SP3: - - installation/system_role - 15-SP4: - - installation/system_role - 15-SP5: - - installation/system_role - 15-SP6: - - installation/system_role - 15-SP7: - - installation/system_role - qam_system_role: - HORIZONTAL_MIGRATION: - 1: - - installation/system_role - sles4sap_product_installation_mode: + sles4sap_product_installation_mode_sle15: SYSTEM_ROLE: default: - installation/sles4sap_product_installation_mode - user_settings: - VERSION: - 12-SP2: - - installation/user_settings - 12-SP3: - - installation/user_settings - 12-SP4: - - installation/user_settings - HORIZONTAL_MIGRATION: - 1: - - installation/user_settings - patch_and_reboot: - FLAVOR: - SAP-DVD-Updates: - - qa_automation/patch_and_reboot - test_sles4sap: - TEST_SLES4SAP: - 1: - - sles4sap/patterns - - sles4sap/sapconf - - sles4sap/saptune scc_deregister: SCC_DEREGISTER: 1: - console/scc_deregistration - generate_image: - GENERATE_IMAGE: - 1: - - console/hostname - - console/force_scheduled_tasks - - shutdown/grub_set_bootargs - - shutdown/cleanup_before_shutdown - - shutdown/shutdown setup_fips: FIPS_ENABLED: 1: diff --git a/tests/installation/system_role.pm b/tests/installation/system_role.pm index 9414b3c20a3f..a7dc8e32f3d8 100644 --- a/tests/installation/system_role.pm +++ b/tests/installation/system_role.pm @@ -14,7 +14,7 @@ use strict; use warnings; use testapi; use Utils::Architectures; -use version_utils qw(is_sle is_opensuse is_microos is_sle_micro); +use version_utils qw(is_sle is_sles4sap is_opensuse is_microos is_sle_micro); use YaST::workarounds; my %role_hotkey = ( @@ -68,6 +68,19 @@ sub assert_system_role { } sub run { + # Check if the installer has a System Role screen. + if (is_sle('=12-sp5') && is_sles4sap) { + # This check is not enough to guarantee that we are in a SLES4SAP + # installation. What this checks is that we are at a job with the + # VERSION '12-SP5' and that the string 'SAP' is contained in FLAVOR OR + # that SLE_PRODUCT is set to sles4sap, At the moment, + # (qam_)create_hdd_sles will get past this check, so we need an extra + # check_screen to know if the SUT runs SLE or SLES4SAP. + if (check_screen('partitioning-edit-proposal-button')) { + record_info("No System Role Screen", "The System Role screen is not shown in SLES4SAP 12SP5"); + return; + } + } if (is_sle('<15') && !is_x86_64) { record_info("Skip screen", "System Role screen is displayed only for x86_64 in SLE-12-SP5 due to it has more than one role available"); }