1044 Commits

Author SHA1 Message Date
Rohit Yadav
ae32aa13ed CLOUDSTACK-9594: Fix regression in test_templates
Fixes regression in component test `test_templates.py`

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 11:57:40 +05:30
Rohit Yadav
8769597523 Merge pull request #1763 from sudhansu7/CLOUDSTACK-9594
CLOUDSTACK-9594: API "list templates templatefilter=all" reveals allAPI "list templates templatefilter=all" reveals all templates.
Using a "list templates templatefilter=all" API call any domain admin can see all templates of all domains in ACS. Information returned includes the account and domain of the template's owner.

The template data shows what that VM is using and any hints from the label. This would give an advantage in what attack vectors to use. The account and domain can possibly be used in brute force attack to guess the password and login information.

Test Scenario:

created two accounts in different domain.

```
mysql> select account_id,username,api_key from user where id in (4,5);
+------------+-----------+----------------------------------------------------------------------------------------+
| account_id | username  | api_key                                                                                |
+------------+-----------+----------------------------------------------------------------------------------------+
|          4 | sudadmin1 | 3qeSuWadNzUFZ_i6c6zbwafjM3Eo0TWpkHw3En9jNsg5Ditk2N18DnbbL2quBYQ7FsdXQ8rwxbyFlE8vyUTwEg |
|          5 | sudadmin  | N5uHVOrg1Ek1F1a_5OXTz4WpLG3ewHqcbPUSBjQ-2CTJdxmUe2go0S8fyqH4Np0scYiehYg2KqthZXCWEyKx1A |
+------------+-----------+----------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> select account_name,domain_id from account where id in (4,5);
+--------------+-----------+
| account_name | domain_id |
+--------------+-----------+
| sudadmin     |         2 |
| sudadmin1    |         3 |
+--------------+-----------+
2 rows in set (0.00 sec)
```

User sudadmin registered a private template named 'Debian'.

http://10.147.59.107:8080/client/api?apikey=N5uHVOrg1Ek1F1a_5OXTz4WpLG3ewHqcbPUSBjQ-2CTJdxmUe2go0S8fyqH4Np0scYiehYg2KqthZXCWEyKx1A&command=listTemplates&templatefilter=self&signature=ODt7zEWCLL20z1FT%2FIkd1molRaM%3D

listTemplate with "templatefilter=self", lists the newly registered template.

```
<listtemplatesresponse cloud-stack-version="4.8.0">
<count>1</count>
	<template>
		<id>51026d32-60ee-4e25-8ffd-3fa3c57fc14c</id>
		<name>Debian</name>
		<displaytext>Debian</displaytext>
		<ispublic>false</ispublic>
		<created>2016-11-10T17:18:00-0500</created>
		<isready>true</isready>
		<passwordenabled>false</passwordenabled>
		<format>VHD</format>
		<isfeatured>false</isfeatured>
		<crossZones>false</crossZones>
		<ostypeid>38c1fc84-a687-11e6-a8c8-06f654000053</ostypeid>
		<ostypename>Debian GNU/Linux 7(64-bit)</ostypename>
		<account>sudadmin</account>
		<zoneid>25fa5b74-d4c2-4bad-8e3a-ceffcd10985e</zoneid>
		<zonename>z1</zonename>
		<status>Download Complete</status>
		<size>2621440000</size>
		<templatetype>USER</templatetype>
		<hypervisor>XenServer</hypervisor>
		<domain>SUDDOMAIN</domain>
		<domainid>a350c00d-4048-4876-ae09-74ad4b7bb28c</domainid>
		<isextractable>false</isextractable>
		<checksum>e87a6d7291b999c92baa9623c9c3c207</checksum>
		<details>{hypervisortoolsversion=xenserver61}</details>
		<sshkeyenabled>false</sshkeyenabled>
		<isdynamicallyscalable>false</isdynamicallyscalable>
	</template>
</listtemplatesresponse>

```

User: sudadmin1
listTemplate with "templatefilter=self" does not list any template.

http://10.147.59.107:8080/client/api?apikey=3qeSuWadNzUFZ_i6c6zbwafjM3Eo0TWpkHw3En9jNsg5Ditk2N18DnbbL2quBYQ7FsdXQ8rwxbyFlE8vyUTwEg&command=listTemplates&templatefilter=self&signature=RfKsdg3RxDkqJotbTlHU2RdbdPA%3D

`<listtemplatesresponse cloud-stack-version="4.8.0"/>
`

NO TEMPLATES

**listTemplate with "templatefilter=all" lists all templates**

http://10.147.59.107:8080/client/api?apikey=3qeSuWadNzUFZ_i6c6zbwafjM3Eo0TWpkHw3En9jNsg5Ditk2N18DnbbL2quBYQ7FsdXQ8rwxbyFlE8vyUTwEg&command=listTemplates&templatefilter=all&signature=l5tubfyABT67d1jY702dvtZODbc%3D

Result:

```
<listtemplatesresponse cloud-stack-version="4.8.0">
<count>3</count>
	<template>
		<id>38451a02-a687-11e6-a8c8-06f654000053</id>
		<name>CentOS 5.6(64-bit) no GUI (XenServer)</name>
		<displaytext>CentOS 5.6(64-bit) no GUI (XenServer)</displaytext>
		<ispublic>true</ispublic>
		....
	</template>
	<template>
		<id>51026d32-60ee-4e25-8ffd-3fa3c57fc14c</id>
		<name>Debian</name>
		<displaytext>Debian</displaytext>
		<ispublic>false</ispublic>
		<created>2016-11-10T17:18:00-0500</created>
		<isready>true</isready>
		<passwordenabled>false</passwordenabled>
		<format>VHD</format>
		<isfeatured>false</isfeatured>
		<crossZones>false</crossZones>
		<ostypeid>38c1fc84-a687-11e6-a8c8-06f654000053</ostypeid>
		<ostypename>Debian GNU/Linux 7(64-bit)</ostypename>
		**<account>sudadmin</account>**
		<zoneid>25fa5b74-d4c2-4bad-8e3a-ceffcd10985e</zoneid>
		<zonename>z1</zonename>
		<size>2621440000</size>
		<templatetype>USER</templatetype>
		<hypervisor>XenServer</hypervisor>
		<domain>SUDDOMAIN</domain>
		<domainid>a350c00d-4048-4876-ae09-74ad4b7bb28c</domainid>
		<isextractable>false</isextractable>
		<checksum>e87a6d7291b999c92baa9623c9c3c207</checksum>
		<details>{hypervisortoolsversion=xenserver61}</details>
		<sshkeyenabled>false</sshkeyenabled>
		<isdynamicallyscalable>false</isdynamicallyscalable>
	</template>
	<template>
		<id>5f6af7bb-d965-4b9b-ab45-6d455b0d6bbe</id>
		<name>SystemVM Template (XenServer)</name>
		<displaytext>SystemVM Template (XenServer)</displaytext>
		<ispublic>false</ispublic>
		.....
	</template>
</listtemplatesresponse>

```

**After Fix:**

http://10.147.59.107:8080/client/api?apikey=3qeSuWadNzUFZ_i6c6zbwafjM3Eo0TWpkHw3En9jNsg5Ditk2N18DnbbL2quBYQ7FsdXQ8rwxbyFlE8vyUTwEg&command=listTemplates&templatefilter=all&signature=l5tubfyABT67d1jY702dvtZODbc%3D

```
<listtemplatesresponse cloud-stack-version="4.8.0">
<count>1</count>
	<template>
		<id>38451a02-a687-11e6-a8c8-06f654000053</id>
		<name>CentOS 5.6(64-bit) no GUI (XenServer)</name>
		<displaytext>CentOS 5.6(64-bit) no GUI (XenServer)</displaytext>
		<ispublic>true</ispublic>
		<created>2016-11-10T09:32:44-0500</created>
		<isready>true</isready>
		<passwordenabled>false</passwordenabled>
		<format>VHD</format>
		<isfeatured>true</isfeatured>
		<crossZones>true</crossZones>
		<ostypeid>38a2bfd6-a687-11e6-a8c8-06f654000053</ostypeid>
		<ostypename>CentOS 5.6 (64-bit)</ostypename>
		<account>system</account>
		<zoneid>25fa5b74-d4c2-4bad-8e3a-ceffcd10985e</zoneid>
		<zonename>z1</zonename>
		<size>21474836480</size>
		<templatetype>BUILTIN</templatetype>
		<hypervisor>XenServer</hypervisor>
		<domain>ROOT</domain>
		<domainid>383e0ea6-a687-11e6-a8c8-06f654000053</domainid>
		<isextractable>true</isextractable>
		<checksum>905cec879afd9c9d22ecc8036131a180</checksum>
		<sshkeyenabled>false</sshkeyenabled>
		<isdynamicallyscalable>true</isdynamicallyscalable>
	</template>
</listtemplatesresponse>

```

Bug has been fixed considering below points
1. templatefilter=all or isofilter=all is applicable only to admin and domain admin.
2. With templatefilter=all or isofilter=all below are the visiblity of templates in system.
- admin should be able to see all templates/iso in system.
- domain admin should be able to see all public template and templates under its domain tree (including sub domain).
- domain admin in a project context should be able to see all public templates and templates registered
as project account and templates which are shared(using updateTemplatePermission api) with project account.

Also Modified "test/integration/component/test_escalation_listTemplateDomainAdmin.py"
This marvin test was written for this scenario but for the second account "templatefilter=all" is not used.

* pr/1763:
  CLOUDSTACK-9594: reverted changes  introduced in  CLOUDSTACK-9376
  CLOUDSTACK-9594: API "list templates templatefilter=all" reveals all templates of all domains

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-12-09 00:31:09 +05:30
Sudhansu
a13231226c CLOUDSTACK-9594: API "list templates templatefilter=all" reveals all
templates of all domains

Bug has been fixed considering below points
1. templatefilter=all or isofilter=all is applicable only to admin
and domain admin.
2. With templatefilter=all or isofilter=all below are the visiblity
of templates in system.
a. admin should be able to see all templates/iso in system.
b. domain admin should be able to see all public template and
templates under its domain tree (including sub domain).
c. domain admin in a project context should be able to see all public
 templates and templates registered as project account and templates
 which are shared(using updateTemplatePermission api) with project account.

Modified
"test/integration/component/test_escalation_listTemplateDomainAdmin.py"
This marvin test is written for this scenario but for the second account
 "templatefilter=all" is not used.
2016-11-11 19:56:35 +05:30
Marc-Aurèle Brothier
158497d68a CLOUDSTACK-9544: Check access on account trying to generate user API keys
This fixes CVE-2016-6813

Signed-off-by: Marc-Aurèle Brothier <m@brothier.org>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
2016-10-27 22:15:49 +05:30
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
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
pavanb018
792e49366b Automation for CLOUDSTACK-9214 , detect wrong GW or NM 2016-01-07 10:47:28 +05:30
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
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
7e902cd505 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9075 - Uses the same vlan since it should have been already released
  CLOUDSTACK-9075 - Adds VPC static routes test
  CLOUDSTACK-9075 - Covers Private GW ACL with Redundant VPCs
  CLOUDSTACK-9075 - Add method to get list of Physical Networks per zone
  CLOUDSTACK-6276 Removing unused parameter in integration test for projects
  CLOUDSTACK-6276 Removing unused parameter in integration test
  CLOUDSTACK-6276 Fixing affinity groups for projects
2015-12-03 20:42:41 +01:00
Remi Bergsma
4ffad548a5 Merge pull request #1107 from karuturi/CLOUDSTACK-9080
CLOUDSTACK-9080: Resource limits for Primary arent respected during attachprimary store resource limit check is not performed while attaching a
volume to a vm. Added them same.
Also added a marvin test case to verify the same.

Testing:
BEFORE
No error is shown in UI when trying to attach a volume even after reaching the resource limits.

```
mysql> select * from resource_limit where type="primary_storage";
+----+-----------+------------+-----------------+-------------+
| id | domain_id | account_id | type            | max         |
+----+-----------+------------+-----------------+-------------+
| 10 |      NULL |          4 | primary_storage | 21474836480 |
+----+-----------+------------+-----------------+-------------+
1 row in set (0.00 sec)

mysql> select * from resource_count where account_id=4 and type='primary_storage';
+----+------------+-----------+-----------------+-------------+
| id | account_id | domain_id | type            | count       |
+----+------------+-----------+-----------------+-------------+
| 63 |          4 |      NULL | primary_storage | 48318382080 |
+----+------------+-----------+-----------------+-------------+
1 row in set (0.00 sec)
```

AFTER
Following error message is shown in UI and the volume is not attached
![screen shot 2015-11-19 at 5 34 08 pm](https://cloud.githubusercontent.com/assets/186833/11336645/046b5bcc-920d-11e5-97af-3d0da14c0e38.png)

The resource limits stays the same

```
mysql> select * from resource_limit where type="primary_storage";
+----+-----------+------------+-----------------+-------------+
| id | domain_id | account_id | type            | max         |
+----+-----------+------------+-----------------+-------------+
| 10 |      NULL |          4 | primary_storage | 21474836480 |
+----+-----------+------------+-----------------+-------------+
1 row in set (0.01 sec)

mysql> select * from resource_count where account_id=4 and type='primary_storage';
+----+------------+-----------+-----------------+-------------+
| id | account_id | domain_id | type            | count       |
+----+------------+-----------+-----------------+-------------+
| 63 |          4 |      NULL | primary_storage | 48318382080 |
+----+------------+-----------+-----------------+-------------+
1 row in set (0.00 sec)
```

Marvin test: nosetests --with-marvin --marvin-config=setup/dev/advanced.cfg --zone=xen-zone0 --hypervisor=xenserver test/integration/component/test_ps_resource_limits_volume.py

before the change

```
# do ... === TestName: test_attach_volume_exceeding_primary_limits | Status : FAILED ===
AssertionError: Resource count 23 should match with the expected resource count 22\n
```

After the change

```
# do ... === TestName: test_attach_volume_exceeding_primary_limits | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 1 test in 1178.354s

OK
```

* pr/1107:
  CLOUDSTACK-9080: Resource limits for Primary arent respected during attach.

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-12-03 09:43:31 +01:00
sanjeev
24db5de900 Incorporated review comments from the PR 2015-12-02 16:06:26 +05:30
sanjeevn
41ce802c93 Add marvin test for bug CS-38356
Bug-Id: CS-38356
Reviewed-By: Self
2015-12-02 16:06:26 +05:30
Patrick Dube
091bb79669 CLOUDSTACK-6276 Removing unused parameter in integration test for projects 2015-11-28 20:46:24 -05:00
Patrick Dube
a1db428e08 CLOUDSTACK-6276 Removing unused parameter in integration test 2015-11-28 20:44:56 -05:00
Patrick Dube
c76d317150 CLOUDSTACK-6276 Fixing affinity groups for projects 2015-11-27 14:43:02 -05:00
Srikanteswararao Talluri
ab385c814f Revert "Change references of people.apache.org to home.apache.org in the test code"
This reverts commit 001169f08f5d315620cb1860a82e4b08d996d8c9.
2015-11-26 12:07:49 +05:30
Srikanteswararao Talluri
45fa8ffb20 Revert "Change references of people.apache.org to home.apache.org in the test code"
This reverts commit af267cf0e5e9853a6acc839615c31120a7c1e83c.
2015-11-26 12:05:42 +05:30
SrikanteswaraRao Talluri
001169f08f Change references of people.apache.org to home.apache.org in the test code
This closes #1123
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
2015-11-26 11:41:11 +05:30
SrikanteswaraRao Talluri
af267cf0e5 Change references of people.apache.org to home.apache.org in the test code
This closes #1123
Signed-off-by: SrikanteswaraRao Talluri <talluri@apache.org>
2015-11-26 11:38:07 +05:30
Rajani Karuturi
256263492f CLOUDSTACK-9080: Resource limits for Primary arent respected during attach.
primary store resource limit check is not performed while attaching a
volume to a vm. Added them same.
Also added a marvin test case to verify the same.
2015-11-24 11:59:31 +05:30
Remi Bergsma
76f430cfc3 Merge release branch 4.6 to master
* 4.6:
  CLOUDSTACK-9015 - Delete public IP in order to get both IP and NAT rule removed.
  CLOUDSTACK-9015 - Add test to cover the rVPC routers stop/start/reboot scenario
  CLOUDSTACK-9015 - Make sure the Backup router can talk to the Master router after a stop/start/reboot
2015-11-19 18:02:13 +01:00
Wilder Rodrigues
459499017f CLOUDSTACK-9015 - Delete public IP in order to get both IP and NAT rule removed.
- Set the IP and NAT to None to make sure they get reassigned.
2015-11-18 16:25:50 +01:00
Remi Bergsma
95ae7963d5 Merge pull request #801 from nlivens/updated-nuage-vsp-plugin
CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2

* pr/801:
  CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-18 12:09:09 +01:00
Wilder Rodrigues
952d9a84d2 CLOUDSTACK-9015 - Add test to cover the rVPC routers stop/start/reboot scenario
- Stop/reboot master router should make the backup router become master
   - Start the stopped router should make be the backup router
2015-11-12 18:32:53 +01:00
Remi Bergsma
f948e96299 Merge pull request #1023 from ekholabs/fix/egress_state-CLOUDSTACK-8925
CLOUDSTACK-8925 - Default allow for Egress rules is not being configured properly in VR iptables rulesThis PR fixes the router default policy for egress. When the default is DENY, the router still allows outgoing connections.

The test component/test_routers_network_ops.py was improved to cover that case as well. The results were:

Test redundant router internals ... === TestName: test_01_isolate_network_FW_PF_default_routes_egress_true | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_02_isolate_network_FW_PF_default_routes_egress_false | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true | Status : SUCCESS ===
ok
Test redundant router internals ... === TestName: test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false | Status : SUCCESS ===
ok

----------------------------------------------------------------------
Ran 4 tests in 3636.656s

OK
/tmp//MarvinLogs/test_routers_network_ops_QDL429/results.txt (END)

* pr/1023:
  CLOUDSTACK-8925 - Implement the default egress DENY/ALLOW properly
  CLOUDSTACK-8925 - Improve the default egress tests in order to cover newly entered rules
  CLOUDSTACK-8925 - Add egress dataset to test_data.py
  CLOUDSTACK-8925 - Drop the traffic when default egress is set to false

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-11-04 14:59:02 +01:00
Wilder Rodrigues
79dabfdae4 CLOUDSTACK-8925 - Implement the default egress DENY/ALLOW properly
- Make tests work with right IP and rules
   - Add egress rule for port 53 protocol UDP when testing default egress DENY on RVR
2015-11-04 13:48:04 +01:00
Wilder Rodrigues
ad4fbcd577 CLOUDSTACK-8925 - Improve the default egress tests in order to cover newly entered rules 2015-11-03 13:59:17 +01:00
sanjeev
7d1dc04a43 CLOUDSTACK-9016: Deploy vm with gateway ip address in VPC
Signed-off-by: sanjeev <sanjeev@apache.org>
2015-11-02 14:41:25 +05:30
Remi Bergsma
d8f9c235e9 Merge pull request #1002 from ekholabs/test/dhcphosts-CLOUDSTACK-9007
CLOUDSTACK-9007 - Write test to check that the /etc/dhcphosts.txt doesn't contain duplicate IPsThis PR contains a test that will cover the fix on PR #981

The tests does the following:

* Creates account, service offering, network offering, network
* Deploys two virtual machines
  - Each machine with a pre-assigned IP
* Creates two FW and PF rules
* Checks that SSH into the VMs works
* Checks default routes from both VMs
* Checks that the /etc/dhcphosts.txt contains 1 entry per VM IP
* Destroys/Expunges 1 VM
* Creates a new VM with the same IP as the destroyed one
* Checks that the /etc/dhcphosts.txt contains 1 entry per VM IP

* pr/1002:
  CLOUDSTACK-9007 - Add test check that /etc/dhcphosts.txt doesn't contain duplicate IPs

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-29 19:55:24 +01:00
Wilder Rodrigues
bf3c894fb9 CLOUDSTACK-9007 - Add test check that /etc/dhcphosts.txt doesn't contain duplicate IPs 2015-10-29 15:22:58 +01:00
Wilder Rodrigues
097ef34b85 CLOUDSTACK-8957 - Add integration test that cheks if the password file is present and not empty 2015-10-29 07:14:51 +01:00
Nick Livens
645f8758df CLOUDSTACK-8832 : Update Nuage VSP plugin to work with Nuage VSP release 3.2 2015-10-27 14:56:57 +01:00
Boris Schrijver
a24cbafb15 CLOUDSTACK-8989 test_ps_limits.py tests can also be run on a basic setup. 2015-10-27 14:30:58 +01:00
Remi Bergsma
5cacd99570 Merge pull request #972 from miguelaferreira/test_isolate_network_FW_PF_default_routes
Fix error message in test_isolate_network_FW_PF_default_routesWhile running test_isolate_network_FW_PF_default_routes it is expected
that SSH'ing into a VM does not work immediately. However, when it fails
(as expected) witht he follwoing error

      ====Trying SSH Connection: Host:192.168.23.12 Uer:root
    Port:22 RetryCnt:1===
      Traceback (most recent call last):
        File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/marvin/sshClient.py", line 121, in createConnection timeout=self.timeout)
        File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/client.py", line 251, in connect retry_on_signal(lambda: sock.connect(addr))
        File /home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/util.py", line 270, in retry_on_signal return function()
        File /home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/client.py", line 251, in <lambda> retry_on_signal(lambda: sock.connect(addr))
        File "/usr/lib64/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args)
      error: [Errno 113] No route to host

it would try to print a message that generates a actual error:

```
  DEBUG: ====Trying SSH Connection: Host:192.168.23.12 User:root
Port:22 RetryCnt:0===
  test_isolate_network_FW_PF_default_routes
(integration.component.test_routers_network_ops.TestIsolatedNetworks):
CRITICAL: EXCEPTION: test_isolate_network_FW_PF_default_routes:
    Traceback (most recent call last):,
      File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
testMethod()',
      File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/test/integration/component/test_routers_network_ops.py", line 448, in test_isolate_network_FW_PF_default_routes self.fail("Failed to SSH into VM - %s" % (public_ip.ipaddress.ipaddress)),
      "AttributeError: 'unicode' object has no attribute 'ipaddress'"
```

* pr/972:
  Fix error message in test_isolate_network_FW_PF_default_routes

Signed-off-by: Remi Bergsma <github@remi.nl>
2015-10-24 09:49:53 +02:00
Miguel Ferreira
c59de915c6 Fix error message in test_isolate_network_FW_PF_default_routes
While running test_isolate_network_FW_PF_default_routes it is expected
that SSH'ing into a VM does not work immediately. However, when it fails
(as expected) witht he follwoing error

      ====Trying SSH Connection: Host:192.168.23.12 Uer:root
    Port:22 RetryCnt:1===
      Traceback (most recent call last):
        File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/marvin/sshClient.py", line 121, in createConnection timeout=self.timeout)
        File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/client.py", line 251, in connect retry_on_signal(lambda: sock.connect(addr))
        File /home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/util.py", line 270, in retry_on_signal return function()
        File /home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/venv/lib/python2.7/site-packages/paramiko/client.py", line 251, in <lambda> retry_on_signal(lambda: sock.connect(addr))
        File "/usr/lib64/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args)
      error: [Errno 113] No route to host

it would try to print a message that generates a actual error:

  DEBUG: ====Trying SSH Connection: Host:192.168.23.12 User:root
Port:22 RetryCnt:0===
  test_isolate_network_FW_PF_default_routes
(integration.component.test_routers_network_ops.TestIsolatedNetworks):
CRITICAL: EXCEPTION: test_isolate_network_FW_PF_default_routes:
    Traceback (most recent call last):,
      File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
testMethod()',
      File "/home/jenkins/workspace/mccloud/mct-run-marvin-tests@2/test/integration/component/test_routers_network_ops.py", line 448, in test_isolate_network_FW_PF_default_routes self.fail("Failed to SSH into VM - %s" % (public_ip.ipaddress.ipaddress)),
      "AttributeError: 'unicode' object has no attribute 'ipaddress'"
2015-10-23 17:01:07 +02:00
Wilder Rodrigues
3ead9d7229 CLOUDSTACK-8935 - Clean up network resources in the right order 2015-10-23 16:00:09 +02:00
Wilder Rodrigues
38d03576d6 CLOUDSTACK-8952 - Make the tests rely on the interface state other than the json file 2015-10-17 14:47:05 +02:00
Wilder Rodrigues
2a747ca735 CLOUDSTACK-8952 - Reduce retried from 20 to 5
- We do not need to retry that much
2015-10-17 12:20:42 +02:00
Wilder Rodrigues
41f4d8b58a CLOUDSTACK-8952 - Make the check for master more reliable
- Do not use the API call because it will read what is in the database, that might not have been updated yet
     * Check the status in the router directly instead
   - Remove all the sleeps
2015-10-17 12:20:41 +02:00
Wilder Rodrigues
1886c4a1b3 CLOUDSTACK-8952 - Make sure we restart dnsmasq if the configuration file changes
- It was working before because the Routers were restarting about 10 times for each operation
     e.g. adding a VM to a network ot acquiring a new IP.
   - Adding stat_rules of internal LB to iptables
     We needed one extra rule in the INPUT chain
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
b4920aa028 CLOUDSTACK-8952 - Do not restart conntrackd unless it's needed
- With the keepalived fixed they should not be needed anymore. So first reducing them drasticaly
   - I am now making a backup of the template file, write to the template file and compare it with the existing configuration
   - The template file is recovered afer the process
   - I also check if the process is running
   - I fixed a bug in the compare method
   - I am now updating the configuration variable once the file content is flushed to disk
2015-10-17 12:20:40 +02:00
Wilder Rodrigues
cd8c3e97f5 CLOUDSTACK-8934 - Fix the AclIP class to make it configure the default FW policy 2015-10-11 14:57:33 +02:00