diff --git a/spec/type_aliases/mountdevice_spec.rb b/spec/type_aliases/mountdevice_spec.rb index 5c1362fc..84d55e78 100644 --- a/spec/type_aliases/mountdevice_spec.rb +++ b/spec/type_aliases/mountdevice_spec.rb @@ -7,7 +7,9 @@ describe 'Swift::MountDevice' do '/dev', '/dev/sda', '/opt/swift/diskfile', - 'LABEL=foo' + 'LABEL=foo', + '50e68500-9920-4ffa-a4cd-34fd2a893530', + 'UUID=50e68500-9920-4ffa-a4cd-34fd2a893530', ].each do |value| it { is_expected.to allow_value(value) } end @@ -24,7 +26,13 @@ describe 'Swift::MountDevice' do 'dev', 'dev/sda', 'LABEL=', - 'LABELfoo' + 'LABELfoo', + '50e6850099204ffaa4cd34fd2a893530', + '50e68500-9920-3ffa-a4cd-34fd2a893530', + 'UUID=', + 'UUID=foo', + 'UUID=50e6850099204ffaa4cd34fd2a893530', + 'UUID=50e68500-9920-3ffa-a4cd-34fd2a893530', ].each do |value| it { is_expected.not_to allow_value(value) } end diff --git a/types/mountdevice.pp b/types/mountdevice.pp index 41642d6d..67ac4575 100644 --- a/types/mountdevice.pp +++ b/types/mountdevice.pp @@ -1,4 +1,6 @@ type Swift::MountDevice = Variant[ Stdlib::Absolutepath, - Pattern[/^LABEL=.+$/] + Pattern[/^LABEL=.+$/], + Pattern[/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/], + Pattern[/^UUID=[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/], ]