Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3436,7 +3436,7 @@ Struct[{
'Match' => Optional[Systemd::Interface::Netdev::Match],
'NetDev' => Optional[Systemd::Interface::Netdev::Netdev],
'Bridge' => Optional[Systemd::Interface::Netdev::Bridge],
'Vlan' => Optional[Systemd::Interface::Netdev::Vlan],
'VLAN' => Optional[Systemd::Interface::Netdev::Vlan],
'MACVLAN' => Optional[Systemd::Interface::Netdev::Macvlan],
'MACVTAP' => Optional[Systemd::Interface::Netdev::Macvlan],
'IPVLAN' => Optional[Systemd::Interface::Netdev::Ipvlan],
Expand Down Expand Up @@ -3524,7 +3524,7 @@ Struct[{
]],
'TransmitHashPolicy' => Optional[Enum['layer2', 'layer3+4', 'layer2+3', 'encap2+3', 'encap3+4']],
'LACPTransmitRate' => Optional[Enum['slow','fast']],
'MIIMonitorSec' => Optional[Integer],
'MIIMonitorSec' => Optional[Numeric],
'PeerNotifyDelaySec' => Optional[Integer[0,300]],
'UpDelaySec' => Optional[Integer[0]],
'DownDelaySec' => Optional[Integer[0]],
Expand Down
36 changes: 36 additions & 0 deletions spec/type_aliases/interface/netdev/bond_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'Systemd::Interface::Netdev::Bond' do
describe 'valid types' do
context 'with valid types' do
[
{},
{ 'MIIMonitorSec' => 42 },
{ 'MIIMonitorSec' => 0.42 },
].each do |value|
describe value.inspect do
it { is_expected.to allow_value(value) }
end
end
end
end

describe 'invalid types' do
context 'with garbage inputs' do
[
true,
false,
:keyword,
nil,
{ 'foo' => 'bar' },
'42',
].each do |value|
describe value.inspect do
it { is_expected.not_to allow_value(value) }
end
end
end
end
end
1 change: 1 addition & 0 deletions spec/type_aliases/interface/netdev_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
context 'with valid types' do
[
{},
{ 'VLAN' => { 'Id' => 42 } },
].each do |value|
describe value.inspect do
it { is_expected.to allow_value(value) }
Expand Down
2 changes: 1 addition & 1 deletion types/interface/netdev.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'Match' => Optional[Systemd::Interface::Netdev::Match],
'NetDev' => Optional[Systemd::Interface::Netdev::Netdev],
'Bridge' => Optional[Systemd::Interface::Netdev::Bridge],
'Vlan' => Optional[Systemd::Interface::Netdev::Vlan],
'VLAN' => Optional[Systemd::Interface::Netdev::Vlan],
Copy link
Member

Choose a reason for hiding this comment

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

stupid question: Is this a breaking change? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well good question (I asked it myself too ;).
I decided no, since setting Vlan does not end in a working setup. And if you still have Vlan set, puppet run fails, but does not make any wrong configuration.

'MACVLAN' => Optional[Systemd::Interface::Netdev::Macvlan],
'MACVTAP' => Optional[Systemd::Interface::Netdev::Macvlan],
'IPVLAN' => Optional[Systemd::Interface::Netdev::Ipvlan],
Expand Down
2 changes: 1 addition & 1 deletion types/interface/netdev/bond.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
]],
'TransmitHashPolicy' => Optional[Enum['layer2', 'layer3+4', 'layer2+3', 'encap2+3', 'encap3+4']],
'LACPTransmitRate' => Optional[Enum['slow','fast']],
'MIIMonitorSec' => Optional[Integer],
'MIIMonitorSec' => Optional[Numeric],
'PeerNotifyDelaySec' => Optional[Integer[0,300]],
'UpDelaySec' => Optional[Integer[0]],
'DownDelaySec' => Optional[Integer[0]],
Expand Down
Loading