1310 Commits

Author SHA1 Message Date
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
Miguel Ferreira
83fd8f60f3 Refactor cloud-utils project into Maven default structure 2015-08-25 14:50:33 +02:00
Remi Bergsma
9c7e81e748 Merge pull request #695 from karuturi/CLOUDSTACK-8669
CLOUDSTACK-8669: create volume failed due to null charsetAdded a new private method getCharSetFromConnection() which checks if
the connection charset is null and if it is null, returns
StringUtils.getPreferredCharset

regression caused by commit f03411ca0436c8b52f5e60b0c8820fd1d1ba2ff6

* pr/695:
  CLOUDSTACK-8669: create volume failed due to null charset
  CLOUDSTACK-8669: making StringUtils.getDefaultCharset protected

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-17 13:54:54 +02:00
Remi Bergsma
64ff67da55 Merge pull request #654 from DaanHoogland/CLOUDSTACK-8656
Cloudstack 8656: do away with more silently ignoring exceptions.a lot of messages added.
some restructuring for test exception assertions and try-with-resource blocks

* pr/654: (29 commits)
  CLOUDSTACK-8656: more logging instead of sysout
  CLOUDSTACK-8656: use catch block for validation
  CLOUDSTACK-8656: class in json specified not found
  CLOUDSTACK-8656: removed unused classes
  CLOUDSTACK-8656: restructure of tests
  CLOUDSTACK-8656: reorganise sychronized block
  CLOUDSTACK-8656: restructure tests to ensure exception throwing
  CLOUDSTACK-8656: validate the throwing of ServerApiException
  CLOUDSTACK-8656: logging ignored exceptions
  CLOUDSTACK-8656: try-w-r removes need for empty catch block
  CLOUDSTACK-8656: try-w-r instead of clunckey close-except
  CLOUDSTACK-8656: deal with empty SQLException catch block by try-w-r
  CLOUDSTACK-8656: unnecessary close construct removed
  CLOUDSTACK-8656: message about timed buffer logging
  CLOUDSTACK-8656: message about invalid number from store
  CLOUDSTACK-8656: move cli test tool to separate file
  CLOUDSTACK-8656: exception is the rule for some tests
  CLOUDSTACK-8656: network related exception logging
  CLOUDSTACK-8656: reporting ignored exceptions in server
  CLOUDSTACK-8656: log in case we are on a platform not supporting UTF8
  ...

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-14 21:38:49 +02:00
Daan Hoogland
08e6e1633c CLOUDSTACK-8656: message about timed buffer logging 2015-08-14 13:29:35 +02:00
Daan Hoogland
4213a22127 CLOUDSTACK-8656: message about invalid number from store 2015-08-14 13:21:46 +02:00
Daan Hoogland
3229d96015 CLOUDSTACK-8656: move cli test tool to separate file 2015-08-14 13:15:11 +02:00
Daan Hoogland
f203acc074 CLOUDSTACK-8656: exception is the rule for some tests 2015-08-14 13:07:48 +02:00
Rohit Yadav
1d190fd0bb utils: add HttpUtils test
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 0fcd9cad1e4a687c275095d6e27bdfb3eff4add8)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 11:59:31 +05:30
Rohit Yadav
89f47ece3d CLOUDSTACK-8702: Add/refactor sessionkey checking code to HttpUtils
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit cb7dd7b27dff1408cc41d69152a644c5b8842bfe)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-08-14 11:56:55 +05:30
Rajani Karuturi
a65339ff1b CLOUDSTACK-8669: making StringUtils.getDefaultCharset protected
made this protected as its only use is in the Test file.
2015-08-13 17:39:44 +05:30
Daan Hoogland
c0534756d0 CLOUDSTACK-8656: network related exception logging 2015-08-11 18:14:20 +02:00
Mike Tutkowski
8b0266d12e Merge branch 'pr/547'
* pr/547:
  CLOUDSTACK-8601. VMFS storage added as local storage can be re-added as shared storage. Fail addition of a VMFS shared storage pool in case it has already been added as local storage in CS.

Signed-off-by: Mike Tutkowski <mike.tutkowski@solidfire.com>
2015-08-10 19:00:53 -06:00
Remi Bergsma
7b47c49bb0 #651 (@borisroman) CLOUDSTACK-8703: Fixed issue when listing direct..
* pr/651:
  CLOUDSTACK-8703: Fixed issue when listing directory on S3, it would only return objectSummaries when the anwser from the S3 System was truncated.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-04 13:50:29 +02:00
Daan Hoogland
e8a00ed989 CLOUDSTACK-8656: try-with-resource in vmsd reader
moved closeable util function up the hierarchy
2015-08-04 11:37:06 +02:00
Remi Bergsma
60633301ac Merge pull request #647 from @wido
CLOUDSTACK-8640: Revert to AWS SDK 1.3.22

* pr/647:
  CLOUDSTACK-8640: Revert to AWS SDK 1.3.22

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-08-03 20:16:04 +02:00
Boris Schrijver
5f87e9c917 CLOUDSTACK-8703: Fixed issue when listing directory on S3, it would only return objectSummaries when the anwser from the S3 System was truncated. 2015-08-03 17:10:05 +02:00
Wido den Hollander
c32656a7ef CLOUDSTACK-8640: Revert to AWS SDK 1.3.22
The newer SDKs API changed which causes our S3 Template Downloader to never complete.

Although we should fix the Template Downloader we can revert to the old AWS SDK for now.

The fix on the longer run will be rewriting the S3 Template Downloader.

Two methods had to be disabled for now since the old SDK does not support them. They can
be re-enabled when the Template Downloader has been fixed.
2015-07-31 12:52:28 +02:00
Daan Hoogland
85e002b230 CLOUDSTACK-8656: filling empty catch block with info messages
using regexp "catch\s*\(\s*(Exception|Throwable)\s*\w*\)\s*\{\s*\}"
2015-07-30 15:51:52 +02:00
Daan Hoogland
2c110ab709 unittesting: test resolution is not guaranteed to be exact 2015-07-29 10:49:16 +02:00
Daan Hoogland
22f194b888 coverity 1125362, 1125363: assorted resource leaks
Signed-off-by: Daan Hoogland <daan.hoogland@gmail.com>

This closes #602
2015-07-27 14:43:11 +02:00
wilderrodrigues
d632d6312b CLOUDSTACK-8660 - Adding new StringUtils.getDefaultCharset() in order to wrap the Charset equivalet method.
- This test was added in order to cover the new StringUtils.getDefaultCharset().
     - One cannot be sure that StringUtils.getPreferredCharset() will always be equals to Charset.defaultCharset()

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

This closes #616
2015-07-23 08:08:46 +02:00
wilderrodrigues
245c976ad0 CLOUDSTACK-8660 - Adding a method to check if UTF-8 is supported
- Changing the test to call isUtf8Supported() before checking if the preferred charset is actually UTF-8

Signed-off-by: wilderrodrigues <wrodrigues@schubergphilis.com>
2015-07-23 08:08:46 +02:00