Skip to content

Commit

Permalink
Fixes #38017 - Update libvirt gems & fix tests
Browse files Browse the repository at this point in the history
Gems:
* Use fog-libvirt 0.13.0
* Use ruby-libvirt 0.8.3

Tests:
* Use "test:///default" for testing
* Fix failing tests
  • Loading branch information
stejskalleos committed Nov 21, 2024
1 parent a525369 commit af99a5c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bundler.d/libvirt.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group :libvirt do
gem 'fog-libvirt', '>= 0.12.0'
gem 'fog-libvirt', '>= 0.13.1'
gem 'ruby-libvirt', '~> 0.5', :require => 'libvirt'
end
3 changes: 0 additions & 3 deletions test/controllers/hosts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,6 @@ def test_submit_multiple_rebuild_config_pessimistic
context 'Fog.mock!' do
setup do
Fog.mock!
Foreman::Model::Libvirt.any_instance.stubs(:hypervisor).returns(stub(:hypervisor))
Foreman::Model::Libvirt.any_instance.expects(:max_cpu_count).returns(10)
Foreman::Model::Libvirt.any_instance.expects(:max_memory).returns(10000000000)
end

teardown { Fog.unmock! }
Expand Down
6 changes: 3 additions & 3 deletions test/unit/compute_resource_host_importer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ class ComputeResourceHostImporterTest < ActiveSupport::TestCase

context 'on libvirt' do
let(:compute_resource) { FactoryBot.build(:libvirt_cr) }
let(:uuid) { 'fog-449765558356062' }
let(:uuid) { '6695eb01-f6a4-8304-79aa-97f2502e193f' }

test 'imports the VM with all parameters' do
assert_equal 'fog-dom1', host.name
assert_equal 'dom.uuid', host.uuid
assert_equal 'test', host.name
assert_equal uuid, host.uuid
assert_nil host.domain
assert_equal 'aa:bb:cc:dd:ee:ff', host.mac
assert_empty host.primary_interface.compute_attributes
Expand Down

0 comments on commit af99a5c

Please sign in to comment.