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

Add quota checking for VMReconfigure tests. #56

Merged
merged 8 commits into from
May 4, 2017

Conversation

billfitzgerald0120
Copy link
Contributor

@billfitzgerald0120 billfitzgerald0120 commented Feb 17, 2017

Updated tests to include quota checking for VMReconfigure.

https://bugzilla.redhat.com/show_bug.cgi?id=1393552

@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz
Please Review

@billfitzgerald0120 billfitzgerald0120 changed the title [WIP] Add quota checking for VMReconfigure tests. Add quota checking for VMReconfigure tests. Apr 4, 2017
@miq-bot miq-bot removed the wip label Apr 4, 2017
billfitzgerald0120 and others added 2 commits April 12, 2017 16:05
Changed bypass_quota to check_quota.
Added a vendor method.
@billfitzgerald0120
Copy link
Contributor Author

@miq-bot add_label bug, fine/yes

@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz
Please Review

@billfitzgerald0120
Copy link
Contributor Author

modified delete disk to handle 0 bytes
@tinaafitz
Please review

@tinaafitz
Copy link
Member

@billfitzgerald0120 Looks good.
@mkanoor Please review.

end
if args_hash[:resource].options[:disk_remove]
args_hash[:resource].options[:disk_remove].each do |disk|
$evm.log(:info, "Removing disk: #{disk.inspect}")
Copy link
Contributor

@mkanoor mkanoor May 4, 2017

Choose a reason for hiding this comment

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

@billfitzgerald0120
Can we move this line to line 163 and change the message to "Reconfigure Disk Removal #{disk.inspect}"

next unless disk_num
disk_n_number = "disk_#{disk_num[1].succ}_size"
disk_n_size = @vm.send(disk_n_number.to_s)
$evm.log(:info, "Removing disk size: #{disk_n_size.to_s(:human_size)}") if disk_n_size
Copy link
Contributor

Choose a reason for hiding this comment

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

@billfitzgerald0120
can use use next unless disk_n_size and change the log message to
$evm.log(:info, "Disk size: #{disk_n_size.to_s(:human_size)}")

if @reconfigure_request
@check_quota = false # default, unless additional quota is requested
vm_id = @miq_request.options[:src_ids]
@vm = $evm.vmdb(:vm).find_by(:id => vm_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

@billfitzgerald0120
Can we raise an error if the vm is not found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mkanoor
Made requested changes.

@miq-bot
Copy link
Member

miq-bot commented May 4, 2017

Checked commits billfitzgerald0120/manageiq-content@259450b~...4ff65f9 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 0 offenses detected
Everything looks fine. 🍰

@mkanoor mkanoor merged commit 321e043 into ManageIQ:master May 4, 2017
@mkanoor mkanoor added this to the Sprint 60 Ending May 8, 2017 milestone May 4, 2017
simaishi pushed a commit that referenced this pull request Jun 6, 2017
@simaishi
Copy link
Contributor

simaishi commented Jun 6, 2017

Fine backport details:

$ git log -1
commit 901889ea13ed813ec39b851873162460834f9cbd
Author: Madhu Kanoor <mkanoor@redhat.com>
Date:   Thu May 4 17:32:59 2017 -0400

    Merge pull request #56 from billfitzgerald0120/quota_reconfig
    
    Add quota checking for VMReconfigure tests.
    (cherry picked from commit 321e0437581853f1b7667439ca6b25c74de41046)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1459261

@simaishi
Copy link
Contributor

simaishi commented Jun 6, 2017

@billfitzgerald0120 This is causing Travis failure in Fine branch (https://travis-ci.org/ManageIQ/manageiq-content/builds/240035211) Can you please take a look?

NoMethodError:
       undefined method `vmware_reconfigure_model' for #<RSpec::ExampleGroups::QuotaValidation_2::VmReconfigQuotaCalculateRequest:0x00000004f90d90>

@gmcculloug
Copy link
Member

Looks like we also need to back port ManageIQ/manageiq#14756.

@billfitzgerald0120
Copy link
Contributor Author

Yes, This is required.
ManageIQ/manageiq#14756

@simaishi
Copy link
Contributor

simaishi commented Jun 6, 2017

Thanks - backported ManageIQ/manageiq#14756, will re-run Travis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants