Commit Graph

728 Commits

Author SHA1 Message Date
zhurong b68a216bb7 Fix tox 4 compatibility
Change-Id: I6bb3ef7ea197a7dfc384991c17e526c23e4b2fed
2023-03-03 01:27:07 +00:00
Andy Botting 60f305aca5 Fix murano-test-runner help output test
Due to slight differences in the --help output text for the test
runner, the output comparison no longer matches once you get past
python 3.8.

This fix cleans up the help text itself, and modifies the test to
only match on some specific elements, not the whole thing.

This should make the test less fragile going forward.

Change-Id: I7b94d8ae9eb58c43676ae3171c0f6193496c6d4b
2022-10-14 16:05:18 +11:00
Andy Botting dc89e7cf61 Fix compatibility with Python 3.10
Since testing with Python 3.10, the test
  murano.tests.unit.dsl.test_helpers.TestDSLHelpers.test_weak_ref
was failing with
  testtools.matchers._impl.MismatchError: 'weakref' != 'ReferenceType'

This is simply the result of newer Python being more correct about
the name of the weakref ReferenceType.

The fix here is to ask what the name is of the class and use that
instead of the hardcoded 'weakref' name.

Change-Id: I26ea4750f10dedb04a07d188e57fcd391a28f870
2022-10-12 21:25:08 +11:00
Andy Botting 411d0f85e8 tests: Remove use of 'oslo_db.sqlalchemy.test_base'
The various test cases and mixins in 'oslo_db.sqlalchemy.test_base' have
been deprecated since oslo.db 4.34.0 (March 2018). Remove use of these.

Change-Id: Ic4ba41e61de3a33d6779b53bb0274e5e115e335a
2022-04-19 09:15:59 +10:00
Jeremy Stanley 398b2d86d5 Tenant to project migration for RequestContext
As of the oslo.context 4.0.0 release, RequestContext objects no
longer have a tenant attribute, instead expecting callers to use
project_id for that purpose. Update all context.tenant references to
context.project_id in order to facilitate this transition.

Change-Id: I2830ccf840bf4d1d8a516287adee51c46d2a5583
2022-03-29 12:43:00 +00:00
zhurong af5a48d282 Fix Engine.execute() in func tests
Change-Id: Iaf443954e2e41fb7c03ea3dc81b53f439531742b
2021-10-16 02:30:34 +00:00
Takashi Kajinami 4193e28ddd Revert "Use fnmatch from oslo.utils"
This reverts commit 4fbe4ee433.

Reason for revert:
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.

[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b

Change-Id: Ic35ab4936d82e07493ecd5f81e6e46a84dc6546c
2021-08-18 14:22:44 +00:00
Takashi Kajinami 2800f0b62c Fix broken unit test
This change mocks sqlalchemy.update during unit tests properly to avoid
the following error.

sqlalchemy.exc.ArgumentError: subject table for an INSERT, UPDATE or
DELETE expected, got <MagicMock name='models.Instance' id='...'>

Closes-Bug: #1938676
Change-Id: I5268132018e0a283bd35b5599cf8ca41968dde93
2021-08-02 17:22:43 +09:00
Ghanshyam Mann 1c87ebf9a8 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

CONF object needs to be initialized before policy enforcer(). That
need to remove cfg.CONF.unregister_opts from TestAuthUtils cleanup
as this is taken care by cfg.clear() with proper workflow otherwise
it end up with error
"oslo_config.cfg.ArgsAlreadyParsedError: arguments
already parsed: reset before unregistering options"

- https://b132754ee7062a9ab187-9add4719a9922a9385555a8552fc2366.ssl.cf5.rackcdn.com/768520/5/check/openstack-tox-py38/7964354/testr_results.html

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I1b6c6485bc651fd0b87244a68204036dd4aa37f4
2021-03-07 17:50:48 -06:00
Erik Olof Gunnar Andersson e5d9d1b74f Use common rpc pattern for all services
This patch introduces a common rpc pattern to ensure
that the rpc transport is shared where possible. This
helps prevent rpc connection leaks and should ensure
that we are making the best possible use of all
available rpc connections.

Change-Id: Ib42e368cfda2b148a07df0bd74046739f40f7018
2021-01-19 12:24:08 -08:00
Andy Botting 09831b64d5 Fix 'method object has no attribute __yaql_function__' on py3
This error was appearing when calling some murano methods through
YAQL functions.

The helpers.function() call was testing for im_func which was
deprecated on Python 3.

Switching to __func__ is the correct way to get the function from
a method.

Change-Id: I473283e0d5a4901ff787f434a5f5f9d923090614
2020-10-30 10:34:41 +11:00
Zuul 05c57f8933 Merge "Switch from unittest2 compat methods to Python 3.x methods" 2020-09-20 01:28:13 +00:00
Sharma-Ritika 91a58c5763 Murano testing to Ubuntu Focal
As per victoria cycle testing runtime and community goal,
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Bump lower constraints to make testing work for Focal.

Change-Id: I1fc6b0c67d767bc698e12f0e79fadd19bb7d0a8d
Story: #2007865
Task: #402198
2020-09-19 01:46:40 +00:00
zhurong fc12a87932 Fix requirements-check job
Change-Id: I169a7e5fc5d5562aac4f8c02f5ceb1843122696e
2020-08-05 09:22:03 +00:00
zhurong 371e99e473 Fix murano ci UT error
Change-Id: I24ea16ae4d853829ca34721febf8c834cc42977f
2020-08-03 01:51:33 +00:00
melissaml 4adf454c86 Switch from unittest2 compat methods to Python 3.x methods
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual

We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: Ida67a22b153175b8517782593718b7c60f633c16
2020-07-05 19:33:17 +08:00
zhurong 7eca01a7d6 Fix pep8 error
Change-Id: I2832b70a6eeb2b9edf2124977e4be362e0eedabe
2020-05-13 14:03:53 +08:00
Sean McGinnis 4866d54831 Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: Id266a937b37507a1cef05ac34e33a80265581ad1
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
2020-04-19 23:23:41 -07:00
Zuul 90def4e28b Merge "Remove six murano/packages" 2020-04-20 01:58:24 +00:00
Zuul 8630251ae5 Merge "Remove six murano/engine" 2020-04-20 01:58:23 +00:00
Zuul 8308ef1b5c Merge "Remove six murano/db" 2020-04-20 01:58:21 +00:00
Zuul c82d8a6c48 Merge "Remove six murano/hacking" 2020-04-20 01:58:20 +00:00
Zuul f93d1e5148 Merge "Remove six murano/dsl" 2020-04-20 01:58:19 +00:00
zhurong 8bf959f805 Remove six murano/api
Change-Id: I53368580d7a2d1923688be80899c97c57aafffad
2020-04-18 08:38:48 +00:00
zhurong 07242fc255 Remove six murano/packages
Depends-On: https://review.opendev.org/#/c/720860/
Change-Id: I88d5b21c24780223196ff3bb7c629f404c343f14
2020-04-18 01:12:08 -07:00
zhurong aa5f945088 Remove six murano/engine
Depends-On: https://review.opendev.org/#/c/720860/
Change-Id: Ib10d9e191ec93e55a0982d29de9a62a7b5d1894f
2020-04-18 01:08:08 -07:00
zhurong 91c0f48a30 Remove six murano/dsl
Change-Id: Iac776e29eb63421577cb928692f2945200f32b1d
2020-04-17 23:32:45 -07:00
zhurong 272a9e40fd Remove six murano/db
Change-Id: Ibc5a314beab903d4cd8d0bd693d8c9c134858c69
2020-04-17 20:05:40 -07:00
zhurong 070a4723be Remove six murano/hacking
Change-Id: I5b33362ccd7065c5c2890d1f1a2cb1082a29a8c2
2020-04-17 19:41:02 -07:00
Andreas Jaeger d1dae85ac7 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Change-Id: Ibe28b6b6bf3927e80816f0c5f1cb972fb6e2374b
2020-03-30 11:59:26 +02:00
Sean McGinnis 25ebd01de3
Drop unittest2 usage
unittest2 was needed for Python versions <= 2.6, so it has not been
needed for quite some time now. See unittest2 note on:

https://docs.python.org/2.7/library/unittest.html

This drops unittest2 in favor of the standard unittest package.

Change-Id: Idb4cb10509f49afe86bfdb688e35a7822dfe38bd
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-01-12 02:40:41 -06:00
zhurong 0ce2ad12d0 Update semantic_version to 2.8.2 and remove multiattach in volume template
Change-Id: I7fedbcf85ee9c4dbacf1fc50cec25380c3b3e93d
2019-09-19 02:45:34 +00:00
zhurong 4ee97f7b7a Bump to hacking 1.1.0
Change-Id: I4019f41d9ddd843872855e6e80c0667ee2df758a
2019-07-04 11:51:47 +00:00
zhulingjie ecf8effdfa Replace git.openstack.org URLs with opendev.org URLs
Thorough replacement of git.openstack.org URLs with their opendev.org counterparts.

Change-Id: Id506aad04b878ba516872ef0169664f47f6eaab0
2019-06-25 14:43:40 +08:00
zhurong e5c89bb4a7 Merge the user given tags when update package
Change-Id: I1b4a556f619c346da49c0ddf5085b2aa12e7752e
2019-03-11 17:02:31 +08:00
zhurong ea03ab3e7c Using trustor's session to delete the trust
Now use admin client to delete the trust gives the error:
"You are not authorized to perform the requested action:
Only admin or trustor can delete a trust.: ForbiddenAction:
You are not authorized to perform the requested action:
Only admin or trustor can delete a trust."

This patch use trustor's session to delete the trust.

Change-Id: Ib673128be860f548195181a465a9dff784cdef1a
2019-01-23 10:56:53 +08:00
zhurong 43182e1ebf Fix pep8 E731 error
Change-Id: I753edf74988065145e98b68fa72d6caa9159c559
2019-01-09 07:47:13 +00:00
zhurong c023d63562 use get_rpc_transport to obtain an RPC transport instance
Change-Id: I4aaef5eb52500f597fa8270c71dd4816167e69cb
2019-01-08 19:43:11 +08:00
akhiljain23 4341093b14 Add framework for murano-status upgrade check
This commit adds the functionality of murano-status CLI for performing
upgrade checks as part of the Stein cycle upgrade-checkers goal.
It only includes a sample check which must be replaced by real checks in
future.

Change-Id: If7987cdf5d9a686abbcad5960b8f391f8b9518a3
Story: 2003657
Task: 26143
2018-10-24 09:31:33 +00:00
zhurong 9fe87010f5 Fix py37 tests failed due to async
Change-Id: If09cc4b27da22924e9ad5a5b930ccb0abcc84a34
Closes-Bug: #1786523
2018-08-11 15:53:06 +08:00
zhurong dc558104bd Remove congress and mistral functional integration tests
The Congress and Mistral functional integration tests has moved to
http://git.openstack.org/cgit/openstack/murano-tempest-plugin

Change-Id: I537f0173926a26cce00f404d2c23e40174491715
Depends-On: https://review.openstack.org/#/c/586761/
2018-07-31 00:38:52 +00:00
Zuul 044a190e81 Merge "The original env should be {}, otherwise it can not be dealt with by heat client." 2018-07-19 06:17:53 +00:00
zhangyifan e47050853d The original env should be {}, otherwise it can not be dealt with by heat client.
Change-Id: If6013085d61ac87e836cea15fc47588753eabc1a
2018-06-19 14:26:45 +08:00
wu.chunyang 7a64448917 Update auth_uri option to www_authenticate_uri
Option auth_uri from group keystone_authtoken is deprecated[1].
Use option www_authenticate_uri from group keystone_authtoken.

[1]: https://review.openstack.org/#/c/508522/

Change-Id: Ib8623a359a27b8a4aa90bf69a3fe3f3a5c2411a6
2018-05-12 06:34:14 +00:00
zhurong a11afbe704 Enable mutable config in Murano
New releases of oslo.config support a 'mutable' parameter to Opts.
This is only respected when the new method mutate_config_files is
called instead of reload_config_files. Heat delegates making this call
to oslo.service, so how do we switch?
Icec3e664f3fe72614e373b2938e8dee53cf8bc5e allows services to tell
oslo.service they want mutate_config_files to be called by passing a
parameter, which this patch does.

This allows Murano to benefit from
I1e7a69de169cc85f4c09954b2f46ce2da7106d90, where the 'debug' option
(owned by oslo.log) is made mutable. We should be able to turn debug
logging on and off by changing the config and sending SIGHUP.

Change-Id: Ia7e405392fe67eb9c4abf2408db0fa25c5546958
Story: 2001545
2018-03-23 08:57:22 +08:00
Tony Breeds 0e439d9a8d Make test allowed_pattern type same as the hot example and fix the gate
This reverts commit 51818f07d1 and forward
ports the testing change from stable pike:

In murano allowed_pattern set as:
allowed_pattern: [A-Za-z0-9]
But in hot example is set as:
allowed_pattern: '[a-zA-Z0-9]*'

So change the test template allowed_pattern.

Change-Id: I89ac4ef9de5eb0a5176c9df2ce1f289ca0d2cc65
(cherry picked from commit a682d5ee92)
2018-03-13 05:47:46 +00:00
Nguyen Hung Phuong 36ed695e33 Remove empty file
murano/tests/unit/api/v1/cloudfoundry/test_router.py
is empty file. We probably should delete it.

Change-Id: Ie0f3488af6771aca0dabec65db3e096cd1f96848
2018-02-23 16:33:23 +07:00
Stan Lagun 6f6897c132 Murano-engine side implementation of agent message signing
Change-Id: I1a23d185ac19f10c98d66f29a6930dfd17793954
Partial-Blueprint: message-signing
2018-01-15 16:56:54 +00:00
zhurong 1ea1cda5d4 Remove murano_tempest_tests from murano repo
Change-Id: I5da1c660393df335f8d5e8ab17b23bb21a8e3257
2017-12-07 02:03:48 +00:00
zhurong 6e1dc58b8e Fix murano-congress-devstack-dsvm job
Change-Id: I2ecfef6e287c0a8adfbde7728de0c1393778a29a
2017-12-02 05:10:32 +00:00