Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure P quota is allowed with type parameters #31

Merged
merged 1 commit into from Mar 30, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/puppet/type/gpfs_fileset_quota.rb
Expand Up @@ -61,8 +61,8 @@
desc 'blockSoftLimit of quota'

validate do |value|
unless value =~ %r{^0$|^([0-9.]+)(M|G|T)$}
raise ArgumentError, "Invalid block_soft_limit: #{value}, must be in format of [0-9]+(M|G|T)"
unless value =~ %r{^0$|^([0-9.]+)(M|G|T|P)$}
raise ArgumentError, "Invalid block_soft_limit: #{value}, must be in format of [0-9]+(M|G|T|P)"
end
end
end
Expand All @@ -71,8 +71,8 @@
desc 'blockHardLimit of quota'

validate do |value|
unless value =~ %r{^0$|^([0-9.]+)(M|G|T)$}
raise ArgumentError, "Invalid block_hard_limit: #{value}, must be in format of [0-9]+(M|G|T)"
unless value =~ %r{^0$|^([0-9.]+)(M|G|T|P)$}
raise ArgumentError, "Invalid block_hard_limit: #{value}, must be in format of [0-9]+(M|G|T|P)"
end
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/puppet/type/gpfs_fileset_quota_spec.rb
Expand Up @@ -75,6 +75,11 @@
expect(quota[:block_soft_limit]).to eq('1.8T')
end

it 'accepts block_soft_limit 1.8P' do
quota[:block_soft_limit] = '1.8P'
expect(quota[:block_soft_limit]).to eq('1.8P')
end

it 'accepts block_soft_limit 0' do
quota[:block_soft_limit] = '0'
expect(quota[:block_soft_limit]).to eq('0')
Expand All @@ -96,6 +101,11 @@
expect(quota[:block_hard_limit]).to eq('1.8T')
end

it 'accepts block_hard_limit 1.8P' do
quota[:block_hard_limit] = '1.8P'
expect(quota[:block_hard_limit]).to eq('1.8P')
end

it 'accepts block_hard_limit 0' do
quota[:block_hard_limit] = '0'
expect(quota[:block_hard_limit]).to eq('0')
Expand Down