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

fix foreman_rex_cockpit acceptance test #1205

Merged
merged 2 commits into from
Jan 24, 2025
Merged

fix foreman_rex_cockpit acceptance test #1205

merged 2 commits into from
Jan 24, 2025

Conversation

evgeni
Copy link
Member

@evgeni evgeni commented Jan 23, 2025

  1. the family is called redhat, not centos
  2. to apply a manifest, you need to define manifest not pp

@evgeni
Copy link
Member Author

evgeni commented Jan 23, 2025

Problem: The operation would result in removing the following protected packages: grub2-tools-minimal

WTH

@@ -1,11 +1,10 @@
require 'spec_helper_acceptance'

describe 'Scenario: install foreman with rex cockpit', if: os[:family] == 'centos' do
describe 'Scenario: install foreman with rex cockpit', if: os[:family] == 'redhat' do
Copy link
Member

Choose a reason for hiding this comment

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

I thought the os thing was a bit weird because I think it comes from serverspec, which has a different interpretation for family. Maybe we should avoid it in general.

Copy link
Member Author

Choose a reason for hiding this comment

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

it is weird already because it's downcased, yes. no idea where it comes from.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Wait, that's os, not family. https://github.com/mizzy/specinfra/tree/master/lib/specinfra/helper/detect_os is used for the family. https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/redhat.rb tells me that family is redhat, unless it's fedora or amazon.

Guess I just made an assumption given Debian/Ubuntu is different: https://github.com/mizzy/specinfra/blob/master/lib/specinfra/helper/detect_os/debian.rb

@ekohl
Copy link
Member

ekohl commented Jan 23, 2025

Problem: The operation would result in removing the following protected packages: grub2-tools-minimal

Package removals on RPMs are weird. I got the impression it always tried to sort of reverse the transaction instead of recalculating the dependency tree.

1. the family is called `redhat`, not `centos`
2. to apply a manifest, you need to define `manifest` not `pp`
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

This is the problem with running tests selectively: it's so easy to just skip the test altogether.

@ekohl
Copy link
Member

ekohl commented Jan 23, 2025

Any idea why DNF thinks it wants to remove grub2-tools-minimal or have you not had a chance yet to look into it?

grub2-tools-minimal gets installed when we install cockpit, and
uninstalling foreman tries to uninstall grub2-tools-minimal as there are
no more dependencies on it, but that fails as it's a protected package

given this is only a test setup in a container, we don't care about grub
at all and can safely purge it again
@evgeni
Copy link
Member Author

evgeni commented Jan 24, 2025

@evgeni evgeni merged commit 89565c3 into master Jan 24, 2025
13 checks passed
@evgeni evgeni deleted the fix-cockpit-test branch January 24, 2025 08:46
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.

2 participants