245 Commits

Author SHA1 Message Date
Jenkins
2b0ae3c079 Merge "Add integration tests for admin actions" 2016-06-16 04:23:12 +00:00
Jenkins
17b014db81 Merge "Authorize super admin actions on all projects" 2016-06-16 02:07:36 +00:00
Zane Bitter
c85cae58bf Fix test_update_restricted timeouts due to timestamp resolution
Updating a stack where the only resource needs replacement but is
restricted from being replaced is *very* fast. Since the test framework
relies on seeing a change in the updated_time timestamp, which has only 1s
resolution, it can easily be missed causing the test to timeout. This adds
a 1s sleep between updates that have the same expected status to ensure
that the timestamp changes.

Change-Id: Ief845a21108e925325b1b3e8f090038ccdf73b8e
Closes-Bug: #1554375
Related-Bug: #1583630
2016-06-14 18:39:51 +00:00
rabi
3b0f8ad21f Add integration tests for admin actions
Add integration tests for super admin actions.

Change-Id: I277f23800274729cf7128fdcb4521e4b221233cf
Partial-Bug: #1466694
2016-06-14 22:39:33 +05:30
rabi
ac86702172 Authorize super admin actions on all projects
This allows admin super user (user with admin role in admin_project)
to do stack operations across all projects.

Change-Id: Ifbf56fde02b89248ee788e6a212ef9d11e665dc0
Partial-Bug: #1466694
2016-06-14 22:16:25 +05:30
rabi
406dd7faa2 Fix env passed to test_replace
We don't seem to be passing the right env to test_replace,
when we want to test with both update and replace restricted.

Change-Id: I895389c1727321f328e6b7bd7c712796257993f1
2016-06-13 12:04:10 +05:30
Thomas Herve
d9855dfe0b Fix tests on Neutron port behavior
Fix some integration tests checking port behavior, as the assumptions we
were making were wrong, and that changed recently.

Closes-Bug: #1591177
Change-Id: I4338eee40d092148831b3e20f8a42a1b3d3ea8bf
2016-06-10 22:35:24 +02:00
Anant Patil
4c54183621 Don't hard code subnet
Replace hard coded private-subnet with configurable heat subnet for
lbaasv2 functional test.

Change-Id: Ie1a3d9ce02da30dcfa67b9de76900807de8212df
2016-06-08 12:44:31 +05:30
Jenkins
bfff4e4fff Merge "Adds default policy rule for resources limited to administrator" 2016-06-06 05:18:45 +00:00
Jenkins
4307bb0ed7 Merge "Add wait_secs to test_stack_update_from_failed_patch" 2016-05-28 10:11:57 +00:00
Thomas Herve
de96d030ff Fix resource loading in resource filtering
We try to be careful when filtering resources from stack, to not load
all of them, but unfortunately it breaks as soon as you have
dependencies with resources that are not returned. To be on the safe
side we need to load them all and filter them afterwards.

Change-Id: I399545a6a4fd77d9707505ec9c4058d384877dec
Closes-Bug: #1585931
2016-05-26 13:48:13 +02:00
Jaime Guerrero
4c4301fbe0 Add wait_secs to test_stack_update_from_failed_patch
Add a 1 second pause to test_stack_update_from_failed_patch.  If a stack is
updated more than once per second, there is a possibility for busy waiting if
_verify_status neither returns nor raises an exception.

Please see
https://github.com/openstack/heat/blob/master/heat_integrationtests/common/test.py#L277
for _verify_status.

Closes bug: 1583630

Change-Id: Ifa9a5e9d69b47fe07fbc9ffcbe8f03479a24bb6c
2016-05-23 22:26:43 +00:00
huangtianhua
a52b821857 Adds default policy rule for resources limited to administrator
Adds default policy rule for resources which are limited to
administrator, to forbid non-admin to create these resources
at the very start.

Change-Id: I9e1ef86f0c44bce5bde3f9e26e1f2b9cb3aef06d
Closes-Bug: #1582187
2016-05-18 09:52:14 +08:00
huangtianhua
66b6490705 Set security_groups when create internal ports for nova server
Make sure nova server be created in correct security groups
if user specified subnet and security_groups when create/update
server.

Change-Id: Ic93cad4def90f3da25390d871d6a8c14ffe1c5ae
Closes-Bug: #1571975
2016-05-17 18:23:09 +08:00
Thomas Herve
d815a06838 Fix properties usage in ResourceChain update
ResourceChain was using the old properties when trying to build the new
template in updates. Let's rebuild the properties so that it works
properly.

Change-Id: I5ba78995819ec2e1d398a02dad9979575bba05b1
Closes-Bug: #1571638
2016-04-19 17:15:58 +02:00
Rabi Mishra
354f1bcef0 Revert "Check RBAC policy for nested stacks"
This is causing issues with tripleo failures
with ValueError, when trying do stack-preview as
part of policy enforcement for stack DELETE.

This reverts commit a8accbba98b5fc15562864030f49d20570bf8412.

Change-Id: I366316f27f24c650bd435e67dd17abd8676cedf4
Closes-Bug: #1561172
2016-03-30 11:48:30 +05:30
Sergey Kraynev
8f370d6174 Increase timeout of WaitCondition due to ConcurrentTransactions
Currently we have retry logic with random period of delay.
There is a chance, when we have several re-try attemts with maximum
timeout, so it can be a root cause of floating fails, when we have not
enough time for getting all signals.

Also decrease number of signals from 30 to 25, due to small risk, when
one of signals goes to ConcurrentTransaction error.

Note, that all these changes are made in corresponding functional test
and don't affect main code.

Change-Id: I9ca85c4378d0f62e316f4f40ff73597ffaaabadf
Related-Bug: #1497274
2016-03-29 09:01:38 +00:00
huangtianhua
018bbd6a3c Add a new HOT template version for Newton
1. Add a HOT template version 'heat_template_version.2016-10-14'
2. Add Newton version '7.0.0' in doc

Change-Id: I8194adbe9a27f982a6b123dda78849d6e5b33eeb
2016-03-24 09:29:48 +08:00
Jenkins
9c9845e7f7 Merge "Fix race condition for WaitCondition with several signals" 2016-03-23 21:08:07 +00:00
Jenkins
bc0080d099 Merge "Use region from config in functional tests" 2016-03-23 18:47:14 +00:00
Rabi Mishra
cbed62355c Use region from config in functional tests
We seem to be using hardcoded region in some inline
templates of fucntional tests. They would fail if
the region name is different. This changes to use
it from the config.

Change-Id: Iafd1251545e00c6cba292b042352b1ef34da81e0
Closes-Bug: #1560585
2016-03-23 18:33:56 +05:30
Sergey Kraynev
cb3183d047 Fix race condition for WaitCondition with several signals
This fix is based on changes introduced in patch
Ibf9dd58a66a77d9ae9d4b519b0f11567977f416c.

Follow changes were done in this patch:
 - According previous item code for calculating metadata of
   wait_condition_handle was moved to separate method -
   normalise_signal_data().
 - Same method was implemented for BaseWaitConditionHandle class, which
   returns original signal data without changes.
 - handle_signal method for BaseWaitConditionHandle class was updated:
   * all code related with updating and verification metadata was moved
     to merge_signal_metadata internal method, which will be called from
     metadata_set method.
   * if/else block was changed to raise error in case, when metadata has
     wrong format, so else section was deleted.
 - corresponding tests for waitcondition resource, which expect several
   signals was added.

Change-Id: Ia25146a742ce79dbb0480d9053131216037e5305
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
Closes-Bug: #1497274
2016-03-23 03:47:49 -04:00
Thomas Herve
90fc4fe89e Remove unknown parameters in patched update
When updating a stack with the existing flag, we keep the parameters
from the old template to be used against the new version. Sometimes
parameters will get remove and won't make sense anymore, and keeping
them would break update with a 'Parameter was not defined' error. This
filters out such parameters so that the updates succeed.

Change-Id: I6f2aa77da28d271dd001a137bb574b5470292f15
Closes-Bug: #1558610
2016-03-17 16:26:40 +01:00
Jenkins
991ce6d72c Merge "Fix race condition in reload_on_sighup functional" 2016-03-16 10:07:26 +00:00
Oleksii Chuprykov
a8accbba98 Check RBAC policy for nested stacks
This prevents stacks with forbidden resources start
to create/update or stuck in DELETE_IN_PROGRESS state,
if delete the stack with admin resources in nested stacks.
Also we need to allow get id of resource that in SUSPEND
state, because of we use stack preview in SUSPEND state.

Change-Id: I328891e62b4f4bcf620c52ef9d4d8ab60801a651
Closes-Bug: #1539145
2016-03-16 06:14:13 +00:00
Mark Vanderwiel
35703069f8 Add functional lbaas v2 tests
For lbaas v2, the scenario tests are on hold until bug:
https://bugs.launchpad.net/octavia/+bug/1557184 can be
resolved for octavia in devstack.

This patch will change the octavia drivers to no-op to
allow functional testing against the heat lbaas v2
resources.  These tests will run under 5 minutes.

Change-Id: I96890725d0b5c498815873b068613ab00f2cbac8
2016-03-15 13:37:48 -05:00
Peter Razumovsky
48387e92a0 Fix race condition in reload_on_sighup functional
Race condition appears in next situation:

  1. First thread calls _set_config_value for one section.
  2. Second thread calls _set_config_value for another section.
  3. First thread. Config option value set, calls
     open(self.config_file, 'wb'), which erases all file content.
  4. Second thread. In previous point moment second thread tries to
     set config option value to self.config_file, which is empty (see 3).
     So, NoSectionError exception raised.

This patch adds ten retries for setting option value, if NoSectionError
raised, i.e. try to wait until self.config_file is busy.

Change-Id: Ic54ea287ebe4724511f75d42677cae5dfdec4e57
Closes-bug: #1535766
2016-03-15 17:58:31 +00:00
Oleksii Chuprykov
a7d63111a3 Fix stack preview
Don't execute translation rule for property that contains
a GetParam function that can't be resolved at the moment.
Such situation happens when we try to resolve get_param function
that refer to parameter with None value. We receive parameter value
from parent stack, where this value is a reference to some resource
without resource_id, so this situation is legal for stack preview
and we shouldn't fail. Note, that we can reproduce this behaviour
only with resources with hidden parameters and overrided  get_resource_id
method, that returns None if resoruce creation has not been started yet.

Change-Id: Ia1097940db983721c8b5116db7ee0a2c4c45339d
Closes-Bug: #1548802
2016-03-10 18:47:40 +02:00
tyagi
96ef3fc4ca Heat integration tests failing against https endpoints
Provide ca_file option to pass the ca certificate to verify https
connection. Also pass verify parameter to the test cases which
directly call requests library methods.

Change-Id: I4a81047136d6a64b151180e95c254edea8165349
Closes-Bug: #1553898
2016-03-07 22:16:00 +05:30
Jenkins
4959f1879e Merge "Fix problems in unicode template support" 2016-03-06 06:06:00 +00:00
Jenkins
9345e1648f Merge "Use oslo.utils.reflection to extract class name" 2016-03-06 05:01:48 +00:00
Ethan Lynn
6cf8dc6e56 Fix problems in unicode template support
If we use unicode as resource name or parameter,
we are likely to encounter unicode problems.
This patch aims to fix unicode problems, and
there are several things to be clear:

1. For the class wrap with six.python_2_unicode_compatible, in
python2 their original __str__ function will map to __unicode__,
and new __str__ function comes from __unicode__.encode.
So we should always return unicode in __str__() if wrap
with python_2_unicode_compatible.

2. python_2_unicode_compatible will not handle __repr__,
__repr__ should return str in all versions of python.

Co-Authored-By: Ethan Lynn <xjunlin@cn.ibm.com>
Closes-Bug: #1524194
Change-Id: Ib4af43d153e0edf9d66308bf8e7b93a3be501d2e
2016-03-04 01:59:40 +00:00
Jenkins
bab3427f37 Merge "Fix test_encryption_vol_type to take admin creds from conf" 2016-03-02 10:17:30 +00:00
Jason Dunsmore
8627aa2b9a Return HTTPBadRequest error from API for immutable parameters
Return HTTPBadRequest error from API instead of
HTTPInternalServerError when immutable parameters are modified.

Change-Id: I37ff6dd7295292b8cd08a7a5085590b654a7e4f2
2016-03-01 21:00:16 -06:00
Jenkins
7405d45312 Merge "Add functional test for immutable parameters" 2016-02-26 16:44:06 +00:00
James Combs
8dd631e3ad Add functional test for immutable parameters
Co-Authored-By: Jason Dunsmore <jasondunsmore@gmail.com>
Change-Id: I0f978e67ecbcaec65222f449cd41f20c768e9937
2016-02-26 07:52:15 -06:00
Jenkins
b8da6cf95e Merge "Add functional tests for update restrict" 2016-02-25 04:09:29 +00:00
Thomas Herve
fe511a958c Make ZaqarEventSinkTest more lenient
We don't have strong ordering of events enforced, so there is no need to
test that events arrive in order, and it actually make tests fail
intermittently. Let's relax that check.

Change-Id: I73be763df5ddf863e29df1b9ac8792f05700e006
Closes-Bug: #1549264
2016-02-24 13:08:06 +01:00
Jenkins
d96d9fbc7a Merge "Add function tests for event sinks" 2016-02-24 11:05:45 +00:00
Jenkins
825ba55b90 Merge "Ignore errors on old properties during update" 2016-02-24 10:02:00 +00:00
Jenkins
0a2915fca4 Merge "Revert "Check RBAC policy for nested stacks"" 2016-02-24 08:47:52 +00:00
Jenkins
9b12e960c2 Merge "Use yaml.safe_dump instead of yaml.dump" 2016-02-24 07:05:46 +00:00
Thomas Herve
4a4ce672fb Revert "Check RBAC policy for nested stacks"
This reverts commit 57fdf732a4bbec296c45355818e67549593c6afb.

It breaks magnum gate.

Change-Id: I0553482d6b56edc08d29e1ab318b3b8962edc04d
2016-02-22 22:54:04 +00:00
Jenkins
7c13f4386c Merge "Check RBAC policy for nested stacks" 2016-02-22 10:54:51 +00:00
Thomas Herve
c4f8db9681 Add function tests for event sinks
Add a new functional test using Zaqar as a target for event sinks. This
fixes the behavior when convergence is on.

Change-Id: I4bbdec55b98d0a261168229540a411d423e9406d
2016-02-22 09:41:13 +00:00
Rabi Mishra
03de65d5eb Use yaml.safe_dump instead of yaml.dump
After changing to use yaml.safe_load, some of the tests are failing
locally with unicode error. Though we've not noticed these issues
at the gate, it's better to use safe_dump to avoid them.

Change-Id: I84cf921afe76b3bed44e84230a71b244bb886cce
Closes-Bug: #1547399
2016-02-20 07:45:32 +05:30
Rabi Mishra
329db1ec50 Add functional tests for update restrict
This adds functional tests for update restrict functionality.

Change-Id: I85e99b376203a48b725c6e9c1d9b5aefa8024b8e
Blueprint: stack-update-restrict
2016-02-19 17:34:35 +05:30
Jenkins
f76d04bf0e Merge "Hook into environment merging on server" 2016-02-19 10:50:46 +00:00
Rakesh H S
c7ab4e82af Fix test_encryption_vol_type to take admin creds from conf
Heat integration test test_encryption_vol_type will not work in environments
where admin user is named differently or does not have the same password as
that of the demo user.

The admin credentials is now made available via heat_integrationtests.conf.
The tests which require admin privileges should be run only if admin
credentials are available and use the same.

Change-Id: I5f329be6d4c4249763e0aec8696fb87605a0812a
Closes-Bug: #1546993
2016-02-19 12:50:13 +05:30
Jenkins
6505388261 Merge "Use yaml.safe_load() instead of yaml.load()" 2016-02-18 12:21:25 +00:00