Skip to content

Issue 2774: Changed the implementation of isVolumeOnManagedStorage(VolumeInfo) to…#2776

Merged
mike-tutkowski merged 1 commit into
apache:4.11from
mike-tutkowski:vol-on-managed-storage
Aug 10, 2018
Merged

Issue 2774: Changed the implementation of isVolumeOnManagedStorage(VolumeInfo) to…#2776
mike-tutkowski merged 1 commit into
apache:4.11from
mike-tutkowski:vol-on-managed-storage

Conversation

@mike-tutkowski
Copy link
Copy Markdown
Member

… check if the data store in question is for primary storage

Description

In the StorageSystemDataMotionStrategy.isVolumeOnManagedStorage(VolumeInfo) method, we should have been checking if the DataStore associated with the VolumeInfo was on primary storage before checking if it is managed storage.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

GitHub Issue/PRs

Fixes: #2774

How Has This Been Tested?

Regression testing

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
    Testing
  • I have added tests to cover my changes.
  • All relevant new and existing integration tests have passed.
  • A full integration testsuite with all test that can run on my environment has passed.

@@ -196,10 +196,16 @@ public StrategyPriority canHandle(DataObject srcData, DataObject destData) {
}

private boolean isVolumeOnManagedStorage(VolumeInfo volumeInfo) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about a unit test here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@DaanHoogland is planning on writing a unit test for the higher-level canHandle method (to add to this PR).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes, I am. I am struggling with the large number of injects but I think the canHandle() should be tested indeed, as the error was because the strategy returned a wrong priority from that call.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That is why we should unit test methods instead. We need to reduce the test code. Otherwise it becomes almost impossible to maintain them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sorry, I'm missing your point

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mike-tutkowski are you going to add some unit test(s)? this is ready for merging otherwise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@rhtyd I believe @rafaelweingartner noted (perhaps on the mailing list) that he would like to add one unit test to this PR before it is merged. Thanks

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also, I think @DaanHoogland was planning on adding a unit test, as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mike-tutkowski Daan has already sent a PR to add unit test to your branch, can you merge that. See mike-tutkowski#6

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@mike-tutkowski the PR I said I wanted to create some unit tests is not this one, it is the other one I worked.

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2212

@borisstoyanov
Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@borisstoyanov a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-2893)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33622 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2776-t2893-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_public_ip_range.py
Intermitten failure detected: /marvin/tests/smoke/test_templates.py
Intermitten failure detected: /marvin/tests/smoke/test_usage.py
Intermitten failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Intermitten failure detected: /marvin/tests/smoke/test_volumes.py
Intermitten failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 60 look OK, 7 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
ContextSuite context=TestDeployVirtioSCSIVM>:setup Error 0.00 test_deploy_virtio_scsi_vm.py
test_03_vpc_privategw_restart_vpc_cleanup Failure 1104.89 test_privategw_acl.py
test_04_extract_template Failure 128.28 test_templates.py
ContextSuite context=TestISOUsage>:setup Error 0.00 test_usage.py
test_01_secure_vm_migration Error 132.72 test_vm_life_cycle.py
test_02_unsecure_vm_migration Error 132.74 test_vm_life_cycle.py
test_03_secured_to_nonsecured_vm_migration Error 133.75 test_vm_life_cycle.py
test_04_nonsecured_to_secured_vm_migration Error 133.75 test_vm_life_cycle.py
test_08_migrate_vm Error 17.69 test_vm_life_cycle.py
test_06_download_detached_volume Failure 137.48 test_volumes.py
test_hostha_enable_ha_when_host_in_maintenance Error 3.46 test_hostha_kvm.py

Copy link
Copy Markdown
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, failed tests are already addressed in separate PRs.

@yadvr yadvr added this to the 4.11.2.0 milestone Aug 7, 2018
@mike-tutkowski
Copy link
Copy Markdown
Member Author

mike-tutkowski commented Aug 9, 2018 via email

@mike-tutkowski mike-tutkowski force-pushed the vol-on-managed-storage branch 3 times, most recently from d937cbf to 0378f84 Compare August 10, 2018 17:05
… check if the data store in question is for primary storage (and added a unit test from Daan Hoogland)
@mike-tutkowski mike-tutkowski force-pushed the vol-on-managed-storage branch from 0378f84 to ab83c19 Compare August 10, 2018 17:24
@mike-tutkowski
Copy link
Copy Markdown
Member Author

Two LGTMs and tests look good. Merging this into 4.11.

@mike-tutkowski mike-tutkowski merged commit e4ec123 into apache:4.11 Aug 10, 2018
@mike-tutkowski
Copy link
Copy Markdown
Member Author

@DaanHoogland Do you know what process I should follow to merge this forward into master? Thanks

@DaanHoogland
Copy link
Copy Markdown
Contributor

there is a tool in tools/git called git-fwd-merge (i think). You should use that to merge 4.11 on master and than push it to origin. Make sure you have pulled both branches first, @mike-tutkowski ;)

@mike-tutkowski mike-tutkowski deleted the vol-on-managed-storage branch August 12, 2018 05:38
@mike-tutkowski
Copy link
Copy Markdown
Member Author

@DaanHoogland I performed the merge to master from 4.11. Can you take a look at 46c56ea and double check that I did it properly? Thanks!

@mike-tutkowski
Copy link
Copy Markdown
Member Author

@DaanHoogland Just looking at how a couple other 4.11-to-4.12 merges were handled, it looks like I did the right thing with my merge.

@DaanHoogland
Copy link
Copy Markdown
Contributor

ok, ignoring then ... ;)

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.

6 participants