GitHub user wilderrodrigues opened a pull request: https://github.com/apache/cloudstack/pull/137
Refactor/citrix resource base rebase Hi Rohit (@bhaisaab) It's a huge piece of work, but it has been extensively tested. Could you please have a look? :) Thanks in advance. Cheers, Wilder XenServer 6.2 running under our VMWare zone CloudStack Management Server running on MacBook Pro MySql running on MackBook Pro Storage Type: Local Storage +87 new unit tests Tests: Test Create Account and user for that account ... === TestName: test_01_create_account | Status : SUCCESS === ok Test Sub domain allowed to launch VM when a Domain level zone is created ... === TestName: test_01_add_vm_to_subdomain | Status : SUCCESS === ok Test delete domain without force option ... === TestName: test_DeleteDomain | Status : SUCCESS === ok Test delete domain with force option ... === TestName: test_forceDeleteDomain | Status : SUCCESS === ok Test update admin details ... === TestName: test_updateAdminDetails | Status : SUCCESS === ok Test update domain admin details ... === TestName: test_updateDomainAdminDetails | Status : SUCCESS === ok Test user update API ... === TestName: test_updateUserDetails | Status : SUCCESS === ok Test login API with domain ... === TestName: test_LoginApiDomain | Status : SUCCESS === ok Test if Login API does not return UUID's ... === TestName: test_LoginApiUuidResponse | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 9 tests in 1330.562s OK /tmp//MarvinLogs/test_accounts_K2LZXD/results.txt (END) Test advanced zone virtual router ... === TestName: test_advZoneVirtualRouter | Status : SUCCESS === ok Test Deploy Virtual Machine ... === TestName: test_deploy_vm | Status : SUCCESS === ok Test Multiple Deploy Virtual Machine ... === TestName: test_deploy_vm_multiple | Status : SUCCESS === ok Test Stop Virtual Machine ... === TestName: test_01_stop_vm | Status : SUCCESS === ok Test Start Virtual Machine ... === TestName: test_02_start_vm | Status : SUCCESS === ok Test Reboot Virtual Machine ... === TestName: test_03_reboot_vm | Status : SUCCESS === ok Test destroy Virtual Machine ... === TestName: test_06_destroy_vm | Status : SUCCESS === ok Test recover Virtual Machine ... === TestName: test_07_restore_vm | Status : SUCCESS === ok Test migrate VM ... SKIP: At least two hosts should be present in the zone for migration Test destroy(expunge) Virtual Machine ... === TestName: test_09_expunge_vm | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 10 tests in 917.300s OK (SKIP=1) /tmp//MarvinLogs/test_vm_life_cycle_HWY7MI/results.txt (END) Test router internal advanced zone ... SKIP: Marvin configuration has no host credentials to check router services Test restart network ... === TestName: test_03_restart_network_cleanup | Status : SUCCESS === ok Test router basic setup ... === TestName: test_05_router_basic | Status : SUCCESS === ok Test router advanced setup ... === TestName: test_06_router_advanced | Status : SUCCESS === ok Test stop router ... === TestName: test_07_stop_router | Status : SUCCESS === ok Test start router ... === TestName: test_08_start_router | Status : SUCCESS === ok Test reboot router ... === TestName: test_09_reboot_router | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 7 tests in 438.857s OK (SKIP=1) /tmp//MarvinLogs/test_routers_15MIHW/results.txt (END) Test start/stop of router after addition of one guest network ... === TestName: test_01_start_stop_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test reboot of router after addition of one guest network ... === TestName: test_02_reboot_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS === ok Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS === ok Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS === ok Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 8 tests in 865.659s OK /tmp//MarvinLogs/test_vpc_routers_GROPM6/results.txt (END) Test to create service offering ... === TestName: test_01_create_service_offering | Status : SUCCESS === ok Test to update existing service offering ... === TestName: test_02_edit_service_offering | Status : SUCCESS === ok Test to delete service offering ... === TestName: test_03_delete_service_offering | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 3 tests in 207.636s OK /tmp//MarvinLogs/test_service_offerings_G3ZEPN/results.txt (END) Test reset virtual machine on reboot ... === TestName: test_01_reset_vm_on_reboot | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 1 test in 232.684s OK /tmp//MarvinLogs/test_reset_vm_on_reboot_9Z28F9/results.txt (END) Test to change service offering of router after addition of one guest network ... === TestName: test_04_chg_srv_off_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test destroy of router after addition of one guest network ... === TestName: test_05_destroy_router_after_addition_of_one_guest_network | Status : SUCCESS === ok Test to stop and start router after creation of VPC ... === TestName: test_01_stop_start_router_after_creating_vpc | Status : SUCCESS === ok Test to reboot the router after creating a VPC ... === TestName: test_02_reboot_router_after_creating_vpc | Status : SUCCESS === ok Tests to change service offering of the Router after ... === TestName: test_04_change_service_offerring_vpc | Status : SUCCESS === ok Test to destroy the router after creating a VPC ... === TestName: test_05_destroy_router_after_creating_vpc | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 6 tests in 679.926s OK /tmp//MarvinLogs/test_redundant_vpc_YB13WE/results.txt (END) test_privategw_acl (integration.acs.tests.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_privategw_acl | Status : SUCCESS === ok ---------------------------------------------------------------------- Ran 1 test in 95.522s OK /tmp//MarvinLogs/test_privategw_acl_61FTL8/results.txt (END) You can merge this pull request into a Git repository by running: $ git pull https://github.com/schubergphilis/cloudstack refactor/citrix_resource_base-REBASE Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cloudstack/pull/137.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #137 ---- commit a1e87782116671521f73a23bb36fd788345366cb Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-19T14:37:08Z First piece of the refactor of the CitrisResourceBase - The same pattern will be used by the other subclasses of the ServerResource interface. commit 4256418af9e1c3f5b97c6fe77968f31c0693ce15 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-20T09:14:04Z Adding CitrixCreateCommandWrapper.java and basic unit tests commit c3ae8c793b8092cf092d66c01ba672a277714ba8 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-20T10:17:46Z Adding the refactor of CitrixCheckConsoleProxyLoadCommandWrapper.java and CitrixWatchConsoleProxyLoadCommandWrapper.java - plus basic tests commit 30e72e4a156a224f109f67b277e1e439bdcc9158 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-20T12:51:46Z Refactoring the whole XsHost thing Refactor the ReadyCommand Fixing the old test Adding basic tests for ReadyCommandWrapper commit 0e51379da72257e34fd24ae8d46df64981458347 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T09:16:16Z Refactoring the GetHostStatsCommand - Added basic tests - Added test for when the key (Command) does not exist in the Map commit 8f04108e23dffc3f7930bdbe111eb11f2653b453 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T09:52:31Z Refactoring the GetVmStatsCommand - Added basic tests commit c7830efef5d168adf37e64da639908f4186a01c2 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T10:05:43Z Refactor the CheckHealthCommand and GetVmDiskStatsCommand classes in CitrixResourceBase - Added basic tests for both wrappers commit 6b80c79986cf5012ea951bb88040a747dd8f2556 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T10:15:37Z Refactoring the StopCommand on CitrixResourceBase to cope with new design - Added basic tests commit 9e41b8051e4a0f41e8867b2b311cf7762cf66ad8 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T10:20:53Z Renaming files - Forgot to add "Citrix" before the new command wrappers commit f2fab5c8c367c73463320375a56d55abbe0c4a61 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T10:39:29Z Refactoring the CitrixRebootCommand in order to have the new design applied - Added basic tests - Changed the way RebootCommand gets called from RebootRouterCommand - Made a couple of methods public in the CitrixResourceBase and its subclasses commit cb07b0ba08d36d0cb76f07215e3b06b02201bd60 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T10:54:21Z Refactoring the CitrixCheckVirtualMachineCommand toc ope with new design - Added basic tests - Added tests for RebootRouterCommand - Removed the code from CitrixResourceBase that has already been refactored commit a70d80dfd690b6cda2dde0eff163da31f55c24ee Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T12:51:48Z Refactoring PrepareForMigrationCommand and MigrateCommand in order to cope with the new design - Basic tests added commit a06958f46927cc5e1555f45d0678977b37c9261e Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T13:31:19Z Refactoring DestroyCommand and CreateStoragePoolCommand wrappers to cope with the new design - Basic tests added s Please enter the commit message for your changes. Lines starting commit 6c775951c7d749877605474b1ba2c43d14464f7d Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T13:51:20Z Refactoring DeleteStoragePoolCommand, ModifyStoragePoolCommand and ResizeVolumeCommand to cope with new design - Basic tests added. commit ea374b6a2ffba8c5ea2222cf1cffce10dbbdff92 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T14:26:03Z Refactoring AttachIsoCommand, AttachVolumeCommand and UpgradeSnapshotCommand to cope with new design - Basic tests added commit 11d0336803048b156731da15239147e7f6b4d03a Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-24T17:04:39Z Refactoring GetStorageStatsCommand and PrimaryStorageDownloadCommand to cope with the new design Fix the NPE in the constructor that was never used - Basic tests added for all changes commit 637a56c3c1f8a33bdbb2344824e4df0ed9dee786 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-25T18:16:02Z Refactoring GetVncPortCommand, MaintainCommand and SetupCommand to cope with new design. - Basic test added, but could not mock all the static stuff so the test is not complete yet. Will look further into it. commit 3a70912b7cd246a698553d1943218b2ed17e1c4a Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-25T18:20:04Z Make methods in subclasses public. Remove the if-commands that I have already refactored. commit 18470a48d0db69e4bd97d22c023f7a5ae3bcbd97 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-26T10:10:35Z Refactoring PingTestCommand to cope with new design - Basic tests added commit 74faf73408f805af7ac64a081c711f1ceac0a144 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-26T14:56:18Z Refactoring CheckOnHostCommand, ModifySshKeysCommand, OvsSetTagAndFlowCommand and StartCommand to cope with new design - Unit tests added commit 30b770aeab9c1efeaf84c4f5274ab2cb044a896c Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-26T15:52:00Z Refactoring CheckSshCommand, OvsFetchInterfaceCommand and SecurityGroupRulesCommand to cope with new design. - Unit Tests added commit 751c14b929c1f9a7e703f2a1fa0d46ca0ca8fe6f Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-30T13:18:46Z Refactoring CleanupNetworkRulesCmd, OvsCreateGreTunnelCommand, OvsDeleteFlowCommand, OvsVpcPhysicalTopologyConfigCommand and OvsVpcRoutingPolicyConfigCommand in order to cope with the new design. - Meny new unit tests added that cover more than the basics! commit fbcae54a5b21cdf5c77dc3676415112ecb3b25cd Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-30T14:05:42Z Refactoring NetworkRulesSystemVmCommand, OvsCreateTunnelCommand, OvsDestroyBridgeCommand, OvsDestroyTunnelCommand, OvsSetupBridgeCommand in order to cope with new design. - Meny unit ests added. commit 24bbfbc1e6608aff56b66a6678a8a876842945eb Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-30T15:31:09Z Refactoring other 8 command wrapper in order to cope with the new design - Advanced unit tests added for half of the commands - Basic unit tests added for the other half commit 02571728c61e64399bea77af3d6ac2d6d87d0404 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-30T17:01:46Z Refactored the remaining commands - Unit tests added In the executeRequest I needed to keep the following: // We need this one because the StorageSubSystemCommand is from another hierarchy. if (cmd instanceof StorageSubSystemCommand) { return storageHandler.handleStorageCommands((StorageSubSystemCommand) cmd); } commit 4600eef87c435598e5d3f1fbe2910d58803c0029 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-30T22:27:06Z Removing all private/protected/public execute() methods from CitrixResourceBase class Started the refactor of the XenServer56Resource class - Unit test added Changing the CitrixRequestWrapper in order to cope with multiple resources classes and commands Still have to remove few methods form CitrixResourceBase commit f3842c81f8ae35b21131abe8d88c8cbc3b201b1c Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-31T05:44:39Z Refactoring XenServer56 and 56FP1 Resources in order to cope with new FenceCommandWrapper - Unit tests added Also removed an unit test that was doing nothing. commit 3ad30a01a85c69cc0a983468b6c12d036fe9d725 Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-31T07:10:40Z Refactoring XenServer56NetworkUsageCommandWrapper in order to cope with the new design - Unit tests added CitrixResourceBase, XenServer56Resource and XenServer56FP1Resource are now done. i commit d93935caacb46dae183d21a260a112d43cf88caf Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-31T07:26:58Z We don't need the Start, Stop, Reboot command in the CitrixRebaseClaas anymore. commit 57d0931b4950d202994d1b6609329502a60a9edf Author: wilderrodrigues <wrodrig...@schubergphilis.com> Date: 2015-03-31T14:49:48Z Adding more tests to cover other possibilities concerning different versions of the XenServer Adding a better algorithm in order to corver deeper inheritance form the command classes Removing some unsued variables. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---