Commit Graph

43 Commits

Author SHA1 Message Date
Peter Sabaini 324679f061 Tox: add Python 3.11 section to tox.ini
Also improve mocking unit tests

Change-Id: Ie4356c23e97cec48f5731323bc90d63335ecc753
2023-11-10 14:12:29 +02:00
Chris MacNaughton 3a774be961 Fix issue with ceph-client relation handling
A bug was introduced when changing ceph-client to
an operator framework library that caused the
fallback application_name handling to present
a class name rather than a remote applicaiton name.

This change updates the handling to get at an
`app.name` rather than an `app`.

As a drive-by, this also allow-lists the fully-
qualified rename.sh.

Closes-Bug: #1995086
Change-Id: I57b685cb78ba5c4930eb0fa73d7ef09d39d73743
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1022
2023-03-10 19:41:11 +00:00
Luciano Lo Giudice af9143503c Unpin tox version
This unpinning is meant to solve the issues with tox 4.x breaking
all the virtualenv dependencies.

Change-Id: Ifc3381b2f2e4e41ebf6676080bf1831baffb0d42
2023-01-19 11:11:53 +09:00
Chris MacNaughton efcd98746b Update tox.ini for charmcraft 2
Also, this fixes an issue with pyopenssl

Change-Id: I8cb2d6ffeb27f58d97a2d4f8b32ced3c527a5f5e
2022-09-28 12:50:47 +00:00
Luciano Lo Giudice 5656db92df Rewrite the 'change-osd-weight' to use the op framework
This patchset changes a single action, 'change-osd-weight' so that
it's implemented with the operator framework.

Change-Id: Ia11885a2096b6e4b1ecda5caea38939e17098e1d
2022-09-08 12:28:17 -03:00
Peter Sabaini 24dfc7440d Add support for prometheus-k8s
Add support for the metrics-endpoint relation. This allows relating
ceph-mon to prometheus-k8s which is being used in the COS Lite
observability stack. Upon relation, the ceph prometheus module will be
enabled and a corresponding scrape job configured for prometheus-k8s.

Drive-by test improvement for the utils module

Change-Id: Iaeee57aaa6f3678fdaef35f2582b4b4c974acb2a
2022-09-06 10:14:37 +02:00
Luciano Lo Giudice 1ee3d04fda First rewrite of ceph-mon with operator framework
This patchset implements the first rewrite of the charm using the
operator framework by simply calling into the hooks.

This change also includes functional validation about charm upgrades
from the previous stable to the locally built charm.

Fix tempest breakage for python < 3.8

Co-authored-by: Chris MacNaughton <chris.macnaughton@canonical.com>

Change-Id: I61308bb2900134ea163d9e92444066a3cb0de43d
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/849
2022-08-19 19:00:56 -03:00
Billy Olsen d72e8db254 Updates for jammy enablement
- charmcraft: build-on 20.04 -> run-on 20.04/22.04 [*archs]
- Refresh tox targets
- Drop impish bundles and OSCI testing
- Add jammy metadata
- Default source is yoga
- Resync charmhelpers and charms.ceph

Change-Id: Ib62d7f882f22146419dfe920045b73452f9af2cb
2022-04-07 14:16:20 +01:00
Alex Kavanagh a7e6225b2b Update to classic charms to build using charmcraft in CI
This update is to ensure that the Zuul Canonical CI builds the charm
before functional tests and ensure that that artifact is used for the
functional tests.  This is to try to ensure that the charm that gets
landed to the charmhub is the same charm that was tested with.

Change-Id: I546438f1af6b3f779aa01e9ddd8c8ae7c3b7d063
2022-02-16 10:45:25 -05:00
Corey Bryant 7cd789601d Add yoga bundles and release-tool syncs
* charm-helpers sync for classic charms
* sync from release-tools
* switch to release-specific zosci functional tests
* run focal-ussuri as smoke tests
* remove trusty, xenial, and groovy metadata/tests
* drop py35 and add py39
* charms.ceph sync

Change-Id: I214c0517b223da5fce9e942269fd8703422d1a2b
2021-11-17 13:46:05 -05:00
Alex Kavanagh cb580a0b91 Add xena bundles
- add non-voting focal-xena bundle
- add non-voting impish-xena bundle
- charm-helpers sync for new charm-helpers changes
- update tox/pip.sh to ensure setuptools<50.0.0

Change-Id: If511b7fee8cf676b6ba7017aa60fe916ac9a26d9
2021-09-21 14:11:55 +01:00
likui 5e729c9bea Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I708abb9d0ff0d42379f8c9003f10e22afac2b33f
2021-08-09 20:20:00 +08:00
Aurelien Lourot 35b2ed1a43 Sync release-tools
In order to fix ResolutionImpossible on tox invocation.

https://github.com/openstack-charmers/release-tools/issues/151
https://github.com/openstack-charmers/release-tools/pull/152

Change-Id: I012eea8b5f7211fd4302e22bccd518f3b80481c1
2021-07-22 14:52:15 +02:00
Aurelien Lourot 644a3ee900 Sync release-tools
Sync release-tools boilerplate containing these changes
in order to pin pip < 20.3:
https://github.com/openstack-charmers/release-tools/pull/125
https://github.com/openstack-charmers/release-tools/pull/126

Change-Id: I9f52fe90d44a95446d8a005d6cb1c98ea73a70e0
2020-12-11 13:54:01 +01:00
Alex Kavanagh f318c00671 Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Change-Id: I9c2419e39899f02e99b07d5dbd0b4cd0f51e03ba
2020-09-26 18:30:12 +01:00
Frode Nordahl c0113217bf Unpin flake8, fix lint
Change-Id: Iab73f1127bfbdf11626727f3044366d2e5745439
2020-08-24 10:54:54 +02:00
Aurelien Lourot e43b5e6562 Sync helpers for 20.05
Change-Id: I695760d4319b8c5c01ad0fd54d6c8d7d1d2633f8
2020-05-18 14:38:49 +02:00
Ryan Beisner 05a9dc6309 Sync charm/ceph helpers, tox, and requirements
Also fix for bug where the mgr daemon is not ready.  A wait is
introduced if it is not ready before trying to assert pg-autotune.

Closes-Bug: #1848576
Change-Id: Ic3c1e1f7902f7e2052dc4cf432303f874369238d
2019-10-17 22:37:39 +01:00
Corey Bryant a5711a0c19 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Note that python35-charm-jobs is retained since this charm is supported
on Xenial.

Change-Id: I51693cd7d535f2b5acb5ba118951f466ef7ac51f
Story: #2005924
Task: #34228
2019-07-30 10:17:59 -04:00
Chris MacNaughton 01fb37ebee Migrate charm-ceph-mon testing to Zaza
Closes-Bug: #1828424
Change-Id: Ie46129f02566f17eabbf2eb0cae217fa0e886a4f
2019-05-16 11:34:57 +00:00
Pete Vander Giessen ab068db29d Replace ostestr with stestr in testing framework.
A system upgrade broke ostestr. We can fix it by just calling stestr
directly.

Change-Id: Id8d098f97ffc8b0cfcf9a1f76e6240dc51e0eed3
2019-03-07 17:10:27 -05:00
Paul Goins e3bf76a1c4 Added tox environment for gathering coverage
This technique was borrowed from the tox "cover" environment in
openstack/nova's tox.ini.  This leverages the fact that stestr lets
you override the python executable via the PYTHON environment
variable.  Doing this allows us to easily generate coverage for our
unit tests.

An important caveat is that this does not provide any coverage for
tests via zaza, amulet, etc.  It is purely focused on the unit tests.

Note that this replaces the previous .coveragerc; coverage
configuration is instead pulled from tox.ini.

Change-Id: Idedc9707c2670825e2307ffacf40496d52f03d13
2019-03-01 14:38:45 +01:00
Frode Nordahl 677dc1806a
Add ``rbd-mirror`` relation
Reactive interface counterpart is here:
https://github.com/openstack-charmers/charm-interface-ceph-rbd-mirror

Sync charms.ceph.

Depends-On: I1bad5311ed034188a78dc67b493c22bff7ce4f7d
Change-Id: I509793e6c5aad9ea41fa4904c83b58e7477770e8
2019-02-25 00:34:07 +03:00
James Page fd331820d0 Use fully qualified basepython for py{35,36} targets
Make sure the exact python version is used for specific python
unit testing targets.

Update functional tests to include nova-cloud-controller.

Change-Id: I8d57719fce4f152a105d8a61c08b556873105708
2018-10-17 14:55:03 +01:00
Doug Hellmann b5e6d96b53 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Ia6790f1f07eca936ec8a3d7b9403ad439275eb25
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-09-26 18:37:31 -04:00
Nguyen Van Duc 06acb3e7cb Add py36 testenv
Python 3.6 is installed by default in Ubuntu 18.04 LTS.
Therefore, according to Transition Plan [1],
it'll be handy to have py36 testenv.

For more details, please check Python2 Deprecation Timeline [2]
and Python3-first Goal - Completion Criteria [3].

[1] https://wiki.ubuntu.com/Python/Python36Transition
[2] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html
[3] https://review.openstack.org/#/c/575933/8/goals/stein/python3-first.rst@42

Change-Id: I63e7db94fa672f80b08a0644fbce7c0732d67ee4
2018-07-12 13:28:12 +07:00
David Ames ec86562991 Enable Bionic as a gate test
Change bionic test from dev to gate for 18.05.

Change-Id: Iaff111e3ac3802481448ac95b936cf043a441fc0
2018-05-11 20:29:12 -07:00
Alex Kavanagh edfd6a55af Tighten up the leader_set(..) usage to handle any errors
This stops leader_set from throwing backtraces, and instead logs the
error and continues as though the charm is not the leader (which is the
case when leader_set(...) fails).

Changed the py35 tox job to invoke py3 (to allow it to also test under
py3.6 on artful+).

Note that the pep8 check is still py27, so the additional # NOQA is
to handle Py2 not having FileNotFoundError.

Change-Id: Ic25d29983db9a0738d83e66de4673bb50594b599
2018-05-08 12:13:23 +01:00
Ryan Beisner 1061abfdc5 Update tox.ini to stop using unverified package
As of pip 10.0, --allow-unverified is not permitted.

Use of the flag in this repo was previously used to force
installation of python-apt to accommodate certain unit tests.

The unverified package, python-apt, is no longer necessary
for test execution.

Related-Bug: #1760720

Change-Id: Ieb62ac460f605f5599206379b79075704a6fc3e9
2018-04-03 16:37:09 +00:00
Ryan Beisner 96657b6f2c Sync charm-helpers
Change-Id: I9571e6a74c2f3da1afb4f2567bda4f3a78696578
2018-02-21 14:07:16 -06:00
Andrew McLeod 52b11dd06e Enable xenial-pike amulet test
Make default func27-smoke xenial-pike
Charm-helpers sync

Review and merge https://github.com/juju/charm-helpers/pull/69 first.

Change-Id: I7a810cc743d242c652959ef87ea5b5f371c480a1
2017-12-05 14:35:53 -08:00
Alex Kavanagh 7586815401 Migrate charm to work with Python3 only
Various changes to migrate the charm to work with Python 3.  The tox.ini
has been modified to inlcude py35 and py36 targets for testing against
Python 3.5 (xenial, zesty), and Python 3.6 (artful+).

Change-Id: I009de528428aaca555b49f3fc17704dcf5f2a28c
2017-11-17 10:22:30 +00:00
Alex Kavanagh 733bad44f2 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I6efa2096237d8cbc6e869fc0f43dc622d4bea8e7
Related-Bug: #1659575
2017-04-27 12:07:07 +01:00
David Ames 9bb335fd88 Enable Ocata Amulet Tests
- Add Zesty as a supported series to metadata.yaml.
- Turn on Xenial-Ocata Amulet test definitions.
- Sync charm helpers to get Juju 2.x amulet compatibility.
- Keeping Zesty-Ocata Amulet test definitions turned off until the
  metadata.yaml changes propagate to the charm store.
- Resync tox.ini to resolve amulet test failures.

Change-Id: I75d0b5e0ff5ba3619e5f24567deb77c404b822cb
2017-03-23 09:27:46 +00:00
Ryan Beisner 00dd3ff7b1 Update tox.ini files from release-tools gold copy
All OpenStack Charms now contain identical tox.ini files,
not to be modified or made unique within each charm repo.

This is to ensure consistency across charm repos in tox
target naming, approach and purpose, also giving the
charm dev and test experience additional consistency.

Also create empty dirs with .keep files where necessary.
Some classic charms have actions and/or lib dirs, and some
do not. In all classic charms, flake will now check those
dirs to ensure lint coverage of existing or future content.

Change-Id: I345e0b5f365bde8b7331a9dab53deb6984ec96cd
2016-09-09 19:21:55 +00:00
James Page 8c1ab254eb Use bundletester for amulet test execution
Switch to using bundletester for execution of functional tests,
leveraging tox to build out test virtualenvs.

Rename amulet tests inline with gate-* and dfs-* naming standards.

Update README to refer to functional testing section of the charm
guide.

Change-Id: I0d378cdffdc2eaa5c34578e85aba6acb7a47a41d
2016-07-20 14:53:55 +01:00
James Page 5d1c1bdfb9 Resync charm-helpers
Avoid use of 'service --status-all' which is currently
broken on trusty for upstart managed daemons; the change
moves to detecting how the daemon is managed, and then
using upstart status XXX or the return code of service XXX
status to determine whether a process is running.

Fixes for IPv6 network address detection under Ubuntu
16.04 which changes the output format of the ip commands
slightly.

Update the version map to include 8.1.x as a Neutron
version for Mitaka.

Fixup mocking of apt during load of unit tests and ensure
that tox does not use any site packages, ensuring that
test execution is isolated from installed OS

Change-Id: I0f8d7cb2689f5e4c94390b324850e4e9b6e10eb5
Closes-Bug: 1581171
Closes-Bug: 1581598
Closes-Bug: 1580674
2016-05-18 17:33:46 +01:00
James Page 5904a7aa04 Update to charm-tools >= 2.0.0
The new release of charm-tools no longer ships the charm
command; update minimum version requirement and switch
to using charm-proof instead, unblocking current pep8
failures across all charms.

Also pin the version of requests to 2.6.0 until theblues
(indirect dependency of charm-tools) sort out its
requirements versioning.

Change-Id: I29210e210b90aa81bf6ee9a020bd6de656750a77
2016-03-23 09:30:16 +00:00
Chris Holcombe 38c868b048 Add support for cache tier management
This change will add two new actions to the ceph-mon charm. These
actions will allow the user to create and remove cache tiers from
existing pools.  Both writeback and read only mode are supported.

Limitations of this patch include not having fine grain control
over the cache tier properties.  Things like hit_set_count,
bloom filter control or cache sizing are not supported yet.

Change-Id: I5a37e79d0d23d35295a8ae97177c940af66b0485
2016-03-10 08:29:12 -08:00
James Page 7ae1008bca Fix tox configuration
Rename lint->pep8, ensure that sitepackages are used with
newer versions of tox/virtualenv.

Change-Id: Ia6b6e27692e581439e6e5a74ecaeb6b3a1e0742f
2016-03-02 10:35:51 +00:00
James Page 23c54210bb Resync tox integration 2015-10-30 15:04:43 +09:00
James Page 89398bd217 Make things alot simpler 2015-10-30 12:30:49 +09:00
James Page fbde2aab1f Add tox configurations and requirements definitions 2015-10-30 11:15:38 +09:00