156 Commits

Author SHA1 Message Date
Laszlo Hornyak
1f72548f57 CLOUDSTACK-4807: tests for NetUtils
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2015-03-03 21:21:52 +01:00
Rohit Yadav
0b94f254e8 CLOUDSTACK-8034: Hash user IDs for SAML authentication
The User table's UUID column is restricted to 40 chars only, since we don't
know how long the nameID/userID of a SAML authenticated user will be - the fix
hashes that user ID and takes a substring of length 40 chars. For hashing,
SHA256 is used which returns a 64 char length string.

- Fix tests, add test cases
- Improve checkSAMLUser method
- Use SHA256 one way hashing to create unique UUID for SAML users

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit b2b496288d164fead2c089fb48319e1988b03ce8)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-01-12 13:37:51 +05:30
Sheng Yang
3c9e14e85a CLOUDSTACK-5241: Remove Rot13 usage 2014-12-03 19:38:47 -08:00
Rohit Yadav
fac7bfc5d5 CLOUDSTACK-8011: Upgrade maven dependencies
Changes;
- Upgrades maven-war plugin to 4.5 (faster war packaging)
- Upgrade spring framework to latest minor release
- Upgrade ehcache, jasypt, httpclient, httpcore and other core dependencies
- Upgrade to latest ipv6 library, fix unit test NetUtilsTest
- httpcore and httpclient are sharing same version variable
- commons-httpclient is different that httpclient, the fix gives it a separate var
- Apidocs failed to generate and get stuck with new reflections version, for now
  we will continue using 0.9.8

Newer dependencies can be listed using:
mvn versions:display-dependency-updates -Dnoredist -Dsimulator -P developer,systemvm

Testing;
- Tested using Maven 3.2.1
- Local noredist build with unit tests succeeds
- CloudStack mgmt server started, basic business layer tests work
- Observed 10-15% build time improvement using new maven-war plugin

Branch: bugfix/4.5-8011 (commits are squashed in favour of a linear history)

Pull request:
https://github.com/apache/cloudstack/pull/50

This closes #50

TravisCI build summary:
https://travis-ci.org/shapeblue/cloudstack/builds/42902172

- Build passes with unit tests
- Apidocs generates successfully
- Most integration tests pass, some fail due to timeout errors, second re-run
  passes some of them

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-12-04 02:12:51 +05:30
amoghvk
960b7bbf74 CLOUDSTACK-7977
Fix password generator, add guards for minimum length
2014-11-26 15:08:48 -08:00
Laszlo Hornyak
3577423da9 removed executable flags from java classes
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-11-23 19:49:01 +01:00
Laszlo Hornyak
b2023d04ba Simplification on Properties handling
- Added method to create properties and load contents from file

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-11-23 19:48:56 +01:00
Hugo Trippaers
16de4a7176 Fix for potential NPE 2014-11-18 14:12:14 +01:00
Daan Hoogland
1de0cb7094 restore barematel work after merge 2014-10-17 10:24:01 +02:00
David Nalley
ac48aa8e0c cleaning up some from a revert 2014-10-12 23:30:04 -04:00
Frank Zhang
8b89494a35 CLOUDSTACK-6278
Baremetal Advanced Networking support
2014-09-18 16:54:37 -07:00
Rohit Yadav
a66127dfb1 utils: add methods to save and load public and private keys
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-09-12 15:40:49 +02:00
Rohit Yadav
12ad5ba197 SAMLUtilsTest: just test that random secure string has some length
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-30 15:37:52 +02:00
Rohit Yadav
1ed532fb20 SAMLUtils: add unit test for SAMLUtils and method to randomly generate X509 certs
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2014-08-28 19:45:26 +02:00
Daan Hoogland
3268f5bd1f CLOUDSTACK-6747 test for test to allow all cidrs on other end of a vpc 2014-06-25 17:09:19 +02:00
Daan Hoogland
d90b8d88ed Revert "CLOUDSTACK-6747 test for test to allow all cidrs on other end of a vpc"
This reverts commit 218c4713ae796bcb0002f12421d24dfee9a5320f.
2014-06-25 17:06:10 +02:00
Daan Hoogland
218c4713ae CLOUDSTACK-6747 test for test to allow all cidrs on other end of a vpc 2014-06-25 16:58:52 +02:00
Daan Hoogland
cd3b027f44 findbugs: unit test coverage on the utils package 2014-06-25 15:43:08 +02:00
Sheng Yang
a93a30595d CLOUDSTACK-6854: Fix inconsistent IPv6 address formats
fc00:0003:1373::0002 should be treated the same as fc00:3:1373::2.
2014-06-23 10:54:12 -07:00
Damodar Reddy
1d0b14673d CLOUDSTACK-6354 : removing the hard coding of key path in EncryptionSecretKeyChecker 2014-04-10 11:44:18 +05:30
Laszlo Hornyak
5f800f2d22 Script cleanup
- new negative tests
- some copy-paste replacement in the code

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-03-30 23:27:40 +02:00
miguelaferreira
ef547108dd NetUtils testing
- Refactor tests:
  - Upgrade tests to use jUnit4
  - Add hamcrest dependency (contribution of by Laszio Hornyak)
  - Break big tests in small unit tests
  - Replace assertTrue/False with complex conditions by assertThat with
specific matchers
- Remove dead code:
  - Private static method never called locally
- Add test for method that validates cidrs

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-02-25 19:23:13 +01:00
Antonio Fornie
808c6df6d7 Fix and add some Rest unit and IT tests. Fix by adding a missing type of RoutingConfig.
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
2014-02-19 09:30:57 +01:00
Hugo Trippaers
594b51c629 Fixup the license headers in the utils project. All files now use the same license header and this is enforced by the maven-license-check plugin. 2014-02-18 12:08:36 +01:00
Hugo Trippaers
a369647bca Fix license headers 2014-02-18 10:16:31 +01:00
Antonio Fornie
510972abde Nvp and rest refactoring and more tests
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
2014-02-18 09:51:54 +01:00
Hugo Trippaers
97bad4f9b3 Fix checkstyle and license issues 2014-02-14 18:37:47 +01:00
wrodrigues
3199de69fe Fixes on Contrail and Mon InMemory plugins; adding comments about the changes.
Signed-off-by: Hugo Trippaers <htrippaers@schubergphilis.com>
2014-02-14 18:37:47 +01:00
Laszlo Hornyak
351ccf3755 Cleanup in UriUtils.getUpdateUri
- String instantiation replaced with StringBuilder and empty string constant

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-02-11 20:44:57 +01:00
Laszlo Hornyak
59364ee9a4 Added test for UriUtils.getUpdateUri
Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-02-11 20:43:49 +01:00
Hugo Trippaers
6c770958f1 Fix unittest issue when you are in a locale that uses comma for decimal separation. 2014-02-11 14:45:45 +01:00
Laszlo Hornyak
8ed9162de7 Cleanup in UriUtils.encodeURIComponent
- StringBuffer replaced with StringBuilder
- nullcheck of tokens array removed since String.split does not return null
- unit test added

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-02-09 21:57:07 +01:00
Laszlo Hornyak
8d801bffab Replaced String concatenation in loop
Replaced String concatenation in loop with StringBuilder
Unit test added

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-02-09 21:27:28 +01:00
Daan Hoogland
b3829e54d6 CLOUDSTACK-6020 ipv4 address can be a larger number then
Interger.MAX_VALUE
2014-02-04 18:40:18 +01:00
Daan Hoogland
62c9343658 compare null to non-null or not-empty-string 2014-01-06 11:28:50 +01:00
Daan Hoogland
b477e4e830 some xtra cases 2013-12-31 12:52:51 +01:00
Daan Hoogland
2cf356e047 isSameIsolationId 2013-12-31 12:25:17 +01:00
Jayapal
07de75191c Revert "CLOUDSTACK-4622:If a VM from guest network is added to network tier of VPC then IP reservation allows the CIDR to be a superset of Network CIDR for that VPC tier"
Reverting this commit as it is breaking vpc deployment, CLOUDSTACK-5652

This reverts commit ab4f095c68d4a4b4fb354b3d95096b193706987d.
2013-12-27 11:15:33 +05:30
Saksham Srivastava
ab4f095c68 CLOUDSTACK-4622:If a VM from guest network is added to network tier of VPC then IP reservation allows the CIDR to be a superset of Network CIDR for that VPC tier
Signed-off-by: Jayapal <jayapal@apache.org>
2013-12-26 16:58:04 +05:30
Min Chen
f420b74890 CLOUDSTACK-5355: addImageStore should not log password in clear text in
the log.
2013-12-03 16:55:26 -08:00
Alex Huang
d620df2bdd Reformatted all of the code. 2013-11-21 06:15:26 -08:00
Alex Huang
224f479974 Removed trailing spaces 2013-11-21 04:08:01 -08:00
Alex Huang
8d62744681 Reformat all source code. Added checkstyle to check the source code 2013-11-20 07:26:53 -08:00
Laszlo Hornyak
58477834b6 InputStream use fix in PropertiesUtil
- use PropertiesUtil.loadFromFile to read the properties
- test added

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2013-10-26 17:47:34 +02:00
Darren Shepherd
81d01369d7 Merge commit 'df728fcf41ba0dfddabfaadea8cbcb77d18bfa96'
Conflicts:
	engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
2013-10-23 12:31:53 -07:00
Laszlo Hornyak
4b530c874f Safe properties loader
- new utility method introduced in PropertiesUtil to load properties objects from files
- RegionManagerImpl modified to use the utility method
- Tests added for both

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2013-10-23 20:50:00 +02:00
Darren Shepherd
323bbccd50 Add unit tests for Transaction 2013-10-17 16:07:11 -07:00
Marcus Sorensen
d430473fe0 add missing license headers to PasswordGeneratorTest.java and an agent.properties 2013-10-14 11:56:21 -06:00
Laszlo Hornyak
47dd1c1e95 PasswordGenerator tests
- StringBuffer replaced with a StringBuilder
- tests added

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2013-10-11 20:09:37 +02:00
Laszlo Hornyak
982db550eb test fix: no assertion on the number of fileds returned
Removed the assertion on the number of fields from ReflectUtil because it did not work with bytecode manipulation like what sonar works with.

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2013-10-11 18:49:10 +02:00