539 Commits

Author SHA1 Message Date
wilderrodrigues
14c123e082 Merge branch 'fix/libvirt_unittests_timeout' of https://github.com/schubergphilis/cloudstack
This closes #270
2015-05-20 15:56:13 +02: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
Wido den Hollander
3894d34b2c CLOUDSTACK-8489: Set smbios information for guest
This allows a guest to easily detect that it is running inside CloudStack
and see which UUID it has.
2015-05-20 13:28:56 +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
c7d2e444d2 Fixing license header in a file added during the LibVirt refactor
- New class is MigrateKVMAsync
2015-05-13 11:56:43 +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
54f68f519f Removing the CheckStateCommand form the IF statement on LibvirtComputingResource
- It's not used and if so would cause an infinite loop.
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
58e5dca8ef CLOUDSTACK-8335: removed ceph repository - artifact resolved from maven central
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Signed-off-by: Rajani Karuturi <rajanikaruturi@gmail.com>
2015-05-01 11:10:06 +05:30
Rohit Yadav
1d99a38096 CLOUDSTACK-8424: enable cpu flags only for guest VMs
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-30 04:13:07 +02:00
Daan Hoogland
7b10591758 findbugs: String.split() will not return nulls by contract 2015-04-29 16:07:38 +02:00
Rajani Karuturi
0b8355920e Merge branch 'volume-upload' into master
This closes #206
2015-04-29 11:12:53 +05:30
Rohit Yadav
29b8800660 kvm: add VMXNET3 nic adapter to nic models
Linux kernel supports vmxnet3, allowing it in KVM plugin would allow us to
run ESX hosts on KVM hosts using CloudStack with vmxnet3 nic which can be
passed as VM's nicAdapter detail

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit e02d787f303c9f463f197337f1cd88032d776c1c)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-28 18:23:55 +02:00
Rohit Yadav
58cc569273 CLOUDSTACK-8424: Add cpu features if guest.cpu.features is set
This improvements checks for "guest.cpu.features" property which is a space
separated list of cpu features that is specific for a host. When added, it
will add  <feature policy='require' name='{{feature-you-listed}}'/> in the
<cpu> section of the generated vm spec xml.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit ea7fd37783cbc7ec78de5a5e84395381b1800a3e)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-28 13:19:49 +02:00
Laszlo Hornyak
9cf31b0714 CLOUDSTACK-8335: removed libvirt.org repository
The only artifact resolved from libvirt.org was org.libvirt:libvirt:0.5.1
this artifact is now available from maven's default central repository

This closes #180

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-24 16:58:59 +02:00
Rohit Yadav
05e4ba7350 kvm: fallback to eu.ceph.com mvn repo as ceph.com is down
As suggested by Wido on the dev ML changing the repo to eu.ceph.com to avoid
build failures. Will revert if ceph.com is up again.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit c9fd57fff3aa1c7428ab15d0aea3067601b16fba)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-16 17:37:11 +05:30
Remi Bergsma
ac06ec02eb kvm: improve CentOS 7 support
CentOS 7 does not ship with ifconfig anymore. We should use ip commands instead.
This also works on older versions, like CentOS 6 and Ubuntu 12.x/14.x, that we
support.

This closes #165

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-04-14 16:51:14 +05:30