186 Commits

Author SHA1 Message Date
weingartner
8355b586a0 Remove test cases duplicated code. 2016-04-12 16:05:18 -03:00
cirstofolini
935113fbd3 Removed unnecessary code from getGuestOsType in CitrixResourceBase 2015-12-20 15:08:44 -02:00
Daan Hoogland
94a14485f7 license 2015-12-14 17:39:06 +01:00
Boris Schrijver
a00fef8c33 Revert "Merge pull request #1243 from SudharmaJain/cs-9166"
This reverts commit 8d2e031a89f5b7c55e1d139b0d8d57d6b9163aff, reversing
changes made to 1b3a792b1211a670234b8e6a505e18cafcabe38a.

No 2x LGTM where given to this PR.
2015-12-14 16:49:11 +01:00
SudharmaJain
601f2dba24 CLOUDSTACK-9166:Build failed in Jenkins: cloudstack-rat-master #7038 2015-12-14 17:13:54 +05:30
SudharmaJain
9ae3c0a5a9 CLOUDSTACK-9127 Missing PV-bootloader-args for "SUSE Linux Enterprise Server 10 SP2 and SP3"
Added Unit test for the new method
2015-12-14 11:26:45 +05:30
Rohit Yadav
f30fbe9a5c Merge branch '4.6' 2015-12-07 12:44:07 +05:30
Anshul Gangwar
f8790c3b9e CLOUDSTACK-9025: Fixed can't create usable template from snapshot in Xenserver and Vmware
Fix also reverts below commit as below solution making assumption about hypervisor which are not applicable
in case of XenServer and VmWare

Revert "CLOUDSTACK-8964: Can't create template or volume from snapshot"

This reverts commit ccf5d75cfbe769b34c021ab3653ed318cae25933.
2015-12-04 14:56:40 +05:30
Remi Bergsma
6d558c0201 Merge pull request #944 from rafaelweingartner/lrg-cs-hackday-012
Create test cases to getPatchFilePath method and class names changed In this commit we created tests cases for the respective classes in package  com.cloud.hypervisor.xenserver.resource.

We added test cases to check the implementation of  com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.getPatchFiles. Therefore, we test in a more comprehensive way the tests that already exist to check the code of com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.getPatchFilePath.

We added a new abstract class, called com.cloud.hypervisor.xenserver.resource.CitrixResourceBaseTest.java

This class has two tests methods:

* com.cloud.hypervisor.xenserver.resource.CitrixResourceBaseTest.testGetPathFilesExeption(CitrixResourceBase), this method tests if the getPatchFilePath() method throws the com.cloud.utils.exception.CloudRuntimeException.CloudRuntimeException when the com.cloud.utils.script.Script.findScript(String, String) return a null value;
* com.cloud.hypervisor.xenserver.resource.CitrixResourceBaseTest.testGetPathFilesListReturned(CitrixResourceBase), this method tests the correct return value from getPatchFilePath() method, basically, verify if the returned list contain the file with the same absolute path that was retrieved from the findScript method.

We also changed the name of those test classes, the change was basically remove the Path word from the name of classes.

* pr/944:
  created tests cases for method "citrixResourceBase.getPatchFiles"

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-03 10:12:07 +01:00
pedro-martins
d01cdb1979 created tests cases for method "citrixResourceBase.getPatchFiles"
we also changed the name of those test classes, the change was basically
remove the “Path” word from the name of classes.

change the private method
com.cloud.hypervisor.xenserver.resource.CitrixResourceBase.getPatchFiles
to protected

added new class in test cases
2015-11-28 19:06:04 -02:00
Devdeep Singh
00522e475b CLOUDSTACK-9081 Migration of vm across clusters fails in clustered MS setup
Storage motion of vm across clusters/xenserver-pools fails in a
clustered management server setup. In xen storage motion we have to send
a migrate_receive command to the destination host, followed by
migrate_send command to the source host. The sr and network detials of
the destination host have to be passed in migrate_send command on the
source. While migrating across clusters the source and destination
resources are seperate objects. To pass this information across
resources we have to send seperate migrate with storage receive and send
commands to the resource. In a clustered ms setup these commands may
have to be forwarded to another ms as the resource may be owned by it.
The serilization of the command and answer objects fails in such case as
it doesn't understand the xapi sr and network objects. Made a change to
serialize these objects in the resource layer and pass the around as
strings in the command and answer objects.  Reviewed-By: Likitha
2015-11-26 11:59:18 +05:30
cirstofolini
1a64c247ad Removed unnecessary @Local annotations and their respective imports from the ComponentLifecycleBase class and its subclasses. 2015-11-21 18:31:11 -02:00
Boris Schrijver
5c0366c99e CLOUDSTACK-9062: Improve S3 implementation.
The S3 implementation is far from finished, this commit focusses on the bases.

 - Upgrade AWS SDK to latest version.
 - Rewrite S3 Template downloader.
 - Rewrite S3Utils utility class.
 - Improve addImageStoreS3 API command.
 - Split various classes for convenience.
 - Various minor improvements and code optimalisations.

A side effect of the new AWS SDK is that it, by default, uses the V4 signature. Therefore I added an option to specify the Signer, so it stays compatible with previous versions.
2015-11-19 15:29:10 +01:00
Remi Bergsma
1f53f2a93e Updating pom.xml version numbers for release 4.7.0-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-15 18:54:13 +01:00
Remi Bergsma
b38c3bed0c Updating pom.xml version numbers for release 4.6.1-SNAPSHOT
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-13 21:27:57 +01:00
Remi Bergsma
e31ade03c6 Updating pom.xml version numbers for release 4.6.0
Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-10 15:45:34 +01:00
Funs Kessen
c4afb76d8c host delegation logging for XenServerGuru.java 2015-10-23 20:09:06 +02:00
Koushik Das
f5b9a96d24 CLOUDSTACK-8826: XenServer - Use device id passed as part of attach volume API properly
If device id passed as part of API and available then use it otherwise fallback on XS to automatically assign one.
For ISO device id used is 3 and it is processed before any other entry to avoid conflict.
2015-09-21 17:09:14 +05:30
Rajani Karuturi
8bc0294014 Revert "Merge pull request #714 from rafaelweingartner/master-lrg-cs-hackday-003"
This reverts commit cd7218e241a8ac93df7a73f938320487aa526de6, reversing
changes made to f5a7395cc2ec37364a2e210eac60720e9b327451.

Reason for Revert:

noredist build failed with the below error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project cloud-plugin-hypervisor-vmware: Compilation failure
[ERROR] /home/jenkins/acs/workspace/build-master-noredist/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java:[484,12] error: non-static variable logger cannot be referenced from a static context
[ERROR] -> [Help 1]

even the normal build is broken as reported by @koushik-das on dev list
http://markmail.org/message/nngimssuzkj5gpbz
2015-08-31 11:27:57 +05:30
Rafael Weingartner
3818257a68 Solved jira ticket: CLOUDSTACK-8750 2015-08-28 22:35:08 -03:00
Koushik Das
e1db6efc74 Removed unused agent command AttachVolumeCommand and corresponding answer AttachVolumeAnswer 2015-08-26 09:50:23 +05:30
Miguel Ferreira
82df5b156b Add UUIDs to constructors (fixing syntax error from 2a6c7f3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #722
2015-08-24 14:12:49 +05:30
Miguel Ferreira
20be6c24f7 Formatting class CitrixRequestWrapperTest
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-24 14:12:49 +05:30
weingartner
ec8976f802 Removed duplicate code in CitrixResourceBase.getPatchFiles
@cristofolini comments:
Removed unnecessary duplicated code by having the body of the
getPatchFiles method only in the
CitrixResourceBase superclass. Given that all of its implementations
consisted of the same code
except for the path which contains the necessary file for that
implementation. An abstract method
getPatchFilePath was created in the CitrixResourceBase superclass so
that each implementation may
return the path containing the specific file needed by that
implementation.

Test cases were created for each implementation, simple as they may be.
One assert is made to verify
that the path returned by each implementation corresponds to the path
that was previously specified
on each getPatchFiles implementation.

removed trailing whitespace
2015-08-17 13:26:25 -03:00
Funs
ca68bb0ef7 xenserver: Improved message for peeples to actually see what the problem is.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #576
2015-07-15 18:24:39 +05:30
Daan Hoogland
e62d952375 coverity 1311706: to generic exeption handling on xapi call
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>
2015-07-14 13:41:09 +02:00
Jayapal
deb694c201 CLOUDSTACK-8324: Added migration changes for config drive 2015-07-10 09:39:27 +05:30
Daan Hoogland
6376503fe3 coverity 1308118: more resources being opened only one closed on exception nothing was closed
Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-07-09 21:30:23 +02:00
weingartner
25e9918c57 Amend last commit, used 4 spaces in code formatting instead of 1 tab character.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>

This closes #560
2015-07-09 13:37:59 +02:00
weingartner
50c4836c9f Cleaned class “com.cloud.hypervisor.xenserver.resource.XcpOssResource” that seemed to be forgotten during the evolution of the ACS. It was removed a few methods that were already coded properly in its parent class “com.cloud.hypervisor.xenserver.resource.CitrixResourceBase”. It was also removed some methods that seemed to cause weird behaviors. The methods removed/fixed are detailed as follows: • com.cloud.hypervisor.xenserver.resource.XcpOssResource.fillHostInfo(Connection, StartupRoutingCommand) – it was removed, because it always added the string “, hvm” to the host capabilities. Therefore, if one uses XCP hypervisor it could cause a lot of trouble when deploying HVM virtual machines in an environment that has PV and HVM clusters. The method is already properly coded in parent class. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.launchHeartBeat(Connection) – It was removed. It was not performing anything and always returns a true value. The method of parent class is properly coded and works for XCP environments. The heartbeat plugin exists in XCP environment. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.initializeLocalSR(Connection) – it was removed. The method of the parent class works properly for XCP environments. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.createPatchVbd(Connection, String, VM) – It was removed. This method causes a bug in XCP environments, because of its half-implementation, it was not possible to migrate system VMs. The parent class implementation works properly for XCP. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.execute(NetworkUsageCommand) – removed, hence it was already coded into parent class and its respective wrappers (“com.cloud.hypervisor.xenserver.resource.wrapper.xcp.XcpServerNetworkUsageCommandWrapper”). BTW: I noticed that the class XcpServerNetworkUsageCommandWrapper and XenServer56NetworkUsageCommandWrapper are almost the same, with the exception that XenServer56NetworkUsageCommandWrapper deals with VPC. I believe that those wrappers could be converted into one, and moved to parent. I am not doing that here because I do not have a XCP environment with advanced networking to test it. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.executeRequest(Command) – removed, hence it is not needed anymor. • com.cloud.hypervisor.xenserver.resource.XcpOssResource.execute(StopCommand) – I did not understand that method. It seemed weird and its removal did not change any behavior of the environment I tested it with.
Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-09 13:37:59 +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
86297e70be CLOUDSTACK-8607 - Make sure the new password replaces the old one in the queue
- Added log info to show details of the operation
   - Renamed the addPwdToQueue to replaceOldPasswdInQueue
2015-07-04 11:33:52 +02:00
wilderrodrigues
efa34361df CLOUDSTACK-8607 - Changed update script to return exit code based on the result
- Changed location of the update_host_passwd script
   - Updated the patch files for XenServer
   - Updated the script path on LibvirtComputing class
   - Removed the hostIP from the LibvirtUpdateHostPasswordCommandWrapper execute() method
2015-07-03 14:29:57 +02:00
wilderrodrigues
0dd02ce043 CLOUDSTACK-8607 - Adding support to update host passwd on XenServer hypervisors
- Adding update_host_passwd to VRScripts
   - Add accessor method to host password on CitrixResourceBase
   - Add implementation to CitrixUpdateHostPasswordCommandWrapper
   - Improve testUpdateHostPasswordCommand() unit test on CitrixRequestWrapperTest
   - Add line to patch files on xenserver directory

Concerning the LibVirt change:

   - I forgot to assing the return of the getDefaultHypervisorScriptsDir() method to the hypervisorScriptsDir variable
2015-07-03 10:24:44 +02:00
Sanjay Tripathi
9044a02d9a VM Snapshot Usage for DATA disk is reported as the size of the DATA disk instead of the actual snapshot size.
This closes #485
2015-06-19 15:55:21 +05:30
Sanjay Tripathi
d702b63bfb CLOUDSTACK-8569: The latter snapshot export for the same volume will fail is 2 snapshot exports are queued
This closes #469
2015-06-17 15:27:03 +05:30
Sanjay Tripathi
47278556f5 CLOUDSTACK-8567 Migrating primary storage causes name_label field to blank.
This closes #468
2015-06-17 14:46:51 +05:30
Rafael da Fonseca
be474f95a1 Fixed 4 findbugs warnings in CitrixResourceBase.java Unnecessary boxing/unboxing of primitive values
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #425
2015-06-15 12:09:39 +03:00
Rafael da Fonseca
b869a16332 Remove unused import to fix checkstyle warning
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #400
2015-06-15 12:04:19 +03:00
Rafael da Fonseca
949e97dec6 Fix findbugs warning in LibvirtConsoleProxyLoadCommandWrapper Encoding is now specified in both server and clients for the console proxy getstatus command For some reason, findbugs did not detect unsafe encoding issue in ConsoleProxyResource.java, is properly specified now though... CitrixConsoleProxyLoadCommandWrapper was specifying system default encoding for operation, should be ok because default for xenserver is UTF-8 since it's linux based, but it's best to specify exact encoding set on the server end to be consistent
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-06-15 12:04:18 +03:00
Rafael da Fonseca
cc6d28fc98 Fix another findbugs encoding warning in CitrixResourceBase In this case, using default encoding is desired, since the purpose is to read shell command output, which uses the platform's default encoding. This gets rid of the findbugs warning.
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #396
2015-06-15 11:59:48 +03:00
Rafael da Fonseca
faa38ad416 Fix findbugs encoding warning in CitrixResourceBase Output of text files should be UTF-8, this is the default for linux, will now always use the same format for every platform
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #395
2015-06-15 11:59:38 +03: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
Jayapal
b616522088 CLOUDSTACK-8324: Corrected the file paths for xenserver command files
This closes #315
2015-05-28 17:02:09 +05:30
Jayapal
6e96fc6f38 CLOUDSTACK-8324: Updated import and added ResourceWrapper annotation 2015-05-28 15:56:37 +05:30
Jayapal
3a8d1f7c55 CLOUDSTACK-8324: Added unit test cases for GetVmIpAddressCommand 2015-05-28 15:56:37 +05:30
Jayapal
e407986183 CLOUDSTACK-8324: Added config drive support for xenserver 2015-05-28 15:51:50 +05:30
Jayapal
7984ae5283 CLOUDSTACK-8324: Resource base changes for vm ip fetch 2015-05-28 15:42:08 +05:30
wilderrodrigues
b155129ae8 Fixing the packaging of the Xen resource tests - The package declaration of all Test classes was point to a package that was not represented as a directory - For example: Class A had "package b.c.d;" as declaration, but the class A was under directory "c"
Maven was bulding the project and executing the tests just fine because it uses "-sourcepath". However,
with IDEs and javac it would fail.

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

This closes #317
2015-05-27 16:06:33 +02:00
Rafael da Fonseca
79d24ae218 Fix xenserver tests for travis 2015-05-23 16:14:09 +02:00