Commit Graph

406 Commits

Author SHA1 Message Date
Takashi Kajinami b452ea7089 Skip test_stack_update_with_replacing_userdata
This test case is frequently failing because of a known libvirt issue
in Ubuntu Jammy. We already disabled one functional test case, but will
disable this test case as well, to reduce failure rate of CI runs and
unblock gate.

The existing skip for a different test case[1] is re-implemented using
the proper configuration knob.

This also fixes tox.ini to adapt to new tox 4.0.
 - Update how passenv is defined because space-separated list is no
   longer allowed. Also the values are not case sensitive.
 - skipdist=True breaks installation so is removed.

[1] https://review.opendev.org/c/openstack/heat/+/866545

Co-Authored-By: Rabi Mishra <ramishra@redhat.com>
Related-Bug: #1998274
Story: 2010487
Task: 47056
Change-Id: I915dc83ccde6b6b8497642857292f9974fd84e98
2022-12-23 13:26:52 +09:00
Takashi Kajinami 500201cb79 Skip test_cancel_update_server_with_port
Currently this test consistently fails because detaching an interface
does not progress, which is likely to be a libvirt issue.

This change disables the test case to temporally unblock CI.

Related-Bug: #1998274
Story: 2010458
Task: 46978
Change-Id: I7d9a1b2239a8406d12f3482062f4efd1d3e55d78
2022-12-05 13:43:09 +09:00
Takashi Kajinami d361aec71b Replace KeyPair resource by TestResource
... because we don't really intend to test the actual resource logic
but behavior of the engine logic to manage resources.

Depends-on: https://review.opendev.org/851669
Story: 2010201
Task: 45918
Change-Id: If651dbe34792c8ec72320a6d389a1bc1f2d23d13
2022-08-01 13:50:29 +09:00
Balazs Gibizer ef731bca05 Fix timeout calc of nested resource groups
The timeout calculation of nested resource groups are using seconds but
then it passing the value in seconds to the stack resource that is
expected it in minutes. This leads to a rapidly increasing timeout value
in each nesting levels.

This patch converts the seconds to minutes before passing it forward.

Story: 2009237
Task: 43372
Change-Id: I3f132d4889723f7b4a3a416779ac5ee7663249b8
2021-09-21 14:21:16 +02:00
Balazs Gibizer 863d645d7e Reproduce bug story/2009237
Add a functional test that reproduces the bug that nested resource group
timeout value is increasing rapidly with every nesting level.

Story: 2009237
Task: 43373
Change-Id: I8e85434a5fb9cc6d0ef3240c8ae6085f5124174b
2021-09-21 14:20:45 +02:00
ricolin ec0c79a155 Add explict dependency to avoid gate unstable
Gate job is extremely unstable because [1]
This patch propose to add explict dependency before we fix the issue.

Story: 2008936
Task: 42544

[1] https://storyboard.openstack.org/#!/story/2008936

Change-Id: I97e05c3d912030dbf77218b114e9e16fb25dca97
2021-06-07 17:12:51 +00:00
Sam Kumar d2be2f9cfe Add test cases to check user{domain}
pattern.

Heat uses domain in user{domain} pattern to
find the user in the corresponding domain.

Change-Id: Ic01877e2524e094b087fcbddac7504356e395031
Story:2007867
Task:40234
2020-11-17 15:19:13 +00:00
Zuul 607d73ea6f Merge "Remove handling for client status races" 2020-11-16 09:20:26 +00:00
Zane Bitter 674a62ae9b Add template version 2021-04-16 for Wallaby
Change-Id: I57047682cfa82ba6ca4affff54fab5216e9ba51c
Story: 2007388
2020-10-27 16:55:38 -04:00
Zuul c20124891e Merge "Remove six and python 2.7 full support" 2020-05-03 07:58:42 +00:00
Andreas Jaeger 37a83c1ede pep8: Enable E226
Enable
"E226 missing whitespace around arithmetic operator"

And fix problems encountered.

Change-Id: I90cbf6220f487a0808e13cd3998c8127be563498
2020-04-30 16:42:53 +02:00
Hervé Beraud 8c96a4d856 Remove six and python 2.7 full support
Six is in use to help us to keep support for python 2.7.
Since the ussuri cycle we decide to remove the python 2.7
support so we can go ahead and also remove six usage from
the python code.

Review process and help
-----------------------
Removing six introduce a lot of changes and an huge amount of modified files
To simplify reviews we decided to split changes into several patches to avoid
painful reviews and avoid mistakes.

To review this patch you can use the six documentation [1] to obtain help and
understand choices.

Additional informations
-----------------------
Changes related to 'six.b(data)' [2]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

six.b [2] encode the given datas in latin-1 in python3 so I did the same
things in this patch.

Latin-1 is equal to iso-8859-1 [3].

This encoding is the default encoding [4] of certain descriptive HTTP
headers.

I suggest to keep latin-1 for the moment and to move to another encoding
in a follow-up patch if needed to move to most powerful encoding (utf8).

HTML4 support utf8 charset and utf8 is the default charset for HTML5 [5].

Note that this commit message is autogenerated and not necesserly contains
changes related to 'six.b'

[1] https://six.readthedocs.io/
[2] https://six.readthedocs.io/#six.b
[3] https://docs.python.org/3/library/codecs.html#standard-encodings
[4] https://www.w3schools.com/charsets/ref_html_8859.asp
[5] https://www.w3schools.com/html/html_charset.asp

Patch 28 of a serie of 28 patches
six fully removed now!
Thank you six for the rendered services!

Change-Id: If44ee4b565cc9390fa0422fba4dda080b4f90b98
2020-04-23 14:49:12 +02:00
Zuul 73f9dc295f Merge "Check task_state of instance before volume actions" 2020-02-20 04:42:20 +00:00
ricolin 40ca7e9e63 Check task_state of instance before volume actions
Check task_state before verify resize or before detachment.

We need to make sure the task_state moved out from resize_finish before
we trigger some action like attach/detach volume.

So when we update flvor and volume at the samethime, the resize action
will not affect volume attachment/detachment.

Depends-On: https://review.opendev.org/#/c/700512/

Change-Id: I64033d5a0a8fea5c4fd93b1deb111d3d8fba0cf7
Story: #2007042
Task: #37854
Task: #37855
Task: #37869
2019-12-26 15:29:05 +00:00
Zane Bitter 6b7d64988c Remove handling for client status races
Now that we guarantee that resources are UPDATE_IN_PROGRESS before the
stack update call returns for legacy stacks (this was already true for
convergence stacks), there is no need to have special handling to check the
updated_time either in StackResources or in functional tests.

Change-Id: I5bf7ed6cb9ba6c77a77dd36eb173e1927065c53e
Story: #1669608
Task: 23176
2019-12-23 18:43:11 +00:00
Zane Bitter 693b82fbd4 Refactor test_conditions functional test
Use the list_resources() method of the test base class.

Change-Id: I7835211c4420f9da44eb2ae2f1d0e1e4b868efc4
2019-12-23 18:27:12 +00:00
Zuul 496e8df76b Merge "Eliminate race in CancelUpdateTest" 2019-12-18 13:48:48 +00:00
Zuul 60ce510086 Merge "Pre-empt in-progress nested stack updates on new update" 2019-11-14 04:36:28 +00:00
Zuul 61048ef16b Merge "Add functional test for utf-8 decode issues" 2019-11-04 03:49:24 +00:00
Zane Bitter 8cd6a06736 Pre-empt in-progress nested stack updates on new update
If the parent resource of a nested stack is locked due to an IN_PROGRESS
update, cancel the nested stack update (which will result in the parent
resource being marked FAILED and releasing the lock so that the new
traversal can begin acting on it). This also cancels all descendants of
the nested stack.

This means that a concurrent update no longer gets blocked at a nested
stack boundary until the previous update has finished.

Change-Id: I5f14453ebab75d89672c6eea12de46d48a5147f3
Task: 17760
2019-10-29 23:15:31 -04:00
Zane Bitter 3b4e0cda28 Eliminate race in CancelUpdateTest
The purpose of this test is to ensure we can rollback an in-progress
Server resource with attached ports. However, by cancelling immediately
we create a race whereby the stack may be rolled back before we have
even started updating the stack, in which case we are not testing the
behaviour we actually care about. Inserting a delay gives Heat enough
time to process the Port and start updating the Server before we cancel
the update.

In some circumstances this could also trigger a race within Heat,
whereby the rollback traversal would not block, but the update traversal
would retrigger it anyway. This resulted in the stack rollback being
marked COMPLETE multiple times, which could also lead to errors in
deleting the old raw_template after it had already been removed. The
latter have been fixed by separate patches. The race itself should be
addressed separately.

Change-Id: I3f9db686c31659437ff4797555e6608986946572
Task: 37199
2019-10-16 21:46:52 -04:00
Zuul 89ab96176f Merge "Add regression tests for conditional outputs in nested stacks" 2019-10-14 07:53:02 +00:00
Rabi Mishra e9e8b7407d Add functional test for utf-8 decode issues
Change-Id: Ifb5100ab2a933f112e76e131cd91ea711b4d1348
Depends-On: https://review.openstack.org/435667
Depends-On: https://review.openstack.org/643504
Story: 2005237
Task: 30025
2019-09-26 06:42:45 +00:00
Zane Bitter aa58fbcacf Load existing resources using correct environment
In convergence we were loading resources from the database using the
current environment. This is incorrect when a previous update has
failed, meaning the resources in the database were created with a
non-current template and environment. If an attempt was made to change
the type of a resource but that resource was never updated, this will
result in us loading a resource with the wrong type. If the type has
been removed then it can result in errors just trying to show the stack.

Note that the Resource.load() method used during a convergence traversal
already does the Right Thing - it only uses the new type if it is a
valid substitution for the old type, and UpdateReplace is later raised
in Resource.update_convergence() if the type does not match in that
specified in the new environment. So we don't see any problems with
stack updates, just with API calls.

Since we cannot change the signature of Resource.__new__() without also
modifying the signature of __init__() in every resource plugin that has
implemented it (many of which are out of tree), instead substitute the
stack definition for the duration of creating the Resource object. This
will result in stack.env returning the environment the resource was last
updated with.

Change-Id: I3fbd14324fc4681b26747ee7505000b8fc9439f1
Story: #2005090
Task: 29688
2019-04-01 14:21:44 +05:30
Zane Bitter 97df8bb6ca Improve best existing resource selection
Rank all existing versions of a resource in a convergence stack to improve
the likelihood that we find the best one to update.

This allows us to roll back to the original version of a resource (or
even attempt an in-place update of it) when replacing it has failed.
Previously this only worked during automatic rollback; on subsequent
updates we would always work on the failed replacement (which inevitably
meant attempting another replacement in almost all cases).

Change-Id: Ia231fae85d1ddb9fc7b7de4e82cec0c0e0fd06b7
Story: #2003579
Task: 24881
2019-01-29 16:47:33 +13:00
Zane Bitter d539fdcb2e Add regression tests for conditional outputs in nested stacks
The patch 85eff5fc3d had to be reverted
because it broke nested stacks in TripleO. To ensure that doesn't happen
again, add some functional tests for conditional outputs in a nested
stack.

Change-Id: I0f7a42c6d1754e340fb519bd228feaa625000ffc
Related-Bug: #1805589
2018-12-04 20:37:17 +13:00
rabi 8bb1cef48f Add functional test for legacy in-place update
in-place update of failed stacks with old resource references
deleted in last update.

Change-Id: I45fbca77c84744e1778c6f2494674233b9193921
Story: #2003612
Task: 25740
2018-09-03 09:57:39 +05:30
Zane Bitter 92101b18e2 Ignore conditions when reparsing ResourceDefinition
In the legacy path we reparse a resource definition to refer to a different
StackDefinition when copying a resource definition into the existing
template (as the resource is updated) or into the backup stack's template.
However, the resources 'condition' may reference conditionals that are not
defined in the template it is being copied into (e.g. during a stack update
that creates a new condition), and in this case the destination template
will become unusable.

Since the fact that we care about the resource definition at all indicates
that the condition was enabled, just ignore the condition after reparsing.
This is consistent with what we do for 'if' macros, which is to resolve the
condition part during reparsing.

Change-Id: I59a374435f6275badc8124efbd7b7db2e36e2de5
Story: #2003558
Task: 24847
2018-08-23 20:03:55 -04:00
Zuul 4030565761 Merge "Add functional test for version negotiation" 2018-07-09 16:09:24 +00:00
Zuul 3a156d4116 Merge "Improve error reporting for missing nested template" 2018-06-25 10:38:34 +00:00
Zane Bitter 3a96fd7e25 Improve error reporting for missing nested template
When the template for a TemplateResource was missing from the files dict
and not otherwise available, we provided misleading feedback when
validating the parent template.

First, we log that we are fetching the template from a URL, even though we
would not actually attempt to do so if it is a file:/// URL. Move the log
to after the allowed scheme check, and log debug to indicate when we cannot
find a template file.

While an exception would be generated in
TemplateResource._generate_schema() at resource initialisation time, it is
suppressed and saved for later. An empty template is used to generate the
properties schema. The exception is re-raised when validate() is called,
but during a template validation we only call validate_template(), not
validate(), so the first error we run into will be a mismatch of property
names. (If no property values were passed in the parent template, we may
not even get an error even though we won't be able to create a stack from
the given data.) Also re-raise the stored exception at the beginning of
validate_template() so that users will see the true source of the error.

Change-Id: I1bc100684e1b84fc9ac54ef523d798b317e4dc51
Story: #1739447
Task: 22219
2018-06-18 18:39:45 +00:00
Pavlo Shchelokovskyy 07f8fd56ab Add functional test for version negotiation
the test attempts to make an unauthenticated request to the Heat API
root.

Change-Id: Ib14628927efe561744cda683ca4dcf27b0524e20
Story: 2002531
Task: 22077
2018-06-14 08:18:28 +00:00
rabi d42f863dc5 Keep old files in file map for rolling update
We would need old resource definitions when doing rolling update of certain
group resources like RG/ASG. Therefore update the file map with the files
from old template.

Change-Id: I8f880e5b23c25159ecab1c63b594329d8df33973
Closes-Bug: #1765454
Task: #17360
Story: #1765454
2018-05-11 12:02:01 +05:30
Zuul 74919e5b00 Merge "Add Rocky versions" 2018-05-02 16:31:16 +00:00
ricolin 6665d9989f Add Rocky versions
* Add Rocky code name
* Add new HOT version for Rocky release
The new version is "2018-08-31" or "rocky".
* Add sem-ver flag
Sem-Ver: api-break

Change-Id: I261b6c28b8b7ee9e75ca9a895155a656ef82cd0d
2018-04-26 14:44:03 +08:00
rabi 685f95b49d Do deepcopy when copying templates
test_template is defined as a dict, so do a deepcopy
instead.

Change-Id: I0f7d222d5f95aa8e8ed73ae0d7a100470271e113
Closes-Bug: #1766448
2018-04-24 16:47:11 +05:30
Zane Bitter a90bc68e76 Correct behaviour of update_replace property in test resource
When the update_replace property is set to True, we should replace
the resource on every update where the 'value' property is
modified.

This was the original semantics of the resource, before it was
erroneously changed in 113b0a4948.

Change-Id: Icb5c3f3078a748359ee954b51f996ef08e9bc0ec
Closes-Bug: #1548356
2018-03-08 17:18:05 -05:00
Zuul e46dbbb491 Merge "Fix races in conditionals tests" 2018-03-05 10:38:25 +00:00
Thomas Herve 9f73a232d7 Return nested parameters for resource group.
This refactors the building of schema from parameter validation to use a
new method (which doesn't keep stacks in memory), and use that new
method for providing proper schema for resource group when the size is
0.

Change-Id: Id3020e8f3fd94e2cef413d5eb9de9d1cd16ddeaa
Closes-Bug: #1751074
Closes-Bug: #1626025
2018-02-26 14:57:01 +01:00
rabi 8d0a96f7af Fix race conditions in test_create_update
If two updates happen in the same second, stack updated_time
does not change. This adds 'action_wait_secs' to have a
different updated_time.

Change-Id: Ie9d1c7fe83abfc7c9431e2d341392296cfd1f8df
Closes-Bug: #1745276
Related-Bug: #1583630
2018-02-20 11:10:34 +05:30
Zane Bitter e1f4d7fca2 Fix races in conditionals tests
In convergence, resources have a tendency to appear and disappear in their
own time, not atomically with a change to the stack state. Therefore when
testing conditionals (i.e. looking for resources to appear/disappear) we
must be careful to take into account the states of the resources we find to
avoid race conditions.

Change-Id: I488921c6c4c3324912ded494db5ab9605becce9b
Closes-Bug: #1737796
2018-02-07 20:22:24 -05:00
rabi 0558b10c48 Remove use of CooldownMixin with scaling policy
Removes the multiple use of the mixin, so that we don't
set metadata for both policy and group. Setting the cooldown
metadata only for group would suffice.

Change-Id: I241a32b52e0708264c80c3eca313a97534927415
Related-Bug: #1555748
2018-01-28 09:41:20 +05:30
ricolin 76891d4a99 Remove ReloadOnSighupTest
Most jobs now run with apache+uwsgi, so the test has no significance.
Also we don't test it anymore.

Depends-On: I022077c92bc10e908c7fe549ed555ad0194e0704
Change-Id: I6d6e025f60867e5128704f54e5e793762f6c1b8a
2018-01-26 17:51:00 -05:00
ricolin aed1e6f368 Remove integration and configuration tests
This patch propose to use heat tempest plugin for Integration tests
(with no co-gating potential) and configuration tests.
Also we will remove test_autoscaling_lb from tempest plugin as well,
since it's no longer been used.
Remove senario base, since we now move all senario tests to plugin.

Change-Id: Ice6a0e1fe8ce2e1de5253c674d11949b0f8a6e31
2018-01-26 17:50:58 -05:00
ricolin ba86129965 Remove potential co-gating integration tests
This patch propose to use heat tempest plugin for potential
co-gating integration tests.
These tests are consider as potential co-gating. And we now
already maintain them in heat tempest plugin.

This also disables all except two of the gate/test jobs, to enable us to
land this series and stop the carnage. The jobs will be re-enabled once
all of the duplicated tests have been eliminated.

Change-Id: I55e204b72cd5a2876576852b10ad09f24d04beb4
2018-01-26 17:50:26 -05:00
ricolin d2bf5ecf6a Remove tests for Interop Tests for add-on trademark program
Remove tests which been planned to added to add-on trademark
program. We now maintain these tests in heat tempest plugin.

Change-Id: I458d39f988019c4f1d62c7e39a325a2082a98561
2018-01-19 13:36:49 -05:00
Zuul e8ab2d5143 Merge "Fix non-destructive upgrade for deprecated res types in convergence" 2017-12-07 07:37:35 +00:00
Zuul 121627bce7 Merge "Add functional tests for stack cancel" 2017-11-17 05:38:25 +00:00
Steven Hardy 313faad5f1 Return Environment from validate_template
This is to enable preview of the merged environment
without merging the environment on the client side.

Related-Bug: #1635409
Change-Id: I7ec3af729a65164230153021f438bf226cc5e858
2017-11-14 17:35:52 +00:00
rabi 6c7d059689 Add functional tests for stack cancel
This adds tests for user initiated stack cancel operations
w/ or w/o rollback.

Change-Id: I8ff787dc02dd76f99e9ece073b2f700c1922104d
Depends-On: Ib107c82f341f4d271859ca7681d65f7ce4c5d0b1
Related-Bug: #1709041
2017-11-10 09:55:11 +05:30