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

BCI: LTSS containers testing on LTSS hosts only #21099

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

Conversation

m-dati
Copy link
Contributor

@m-dati m-dati commented Jan 31, 2025

An LTSS container shall run only on sle LTSS host with egistration activated, otherwise stop.

@m-dati m-dati force-pushed the bci_host_ltss branch 2 times, most recently from 5121dae to d85f914 Compare January 31, 2025 22:45
die "OUT SCOPE: LTSS containers $cont_vers on $host_dist $host_vers host test excluded."
unless ($host_dist =~ /^sle/ && $host_vers =~ /^1[25]/ && $host_vers eq substr($cont_vers, 0, 2));
# check LTSS activation
my $status = q(SUSEConnect -s | jq -Mr '.[] | select(.identifier == "SLES-LTSS") | .subscription_status');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the whole PR can re reduced to a SLES version check and this command.

@m-dati would you care to simplify the PR please?

Copy link
Contributor Author

@m-dati m-dati Feb 3, 2025

Choose a reason for hiding this comment

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

Please, could you elaborate about 'simplify', being this logic at different levels of checks?
This is a check to verfiy if rules are satisfied otherwise stop run in the negative case. Each previous 'return' or 'die' is propaedeutic check of a part of the rules (also explained in the comments), before next level, till final return. And it seemed already miminal.

Copy link
Contributor

Choose a reason for hiding this comment

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

if (get_var('CONTAINER_IMAGE_TO_TEST') =~ "ltss") {
    validate_script_output('SUSEConnect -s | jq -Mr ".[] | select(.identifier == \"SLES-LTSS\") | .subscription_status"', qr/ACTIVE/, fail_message => "Host requires LTSS subscription for LTSS container");
}

Copy link
Contributor

Choose a reason for hiding this comment

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

You could even make a one-liner out of this.

Copy link
Contributor Author

@m-dati m-dati Feb 3, 2025

Choose a reason for hiding this comment

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

But, lines n.88 and n.93 on versions also are needed to be verified, other than the 'ltss' part: in your proposal those tests are missing.
This routine envelopes all the checks and seemed cleaner as solution.

Copy link
Contributor

@grisu48 grisu48 Feb 3, 2025

Choose a reason for hiding this comment

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

They are not needed because on those SLES versions, the LTSS extension is not available anyways.

At the end, all you need to check is if there is a LTSS Subscription active, and your code does that in a rather elegant way already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Plus: Removing those version checks means we also do not need to edit the code in the future, when 15-SP6 or 15-SP7 become LTSS as well. Your check via SUSEConnect still works and does not require future changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

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.

3 participants