Revision 35241dd6
Added by Marek Hulán over 8 years ago
test/unit/nic_test.rb | ||
---|---|---|
test "Mac address uniqueness validation is skipped for virtual NICs and unmanaged hosts" do
|
||
host = FactoryGirl.create(:host, :managed)
|
||
Nic::Base.create! :mac => "cabbccddeeff", :host => host # physical
|
||
host.reload
|
||
virtual = Nic::Base.new :mac => "cabbccddeeff", :host => host, :virtual => true
|
||
assert virtual.valid?
|
||
assert virtual.save
|
||
... | ... | |
context 'BMC' do
|
||
setup do
|
||
disable_orchestration
|
||
@subnet = FactoryGirl.create(:subnet, :dhcp)
|
||
@subnet = FactoryGirl.create(:subnet, :dhcp, :ipam => Subnet::IPAM_MODES[:db])
|
||
@domain = FactoryGirl.create(:domain)
|
||
@interface = FactoryGirl.create(:nic_bmc, :ip => @subnet.unused_ip,
|
||
:host => FactoryGirl.create(:host),
|
Also available in: Unified diff
Fixes #11034 - custom uniqueness validations for interface attributes