1500 Commits

Author SHA1 Message Date
Will Stevens
744f9d5615 Merge release branch 4.7 to 4.8
* 4.7:
  CLOUDSTACK-9376: Restrict listTemplates API with filter=all for root admin
  CLOUDSTACK-9369: Restrict default login to ldap/native users
  Add lsb-release dependency to mgmt server and agent on Debian/Ubuntu.
  Emit template UUID and class type over event bus when deleting templates.
2016-05-27 15:03:42 -04:00
Rohit Yadav
0cb60a72fe CLOUDSTACK-9376: Restrict listTemplates API with filter=all for root admin
Restricts use of listemplates API with templatefilter=all for root admin only.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-27 15:01:15 -04:00
Rohit Yadav
566e7d9fac CLOUDSTACK-9369: Restrict default login to ldap/native users
- Restricts default login auth handler to ldap and native-cloudstack users
- Refactors and create re-usable method to find domain by id/path
- Adds unit test for refactored method in DomainManagerImpl
- Adds smoke test for login handler

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-05-27 15:00:05 -04:00
Will Stevens
dbbc37ecc7 Merge release branch 4.7 to 4.8
* 4.7:
  CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos
  Handle private gateways more reliably
  CLOUDSTACK-9287 - Fix RVR public interface
  CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes
  CLOUDSTACK-9287 - Refactor the interface state configuration
  CLOUDSTACK-9287 - Check if the nic profile has already been removed from a certain router
  CLOUDSTACK-9287 - Bring up the private gw interface on state change to master
  CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw
  CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues
  CLOUDSTACK-9287 - Put private gateway interface down on backup router
  CLOUDSTACK-9287 - Generate new mac address if router is redundant and nic profile exists
  Add private gateway IP to router initialization config
  apply static routes on change to master state
2016-05-12 11:03:57 -04:00
Will Stevens
309a60ea71 Merge pull request #1483 from remibergsma/pr1413-wilder-47
CLOUDSTACK-9287 - Fix unique mac address per rVPC routerThis is work by @wilderrodrigues, see PR #1413 It contains important fixes and I think it needs to be included so I send the PR again.

* pr/1483:
  CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos
  CLOUDSTACK-9287 - Fix RVR public interface
  CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes
  CLOUDSTACK-9287 - Refactor the interface state configuration
  CLOUDSTACK-9287 - Check if the nic profile has already been removed from a certain router
  CLOUDSTACK-9287 - Bring up the private gw interface on state change to master
  CLOUDSTACK-9287 - Make sure private gw interface is not used for default gw
  CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues
  CLOUDSTACK-9287 - Put private gateway interface down on backup router
  CLOUDSTACK-9287 - Generate new mac address if router is redundant and nic profile exists

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-12 11:00:40 -04:00
Rohit Yadav
126a039eb8 Merge branch '4.7' into 4.8 2016-05-03 08:20:27 +05:30
Will Stevens
987e8009b0 Merge pull request #1473 from remibergsma/47_bump_test_loadbalance_retries
Bump ssh retries to prevent false positives of test_loadbalanceNo more false positives after this change.

```
[root@cs1 integration]# cat /tmp//MarvinLogs/test_loadbalance_TR5RJD/results.txt
Test to create Load balancing rule with source NAT ... === TestName: test_01_create_lb_rule_src_nat | Status : SUCCESS ===
ok
Test to create Load balancing rule with non source NAT ... === TestName: test_02_create_lb_rule_non_nat | Status : SUCCESS ===
ok
Test for assign & removing load balancing rule ... === TestName: test_assign_and_removal_lb | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 3 tests in 930.418s

OK
```

* pr/1473:
  bump ssh retries to prevent false positives of test_loadbalance

Signed-off-by: Will Stevens <williamstevens@gmail.com>
2016-05-02 17:00:33 -04:00
Remi Bergsma
b32c0569c5 bump ssh retries to prevent false positives of test_loadbalance 2016-04-30 20:58:40 +02:00
Will Stevens
d11194abec Merge release branch 4.7 to 4.8
* 4.7:
  Removed sleeps and used validateList as requested.
  Added required_hardware="false" attr above test_02_root_volume_attach_detach
  Modified test_volumes.py to include a hypervisor test for root attach/detach testing
  Let hypervisor type KVM and Simulator detach root volumes. Updated test_volumes.py to include a test for detaching and reattaching a root volume from a vm. I also had to update base.py to allow attach_volume to have the parameter deviceid to be passed as needed.
2016-04-28 16:03:46 -04:00
David Mabry
73cd427555 Removed sleeps and used validateList as requested. 2016-04-27 10:31:50 -04:00
David Mabry
760ad0e265 Added required_hardware="false" attr above test_02_root_volume_attach_detach 2016-04-20 08:32:42 -05:00
David Mabry
ec7a86b2de Modified test_volumes.py to include a hypervisor test for root attach/detach testing 2016-04-19 09:28:57 -05:00
David Mabry
0b7cc087f8 Let hypervisor type KVM and Simulator detach root volumes.
Updated test_volumes.py to include a test for detaching and reattaching a root volume from a vm. I also had to update base.py to allow attach_volume to have the parameter deviceid to be passed as needed.
2016-04-18 15:40:36 -05:00
Wilder Rodrigues
799b9f223d CLOUDSTACK-9287 - Improve test by checking if pvt gw is removed and fix typos 2016-04-12 10:47:04 +02:00
Wilder Rodrigues
0e91468964 CLOUDSTACK-9287 - Add integration test to cover the private gateway related changes 2016-04-09 21:14:33 +02:00
Wilder Rodrigues
250be376e8 CLOUDSTACK-9287 - Add integration test to cover the private gw interface/mac address issues 2016-04-09 21:13:41 +02:00
Daan Hoogland
addb26455a Merge release branch 4.7 to master
* 4.7:
  CLOUDSTACK-9154 - Sets the pub interface down when all guest nets are gone
  CLOUDSTACK-9187 - Makes code ready for more something like ethXXXX, if we ever get that far
  CLOUDSTACK-9188 -  Reads network GC interval and wait from configDao
  CLOUDSTACK-9187 - Fixes interface allocation to VRRP instances
  CLOUDSTACK-9187 - Adds test to cover multiple nics and nic removal
  CLOUDSTACK-9154 - Adds test to cover nics state after GC
  CLOUDSTACK-9154 - Returns the guest iterface that is marked as added

 Conflicts:
	engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
2016-01-17 20:04:11 +01:00
Remi Bergsma
ff89587fd1 Merge pull request #1277 from ekholabs/fix/4.7-rvpc-net-gc-CLOUDSTACK-9154
[4.7] Critical VPCVR issues fixed: CLOUDSTACK-9154; CLOUDSTACK-9187; and CLOUDSTACK-9188This PR applies the same fixes as in the PR #1259, but against branch 4.7.

Please refer to PR #1259 for the tests results and all the comments already made there.

Issues fixed are:

* CLOUDSTACK-9154: rVPC doesn't recover from cleaning up of network garbage collector
* CLOUDSTACK-9187: rVPC routers in Master/Master due to concurrency problem when writing the keepalivd.conf
* CLOUDSTACK-9188: NetworkGarbageCollector is not using gc.interval and gc.wait from settings

Those changes have been covered by 2 new tests added to ```smoke/test_vpc_redundant.py```:

* test_04_rvpc_network_garbage_collector_nics
* test_05_rvpc_multi_tiers

The test ```test_04_rvpc_network_garbage_collector_nics``` depends on the global settings for the network.gc.interval and gc.wait. If one wants the test to run quicker, please change the settings (default is 600 seconds for each) and restart the Management Server before running the tests. I would suggest to set it to 60 seconds.

In addition, the NetworkGarbageCollector was redefining the settings above mentioned and not reading their values through ConfigDao. Due to that, the settings were not being applied properly and the test was waiting to long to check the VPC routers.

* pr/1277:
  CLOUDSTACK-9154 - Sets the pub interface down when all guest nets are gone
  CLOUDSTACK-9187 - Makes code ready for more something like ethXXXX, if we ever get that far
  CLOUDSTACK-9188 -  Reads network GC interval and wait from configDao
  CLOUDSTACK-9187 - Fixes interface allocation to VRRP instances
  CLOUDSTACK-9187 - Adds test to cover multiple nics and nic removal
  CLOUDSTACK-9154 - Adds test to cover nics state after GC
  CLOUDSTACK-9154 - Returns the guest iterface that is marked as added

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-17 19:12:43 +01:00
Remi Bergsma
329c012b79 Merge pull request #994 from pritisarap12/snapshot-has-no-attribute-len
CLOUDSTACK-9001: Modifying snapshot results validation Currently snapshots results validation is based on length of snapshot result but if snapshot creation fails then None type object will not have "len" attribute hence modifying the validation.

* pr/994:
  CLOUDSTACK-9001: Modifying snapshot results validation in testpath_uuid_event testpath

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-17 13:40:31 +01:00
Remi Bergsma
a4d0af2133 Merge pull request #1000 from pritisarap12/CLOUDSTACK-9005-Modifying-tearDown-function
CLOUDSTACK-9005: Modifying tearDown functionModifying tearDown function to check if data volume is in detached state before deleting the volume

* pr/1000:
  CLOUDSTACK-9005: Modifying tearDown function

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-17 13:38:40 +01:00
Remi Bergsma
24818af23a Merge release branch 4.7 to master
* 4.7:
  CLOUDSTACK-9222 Prevent cloud.log.1 filling up the disk
  Add integration test for restartVPC with cleanup, and Private Gateway enabled.
  Nullpointer Exception in NicProfileHelperImpl
2016-01-16 20:25:29 +01:00
Remi Bergsma
4dabd1311c Merge pull request #1328 from borisroman/nullpointer_nicprofilehelperimpl
NicProfileHelperImpl NullpointerException when ipVO is nullWhen a VPC has a private gateway, and one would like to restart the VPC with **cleanup** it would fail.

This PR adds a NullPointer check and verifies it with an integration test.

```
test_01_vpc_privategw_acl (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_01_vpc_privategw_acl | Status : SUCCESS ===
ok
test_02_vpc_privategw_static_routes (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_02_vpc_privategw_static_routes | Status : SUCCESS ===
ok
test_03_vpc_privategw_restart_vpc_cleanup (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_03_vpc_privategw_restart_vpc_cleanup | Status : SUCCESS ===
ok
test_04_rvpc_privategw_static_routes (integration.smoke.test_privategw_acl.TestPrivateGwACL) ... === TestName: test_04_rvpc_privategw_static_routes | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 4 tests in 2945.055s

OK
```

* pr/1328:
  Add integration test for restartVPC with cleanup, and Private Gateway enabled.
  Nullpointer Exception in NicProfileHelperImpl

Signed-off-by: Remi Bergsma <github@remi.nl>
2016-01-16 20:15:52 +01:00
Remi Bergsma
75b68c6829 Merge release branch 4.7 to master
* 4.7:
  Fix unable to setup more than one Site2Site VPN Connection
  FIX S2S VPN rVPC: Check only redundant routers in state MASTER
  PEP8 of integration/smoke/test_vpc_vpn
  Add S2S VPN test for Redundant VPC
  Make integration/smoke/test_vpc_vpn Hypervisor independant
  FIX VPN: non-working ipsec commands
  [UI] MADNESS
  [DB] Add force_encap field to s2s_customer_gateway table
  [ROUTER] Add forceencaps field to python router ipsec config method
  [TEST] unittest needs rework
  [MARVIN] Add forceencap field to VpnCustomerGateway class in marvin base
  [CORE] Add Force UDP Encapsulation option to Site2Site VPN
  CLOUDSTACK-9186: Root admin cannot see VPC created by Domain admin user
  CLOUDSTACK-9192: UpdateVpnCustomerGateway is failing
  CLOUDSTACK-6485 prevent ip asignment of private gw iface
  CLOUDSTACK-9204 Do not error when staticroute is already gone
  make both check lines consistent
  CLOUDSTACK-9181 Prevent syntax error in checkrouter.sh
  CLOUDSTACK-9202 Bump ssh timeout
2016-01-16 19:54:41 +01:00
Michael Andersen
ecc8cc0bc9 PEP8 of integration/smoke/test_vpc_vpn 2016-01-12 11:24:35 +01:00
Michael Andersen
a42b04695f Add S2S VPN test for Redundant VPC 2016-01-12 11:24:34 +01:00
Michael Andersen
fd83ca00e3 Make integration/smoke/test_vpc_vpn Hypervisor independant 2016-01-12 11:24:34 +01:00
Boris Schrijver
de11b7307c Add integration test for restartVPC with cleanup, and Private Gateway enabled. 2016-01-11 16:02:32 +01:00
pavanb018
792e49366b Automation for CLOUDSTACK-9214 , detect wrong GW or NM 2016-01-07 10:47:28 +05:30
Miguel Ferreira
c285d6cfb4 Use NSX specific config values instead of zone config values 2015-12-24 16:07:06 -03:00
Miguel Ferreira
acdc42cb48 Fix method call bugs when accessign non defined variables 2015-12-24 16:07:06 -03:00
Miguel Ferreira
f804c9756d Use helper method to migrate router vm 2015-12-24 16:07:06 -03:00
nvazquez
4ac2737754 CLOUDSTACK-9074: Marvin tests for NSX Shared Networks Support 2015-12-24 16:07:06 -03:00
Wilder Rodrigues
5ef3144fdf CLOUDSTACK-9154 - Sets the pub interface down when all guest nets are gone
- Refactors the set_backup, set_master and set_fault methods to have better names for the variable
   - Increase the sleep on the test in order to wait for the routers to be ready. It's now 3 times the GC settings
2015-12-22 14:52:08 +01:00
Wilder Rodrigues
f5a6dee8dd CLOUDSTACK-9187 - Makes code ready for more something like ethXXXX, if we ever get that far
- Adds log info to NetworkOrchestrator in order to make the work of the Net-Scavenger more visible.
2015-12-22 14:52:07 +01:00
Wilder Rodrigues
b1e4210682 CLOUDSTACK-9187 - Adds test to cover multiple nics and nic removal 2015-12-22 14:52:06 +01:00
Wilder Rodrigues
749ac2e224 CLOUDSTACK-9154 - Adds test to cover nics state after GC 2015-12-22 14:52:05 +01:00
Wilder Rodrigues
43ce049d43 CLOUDSTACK-9135 - Makes test compliant with Redundant VPCs 2015-12-11 15:03:50 +01:00
Wilder Rodrigues
632ee18ab7 CLOUDSTACK-9135 - Moves test into smoke directory
- Missed this test when moved the other 5 ones.
2015-12-10 13:27:53 +01:00
Remi Bergsma
cd81982b39 Merge pull request #1204 from ekholabs/improve/test-internal-lb-CLOUDSTACK-9123
CLOUDSTACK-9123 - As a Developer I want the test_internal_lb.py to work with multiple hypervisorsThis PR make the test_internal_lb.py work with other Hypervisors types.

   - Get hypervisor information from testClient.getHypervisorInfo()
   - Adds XenServer, HyperV and VMware hypervisors
   - Makes sure the OS type is "Other PV (64-bit)"

* pr/1204:
  CLOUDSTACK-9123 - Make test compliant with multiple hypervisors

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-10 11:18:44 +01:00
Wilder Rodrigues
c7f5e8a827 CLOUDSTACK-9123 - Make test compliant with multiple hypervisors
- Get hypervisor information from testClient.getHypervisorInfo()
   - Adds HyperV and VMware hypervisors
   - Makes sure the OS type is "Other PV (64-bit)"
2015-12-09 17:45:40 +01:00
Wilder Rodrigues
fb92de5262 CLOUDSTACK-9120 - Moves tests to the smoke directory
- Those tests are doing a lot more than component tests would do. They require hardware and a lot of resources from real hypervisors.
2015-12-08 20:28:07 +01:00
Remi Bergsma
738b78886e Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9118 - Adds integration test to cover routers state.
  CLOUDSTACK-9118 - Improves the existing checkrouter.sh script
2015-12-08 20:12:09 +01:00
Wilder Rodrigues
848ef78158 CLOUDSTACK-9118 - Adds integration test to cover routers state.
- Refactoring the existing tests
2015-12-08 11:06:35 +01:00
Remi Bergsma
e08294a95f Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9106 - Makes Enum name compliant with Java code conventions.
  CLOUDSTACK-9106 - Adds a test to cover the changes in the applyVpnUsers() method
  CLOUDSTACK-9106 - Makes the router commands call more consistent.
  CLOUDSTACK-9106 - Enables private gateway tests on Redundant VPCs
  CLOUDSTACK-9106 - Refactor the createPrivateNicProfileForGateway() method
  CLOUDSTACK-9106 - Reduces the amount of iterations through the routers of a VPC
  Add support for not (re)starting server after cloud-setup-management.

Closed PRs that will not be considered for merge:
This closes #1158
This closes #1097
2015-12-07 21:36:36 +01:00
Remi Bergsma
8757daf2d1 Merge pull request #1178 from miguelaferreira/nsx-livelock
Prevent live-lock in NSX API clientThe NSX api client relies on a sequence of responses to identify the need to authenticate and to follow redirects. In order to avoid live-locks, the NSX API client has a counter that will abort the execution after 5 consecutive requests that do not produce a Success (200) response.
When a NSX controller enters a faulty state it can allow authentication requests but deny any other API call. In such cases the NSX API client will consider the denied request a reason to follow a redirect and will enter into a live-lock (because the actual redirection is not happening).
This PR changes the NSX API client to no reset it's counter on a Success response from an authentication request. That is, the counter is only reset if another type of API call yields a Success response.

In addition, this PR also:
* changes the configuration of the license-maven-plugin to ignore files generated by pmd
* moves the NSX marvin test to a plugins folder
* refactors the NSX marvin test to reduce duplication
* adds an extra test case to the NSX marvin test that checks that NSX tunnels are properly created

* pr/1178:
  Test NSX tunnel in guest network
  Refactor test cases to reduce duplication
  Use logger to print debug messages during test
  Move NSX integrationt test to new plugins folder
  Ignore pmd generated files during license check
  Fix NSX rest client to not reset execution counter after a login
  Add test for NSX plugin that simulates a live lock

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-07 19:34:20 +01:00
Abhinandan Prateek
987fcbd441 CLOUDSTACK-8592: Implement Quota service
Quota service while allowing for scalability will make sure that the cloud is
not exploited by attacks, careless use and program errors. To address this
problem, we propose to employ a quota-enforcement service that allows resource
usage within certain bounds as defined by policies and available quotas for
various entities.  Quota service extends the functionality of usage server to
provide a measurement for the resources used by the accounts and domains using a
common unit referred to as cloud currency in this document. It can be configured
to ensure that your usage won’t exceed the budget allocated to accounts/domain
in cloud currency.  It will let user know how much of the cloud resources he is
using. It will help the cloud admins, if they want, to ensure that a user does
not go beyond his allocated quota. Per usage cycle if a account is found to be
exceeding its quota then it is locked. Locking an account means that it will not
be able to initiat e a new resource allocation request, whether it is more
storage or an additional ip. Needless to say quota service as well as any action
on the account is configurable.

Changes from Github code review:

- Added marvin test for quota plugin API
- removed unused commented code
- debug messages in debug enabled check
- checks for nulls, fixed access to member variables and feature
- changes based on PR comments
- unit tests for UsageTypes
- unit tests for all Cmd classes
- unit tests for all service and manager impls
- try-catch-finally or try-with-resource in dao impls for failsafe db switching
- remove dead code
- add missing quota calculation case (regression fixed)
- replace tabs with spaces in pom.xmls
- quota: though default value for quota_calculated is 0, the usage server
  makes it null while entering usage entries. Flipping the condition so
  as to acocunt for that.
- quotatypes: fix NPE in quota type
- quota framework test fixes
- made statement period configurable
- changed default email templates to reflect the fact that exhausted quota may not result in a locked account
- added quotaUpdateCmd that refreshes quota balances and sends alerts and statements
- report quotaSummary command returns quota balance, quota usage and state for all account
- made UI framework changes to allow for text area input in edit views
- process usage entries that have greater than 0 usage
- orocess quota entries only if tariff is non zero
- if there are credit entries but no balance entry create a dummy balance entry
- remove any credit entries that are before the last balance entry
  when displaying balance statement
- on a rerun the last balance is now getting added

FS: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Quota+Service+-+FS
PR: https://github.com/apache/cloudstack/pull/768

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2015-12-07 23:02:48 +05:30
Wilder Rodrigues
1738ce1740 CLOUDSTACK-9106 - Enables private gateway tests on Redundant VPCs 2015-12-07 10:30:18 +01:00
Miguel Ferreira
811f254e4d Test NSX tunnel in guest network 2015-12-05 17:51:26 +01:00
Miguel Ferreira
a633ef8113 Refactor test cases to reduce duplication 2015-12-05 17:51:20 +01:00
Miguel Ferreira
1e820e3906 Use logger to print debug messages during test 2015-12-05 15:52:23 +01:00