Bug 1342180

Summary: Quota enforcement for user as quota source does not work
Product: Red Hat CloudForms Management Engine Reporter: Aziza Karol <akarol>
Component: AutomateAssignee: William Fitzgerald <wfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Milan Falešník <mfalesni>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: jhardy, jprause, mfalesni, mkanoor, obarenbo, simaishi, tfitzger, wfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: quota
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1353240 (view as bug list) Environment:
Last Closed: 2017-01-11 20:10:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353240    

Description Aziza Karol 2016-06-02 15:49:28 UTC
Description of problem:


Version-Release number of selected component (if applicable):
5.6.0.8

How reproducible:
100%

Steps to Reproduce:
using the automate explorer:
1) Copy the /System/CommonMethods/QuotaMethods/quota_source method to a writable enabled domain.

quota_source method.
#
# Description: Get quota source.
#

@miq_request = $evm.root['miq_request']
$evm.root['quota_source_type'] = $evm.parent['quota_source_type'] || $evm.object['quota_source_type']

if $evm.root['quota_source_type'].casecmp('group').zero?
  $evm.root['quota_source'] = @miq_request.requester.current_group
else
  $evm.root['quota_source'] = @miq_request.tenant
  $evm.root['quota_source_type'] = 'user'
end

2) Edit the copied quota_source method:
  a.set the quota_source_type to group.
3) Validate and save method.
4) Copy the /System/CommonMethods/QuotaStateMachine/Quota instance to a writable enabled domain.
5) Modify the copied Quota instance to set desired quota test values. for ex: set the quota for cpu only or you can also set it by tagging.
6) Run test(Provision service and/or VMs).

Actual results:
Quota enforcement for user as quota source does not work

Expected results:
Quota enforcement for user as quota source should work

Additional info:

Comment 3 CFME Bot 2016-06-14 21:50:58 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b086426c1b1dbf0cf6cc0fa3db574bf6b7ac4cae

commit b086426c1b1dbf0cf6cc0fa3db574bf6b7ac4cae
Author:     william fitzgerald <wfitzger>
AuthorDate: Tue Jun 14 11:48:54 2016 -0400
Commit:     william fitzgerald <wfitzger>
CommitDate: Tue Jun 14 15:37:18 2016 -0400

    Automate - Quota enforcement for user fix
    
    Modified Log message to display quota source.
    
    Added new spec test for user quota.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1342180
    
    Modified log message to include 'source'.

 .../System/CommonMethods/QuotaMethods.class/__methods__/limits.rb  | 2 +-
 .../CommonMethods/QuotaMethods.class/__methods__/quota_source.rb   | 5 ++++-
 spec/automation/unit/method_validation/quota_source_spec.rb        | 7 +++++++
 3 files changed, 12 insertions(+), 2 deletions(-)

Comment 6 Milan Falešník 2016-10-03 12:10:36 UTC
Verified in 5.7.0.3

When copying and modifying /System/CommonMethods/QuotaStateMachine/quota to user the user as the quota source and when the user is tagged, the quotas are in effect.