Commit Graph

68 Commits

Author SHA1 Message Date
Luciano Lo Giudice e4a9aadf05 Make Ceph tests more generic (#1034) 2023-04-10 22:25:06 +02:00
Peter Sabaini 9880637aa1 Move pristine test to ceph-osd tests
Pristine status test was applied to all ceph related charms, but only
really is relevant for the ceph-osd charm.
2023-03-31 12:45:49 +02:00
Peter Sabaini ef62272bbf Unblock after pristine status (#1025)
When a charm has a non-pristine status, it should leave the
previously-set blocked state (LP #1988088) if there are no
non-pristine disks

Also: seeing some spurious test failures due to timeouts
waiting on disk removal -- wait a bit longer
2023-03-21 19:26:15 +00:00
Chris MacNaughton f5cfd59a80 Requiring that a bundle defines more than one OSD is unecessary
While the disk replacement rests are good for the OSD charm,
and it's useful to have more disks by default in that case,
requiring extra disk for all applications that tun the Ceph tests
is an unreasonable burden, requiring additional changed just
to accommodate the OSD charm tests.

This change updates to check if we have enough disks available
before running the disk replacement tests.
2023-03-10 14:43:26 -05:00
Utkarsh Bhatt cd0ae7c0d8 Replaced Loopback with block device from bundle. (#989) 2023-03-10 13:05:47 +00:00
Felipe Reyes 618fb7b6e9 Retry when checking ceph pool compression mode.
The compression mode after it's set via config-changed might take a
while to fully propagate to the whole cluster, hence the hook may be
done before the cluster is fully configured with the new compression
mode. This is more noticeable in the gate when there are many jobs
running in parallel.

This patch modes the check to its own method wrapped with a
tenacity.retry decorator to make the test more robust.

Closes #946
2023-02-20 11:31:45 -03:00
Felipe Reyes 2cd18b484d Replace assertEquals with assertEqual.
DeprecationWarning: Please use assertEqual instead.
2023-02-14 14:45:20 -03:00
Chris MacNaughton 1a529276df Migrate several Ceph test cases to not use the openstack base 2023-01-23 09:43:23 -05:00
Peter Sabaini 74bca90a6f Ceph: also check ceph-mgr (#973)
In the ceph lowlevel test, also check for ceph-mgr process and
service.
2022-10-27 13:46:08 +02:00
Chris MacNaughton 98a1c8948a [ceph] remove white-box testing migrated from amulet (#951) 2022-10-12 15:34:14 +01:00
Utkarsh Bhatt 6a222d1210 replaced deprecated relation (#926)
Co-authored-by: utkarshbhatthere <utkarsh.bhatt@canonical.com>
2022-09-24 15:01:49 +02:00
Utkarsh Bhatt 91748b598c Adds scaledown check and verification for stoppage of synchronisation. (#863) 2022-09-12 18:37:06 +00:00
Luciano Lo Giudice acf30b3a8a Add functional tests for ceph-mon actions. (#866)
* Add functional tests for ceph-mon actions.

This PR adds functional validation for 2 actions of the ceph-mon
charm that are currently being rewritten.

Cleanup after the tests run.

Co-authored-by: Luciano Lo Giudice <luciano.logiudice@canonical.com>
2022-09-09 11:24:10 +00:00
Luciano Lo Giudice 5da70ae0fd Move tests that aren't in stable to a different class (#849)
In order to correctly test the upgrade from stable, we have to
move the tests that haven't landed yet to a different class so
that the charm can select to run them only after performing the
upgrade to the locally built charm.
2022-08-09 12:57:18 +00:00
Utkarsh Bhatt efdb1ae4e3 Add Testcases for Ceph-RGW multisite migration (#840)
The updated testcase handles verifying the expected states
that are safe to migrate, as well as verifying that pre- and post-
migration data are correctly synced.
2022-08-08 12:03:35 +00:00
Liam Young 4a6418e939 Prometheus has registered a non-zero num of osds (#820)
Change prometheus test to check it has a non-zero amount of OSDs
registered rather than a specific number. This stops the number of
OSDs having to be managed in the tests.
2022-07-08 11:17:28 +01:00
Luciano Lo Giudice be70ef7529 Make Ceph tests idempotent (#795)
With the upcoming transition to an operator-framework charm, the
Ceph tests need to be idempotent, since we'll be testing the upgrade
path from classical to operator. The tests that need fixing are the
ones that call out to add/remove disks, since they create loopback
devices to back the OSD's but never remove them.
2022-06-27 20:44:24 +02:00
Felipe Reyes f02beca790 Reduce the number of pgs on pool creation. (#794)
This change reduces the number of pgs requested on the creation of a
test pool to make it suitable for a 3 OSDs cluster.

Fixes: #647
2022-06-23 15:58:07 +02:00
Juan Pablo Noreña-Monsalve 0f867b476d update test.py 2022-06-09 06:53:13 -05:00
Juan Pablo Noreña-Monsalve 72e2979901 update test.py 2022-06-09 06:47:47 -05:00
Juan Pablo Norena 8cba107f3a add test for deleting non-existing user 2022-05-18 11:57:29 +00:00
Juan Pablo Norena a8f71c8e05 Add test for ceph auth actions get-or-create-user and delete-user 2022-05-15 20:13:26 +00:00
Billy Olsen 0d07a39d60 Merge pull request #667 from gnuoy/ceph-radosgw-multi
Add wait for sync to ceph RGW tests
2022-05-10 10:11:28 -07:00
Luciano Lo Giudice a7f4e92e02 Reorder storage operation 2022-04-12 21:16:27 -03:00
Luciano Lo Giudice b7bb8597ce Sync kernel partitions 2022-04-12 19:47:43 -03:00
Luciano Lo Giudice f09bc087b3 Setup loop devices early on in the Ceph tests
There appears to be a race condition between the loop device creation
and its actual usage. In order to prevent that, this PR setups these
devices during the test initialization instead of right before using
them in the 'add-disk' tests.
2022-04-12 17:30:25 -03:00
Luciano Lo Giudice 3a7afecf4d Remove spurious loop device 2022-03-21 19:51:59 -03:00
Luciano Lo Giudice e1d10f9359 Use the correct module 2022-03-21 18:44:42 -03:00
Luciano Lo Giudice 1b01ff2c51 Merge branch 'master' into osd-remove-test 2022-03-21 18:39:59 -03:00
Chris MacNaughton a45db73007 Merge pull request #675 from openstack-charmers/osd-add-disk-test
Osd add disk test
2022-02-22 07:47:52 +00:00
Luciano Lo Giudice 11fa17fc6e Correctly prefix module access 2022-02-17 18:19:49 -03:00
Luciano Lo Giudice ed47cb718a Correctly indent docstring 2022-02-17 18:15:46 -03:00
Luciano Lo Giudice e6d6b9e4b5 Run command on ceph-mon since some versions don't allow ceph-osd for it 2022-02-17 18:12:05 -03:00
Luciano Lo Giudice e751e4a989 Rearrange functions into separate modules 2022-02-10 14:28:50 -03:00
Luciano Lo Giudice c8302161a1 Also test that the new number of OSD's is correct. 2022-01-20 20:47:12 -03:00
Alex Kavanagh 0af4c93d52 Switch unit.public_address to unit.get_public_address()
Due to the bug [1] on OpenStack providers, unit.public_address doesn't
actually work reliably.  The fix [2] is only for the async function
unit.get_public_address().  Sadly, zaza relied on unit.public_address
and so it needs this patch for juju 2.9 support on OpenStack providers.

This patch relies on an associated patch in zaza [3]; thus this will
fails its tests until that passes.

[1]: https://github.com/juju/python-libjuju/issues/551
[2]: https://github.com/juju/python-libjuju/pull/600
[3]: https://github.com/openstack-charmers/zaza/pull/468
2022-01-14 15:21:32 +00:00
Luciano Lo Giudice 4ecea0ee06 Remove unused variable 2021-12-09 19:10:43 -03:00
Luciano Lo Giudice efc30389d6 Implement test for disk replacement
This PR builds on the add-disk one, testing the complete flow
of adding a disk, removing it and finally re-adding it after
recycling the original OSD id.
2021-12-09 19:08:11 -03:00
Luciano Lo Giudice f6a0b14df4 Fix import of juju utilities 2021-11-29 16:00:26 -03:00
Luciano Lo Giudice 7933615a7e Remove unused import 2021-11-29 12:09:28 -03:00
Luciano Lo Giudice 97f1ea5693 Move functions into juju utilities. 2021-11-29 12:08:28 -03:00
Luciano Lo Giudice 4a52ba1dba Add docstrings. 2021-11-26 18:40:14 -03:00
Luciano Lo Giudice a7865afb64 Test the enhancements of the 'add-disk' action for ceph-osd
This PR tests that a new device is succesfully added to the OSD
charm, and that it's done so via the 'bcache' mechanism. The
backing storage is provided via a loopback device, whereas the
caching storage is provided by Juju itself.
2021-11-26 18:29:29 -03:00
Liam Young 7f7b4f0dc7 Add wait for sync to ceph RGW tests 2021-11-10 14:35:54 +00:00
Corey Bryant 11f956b81b Skip failing ceph test
Skip test_ceph_pool_creation_with_text_file for releases >= victoria
until the issue is properly fixed.

This works around issue #647
2021-11-03 21:24:45 +00:00
Garrett Thompson 33ab875eb2 Replace get_relation_from_unit for ceph test 2021-02-02 09:58:13 -08:00
Liam Young ddd9c74028 Use keystone in the first instance 2021-01-06 12:12:42 +00:00
Liam Young ed3b2737d1 Use ceph-mon to check ceph version not keystone
The test class BlueStoreCompressionCharmOperation gates tests on
whether the ceph release is mimic or newer but it uses the
keystone application to calculate the currently deployed version.
This PR switches the test class to ceck the version of ceph-mon
instead which makes more sense and the keystone application may
not always present in a ceph deployment.
2021-01-06 11:38:41 +00:00
Aurelien Lourot a8ca4720a3 Fix BlueStoreCompressionCharmOperation on Victoria (#468)
Before this fix, the test tried to determine the OpenStack
release based on the ceph-mon charm. Unfortunately Ceph has
the same version on Ussuri and Victoria. As a consequence
the test would wrongly conclude that it's testing against
"groovy_ussuri", which isn't a valid Ubuntu/OpenStack pair.

With this fix, the test now determines the OpenStack
release based on the keystone charm, with which we are able
to tell Ussuri and Victoria apart. This test class is being
run against the following charm functional tests at the
moment, which all have a keystone charm in their test
bundles: nova-compute, cinder-ceph, glance, ceph-fs,
ceph-radosgw and gnocchi.
2020-11-27 09:53:12 +01:00
Frode Nordahl 4db2202b1e ceph: Add functional tests for BlueStore compression 2020-09-18 09:08:41 +02:00