mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Accept network interface MAC addresses without colon delimiters
Commonly found in other Vagrant providers, a MAC address format without colon delimiters is now accepted for better cross-compatibility of Vagrantfiles.
This commit is contained in:
@@ -44,8 +44,15 @@ describe VagrantPlugins::ProviderLibvirt::Config do
|
||||
assert_valid
|
||||
end
|
||||
|
||||
it 'is valid with MAC containing no delimiters' do
|
||||
network = [:public, { mac: 'aabbccddeeff' }]
|
||||
expect(vm).to receive(:networks).and_return([network])
|
||||
assert_valid
|
||||
expect(network[1][:mac]).to eql('aa:bb:cc:dd:ee:ff')
|
||||
end
|
||||
|
||||
it 'should be invalid if MAC not formatted correctly' do
|
||||
expect(vm).to receive(:networks).and_return([[:public, { mac: 'aabbccddeeff' }]])
|
||||
expect(vm).to receive(:networks).and_return([[:public, { mac: 'aa/bb/cc/dd/ee/ff' }]])
|
||||
assert_invalid
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user