85 Commits

Author SHA1 Message Date
Daan Hoogland
5a134a6fe6 unit test for interface patterns in libvirt compute resource 2015-10-24 00:57:01 +02:00
Mike Tutkowski
c5a0d5e01c Support live migration on older version of Libvirt 2015-08-31 22:06:51 -06:00
Koushik Das
e1db6efc74 Removed unused agent command AttachVolumeCommand and corresponding answer AttachVolumeAnswer 2015-08-26 09:50:23 +05:30
Rohit Yadav
869a83f8f8 plugins: fix test case, interface usage and checkstyle import issue
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 12:23:50 +05:30
Daan Hoogland
10853bfa8a adhere to naming conventions for enums
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-14 11:50:39 +02:00
wilderrodrigues
e348e76eee CLOUDSTACK-8607 - Improving unit tests
- Adding more unit tests as suggested by Daan and Rajani.
   - Mocking SshHelper and the Script classes, used by Citrix and Libvirt resources respectively.
2015-07-06 14:58:17 +02:00
wilderrodrigues
47c7a1083f CLOUDSTACK-8607 - Adding update_host_passwd.sh script
- Modifying the LibvirtUpdateHostPasswordCommandWrapper in order to execute the script on the host
   - Adding the script path to LibvirtComputingResource
   - Adding the host IP address as an instance variable on UpdateHostPasswordCommand
   - Improving the Unit Test (LibvirtComputingResourceTest) to get it covering the new code
2015-07-02 14:54:51 +02:00
wilderrodrigues
527d6ee77b Making possible to update KVM hosts password in the database via the API
- Make sure the doUpdateHostPassword() method returns the result from the answer, not always true
   - Added the LibvirtUpdateHostPasswordCommandWrapper class, which will handle the changes in the KVM agent
     That's will be further implemented in the future. The command will avoid the agent to complain about Unsupported command
   - Added a test to make sure the current implementation of the comment works
     - If changes in the future, it will also require changes. In that way, we make sure nobody will break it

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #527
2015-06-29 09:59:12 +02:00
wilderrodrigues
607a63b12d Mocking the Connect object used in the LibvirtMigrateCommandWrapper
When executing the tests in an environment where Libvirt is also installed, it
caused errors.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #342
2015-06-01 21:11:25 +02:00
wilderrodrigues
b267c5fc5a Replacing real IPs by 127.0.0.1. - It was causing problems in some environments - The Ips should have been removed in a previous commit, but some of them were missed
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #325
2015-05-29 11:25:40 +02:00
Rohit Yadav
cde6ef94b8 CLOUDSTACK-8247: Pull average Cpu util report between polling
Pull average Cpu util report between polling intervals instead of since boot
instead of using values since uptime

(cherry picked from commit 04176eaf171b46638be99b2f675aa2f09e99e1b8)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

This closes #297
2015-05-25 15:52:00 +02:00
Rohit Yadav
c37060a1ff CLOUDSTACK-8338: Fix hypervisor stats reporting for KVM on EL7
EL7 has a different output to 'free', use /proc/meminfo instead of a tool to be
more consistent across distros

(cherry picked from commit 212a05a345aa19cd2597b7ff5d6a1da7b35b9fc1)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

Conflicts:
	plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
2015-05-22 12:10:54 +01:00
wilderrodrigues
982a0235a0 CLOUDSTACK-8486
Removing real IPs from the tests because they cause a long running time for LibvirtComputingResourceTest
    - In a local machine it takes 1.977s, but in a KVM test environment it's taking 257.879 sec
2015-05-20 14:52:08 +02:00
wilderrodrigues
ab7473eea0 Changing the JUnit runner in order to avoid problems with Java 8 - All tests passed using different approaches - Maven with parameters: -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 - Maven without parameters
All builds were executed using javac 1.8.0_31

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #266
2015-05-20 09:53:46 +01:00
wilderrodrigues
0cdb4b6108 Fixing the testGetHostStatsCommand test under LibvirtComputingResourceTest. - Removed the expected value from the Test annotation - Mocking the bash path in order to avoid environment/OS issues
Fixing typo on LibvirtRequestWrapper
  - Replace linbvirtCommands by libvirtCommands on LibvirtRequestWrapper

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #255
2015-05-18 20:07:02 +02:00
wilderrodrigues
f575206ad4 Fixing testModifySshKeysCommand in the LibvirtComputingResourceTest class
- The test was okay, but when running in an environment where a /root/.ssh/id_rsa existed, it would return true then fail
  - We now mock the calls to methods that return the key paths, instead of relying in the static variables
2015-05-08 19:53:03 +02:00
wilderrodrigues
74ad48db55 Refactoring the LibvirtComputingResource
- Adding LibvirtStartCommandWrapper
  - 8 unit tests added
  - KVM hypervisor plugin with 23.2% coverage
2015-05-06 19:24:16 +02:00
wilderrodrigues
09656ca84e Refactoring the LibvirtComputingResource
- Adding LibvirtNetworkElementCommandWrapper and LibvirtStorageSubSystemCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 22.2% coverage

I also refactored the StorageSubSystemCommand interface into an abstract class
  - Remove the pseudo-multiple-inheritance implementation
    - The StorageSubSystemCommand was an interface, not related to the Command class
      and its implementation were extending the Command class anyway. The whole structure is better now.
2015-05-06 19:24:16 +02:00
wilderrodrigues
08106e34d0 Refactoring the LibvirtComputingResource
- Adding LibvirtResizeVolumeCommandWrapper
  - 5 unit tests added
  - KVM hypervisor plugin with 22.1% coverage
2015-05-06 19:24:15 +02:00
wilderrodrigues
ae505e7bef Refactoring the LibvirtComputingResource
- Addin LibvirtPvlanSetupCommandWrapper
  - 6 unit tests added
  - KVM hypervisor plugin with 21% coverage

From the 6 tests added, 2 were extra tests to increase the coverage of the LibvirtStopCommandWrapper
  - Increased from 35% to 78.7%
2015-05-06 19:24:15 +02:00
wilderrodrigues
7fd43f33d3 Refactoring the LibvirtComputingResource
- 5 unit tests added
  - KVM hypervisor plugin with 20.1% coverage
2015-05-06 19:24:15 +02:00
wilderrodrigues
0b1b2b6d92 Refactoring the LibvirtComputingResource
- Adding LibvirtCopyVolumeCommandWrapper

Refactoring the LibvirtUtilitiesHelper
  - Changing method name

Did not add any test to this commit due to the refactor mentioned abot.
Will proceed and add the tests

i# Please enter the commit message for your changes. Lines starting
2015-05-06 19:24:15 +02:00
wilderrodrigues
885b9e45d7 Renaming LibvirtConnectionWrapper to LibvirtUtilitiesHelper
- Gave it a better, more suggestive, name since I now added other methods to the class.
  - It makes easier to mock objects and get a better coverage of the classes
2015-05-06 19:24:14 +02:00
wilderrodrigues
b3913ca1fb Refactoring the LibvirtComputingResource
- Adding LibvirtCreatePrivateTemplateFromSnapshotCommandWrapper
  - 5 unit tests added
  - KVM hypervisor plugin with 19.5% coverage
2015-05-06 19:24:14 +02:00
wilderrodrigues
bcf78d3b43 Refactoring the LibvirtComputingResource
- Adding LibvirtBackupSnapshotCommandWrapper, LibvirtCreatePrivateTemplateFromVolumeCommandWrapper and LibvirtManageSnapshotCommandWrapper
  - 3 unit tests added
  - KVM hypervisor plugin with 18.3% coverage

Less tests added to those classes because the code is quite complex and way too long.
The tests added are just covering the new flow, to make sure it works fine. I will come back to those classes later.
2015-05-06 19:24:13 +02:00
wilderrodrigues
52d9f0c206 Refactoring the LibvirtComputingResource
- Adding LibvirtNetworkUsageCommandWrapper, LibvirtPlugNicCommandWrapper and LibvirtUnPlugNicCommandWrapper
  - 9 unit tests added
  - KVM hypervisor plugin with 18.3% coverage
2015-05-06 19:24:13 +02:00
wilderrodrigues
ff7ae9ca0c Refactoring the LibvirtComputingResource
- Adding LibvirtCreateVolumeFromSnapshotCommandWrapper, LibvirtFenceCommandWrapper and LibvirtSecurityGroupRulesCommandWrapper
  - 6 unit tests added
  - KVM hypervisor plugin with 17.2% coverage
2015-05-06 19:24:13 +02:00
wilderrodrigues
3c8b217262 Refactoring the LibvirtComputingResource
- Adding LibvirtCheckOnHostCommandWrapper and LibvirtOvsCreateTunnelCommandWrapper
  - 4 unit tests added
  - KVM hypervisor plugin with 16.2% coverage
2015-05-06 19:24:12 +02:00
wilderrodrigues
6748a73b82 Refactoring the LibvirtComputingResource
- Adding 4 new command wrappers
  - 12 unit tests added
  - KVM hypervisor plugin with 15.5% coverage
2015-05-06 19:24:12 +02:00
wilderrodrigues
5499eecd33 Refactoring the LibvirtComputingResource
- Adding 7 new command wrappers
  - 10 unit tests added
  - KVM hypervisor plugin with 14.8% coverage
2015-05-06 19:24:12 +02:00
wilderrodrigues
4887ce7254 Refactoring the LibvirtComputingResource
- Adding LibvirtOvsDestroyBridgeCommandWrapper, LibvirtOvsSetupBridgeCommandWrapper
  - 4 unit tests added
  - KVM hypervisor plugin with 13.9% coverage

More tests added to cover LibvirtPrepareForMigrationCommandWrapper
  - Coverage of this wrapper broght from 37% to 90.6%
  - 4 new tests added
2015-05-06 19:24:11 +02:00
wilderrodrigues
0d860af659 Refactoring the LibvirtComputingResource
- Adding LibvirtDeleteStoragePoolCommandWrapper, LibvirtGetStorageStatsCommandWrapper and LibvirtUpgradeSnapshotCommandWrapper
  - 7 unit tests added
  - KVM hypervisor plugin with 13.6% coverage
2015-05-06 19:24:11 +02:00
wilderrodrigues
8268d353a2 Refactoring the LibvirtComputingResource
- Adding LibvirtPrimaryStorageDownloadCommandWrapper
  - 4 unit tests added
  - KVM hypervisor plugin with 13.3% coverage
2015-05-06 19:24:11 +02:00
wilderrodrigues
4472cade2f Refactoring the LibvirtComputingResource
- Adding LibvirtDestroyCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 12.9% coverage
2015-05-06 19:24:11 +02:00
wilderrodrigues
cb4670279f Refactoring the LibvirtComputingResource
- Adding LibvirtCreateCommandWrapper and LibvirtMaintainCommandWrapper
  - 4 unit tests added
  - KVM hypervisor plugin with 12.7% coverage
2015-05-06 19:24:10 +02:00
wilderrodrigues
6f757c6bf0 Refactoring the LibvirtComputingResource
- Adding LibvirtModifySshKeysCommandWrapper
  - 1 unit test added
  - KVM hypervisor plugin with 12.3% coverage
2015-05-06 19:24:10 +02:00
wilderrodrigues
f14c7c2074 Refactoring the LibvirtComputingResource
- Adding LibvirtGetVncPortCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 12.1% coverage
2015-05-06 19:20:43 +02:00
wilderrodrigues
7319a12600 Refactoring the LibvirtComputingResource
- Adding LibvirtCheckConsoleProxyLoadCommandWrapper, LibvirtConsoleProxyLoadCommandWrapper, LibvirtWatchConsoleProxyLoadCommandWrapperand CitrixConsoleProxyLoadCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 12% coverage

Refactored the CommandWrapper interface in order to remove the esecuteProxyLoadScan, which is now
implemented bu subclasses.
2015-05-06 19:20:43 +02:00
wilderrodrigues
08a9523dcd Fixing assertion on the tests that are execting exceptions 2015-05-06 19:20:43 +02:00
wilderrodrigues
40886b337c Refactoring the LibvirtComputingResource
- Adding LibvirtAttachVolumeCommandWrapper
  - 3 unit tests added
  - KVM hypervisor plugin with 11.7% coverage
2015-05-06 19:20:42 +02:00
wilderrodrigues
4d216f1a63 Refactoring the LibvirtComputingResource
- Adding LibvirtAttachIsoCommandWrapper, LibvirtAttachIsoCommandWrapper and LibvirtAttachIsoCommandWrapper
  - 7 unit tests added
  - KVM hypervisor plugin with 11.5% coverage
2015-05-06 19:20:42 +02:00
wilderrodrigues
be1e517615 Refactoring the LibvirtComputingResource
- Adding LibvirtPingTestCommandWrapper
  - 3 unit tests added
  - KVM hypervisor plugin with 11.2% coverage
2015-05-06 19:20:42 +02:00
wilderrodrigues
28e55462f1 Refactoring the LibvirtComputingResource
- Adding LibvirtMigrateCommandWrapper
  - 1 unit tests added
  - KVM hypervisor plugin with 10.9% coverage
2015-05-06 19:20:41 +02:00
wilderrodrigues
d730efb866 Refactoring the LibvirtComputingResource
- Adding LibvirtCheckHealthCommandWrapper and LibvirtPrepareForMigrationCommandWrapper
  - 2 unit tests added
  - KVM hypervisor plugin with 10.8% coverage
2015-05-06 19:20:41 +02:00
wilderrodrigues
6e568125fc Refactoring the LibvirtComputingResource
- Adding LibvirtGetHosStatsCommandWrapper
  - 1 unit test added
  - KVM hypervisor with 10.5% coverage

Tests are a bit limited on this one becuause of the current implementation. Would clean it up later in a separate branch
2015-05-06 19:20:41 +02:00
wilderrodrigues
7a90c018fb Refactoring the LibvirtComputingResource
- Adding LibvirtRebootCommandWrapper and LibVirtRebootRouterCommandWrapper
  - 2 unit tests added
  - KVM hypervisor with 10.5% coverage
2015-05-06 19:20:40 +02:00
wilderrodrigues
51093afcf1 Refactoring the LibvirtComputingResource
- Adding LibvirtGetVmDiskStatsCommandWrapper
  - 1 unit test

Added getConnection() to LibvirtConnectionWrapper
2015-05-06 19:20:40 +02:00
wilderrodrigues
7086d64387 Refactoring the LibvirtComputingResource
- Adding LibvirtGetVmStatsCommandWrapper
  - 3 unit tests

Refactored the LibvirtConnectiobn by surrounding it with an wrapper.
  - Make it easier to cover the static/native calls
  - Added better coverage to StopCommand tests
2015-05-06 19:20:40 +02:00
wilderrodrigues
508f10527f Refactoring the LibvirtComputingResource
- Adding LibvirtStopCommandWrapper
  - LibvirtRequestWrapper
  - 1 unit tests

Refactored the RequestWrapper to make it better.
  - Changes also applied to the CitrixRequestWrapper
2015-05-06 19:20:39 +02:00
Laszlo Hornyak
0fda5a03a4 CLOUDSTACK-8292: fix for java 1.8 compilation
Refactored to use the XPatch expressions to check the generated domain xml rathern than string comparison.

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2015-02-28 20:11:46 +01:00