Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTSS registration in HanaSR test #20642

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mpagot
Copy link
Contributor

@mpagot mpagot commented Nov 14, 2024

Verification run:

BYOS

No LTSS ADDON sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

No LTSS ADDON and also including SUSE/qe-sap-deployment#295. sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

SCC_ADDONS=ltss but no regcode (expected to fails) sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

And this is with intentionally wrong code (expected to fails)

SCC_ADDONS=ltss and SCC_REGCODE_LTSS sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

BYOS with ltss and so test code should enable use_suseconnect. Also including SUSE/qe-sap-deployment#295. sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

PAYG

Has BYOS in the openQA name but it is PAYG, without ltss. Also including SUSE/qe-sap-deployment#295

sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

with ltss Also including SUSE/qe-sap-deployment#295
sle-12-SP5-HanaSr-Azure-Byos-x86_64-Build12-SP5_2024-11-12T03:03:21Z-hanasr_azure_test_sbd az_Standard_E4s_v3

@mpagot mpagot added the WIP Work in progress label Nov 14, 2024
Copy link

Great PR! Please pay attention to the following items before merging:

Files matching lib/**.pm:

  • Consider adding or extending unit tests in t/

This is an automatically generated QA checklist based on modified files.

@mpagot mpagot force-pushed the ltss_hanaSR branch 3 times, most recently from 74f8112 to a4386d9 Compare November 15, 2024 07:18
}
else {
push @playbook_list, "registration.yaml $reg_code";
my @reg_args = ('registration.yaml');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

as the command line composition for this playbook become more complex I decided to fit all argument in a list and then join them at the end

push @playbook_list, "registration.yaml $reg_code";
my @reg_args = ('registration.yaml');
push @reg_args, '-e reg_code=' . get_required_var('SCC_REGCODE_SLES4SAP') . " -e email_address=''";
push @reg_args, '-e use_suseconnect=true' if ($args{registration} eq 'suseconnect');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to inline

push @reg_args, '-e reg_code=' . get_required_var('SCC_REGCODE_SLES4SAP') . " -e email_address=''";
push @reg_args, '-e use_suseconnect=true' if ($args{registration} eq 'suseconnect');
if ($args{ltss}) {
my @ltss_args = split(/,/, $args{ltss});
Copy link
Contributor Author

@mpagot mpagot Nov 15, 2024

Choose a reason for hiding this comment

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

if ($args{ltss}) {
my @ltss_args = split(/,/, $args{ltss});
push @reg_args, "-e sles_modules='[{" .
"\"key\":\"$ltss_args[0]\"," .
Copy link
Contributor Author

Choose a reason for hiding this comment

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

sles_modules= on the Ansible side, potentially supports multiple modules to be passed at once.

This implementation only support one.

[0] is the name of the extension
[1] is the registration code

# This implementation has a known limitation
# if SCC_ADDONS has two or more elements (like "ltss,ltss_es")
# only the last one will be added to the playbook argument.
foreach my $addon (@addons) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Scan all extensions in SCC_ADDONS and only care about ltss, calculate SCC Extension name and reg code for it and pack them in the right format expected by ltss argument of create_playbook_section_list

@alvarocarvajald alvarocarvajald changed the title LTSS registratio in HanaSR test LTSS registration in HanaSR test Nov 15, 2024
tests/sles4sap/publiccloud/qesap_terraform.pm Show resolved Hide resolved
# Keep the code simple by only support ltss addons,
# it simplify version calculation.
$name = get_addon_fullname($addon) if ($addon =~ 'ltss');
if (length $name) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if ($name) should be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I get it from

Add code to get the SCC extension name, reg code and use them to populate
the conf.yaml register.yaml playbook command line.
Only handle LTSS extensions.
Copy link
Contributor

@alvarocarvajald alvarocarvajald left a comment

Choose a reason for hiding this comment

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

LGTM

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