Project

General

Profile

« Previous | Next » 

Revision 5e74b082

Added by Ivan Necas about 8 years ago

Fixes #6959 - set operating system for RHEV/ovirt VMs

Backward compatible, but works best with https://github.com/abenari/rbovirt/pull/104

View differences:

test/unit/compute_resource_test.rb
assert(cr.valid?, 'ComputeResource can have spaces in name')
end
end
describe "host_interfaces_attrs" do
before do
@cr = compute_resources(:mycompute)
end
test "only physical interfaces are added to the compute attributes" do
physical_nic = FactoryGirl.build(:nic_base, :virtual => false,
:compute_attributes => { :id => '1', :virtual => false })
virtual_nic = FactoryGirl.build(:nic_base, :virtual => true,
:compute_attributes => { :id => '2', :virtual => true })
host = FactoryGirl.build(:host, :interfaces => [physical_nic, virtual_nic])
nic_attributes = @cr.host_interfaces_attrs(host).values.select(&:present?)
assert_equal '1', nic_attributes.first[:id]
end
end
end

Also available in: Unified diff