-
Notifications
You must be signed in to change notification settings - Fork 18
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
Added check for missing marketplaceProductCodes in instance identity. #345
Open
narmaku
wants to merge
1
commit into
osbuild:main
Choose a base branch
from
narmaku:add-aws-marketplace-product-code-test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -401,31 +401,39 @@ def test_aws_instance_identity(self, host, instance_data, instance_data_aws_web) | |
assert instance_data_aws_web['region'] in instance_data['availability_zone'], \ | ||
'Unexpected region for deployed instance' | ||
|
||
# Check instance architecture | ||
arch = instance_data_aws_web['architecture'] | ||
if arch == 'arm64': | ||
arch = 'aarch64' | ||
|
||
assert arch == host.system_info.arch, \ | ||
'Unexpected architecture for deployed instance' | ||
|
||
# Check Billing Codes | ||
ami_name = instance_data['name'] | ||
obtained_billing_codes = instance_data_aws_web['billingProducts'] | ||
if obtained_billing_codes: | ||
expected_billing_codes = [] | ||
if test_lib.is_rhel_high_availability(host) and 'Access2' not in ami_name: | ||
# RHELDST-4222, on-demand (hourly) has the billing code for RHEL and for HA | ||
expected_billing_codes = ['bp-79a54010', 'bp-6fa54006'] | ||
elif 'Hourly2' in ami_name: | ||
expected_billing_codes = ['bp-6fa54006'] | ||
elif 'Access2' in ami_name: | ||
# Cloud Access billing code, means don't charge for the OS (so it can apply to anything cloud Access) | ||
expected_billing_codes = ['bp-63a5400a'] | ||
else: | ||
pytest.skip( | ||
'Unable to decide billing codes as no "Hourly2" or "Access2" found in AMI name') | ||
|
||
billing_codes = [] | ||
if test_lib.is_rhel_high_availability(host) and 'Access2' not in ami_name: | ||
# RHELDST-4222, on-demand (hourly) has the billing code for RHEL and for HA | ||
billing_codes = ['bp-79a54010', 'bp-6fa54006'] | ||
elif 'Hourly2' in ami_name: | ||
billing_codes = ['bp-6fa54006'] | ||
elif 'Access2' in ami_name: | ||
# Cloud Access billing code, means don't charge for the OS (so it can apply to anything cloud Access) | ||
billing_codes = ['bp-63a5400a'] | ||
else: | ||
pytest.skip( | ||
'Unable to decide billing codes as no "Hourly2" or "Access2" found in AMI name') | ||
for code in expected_billing_codes: | ||
assert code in obtained_billing_codes, \ | ||
f'Expected billing code "{code}" not found in instance document data' | ||
|
||
obtained_marketplace_product_codes = list(instance_data_aws_web['marketplaceProductCodes']) | ||
|
||
print(f'marketplaceProductCodes = {obtained_billing_codes}') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy& paste issue? marketplaceProductCodes vs obtained_billing_code |
||
|
||
for code in billing_codes: | ||
assert code in instance_data_aws_web['billingProducts'], \ | ||
'Expected billing code not found in instance document data' | ||
assert len(obtained_marketplace_product_codes) > 1, 'List of marketplaceProductCodes is empty' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will fail for pre-release testing. |
||
|
||
@pytest.mark.run_on(['rhel']) | ||
def test_cmdline_nvme_io_timeout(self, host): | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you add
ami_name
to the message?