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

Improve validation AWS packages #5790

Merged
merged 1 commit into from Sep 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 14 additions & 25 deletions tests/console/validate_packages_and_patterns.pm
Expand Up @@ -35,35 +35,20 @@ if (check_var('VALIDATE_PCM_PATTERN', 'azure')) {
};
}
elsif (check_var('VALIDATE_PCM_PATTERN', 'aws')) {
# We have different pattern names on SLE 15 and SLE 12
my $aws_pattern = is_sle('15+') ? 'Amazon_Web_Services' : 'Amazon-Web-Services';
my @aws_pattern_packages = qw(
aws-cli cloud-init
cloud-regionsrv-client
docker-img-store-setup growpart supportutils-plugin-suse-public-cloud
regionServiceClientConfigEC2 s3fs
);
if (is_sle('15+')) {
push @aws_pattern_packages, qw(
cloud-regionsrv-client-plugin-ec2
patterns-public-cloud-15-Amazon-Web-Services
python3-ec2deprecateimg python3-ec2metadata python3-ec2publishimg
python3-ec2uploadimg python3-s3transfer python3-susepubliccloudinfo
);
}
else {
push @aws_pattern_packages, qw(
patterns-public-cloud-Amazon-Web-Services
python-ec2deprecateimg python-ec2metadata python-ec2publishimg
python-ec2uploadimg python-s3transfer python-susepubliccloudinfo
);
}
$software{$aws_pattern} = {
# Different pattern and packages names on SLE 15 and SLE 12
my %aws_specific = is_sle('15+') ? (name => 'Amazon_Web_Services', sle_version => '15-', py_version => 'python3') :
(name => 'Amazon-Web-Services', py_version => 'python');
$software{%aws_specific{name}} = {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not valid perl - I wonder how you validated this, but your validation run is unreachable

Copy link
Member

Choose a reason for hiding this comment

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

I assume you came to this PR due to broken tests? Feel free to revert the change in a revert PR and ping the author to bring back the changes properly

Copy link
Contributor

Choose a reason for hiding this comment

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

5794 - @jknphy already has email from @msmeissn

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback and the revert and sorry for the inconvenience.
I can see in the logs of the validations both errors, but they didn't produce a failed job on my local machine neither detected by Travis. Is there something in my configuration that I should tweak to avoid this in the future?
New PR: #5795

Copy link
Contributor

Choose a reason for hiding this comment

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

It's very possible that the old sle12 perl is different - why travis didn't catch it, I don't know

repo => 'Module-Public-Cloud',
installed => 1,
condition => sub { check_var_array('PATTERNS', 'aws') },
pattern => 1,
packages => \@aws_pattern_packages,
packages => ['aws-cli', 'cloud-init', 'cloud-regionsrv-client', 'cloud-regionsrv-client-plugin-ec2',
'docker-img-store-setup', 'growpart', 'patterns-public-cloud-' . $aws_specific{sle_version} . 'Amazon-Web-Services',
$aws_specific{py_version} . '-ec2deprecateimg', $aws_specific{py_version} . '-ec2metadata',
Copy link
Member

Choose a reason for hiding this comment

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

I was also concerned how strict we should be with packages names, so that it's not pain to maintain. So, let's try it put and see if it worth it, or we can be less strict with search.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree, it is a refactor to avoid so many lines of code and conditions, but if it is painful to maintain we can do it in different way in the future.

$aws_specific{py_version} . '-ec2publishimg', $aws_specific{py_version} . '-ec2uploadimg',
$aws_specific{py_version} . '-s3transfer', $aws_specific{py_version} . '-susepubliccloudinfo',
'regionServiceClientConfigEC2', 's3fs', 'supportutils-plugin-suse-public-cloud'],
};
} else {
$software{salt} = {
Expand Down Expand Up @@ -117,6 +102,10 @@ sub verify_pattern {

for my $package (@{$software{$name}->{packages}}) {
if ($pattern_info !~ /$package/) {
if ($package eq 'cloud-regionsrv-client-plugin-ec2') {
record_soft_failure 'bsc#1108267 -- Differences in the content of pattern Amazon Web Service between SLE12SP4 and SLE15.1';
next;
}
$errors .= "Package '$package' is not listed in the pattern '$name'\n";
}
}
Expand Down