From f08bd07848bc638a08313ab6f88b8edc0e84d4eb Mon Sep 17 00:00:00 2001 From: Paolo Stivanin Date: Thu, 8 Aug 2024 10:41:59 +0200 Subject: [PATCH] CC: handle also the not encrypted scenario Ticket: https://progress.opensuse.org/issues/164556 --- .../CommonCriteriaConfigurationController.pm | 5 +++- .../CommonCriteriaConfigurationPage.pm | 12 ++++++--- .../{cc.yaml => aarch64_x86_64/cc_beta.yaml} | 6 ++++- .../cc_qr.yaml} | 3 +-- .../cc_qr_no_fde_15sp4.yaml} | 12 +++------ .../create_hdd_cc_libyui/cc_qr_x86_64.yaml | 25 ------------------- .../{cc_s390x.yaml => s390x/cc_beta.yaml} | 9 ++++--- .../{cc_qr_s390x.yaml => s390x/cc_qr.yaml} | 7 +++--- .../cc_qr_no_fde_15sp4.yaml} | 11 +++----- ...wd.pm => common_criteria_configuration.pm} | 11 +++++--- 10 files changed, 43 insertions(+), 58 deletions(-) rename schedule/security/create_hdd_cc_libyui/{cc.yaml => aarch64_x86_64/cc_beta.yaml} (85%) rename schedule/security/create_hdd_cc_libyui/{cc_qr_aarch64.yaml => aarch64_x86_64/cc_qr.yaml} (95%) rename schedule/security/create_hdd_cc_libyui/{cc_qr.yaml => aarch64_x86_64/cc_qr_no_fde_15sp4.yaml} (65%) delete mode 100644 schedule/security/create_hdd_cc_libyui/cc_qr_x86_64.yaml rename schedule/security/create_hdd_cc_libyui/{cc_s390x.yaml => s390x/cc_beta.yaml} (85%) rename schedule/security/create_hdd_cc_libyui/{cc_qr_s390x.yaml => s390x/cc_qr.yaml} (92%) rename schedule/security/create_hdd_cc_libyui/{cc_qr_s390x_15SP4.yaml => s390x/cc_qr_no_fde_15sp4.yaml} (68%) rename tests/installation/common_criteria_configuration/{common_criteria_encryption_pwd.pm => common_criteria_configuration.pm} (52%) diff --git a/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationController.pm b/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationController.pm index 2e7dcd95102c..c422c8918705 100644 --- a/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationController.pm +++ b/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationController.pm @@ -11,6 +11,7 @@ package Installation::CommonCriteriaConfiguration::CommonCriteriaConfigurationController; use strict; use warnings; +use testapi; use Installation::CommonCriteriaConfiguration::CommonCriteriaConfigurationPage; use Installation::Popups::YesNoPopup; use YuiRestClient; @@ -32,7 +33,9 @@ sub new { sub init { my ($self, $args) = @_; $self->{CommonCriteriaConfigurationPage} = Installation::CommonCriteriaConfiguration::CommonCriteriaConfigurationPage->new({app => YuiRestClient::get_app()}); - $self->{WeakPasswordPopup} = Installation::Popups::YesNoPopup->new({app => YuiRestClient::get_app()}); + if (check_var('ENCRYPT', '1')) { + $self->{WeakPasswordPopup} = Installation::Popups::YesNoPopup->new({app => YuiRestClient::get_app()}); + } return $self; } diff --git a/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationPage.pm b/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationPage.pm index a88b3c8f1b72..8a91ce59b8d5 100644 --- a/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationPage.pm +++ b/lib/Installation/CommonCriteriaConfiguration/CommonCriteriaConfigurationPage.pm @@ -10,13 +10,19 @@ package Installation::CommonCriteriaConfiguration::CommonCriteriaConfigurationPage; use parent 'Installation::Navigation::NavigationBase'; use strict; +use testapi; use warnings; sub init { my $self = shift; $self->SUPER::init(); - $self->{txb_password} = $self->{app}->textbox({id => 'passphrase'}); - $self->{txb_repeat_password} = $self->{app}->textbox({id => 'repeat_passphrase'}); + if (check_var('ENCRYPT', '1')) { + $self->{txb_password} = $self->{app}->textbox({id => 'passphrase'}); + $self->{txb_repeat_password} = $self->{app}->textbox({id => 'repeat_passphrase'}); + } else { + $self->{txt_cc} = $self->{app}->textbox({id => 'text'}); + } + return $self; } @@ -32,7 +38,7 @@ sub enter_confirm_password { sub is_shown { my ($self) = @_; - return $self->{txb_password}->exist(); + return check_var('ENCRYPT', '1') ? $self->{txb_password}->exist() : $self->{txt_cc}->exist(); } 1; diff --git a/schedule/security/create_hdd_cc_libyui/cc.yaml b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_beta.yaml similarity index 85% rename from schedule/security/create_hdd_cc_libyui/cc.yaml rename to schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_beta.yaml index dd415f2ae2e8..9f22de946fae 100644 --- a/schedule/security/create_hdd_cc_libyui/cc.yaml +++ b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_beta.yaml @@ -3,11 +3,15 @@ description: > Installation using the Common Criteria role and full disk encryption on beta SLES. schedule: + access_beta: + - installation/access_beta_distribution system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd + - installation/common_criteria_configuration/common_criteria_configuration suggested_partitioning: - installation/partitioning/new_partitioning_gpt + grub: + - installation/handle_reboot first_login: - installation/boot_encrypt - installation/first_boot diff --git a/schedule/security/create_hdd_cc_libyui/cc_qr_aarch64.yaml b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr.yaml similarity index 95% rename from schedule/security/create_hdd_cc_libyui/cc_qr_aarch64.yaml rename to schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr.yaml index 59b98cb0be7a..6029abb39a1a 100644 --- a/schedule/security/create_hdd_cc_libyui/cc_qr_aarch64.yaml +++ b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr.yaml @@ -4,12 +4,11 @@ description: > Installation using the Common Criteria role and full disk encryption on QR SLES. schedule: - access_beta: [] product_selection: - installation/product_selection/install_SLES system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd + - installation/common_criteria_configuration/common_criteria_configuration suggested_partitioning: - installation/partitioning/new_partitioning_gpt grub: [] diff --git a/schedule/security/create_hdd_cc_libyui/cc_qr.yaml b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr_no_fde_15sp4.yaml similarity index 65% rename from schedule/security/create_hdd_cc_libyui/cc_qr.yaml rename to schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr_no_fde_15sp4.yaml index 66dcdfc81b27..beb2dabe982c 100644 --- a/schedule/security/create_hdd_cc_libyui/cc_qr.yaml +++ b/schedule/security/create_hdd_cc_libyui/aarch64_x86_64/cc_qr_no_fde_15sp4.yaml @@ -1,20 +1,14 @@ --- name: create_hdd_common_criteria description: > - Installation using the Common Criteria role and full disk - encryption on QR SLES. + Installation using the Common Criteria role without full disk + encryption on QR SLES 15-SP4. schedule: - access_beta: [] product_selection: - installation/product_selection/install_SLES system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd - suggested_partitioning: - - installation/partitioning/new_partitioning_gpt - first_login: - - installation/boot_encrypt - - installation/first_boot + - installation/common_criteria_configuration/common_criteria_configuration system_preparation: - console/hostname - console/system_prepare diff --git a/schedule/security/create_hdd_cc_libyui/cc_qr_x86_64.yaml b/schedule/security/create_hdd_cc_libyui/cc_qr_x86_64.yaml deleted file mode 100644 index 66dcdfc81b27..000000000000 --- a/schedule/security/create_hdd_cc_libyui/cc_qr_x86_64.yaml +++ /dev/null @@ -1,25 +0,0 @@ ---- -name: create_hdd_common_criteria -description: > - Installation using the Common Criteria role and full disk - encryption on QR SLES. -schedule: - access_beta: [] - product_selection: - - installation/product_selection/install_SLES - system_role: - - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd - suggested_partitioning: - - installation/partitioning/new_partitioning_gpt - first_login: - - installation/boot_encrypt - - installation/first_boot - system_preparation: - - console/hostname - - console/system_prepare - - console/force_scheduled_tasks - - security/cc/ensure_crypto_checks_enabled - - shutdown/grub_set_bootargs - - shutdown/cleanup_before_shutdown - - shutdown/shutdown diff --git a/schedule/security/create_hdd_cc_libyui/cc_s390x.yaml b/schedule/security/create_hdd_cc_libyui/s390x/cc_beta.yaml similarity index 85% rename from schedule/security/create_hdd_cc_libyui/cc_s390x.yaml rename to schedule/security/create_hdd_cc_libyui/s390x/cc_beta.yaml index 2c989661b268..743b6dec6910 100644 --- a/schedule/security/create_hdd_cc_libyui/cc_s390x.yaml +++ b/schedule/security/create_hdd_cc_libyui/s390x/cc_beta.yaml @@ -1,17 +1,20 @@ ---- name: create_hdd_common_criteria description: > Installation using the Common Criteria role and full disk encryption on beta SLES. schedule: + access_beta: + - installation/access_beta_distribution system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd + - installation/common_criteria_configuration/common_criteria_configuration suggested_partitioning: - installation/partitioning/new_partitioning_gpt grub: - - installation/boot_encrypt - installation/handle_reboot + first_login: + - installation/boot_encrypt + - installation/first_boot system_preparation: - console/hostname - console/system_prepare diff --git a/schedule/security/create_hdd_cc_libyui/cc_qr_s390x.yaml b/schedule/security/create_hdd_cc_libyui/s390x/cc_qr.yaml similarity index 92% rename from schedule/security/create_hdd_cc_libyui/cc_qr_s390x.yaml rename to schedule/security/create_hdd_cc_libyui/s390x/cc_qr.yaml index 9becb8f1e720..2caf5eaeb32a 100644 --- a/schedule/security/create_hdd_cc_libyui/cc_qr_s390x.yaml +++ b/schedule/security/create_hdd_cc_libyui/s390x/cc_qr.yaml @@ -4,15 +4,16 @@ description: > Installation using the Common Criteria role and full disk encryption on QR SLES. schedule: - access_beta: [] system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd + - installation/common_criteria_configuration/common_criteria_configuration suggested_partitioning: - installation/partitioning/new_partitioning_gpt grub: - - installation/boot_encrypt - installation/handle_reboot + first_login: + - installation/boot_encrypt + - installation/first_boot system_preparation: - console/hostname - console/system_prepare diff --git a/schedule/security/create_hdd_cc_libyui/cc_qr_s390x_15SP4.yaml b/schedule/security/create_hdd_cc_libyui/s390x/cc_qr_no_fde_15sp4.yaml similarity index 68% rename from schedule/security/create_hdd_cc_libyui/cc_qr_s390x_15SP4.yaml rename to schedule/security/create_hdd_cc_libyui/s390x/cc_qr_no_fde_15sp4.yaml index 4dd30a668f5a..994f68cec4a1 100644 --- a/schedule/security/create_hdd_cc_libyui/cc_qr_s390x_15SP4.yaml +++ b/schedule/security/create_hdd_cc_libyui/s390x/cc_qr_no_fde_15sp4.yaml @@ -1,19 +1,14 @@ --- name: create_hdd_common_criteria description: > - Installation using the Common Criteria role and full disk - encryption on QR SLES. + Installation using the Common Criteria role without full disk + encryption on QR SLES 15-SP4. schedule: access_beta: - installation/product_selection/install_SLES system_role: - installation/system_role/select_common_criteria_role - - installation/common_criteria_configuration/common_criteria_encryption_pwd - suggested_partitioning: - - installation/partitioning/new_partitioning_gpt - grub: - - installation/boot_encrypt - - installation/handle_reboot + - installation/common_criteria_configuration/common_criteria_configuration system_preparation: - console/hostname - console/system_prepare diff --git a/tests/installation/common_criteria_configuration/common_criteria_encryption_pwd.pm b/tests/installation/common_criteria_configuration/common_criteria_configuration.pm similarity index 52% rename from tests/installation/common_criteria_configuration/common_criteria_encryption_pwd.pm rename to tests/installation/common_criteria_configuration/common_criteria_configuration.pm index 948f3de225a2..095642fbacc7 100644 --- a/tests/installation/common_criteria_configuration/common_criteria_encryption_pwd.pm +++ b/tests/installation/common_criteria_configuration/common_criteria_configuration.pm @@ -7,13 +7,18 @@ use parent 'y2_installbase'; use strict; +use testapi; use warnings; sub run { my $common_criteria_configuration = $testapi::distri->get_common_criteria_configuration(); - $common_criteria_configuration->configure_encryption($testapi::password); - $common_criteria_configuration->go_forward(); - $common_criteria_configuration->get_weak_password_warning->press_yes(); + if (check_var('ENCRYPT', '1')) { + $common_criteria_configuration->configure_encryption($testapi::password); + $common_criteria_configuration->go_forward(); + $common_criteria_configuration->get_weak_password_warning->press_yes(); + } else { + $common_criteria_configuration->go_forward(); + } } 1;