diff --git a/REFERENCE.md b/REFERENCE.md index 96cb6564..dc8c5bf4 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -3186,16 +3186,17 @@ Alias of ```puppet Struct[{ - Optional['What'] => String[1], - Optional['Where'] => Stdlib::Unixpath, - Optional['Type'] => String[1], - Optional['Options'] => String[1], - Optional['SloppyOptions'] => Boolean, - Optional['LazyUnmount'] => Boolean, - Optional['ReadWriteOnly'] => Boolean, - Optional['ForceUnmount'] => Boolean, - Optional['DirectoryMode'] => Stdlib::Filemode, - Optional['TimeoutSec'] => String[0], + Optional['What'] => String[1], + Optional['Where'] => Stdlib::Unixpath, + Optional['Type'] => String[1], + Optional['Options'] => String[1], + Optional['SloppyOptions'] => Boolean, + Optional['LazyUnmount'] => Boolean, + Optional['ReadWriteOnly'] => Boolean, + Optional['ForceUnmount'] => Boolean, + Optional['DirectoryMode'] => Stdlib::Filemode, + Optional['TimeoutSec'] => String[0], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], }] ``` @@ -3504,6 +3505,7 @@ Struct[{ Optional['FileDescriptorName'] => String[1,255], Optional['TriggerLimitIntervalSec'] => String[1], Optional['TriggerLimitBurst'] => Integer[0], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], }] ``` @@ -3518,10 +3520,11 @@ Alias of ```puppet Struct[{ - Optional['What'] => String[1], - Optional['Options'] => String[1], - Optional['Priority'] => Integer, - Optional['TimeoutSec'] => Variant[Integer[0],String[0]] + Optional['What'] => String[1], + Optional['Options'] => String[1], + Optional['Priority'] => Integer, + Optional['TimeoutSec'] => Variant[Integer[0],String[0]], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], }] ``` diff --git a/spec/type_aliases/systemd_unit_mount_spec.rb b/spec/type_aliases/systemd_unit_mount_spec.rb index 76e0437e..01161a0b 100644 --- a/spec/type_aliases/systemd_unit_mount_spec.rb +++ b/spec/type_aliases/systemd_unit_mount_spec.rb @@ -39,4 +39,13 @@ it { is_expected.to allow_value({ assert => true }) } end end + + context 'with a key of OOMScoreAdjust' do + it { + is_expected.to allow_value({ 'OOMScoreAdjust' => 999 }) + is_expected.to allow_value({ 'OOMScoreAdjust' => -999 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => 1005 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => '10' }) + } + end end diff --git a/spec/type_aliases/systemd_unit_socket_spec.rb b/spec/type_aliases/systemd_unit_socket_spec.rb index bd007961..bb4ce183 100644 --- a/spec/type_aliases/systemd_unit_socket_spec.rb +++ b/spec/type_aliases/systemd_unit_socket_spec.rb @@ -17,4 +17,13 @@ it { is_expected.not_to allow_value({ assert => 'mything' }) } end end + + context 'with a key of OOMScoreAdjust' do + it { + is_expected.to allow_value({ 'OOMScoreAdjust' => 999 }) + is_expected.to allow_value({ 'OOMScoreAdjust' => -999 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => 1005 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => '10' }) + } + end end diff --git a/spec/type_aliases/systemd_unit_swap_spec.rb b/spec/type_aliases/systemd_unit_swap_spec.rb index 626d1a52..9d94b91e 100644 --- a/spec/type_aliases/systemd_unit_swap_spec.rb +++ b/spec/type_aliases/systemd_unit_swap_spec.rb @@ -25,4 +25,13 @@ context 'with a key of Where' do it { is_expected.not_to allow_value({ 'Where' => '/mnt/foo' }) } end + + context 'with a key of OOMScoreAdjust' do + it { + is_expected.to allow_value({ 'OOMScoreAdjust' => 999 }) + is_expected.to allow_value({ 'OOMScoreAdjust' => -999 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => 1005 }) + is_expected.not_to allow_value({ 'OOMScoreAdjust' => '10' }) + } + end end diff --git a/types/unit/mount.pp b/types/unit/mount.pp index 5a9cf24c..a0b76c94 100644 --- a/types/unit/mount.pp +++ b/types/unit/mount.pp @@ -3,15 +3,16 @@ # type Systemd::Unit::Mount = Struct[ { - Optional['What'] => String[1], - Optional['Where'] => Stdlib::Unixpath, - Optional['Type'] => String[1], - Optional['Options'] => String[1], - Optional['SloppyOptions'] => Boolean, - Optional['LazyUnmount'] => Boolean, - Optional['ReadWriteOnly'] => Boolean, - Optional['ForceUnmount'] => Boolean, - Optional['DirectoryMode'] => Stdlib::Filemode, - Optional['TimeoutSec'] => String[0], + Optional['What'] => String[1], + Optional['Where'] => Stdlib::Unixpath, + Optional['Type'] => String[1], + Optional['Options'] => String[1], + Optional['SloppyOptions'] => Boolean, + Optional['LazyUnmount'] => Boolean, + Optional['ReadWriteOnly'] => Boolean, + Optional['ForceUnmount'] => Boolean, + Optional['DirectoryMode'] => Stdlib::Filemode, + Optional['TimeoutSec'] => String[0], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], } ] diff --git a/types/unit/socket.pp b/types/unit/socket.pp index 6acab1c8..6152b38b 100644 --- a/types/unit/socket.pp +++ b/types/unit/socket.pp @@ -61,5 +61,6 @@ Optional['FileDescriptorName'] => String[1,255], Optional['TriggerLimitIntervalSec'] => String[1], Optional['TriggerLimitBurst'] => Integer[0], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], } ] diff --git a/types/unit/swap.pp b/types/unit/swap.pp index 03106911..f7860d45 100644 --- a/types/unit/swap.pp +++ b/types/unit/swap.pp @@ -3,9 +3,10 @@ # type Systemd::Unit::Swap = Struct[ { - Optional['What'] => String[1], - Optional['Options'] => String[1], - Optional['Priority'] => Integer, - Optional['TimeoutSec'] => Variant[Integer[0],String[0]] + Optional['What'] => String[1], + Optional['Options'] => String[1], + Optional['Priority'] => Integer, + Optional['TimeoutSec'] => Variant[Integer[0],String[0]], + Optional['OOMScoreAdjust'] => Integer[-1000,1000], } ]