1082 Commits

Author SHA1 Message Date
Remi Bergsma
312b9aff94 Merge release branch 4.6 to master
* 4.6:
  Adapted HypervisorUtilsTest to no longer give false positives
2015-12-10 16:24:36 +01:00
Nick Livens
132c35639b Adapted HypervisorUtilsTest to no longer give false positives 2015-12-08 08:12:58 +01:00
Daan Hoogland
afe1130920 Merge pull request #1057 from DaanHoogland/CWE-190
Cwe 190coverity warnings of this type adressed. Some where dismissed and maybe with reason but it seemed possible to remove them and hence obligatory ;p

* pr/1057:
  move back to original contract of isNetworksOverlap()
  Changed the behavior of methods that use NetUtils.cidrToLong(String)
  CWE-190 unit test for extremes of long netMaskFromCidr(long)
  CWE-190 netmask as long form cidr-size as method
  CID-1116482 cidrToLong cleanup of bitshift problem
  CID-1116483 cidr to netmask bitshifts guarded with casts
  CID-1116484 cast to long and use long as cidrsize type  and simpel test
  CID-1116485: cast cidr during bit shifting  and simple test included
  CID-1175714 casts before bit shift

Signed-off-by: Daan Hoogland <daan@onecht.net>
2015-12-06 20:10:57 +01:00
Remi Bergsma
a6b6f4104d Merge pull request #1102 from rafaelweingartner/master-lrg-cs-hackday-006
Removed unnecessary @Local annotations and their respective importsFollowing @rafaelweingartner 's findings in PR #714 that many spring beans contained an @Local annotation, we've decided to remove said annotations and their imports from the ComponentLifecycleBase class and its subclasses seeking a reduction of a few hundred lines of useless code.

I had already opened a pull request for this (#853) but at some point my commit disappeared from the PR entirely, showing no new changes in code, which caused it to be merged automatically (with no changes).

* pr/1102:
  Removed unnecessary @Local annotations and their respective imports from the ComponentLifecycleBase class and its subclasses.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-23 11:25:43 +01:00
Remi Bergsma
a3688e0eb5 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9052 Shuffling the password to avoid having a subset of characters in fixed positions.
  Refactor package.sh:  * lint  * adjust exit codes (1 for usage, 2 for maven, 3 for rpmbuild)  * variable naming consistency  * add option for package release version  * revise synopsis and usage
2015-11-22 12:52:43 +01:00
Remi Bergsma
3f7a86d8ef Merge pull request #1058 from greenqloud/pr/password_security
Shuffling the password to avoid having a subset of characters in fixed positions.Related to CLOUDSTACK-9052.

I am shuffling the characters in the password, to avoid having a certain char type in fixed positions. I modified the tests accordingly to only check that the different character types are present.

I think it would be good to remove the hard requirement to have at least one of digits, upper-case, and  lowercase chars, as it reduces the number of possible combinations passwords can take. What do you think?

* pr/1058:
  CLOUDSTACK-9052 Shuffling the password to avoid having a subset of characters in fixed positions.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-22 12:46:32 +01:00
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
Daan Hoogland
4b7f87b9c8 move back to original contract of isNetworksOverlap() 2015-11-21 18:58:54 +01:00
weingartner
1d6ee2dcb0 Changed the behavior of methods that use NetUtils.cidrToLong(String)
Given that the method com.cloud.utils.net.NetUtils.cidrToLong(String)
now throws an exception when receiving null or empty cidrs, there is the
need to change methods that use it. Those methods were changed and test
cases created.
2015-11-20 13:31:58 -02:00
Daan Hoogland
02058b939c CWE-190 unit test for extremes of long netMaskFromCidr(long) 2015-11-19 19:37:26 +01: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
nnesic
52ccfaac0c CLOUDSTACK-9052 Shuffling the password to avoid having a subset of characters in fixed positions. 2015-11-19 13:17:20 +00:00
nvazquez
b20c5be1ce CLOUDSTACK-8956: Remove assert(false) on opaque network and ping method on NiciraNvpApiVersion 2015-11-16 11:29:31 -08:00
nvazquez
2386ae5e5a CLOUDSTACK-8956: Log NSX Api Version 2015-11-16 11:29:30 -08:00
Daan Hoogland
1bc837837f CWE-190 netmask as long form cidr-size as method 2015-11-16 18:25:32 +01:00
Daan Hoogland
3ae4dd06f3 CID-1116482 cidrToLong cleanup of bitshift problem
and some trivial testing
2015-11-16 18:25:32 +01:00
Daan Hoogland
f9d5c6918c CID-1116483 cidr to netmask bitshifts guarded with casts
and simple test
2015-11-16 18:25:32 +01:00
Daan Hoogland
2fadfe93dc CID-1116484 cast to long and use long as cidrsize type
and simpel test
2015-11-16 18:25:32 +01:00
Daan Hoogland
637afb9b67 CID-1116485: cast cidr during bit shifting
and simple test included
2015-11-16 18:25:31 +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
Daan Hoogland
a580330864 CLOUDSTACK-9023 filtering privatekey info from logging 2015-11-10 12:08:01 +01:00
Wido den Hollander
602231132d kvm: Add UnitTests for LibvirtUtilitiesHelper
These were lacking, but this helper is used in various places
inside the KVM code.

Some simple tests to verify the helper is doing what we expect it
to do.
2015-10-30 12:34:00 +01:00
Daan Hoogland
d0a1820394 CLOUDSTACK-8981 coded a more obscure host and clear failure message
test fails when port is reachable so prevent it as much as possible
 making sure that all kinds of weird developers can work with it
2015-10-22 15:35:50 +02:00
Boris Schrijver
b34f86c8d5 Added return statement to stop start() if there has been an ConnectException. 2015-09-22 00:38:16 +02:00
wilderrodrigues
6e426fa46d Revert "Merge pull request #825 from borisroman/charset"
This reverts commit a44e2bff7ec0c1548d89722c40488746454adce1, reversing
changes made to 06cefaf493423c953a95ee92482a2d0a20a21095.

We are reverting the PR #825 because it breaks Master.
2015-09-15 14:58:18 +02:00
Boris Schrijver
71929fdedd Replaced all occurences of Charset.forName(UTF-8) with StringUtils.getPreferredCharset(). 2015-09-15 12:00:33 +02:00
Wido den Hollander
d091b9189c Merge pull request #795 from borisroman/CLOUDSTACK-8819
CLOUDSTACK-8819: Added QCOW2 virtual size checking for S3.- Cleaned up S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl

* pr/795:
  Added Unit Tests for QCOW2Utils.
  Fixed Findbugs issue introduced by 1c6378ec0056e8c75990a4a0c15e99b2df162a75 PR #795.
  Added QCOW2 virtual size checking for S3.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
2015-09-14 12:02:03 +02:00
Boris Schrijver
aa19a6a05a Added Unit Tests for QCOW2Utils. 2015-09-14 10:56:21 +02:00
Boris Schrijver
1c6378ec00 Added QCOW2 virtual size checking for S3.
- Cleaned up S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl
2015-09-11 14:57:32 +02:00
wilderrodrigues
79a3f8c577 CLOUDSTACK-8822 - Replacing Runnable by Callable in the Taks and NioConnection classes
- All the sub-classes were also updated according to the changes in the super-classes
   - There were also code formatting changes
2015-09-11 11:28:40 +02:00
Boris Schrijver
1971614e31 Added QCOW2 virtual size checking for S3.
- Cleaned up S3TemplateDownloader
- Created static QCOW2 utils class.
- Reformatted some parts of DownloadManagerImpl
2015-09-10 16:45:48 +02:00
Rohit Yadav
dd9ba48efa Merge pull request #753 from shapeblue/master-CLOUDSTACK-8762
CLOUDSTACK-8762: Check to confirm disk activity before starting a VMImplements a VM volume/disk file activity checker that checks if QCOW2 file
has been changed before starting the VM. This is useful as a pessimistic
approach to save VMs that were running on faulty hosts that CloudStack could
try to launch on other hosts while the host was not cleanly fenced. This is
optional and available only if you enable the settings in agent.properties
file, on per-host basis.

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

* pr/753:
  CLOUDSTACK-8762: Check to confirm disk activity before starting a VM

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-09-02 14:55:54 +05:30
Rajani Karuturi
22c78ede32 Fixing line endings in the new file introduced in PR #762 merged through commit e8979c0e658b3e3d3c8553f865411d4ececa5f4f 2015-09-01 14:34:54 +05:30
Rajani Karuturi
e8979c0e65 Merge pull request #762 from rafaelweingartner/cglibThrowableRenderer
Proposal for an improved CglibThrowableRendererFollowing our discussions on mailing list, here is a PR with a proposal for an improvement on CglibThrowableRenderer. We would still have to define a number to limit the stack traces of causes (I randomly chose 3, just to get the code running). The test case is also not good in my opinion, but I ran out of ideas (waiting for suggestions on that).

* pr/762:
  Changed the test case to test each of the log traces in the array list.
  Proposal for an improved CglibThrowableRenderer

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-09-01 14:31:32 +05:30
weingartner
b49d681598 Changed the test case to test each of the log traces in the array list. 2015-08-31 07:51:01 -03:00
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
weingartner
89bac529cc Proposal for an improved CglibThrowableRenderer
Apache license
Shame on me...

Fix test to pass on travis build
2015-08-29 21:49:56 -03:00
Rafael Weingartner
3818257a68 Solved jira ticket: CLOUDSTACK-8750 2015-08-28 22:35:08 -03:00
Rajani Karuturi
f5a7395cc2 Merge pull request #752 from ustcweizhou/BasicRestClientTest-fakelocalhost
use fakelocalhost in BasicRestClientTestBasicRestClientTest will fail if the port 443 is open on localhost.
use fakelocalhost instead of localhost can fix it.
Please see the latest discussion in https://github.com/apache/cloudstack/pull/737

* pr/752:
  use fakelocalhost in BasicRestClientTest

Signed-off-by: Rajani Karuturi <rajani.karuturi@citrix.com>
2015-08-28 22:12:42 +05:30
Rohit Yadav
52a98fa6cf CLOUDSTACK-8762: Check to confirm disk activity before starting a VM
Implements a VM volume/disk file activity checker that checks if QCOW2 file
has been changed before starting the VM. This is useful as a pessimistic
approach to save VMs that were running on faulty hosts that CloudStack could
try to launch on other hosts while the host was not cleanly fenced. This is
optional and available only if you enable the settings in agent.properties
file, on per-host basis.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-28 16:05:30 +05:30
Miguel Ferreira
4c1a5f7657 Putting CglibThrowableRenderer.java back after it was removed in 83fd8f6
Also removing the entry 'log/' from .gitignore since that was the
culprit for the removal of the file.
2015-08-28 11:18:44 +02:00
Wei Zhou
5e792e33ec use fakelocalhost in BasicRestClientTest 2015-08-27 10:32:57 +02:00
wilderrodrigues
d74d134698 Removing unit test that was covering the resolution of the nano time
- The difference between 2 consecultive calls to System.nanoTime() returns a resolution that depends on the OS implementation. Due to that, the test was failing in an inttermmitent manner
   - Today we decided to remove the test since it was not testing a direct feature of ACS
2015-08-26 20:00:59 +02:00
Miguel Ferreira
09f7153378 Use NSX specific RestClient in API implementation (NiciraNvpApi)
- Simplify public API to return Lists instead of NiciraNvpLists
2015-08-25 17:36:17 +02:00
Miguel Ferreira
18e6b9ba78 Add NSX specific RestClient implementation
- Add -noverify JVM arg to surefire plugin, to allow Powermockito to
  de-encapsulate private methods
- Add dependency on cloud-utils test-jar to use custom HttpRequest
  matchers
2015-08-25 17:36:15 +02:00
Miguel Ferreira
de63b94f2d Delegate HTTP protocol activity in RESTServiceConnector to RestClient
- All HTTP protocol activities are now handled by RestClient
- This service is now only responsible for creating requests, and
  dispatching them to the client
- Provides a Simple API for creating, updating, retrieving and deleting
  objects
2015-08-25 17:36:14 +02:00
Miguel Ferreira
8a93bb8d2d Add basic RestClient implentation based on HTTP Components 4.5
- Upgrade version of HTTP Components to 4.5
- Add helper class to create Http clients
- Add helper class to build http requests
- Add enum with the different Http Methods
- Add constants class for HTTP related values
2015-08-25 17:36:13 +02:00
Miguel Ferreira
5fc953eda2 Code clean up in cloud-utils project
- Code formatting
- Remove unused methods
2015-08-25 17:36:11 +02:00