-
Notifications
You must be signed in to change notification settings - Fork 282
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
base: master
Are you sure you want to change the base?
Conversation
5121dae
to
d85f914
Compare
tests/containers/bci_prepare.pm
Outdated
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'); |
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.
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?
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.
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.
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 (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");
}
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.
You could even make a one-liner out of this.
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.
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.
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.
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.
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.
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.
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.
ok
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.
updated
An
LTSS container
shall run only on sleLTSS host
with egistration activated, otherwise stop.Related ticket: https://progress.opensuse.org/issues/175938
Verification run:
FAIL: as expected, non-sle host and LTSS container
PASS: LTSS host and LTSS container