-
Notifications
You must be signed in to change notification settings - Fork 280
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
base: master
Are you sure you want to change the base?
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
74f8112
to
a4386d9
Compare
} | ||
else { | ||
push @playbook_list, "registration.yaml $reg_code"; | ||
my @reg_args = ('registration.yaml'); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unpack arguments, symmetrical to pack in https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/20642/files#diff-d537e7676e4de934957a302dd9662d07237c473a02581e3fa2ca4065a6471c6dR190
if ($args{ltss}) { | ||
my @ltss_args = split(/,/, $args{ltss}); | ||
push @reg_args, "-e sles_modules='[{" . | ||
"\"key\":\"$ltss_args[0]\"," . |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
# Keep the code simple by only support ltss addons, | ||
# it simplify version calculation. | ||
$name = get_addon_fullname($addon) if ($addon =~ 'ltss'); | ||
if (length $name) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
if (length $name) { |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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